diff --git a/lib/main.dart b/lib/main.dart index 5e832f6..6ad2aaf 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,8 +1,10 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_website/components/colors.dart'; import 'package:flutter_website/ui/block_wrapper.dart'; import 'package:flutter_website/ui/carousel/carousel.dart'; import 'package:responsive_framework/responsive_framework.dart'; +import 'package:universal_io/io.dart'; import 'ui/blocks.dart'; @@ -69,10 +71,11 @@ List blocks = [ const BlockWrapper(LearnFromDevelopers()), const BlockWrapper(WhoUsesFlutter()), // Disabled codelab block for performance. - const ResponsiveVisibility( - hiddenConditions: [Condition.smallerThan(name: DESKTOP)], - child: BlockWrapper(FlutterCodelab()), - ), + if (kIsWeb || Platform.isAndroid || Platform.isIOS) + const ResponsiveVisibility( + hiddenConditions: [Condition.smallerThan(name: DESKTOP)], + child: BlockWrapper(FlutterCodelab()), + ), const BlockWrapper(FlutterNewsRow()), const BlockWrapper(InstallFlutter()), const Footer(), diff --git a/lib/ui/blocks.dart b/lib/ui/blocks.dart index 0ea8ad2..52cb8af 100644 --- a/lib/ui/blocks.dart +++ b/lib/ui/blocks.dart @@ -1,9 +1,11 @@ import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.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_io/io.dart'; import 'package:video_player/video_player.dart'; import 'package:webview_flutter/webview_flutter.dart'; @@ -1028,16 +1030,16 @@ class _LearnFromDevelopersState extends State { padding: const EdgeInsets.symmetric(horizontal: 25), child: AspectRatio( aspectRatio: videoAspectRatio, - child: WebViewWidget( - key: webViewKey, - controller: WebViewController() - ..loadRequest(Uri.parse(videoUrl)), - ) + child: (kIsWeb || Platform.isAndroid || Platform.isIOS) + ? WebViewWidget( + key: webViewKey, + controller: WebViewController() + ..loadRequest(Uri.parse(videoUrl)), + ) + : Image.asset( + "assets/images/video_thumbnail_learn_from_developers.png", + fit: BoxFit.contain) // TODO: Legacy WebView on Web workarounds. - // (kIsWeb) - // ? Image.asset( - // "assets/images/video_thumbnail_learn_from_developers.png", - // fit: BoxFit.contain) // HtmlElementView( // key: webViewKey, // viewType: webViewKey.toString(), diff --git a/pubspec.lock b/pubspec.lock index 14c61ed..1c4bbf2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -373,7 +373,7 @@ packages: source: hosted version: "2.2.4" universal_io: - dependency: transitive + dependency: "direct main" description: name: universal_io sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" diff --git a/pubspec.yaml b/pubspec.yaml index 1389459..3e0276d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,6 +17,7 @@ dependencies: webview_flutter_web: ^0.2.2+4 universal_html: ^2.2.4 google_fonts: ^6.1.0 + universal_io: ^2.2.2 responsive_framework: path: responsive_framework/ diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp index 3b9a7d0..c9f7e68 100644 --- a/windows/runner/main.cpp +++ b/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.Create(L"flutter_website", origin, size)) { + if (!window.Create(L"Flutter.dev", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true);