showAlertSnackBar function
void
showAlertSnackBar({
- required BuildContext context,
- required String title,
- String? message,
- SILSnackBarAction? action,
- SnackBarType? type,
used to show the custom SilSnackBar
takes an optional title and message
also takes an optional action of type SILSnackBarAction
also takes an optional SnackBarType
Implementation
void showAlertSnackBar({
required BuildContext context,
required String title,
String? message,
SILSnackBarAction? action,
SnackBarType? type,
}) {
ScaffoldMessenger.of(context)
..hideCurrentSnackBar()
..showSnackBar(
SILSnackBar(
type: type ?? SnackBarType.info,
onAction: action,
title: title,
content: Text(
message ?? UserFeedBackTexts.getErrorMessage(),
textAlign: TextAlign.start,
style: normalSize12Text().copyWith(height: 1.3),
),
duration: const Duration(seconds: kShortSnackBarDuration),
),
);
return;
}