Skip to content

Commit 5988770

Browse files
committed
remove dynamic variable in example
1 parent d7e07e2 commit 5988770

File tree

1 file changed

+6
-8
lines changed
  • packages/webview_flutter/webview_flutter_android/example/lib

1 file changed

+6
-8
lines changed

packages/webview_flutter/webview_flutter_android/example/lib/main.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)