showGrockMaterialBannerWithIconAndColor method

void showGrockMaterialBannerWithIconAndColor(
  1. String message, {
  2. Duration? duration,
  3. required String actionLabel,
  4. required VoidCallback action,
  5. required IconData icon,
  6. required Color color,
})

showMaterialBanner method

Implementation

void showGrockMaterialBannerWithIconAndColor(
  String message, {
  Duration? duration,
  required String actionLabel,
  required VoidCallback action,
  required IconData icon,
  required Color color,
}) {
  ScaffoldMessenger.of(context).showMaterialBanner(
    MaterialBanner(
      content: Row(
        children: [
          Icon(icon, color: color),
          SizedBox(width: 10),
          Text(message),
        ],
      ),
      actions: [
        TextButton(
          child: Text(actionLabel),
          onPressed: action,
        ),
      ],
    ),
  );
}