2024-09-06 06:30:31 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2024-12-19 05:21:33 +00:00
|
|
|
import 'package:konectar_events/utils/appcolors.dart';
|
2024-09-06 06:30:31 +00:00
|
|
|
import 'package:konectar_events/utils/constants.dart';
|
|
|
|
|
|
|
|
class SnackBarWidget {
|
2024-12-09 09:05:56 +00:00
|
|
|
static displaySnackBar(String msg, BuildContext context,
|
|
|
|
{bool error = false}) {
|
2024-09-06 06:30:31 +00:00
|
|
|
final snackBar = SnackBar(
|
|
|
|
content: Text(
|
|
|
|
msg,
|
|
|
|
style: TextStyle(color: Colors.black),
|
|
|
|
),
|
2024-12-19 05:21:33 +00:00
|
|
|
backgroundColor:
|
|
|
|
error ? Color.fromARGB(255, 235, 110, 76) : AppColors.oldbgcolor,
|
2024-12-09 09:05:56 +00:00
|
|
|
duration: error ? Durations.long3 : Durations.long1,
|
2024-09-06 06:30:31 +00:00
|
|
|
);
|
|
|
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
|
|
|
//scaffoldKeyLogin.currentState!.showSnackBar(snackBar);
|
|
|
|
}
|
|
|
|
}
|