KonectarApp/lib/widgets/snackbar.dart

21 lines
674 B
Dart
Raw Normal View History

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 {
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,
duration: error ? Durations.long3 : Durations.long1,
2024-09-06 06:30:31 +00:00
);
ScaffoldMessenger.of(context).showSnackBar(snackBar);
//scaffoldKeyLogin.currentState!.showSnackBar(snackBar);
}
}