showMessageWithAction method

ScaffoldFeatureController<SnackBar, SnackBarClosedReason> showMessageWithAction(
  1. String text, {
  2. required VoidCallback onAction,
  3. required String actionLabel,
  4. required ThemeData theme,
  5. Color? actionColor,
})

Implementation

ScaffoldFeatureController<SnackBar, SnackBarClosedReason>
    showMessageWithAction(
  String text, {
  required VoidCallback onAction,
  required String actionLabel,
  required ThemeData theme,
  Color? actionColor,
}) {
  return _show(
    SnackBar(
      content: Text(text),
      action: SnackBarAction(
        textColor: actionColor ?? theme.colorScheme.inversePrimary,
        label: actionLabel,
        onPressed: onAction,
      ),
    ),
  );
}