Skip to content

Commit

Permalink
[Presentation] On not supported platforms, show a dummy msg in the ap…
Browse files Browse the repository at this point in the history
…p_webview.dart
  • Loading branch information
Wolfteam committed Apr 22, 2023
1 parent c054c29 commit e8a633b
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions lib/presentation/shared/app_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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),
);
}
}
Expand Down

0 comments on commit e8a633b

Please sign in to comment.