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';
7
7
8
8
void main (List <String > args) {
9
9
debugPrint ('args: $args ' );
10
+ WidgetsFlutterBinding .ensureInitialized ();
10
11
if (runWebViewTitleBarWidget (args)) {
11
12
return ;
12
13
}
13
- WidgetsFlutterBinding .ensureInitialized ();
14
14
runApp (const MyApp ());
15
15
}
16
16
Original file line number Diff line number Diff line change 1
- import 'dart:async' ;
2
-
3
1
import 'package:flutter/material.dart' ;
4
2
5
3
import 'message_channel.dart' ;
@@ -18,7 +16,6 @@ bool runWebViewTitleBarWidget(
18
16
List <String > args, {
19
17
WidgetBuilder ? builder,
20
18
Color ? backgroundColor,
21
- void Function (Object error, StackTrace stack)? onError,
22
19
}) {
23
20
if (args.isEmpty || args[0 ] != 'web_view_title_bar' ) {
24
21
return false ;
@@ -28,22 +25,13 @@ bool runWebViewTitleBarWidget(
28
25
return false ;
29
26
}
30
27
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
+ ));
47
35
return true ;
48
36
}
49
37
You can’t perform that action at this time.
0 commit comments