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 1313 android : name =" io.flutter.embedding.android.FlutterActivity"
1414 android : configChanges =" orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1515 android : hardwareAccelerated =" true"
16+ android : exported =" true"
1617 android : launchMode =" singleTop"
1718 android : theme =" @style/LaunchTheme"
1819 android : windowSoftInputMode =" adjustResize" >
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class _MyAppState extends State<MyApp> {
2222 String _errorString = "unknown" ;
2323 bool _isUserResolvable = false ;
2424 bool _errorNotificationShown = false ;
25+ bool _errorDialogFragmentShown = false ;
2526
2627 // Platform messages are asynchronous, so we initialize in an async method.
2728 Future <void > checkPlayServices ([bool showDialog = false ]) async {
@@ -121,6 +122,25 @@ class _MyAppState extends State<MyApp> {
121122 });
122123 }
123124
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+
124144 @override
125145 Widget build (BuildContext context) {
126146 return MaterialApp (
@@ -182,10 +202,7 @@ class _MyAppState extends State<MyApp> {
182202 child: const Text ('Show error dialog fragment' ),
183203 color: Colors .red,
184204 ),
185- Center (
186- child: Text (
187- 'Error dialog shown: $_errorDialogShown \n ' )),
188-
205+ Center (child: Text ('Error dialog shown: $_errorDialogFragmentShown \n ' )),
189206 ],
190207 )),
191208 );
Original file line number Diff line number Diff line change @@ -132,13 +132,12 @@ class GoogleApiAvailability {
132132 }
133133
134134 final showErrorDialogFragment =
135- await _methodChannel.invokeMethod ('showErrorDialogFragment' );
135+ await _methodChannel.invokeMethod ('showErrorDialogFragment' );
136136
137137 if (showErrorDialogFragment == null ) {
138138 return false ;
139139 }
140140
141141 return showErrorDialogFragment;
142142 }
143-
144143}
You can’t perform that action at this time.
0 commit comments