show method

  1. @override
void show(
  1. BuildContext context,
  2. String completerId, {
  3. dynamic data,
})
override

Implementation

@override
void show(BuildContext context, String completerId, {dynamic data}) {
  showDialog(
    barrierDismissible: false,
    context: context,
    builder: (context) => AlertDialog(
      title: Text(data['title']),
      content: Text(data['text']),
      actions: data['actions']
          .map<Widget>((action) => ElevatedButton(
              child: Text(action['text']),
              onPressed: () {
                if (action['onPressed'] != null) {
                  action['onPressed']();
                }
                ServiceManager<UpDialogService>().completeDialog(
                    context: context, completerId: completerId, result: null);
              }))
          .toList(),
    ),
  );
}