Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove dynamic variable in example
  • Loading branch information
jsharp83 committed Jan 22, 2024
commit 5988770e95d760d98d63b8ce42a46ce48ac40253
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ class SampleMenu extends StatelessWidget {
}

Future<bool> _showConfirm(BuildContext context, String message) async {
final dynamic result = await showDialog<bool>(
return await showDialog<bool>(
context: context,
builder: (BuildContext ctx) {
return AlertDialog(
Expand All @@ -721,14 +721,13 @@ class SampleMenu extends StatelessWidget {
child: const Text('OK')),
],
);
});

return result.runtimeType == bool && result as bool;
}) ??
false;
}

Future<String> _showTextInput(
BuildContext context, String message, String? defaultText) async {
final dynamic result = await showDialog<String>(
return await showDialog<String>(
context: context,
builder: (BuildContext ctx) {
return AlertDialog(
Expand All @@ -741,9 +740,8 @@ class SampleMenu extends StatelessWidget {
child: const Text('Enter')),
],
);
});

return result.runtimeType == String ? result as String : '';
}) ??
'';
}
}

Expand Down