File tree Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Original file line number Diff line number Diff line change 13
13
android : name =" io.flutter.embedding.android.FlutterActivity"
14
14
android : configChanges =" orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
15
15
android : hardwareAccelerated =" true"
16
+ android : exported =" true"
16
17
android : launchMode =" singleTop"
17
18
android : theme =" @style/LaunchTheme"
18
19
android : windowSoftInputMode =" adjustResize" >
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class _MyAppState extends State<MyApp> {
22
22
String _errorString = "unknown" ;
23
23
bool _isUserResolvable = false ;
24
24
bool _errorNotificationShown = false ;
25
+ bool _errorDialogFragmentShown = false ;
25
26
26
27
// Platform messages are asynchronous, so we initialize in an async method.
27
28
Future <void > checkPlayServices ([bool showDialog = false ]) async {
@@ -121,6 +122,25 @@ class _MyAppState extends State<MyApp> {
121
122
});
122
123
}
123
124
125
+ Future <void > showErrorDialogFragment () async {
126
+ bool errorDialogFragmentShown;
127
+
128
+ try {
129
+ errorDialogFragmentShown =
130
+ await GoogleApiAvailability .instance.showErrorDialogFragment ();
131
+ } on PlatformException {
132
+ errorDialogFragmentShown = false ;
133
+ }
134
+
135
+ if (! mounted) {
136
+ return ;
137
+ }
138
+
139
+ setState (() {
140
+ _errorDialogFragmentShown = errorDialogFragmentShown;
141
+ });
142
+ }
143
+
124
144
@override
125
145
Widget build (BuildContext context) {
126
146
return MaterialApp (
@@ -182,10 +202,7 @@ class _MyAppState extends State<MyApp> {
182
202
child: const Text ('Show error dialog fragment' ),
183
203
color: Colors .red,
184
204
),
185
- Center (
186
- child: Text (
187
- 'Error dialog shown: $_errorDialogShown \n ' )),
188
-
205
+ Center (child: Text ('Error dialog shown: $_errorDialogFragmentShown \n ' )),
189
206
],
190
207
)),
191
208
);
Original file line number Diff line number Diff line change @@ -132,13 +132,12 @@ class GoogleApiAvailability {
132
132
}
133
133
134
134
final showErrorDialogFragment =
135
- await _methodChannel.invokeMethod ('showErrorDialogFragment' );
135
+ await _methodChannel.invokeMethod ('showErrorDialogFragment' );
136
136
137
137
if (showErrorDialogFragment == null ) {
138
138
return false ;
139
139
}
140
140
141
141
return showErrorDialogFragment;
142
142
}
143
-
144
143
}
You can’t perform that action at this time.
0 commit comments