Skip to content

Commit

Permalink
Fix webview needing to be manually toggled every time the app is rest…
Browse files Browse the repository at this point in the history
…arted
  • Loading branch information
DavidDWiser committed Mar 10, 2022
1 parent 1f92de0 commit 09f20f3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/screens/main_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class MainScreen extends StatefulWidget {
}

class _MainScreenState extends State<MainScreen> {
late final WebViewManager webViewManagerController;
var currentIndex = 0.obs;
var title = 'Home'.obs;
final webViewManagerController = Get.find<WebViewManager>();

final List<Widget> _pages = [
const HomeScreen(),
Expand All @@ -27,6 +27,17 @@ class _MainScreenState extends State<MainScreen> {
BookMarksScreen(),
];

@override
void initState() {
super.initState();

webViewManagerController = Get.find<WebViewManager>();

// Make sure we only call this once during main screen initialization to
// also properly initialize the webView status
webViewManagerController.getVideoPlayerType();
}

@override
Widget build(BuildContext context) {
return Scaffold(
Expand Down

0 comments on commit 09f20f3

Please sign in to comment.