Future <bool> ShowYesNoDialog(
BuildContext context,
doYes,
doNo
) async
{
return showDialog(
context: context,
builder: (context) => AlertDialog(
actions: <Widget>[
RaisedButton(
onPressed: ((){doYes();}),
),
RaisedButton(
onPressed: ((){doNo();}),
),
],
),
) ??
false;
}
await ShowYesNoDialog(
context, 'SayYesNo', 'Yes or No?',
((){print('yes');}),
((){print('no')}),
);
沒有留言:
張貼留言