From e8a633b351d308c549debdff66b877531b1a4cff Mon Sep 17 00:00:00 2001 From: Efrain Bastidas Date: Fri, 21 Apr 2023 23:40:03 -0500 Subject: [PATCH] [Presentation] On not supported platforms, show a dummy msg in the app_webview.dart --- lib/presentation/shared/app_webview.dart | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/presentation/shared/app_webview.dart b/lib/presentation/shared/app_webview.dart index e4ea959de..fd47be2d2 100644 --- a/lib/presentation/shared/app_webview.dart +++ b/lib/presentation/shared/app_webview.dart @@ -6,6 +6,7 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:responsive_builder/responsive_builder.dart'; import 'package:shiori/generated/l10n.dart'; import 'package:shiori/presentation/shared/loading.dart'; +import 'package:shiori/presentation/shared/nothing_found_column.dart'; import 'package:shiori/presentation/shared/page_message.dart'; import 'package:webview_windows/webview_windows.dart'; @@ -39,13 +40,22 @@ class AppWebView extends StatelessWidget { ); } - return _MobileWebView( - url: url, - userAgent: userAgent, - hasInternetConnection: hasInternetConnection, + if (Platform.isAndroid || Platform.isIOS) { + return _MobileWebView( + url: url, + userAgent: userAgent, + hasInternetConnection: hasInternetConnection, + appBar: appBar, + script: script, + isLoading: isLoading, + ); + } + + //TODO: BETA 6 of flutter_inappwebview should add support macos + final s = S.of(context); + return Scaffold( appBar: appBar, - script: script, - isLoading: isLoading, + body: NothingFoundColumn(msg: s.nothingToShow), ); } }