popupWidget static method

Widget popupWidget({
  1. required BuildContext context,
  2. String? title,
  3. Widget? titleWidget,
  4. IconData? icon,
  5. dynamic body,
  6. dynamic button1,
  7. dynamic button2,
  8. dynamic button3,
  9. dynamic button4,
  10. dynamic key,
})

Implementation

static Widget popupWidget(
    {required BuildContext context,
    String? title,
    Widget? titleWidget,
    IconData? icon,
    body,
    button1,
    button2,
    button3,
    button4,
    key}) {
  return AlertDialog(
    key: key,
    titlePadding:
        EdgeInsets.zero, //const EdgeInsets.fromLTRB(4.0, 14, 5.0, 3),
    contentPadding: const EdgeInsets.all(4.0),
    actionsPadding: const EdgeInsets.all(8.0),
    insetPadding: const EdgeInsets.all(8.0),
    backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
    title: titleWidget ??
        (title != null
            ? titleBar(
                context: context, icon: icon, title: title, buttons: null)
            : null),
    content: body,
    actions: <Widget>[
      if (button1 != null) button1,
      if (button2 != null) button2,
      if (button3 != null) button3,
      if (button4 != null) button4
    ],
  );
}