Vaibhav Surve 34100a4d9e -- Enhance layout with floating action button and navigation improvements
- Added a floating action button to the Layout widget for better accessibility.
- Updated the left bar navigation items for clarity and consistency.
- Introduced Daily Progress Report and Daily Task Planning screens with comprehensive UI.
- Implemented filtering and refreshing functionalities in task planning.
- Improved user experience with better spacing and layout adjustments.
- Updated pubspec.yaml to include new dependencies for image handling and path management.
2025-05-28 17:35:42 +05:30

48 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
enum SnackbarType { success, error, warning, info }
void showAppSnackbar({
required String title,
required String message,
SnackbarType type = SnackbarType.info,
}) {
Color backgroundColor;
IconData iconData;
switch (type) {
case SnackbarType.success:
backgroundColor = Colors.green;
iconData = Icons.check_circle;
break;
case SnackbarType.error:
backgroundColor = Colors.red;
iconData = Icons.error;
break;
case SnackbarType.warning:
backgroundColor = Colors.orange;
iconData = Icons.warning;
break;
case SnackbarType.info:
backgroundColor = Colors.blue;
iconData = Icons.info;
break;
}
Get.snackbar(
title,
message,
backgroundColor: backgroundColor,
colorText: Colors.white,
snackPosition: SnackPosition.BOTTOM,
margin: const EdgeInsets.all(16),
borderRadius: 8,
duration: const Duration(seconds: 3),
icon: Icon(
iconData,
color: Colors.white,
),
);
}