Skip to content

Commit 12ef635

Browse files
committed
Remove MaterialApp to remove the root Navigator, replace with necessary configuration widgets
1 parent 7d5a5f5 commit 12ef635

1 file changed

Lines changed: 36 additions & 13 deletions

File tree

‎packages/diagram_capture/lib/diagram_capture.dart‎

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'dart:typed_data';
88
import 'dart:ui' as ui;
99

1010
import 'package:animation_metadata/animation_metadata.dart';
11+
import 'package:flutter/cupertino.dart';
1112
import 'package:flutter/foundation.dart';
1213
import 'package:flutter/gestures.dart';
1314
import 'package:flutter/material.dart';
@@ -34,19 +35,41 @@ class _Diagram extends StatelessWidget {
3435

3536
@override
3637
Widget build(BuildContext context) {
37-
return new MaterialApp(
38-
debugShowCheckedModeBanner: false,
39-
home: new Material(
40-
child: new Builder(
41-
builder: (BuildContext context) {
42-
return new Center(
43-
child: new RepaintBoundary(
44-
key: boundaryKey,
45-
child: child,
46-
),
47-
);
48-
},
49-
),
38+
return Directionality(
39+
textDirection: TextDirection.ltr,
40+
child: Overlay(
41+
initialEntries: <OverlayEntry>[
42+
OverlayEntry(
43+
builder: (BuildContext context) {
44+
return Localizations(
45+
locale: const Locale('en', 'US'),
46+
delegates: <LocalizationsDelegate<dynamic>>[
47+
DefaultWidgetsLocalizations.delegate,
48+
DefaultMaterialLocalizations.delegate,
49+
DefaultCupertinoLocalizations.delegate,
50+
],
51+
child: Theme(
52+
data: ThemeData(),
53+
child: MediaQuery(
54+
data: MediaQueryData.fromWindow(WidgetsBinding.instance.window),
55+
child: new Material(
56+
child: new Builder(
57+
builder: (BuildContext context) {
58+
return new Center(
59+
child: new RepaintBoundary(
60+
key: boundaryKey,
61+
child: child,
62+
),
63+
);
64+
},
65+
),
66+
),
67+
),
68+
),
69+
);
70+
}
71+
)
72+
],
5073
),
5174
);
5275
}

0 commit comments

Comments
 (0)