pass context to an onpressed flutter code example
Example: onpressed pass context flutter
FloatingActionButton(
onPressed: () => _showAddingDialog(context),
),
Future _showAddingDialog(BuildContext context) {
// ...
}
FloatingActionButton(
onPressed: () => _showAddingDialog(context),
),
Future _showAddingDialog(BuildContext context) {
// ...
}