Skip to content

Commit

Permalink
Remove HTML UI Element
Browse files Browse the repository at this point in the history
  • Loading branch information
rayliverified committed Feb 24, 2024
1 parent e410379 commit 62dfcb9
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions lib/ui/blocks.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import 'dart:ui' as ui;

import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_website/components/components.dart';
import 'package:flutter_website/utils/utils.dart';
import 'package:responsive_framework/responsive_framework.dart';
import 'package:universal_html/html.dart' as html;
import 'package:video_player/video_player.dart';
import 'package:webview_flutter/webview_flutter.dart';

Expand Down Expand Up @@ -970,17 +967,6 @@ class _LearnFromDevelopersState extends State<LearnFromDevelopers> {
@override
void initState() {
super.initState();
webViewKey = UniqueKey();
// TODO: Breaks mobile builds. Official Flutter WebView plugin is working on Web support.
// TODO: Resets iframe on scroll. Wait for official Flutter fix.
// ignore: undefined_prefixed_name
ui.platformViewRegistry.registerViewFactory(
webViewKey.toString(),
(viewId) => html.IFrameElement()
..width = "1080"
..height = "606"
..src = videoUrl
..style.border = "none");
}

@override
Expand Down Expand Up @@ -1256,7 +1242,6 @@ class _FlutterCodelabState extends State<FlutterCodelab>
codelabIds[1]: getCupertinoSelectionWidget(codelabIds[1]),
codelabIds[2]: getCupertinoSelectionWidget(codelabIds[2]),
};
setCodelabHtmlElementView();
}

@override
Expand Down Expand Up @@ -1342,21 +1327,9 @@ class _FlutterCodelabState extends State<FlutterCodelab>
void setCodelabSelected(String codelab) {
codelabSelected = codelab;
codelabUrlSelected = codelabUrls[codelabIds.indexOf(codelab)];
setCodelabHtmlElementView();
setState(() {});
}

void setCodelabHtmlElementView() {
// ignore: undefined_prefixed_name
ui.platformViewRegistry.registerViewFactory(
codelabSelected,
(viewId) => html.IFrameElement()
..width = "1080"
..height = "617"
..src = codelabUrlSelected
..style.border = "none");
}

Widget getCupertinoSelectionWidget(String text) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 24),
Expand Down

0 comments on commit 62dfcb9

Please sign in to comment.