showGrockSnackBarWithActionAndIcon method
void
showGrockSnackBarWithActionAndIcon(
- String message, {
- Duration? duration,
- required String actionLabel,
- required VoidCallback action,
- required IconData icon,
showSnackBar
method
Implementation
void showGrockSnackBarWithActionAndIcon(
String message, {
Duration? duration,
required String actionLabel,
required VoidCallback action,
required IconData icon,
}) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Row(
children: [
Icon(icon),
SizedBox(width: 10),
Text(message),
],
),
duration: duration ?? const Duration(seconds: 2),
action: SnackBarAction(
label: actionLabel,
onPressed: action,
),
),
);
}