feat: toast
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import 'package:another_flushbar/flushbar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../common/theme/theme.dart';
|
||||
|
||||
class AppFlushbar {
|
||||
static void showSuccess(BuildContext context, String message) {
|
||||
Flushbar(
|
||||
messageText: Text(
|
||||
message,
|
||||
style: AppStyle.lg.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
icon: const Icon(Icons.check_circle, color: Colors.white),
|
||||
duration: const Duration(seconds: 2),
|
||||
flushbarPosition: FlushbarPosition.BOTTOM,
|
||||
backgroundColor: AppColor.secondary,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
margin: const EdgeInsets.all(12),
|
||||
).show(context);
|
||||
}
|
||||
|
||||
static void showError(BuildContext context, String message) {
|
||||
Flushbar(
|
||||
messageText: Text(
|
||||
message,
|
||||
style: AppStyle.lg.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
icon: const Icon(Icons.error, color: Colors.white),
|
||||
duration: const Duration(seconds: 3),
|
||||
flushbarPosition: FlushbarPosition.BOTTOM,
|
||||
backgroundColor: AppColor.error,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
margin: const EdgeInsets.all(12),
|
||||
).show(context);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user