popupDialog method

Widget popupDialog(
  1. BuildContext context,
  2. String title,
  3. String text,
  4. dynamic button1, {
  5. dynamic button2,
})

Implementation

Widget popupDialog(BuildContext context, String title, String text, button1,
    {button2}) {
  return AlertDialog(
    backgroundColor: Colors.white,
    title: Text(
      title,
      style: Theme.of(context).textTheme.bodyLarge,
    ),
    content: Column(
      mainAxisSize: MainAxisSize.min,
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Text(text, style: Theme.of(context).textTheme.bodySmall),
      ],
    ),
    actions: <Widget>[
      if (button1 != null) button1,
      if (button2 != null) button2
    ],
  );
}