File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
packages/webview_flutter/webview_flutter_android/example/lib Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -703,7 +703,7 @@ class SampleMenu extends StatelessWidget {
703703 }
704704
705705 Future <bool > _showConfirm (BuildContext context, String message) async {
706- final dynamic result = await showDialog <bool >(
706+ return await showDialog <bool >(
707707 context: context,
708708 builder: (BuildContext ctx) {
709709 return AlertDialog (
@@ -721,14 +721,13 @@ class SampleMenu extends StatelessWidget {
721721 child: const Text ('OK' )),
722722 ],
723723 );
724- });
725-
726- return result.runtimeType == bool && result as bool ;
724+ }) ??
725+ false ;
727726 }
728727
729728 Future <String > _showTextInput (
730729 BuildContext context, String message, String ? defaultText) async {
731- final dynamic result = await showDialog <String >(
730+ return await showDialog <String >(
732731 context: context,
733732 builder: (BuildContext ctx) {
734733 return AlertDialog (
@@ -741,9 +740,8 @@ class SampleMenu extends StatelessWidget {
741740 child: const Text ('Enter' )),
742741 ],
743742 );
744- });
745-
746- return result.runtimeType == String ? result as String : '' ;
743+ }) ??
744+ '' ;
747745 }
748746}
749747
You can’t perform that action at this time.
0 commit comments