File tree Expand file tree Collapse file tree 2 files changed +8
-20
lines changed
packages/desktop_webview_window Expand file tree Collapse file tree 2 files changed +8
-20
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ import 'package:path_provider/path_provider.dart';
77
88void main (List <String > args) {
99 debugPrint ('args: $args ' );
10+ WidgetsFlutterBinding .ensureInitialized ();
1011 if (runWebViewTitleBarWidget (args)) {
1112 return ;
1213 }
13- WidgetsFlutterBinding .ensureInitialized ();
1414 runApp (const MyApp ());
1515}
1616
Original file line number Diff line number Diff line change 1- import 'dart:async' ;
2-
31import 'package:flutter/material.dart' ;
42
53import 'message_channel.dart' ;
@@ -18,7 +16,6 @@ bool runWebViewTitleBarWidget(
1816 List <String > args, {
1917 WidgetBuilder ? builder,
2018 Color ? backgroundColor,
21- void Function (Object error, StackTrace stack)? onError,
2219}) {
2320 if (args.isEmpty || args[0 ] != 'web_view_title_bar' ) {
2421 return false ;
@@ -28,22 +25,13 @@ bool runWebViewTitleBarWidget(
2825 return false ;
2926 }
3027 final titleBarTopPadding = int .tryParse (args.length > 2 ? args[2 ] : '0' ) ?? 0 ;
31- runZonedGuarded (
32- () {
33- WidgetsFlutterBinding .ensureInitialized ();
34- runApp (_TitleBarApp (
35- webViewId: webViewId,
36- titleBarTopPadding: titleBarTopPadding,
37- backgroundColor: backgroundColor,
38- builder: builder ?? _defaultTitleBar,
39- ));
40- },
41- onError ??
42- (e, s) {
43- debugPrint ('WebViewTitleBar: unhandled expections: $e , $s ' );
44- },
45- );
46-
28+ WidgetsFlutterBinding .ensureInitialized ();
29+ runApp (_TitleBarApp (
30+ webViewId: webViewId,
31+ titleBarTopPadding: titleBarTopPadding,
32+ backgroundColor: backgroundColor,
33+ builder: builder ?? _defaultTitleBar,
34+ ));
4735 return true ;
4836}
4937
You can’t perform that action at this time.
0 commit comments