28 lines
587 B
Dart
28 lines
587 B
Dart
import 'package:bot_toast/bot_toast.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
void toast(String? value, {bool show = true}) {
|
|
if (show && value != null) {
|
|
BotToast.showText(
|
|
text: value,
|
|
align: const Alignment(0, -0.1),
|
|
contentColor: Colors.white,
|
|
textStyle: TextStyle(fontSize: 14.sp, color: Colors.black),
|
|
);
|
|
}
|
|
}
|
|
|
|
void loading({bool show = true}) {
|
|
if (show) {
|
|
BotToast.showLoading();
|
|
}
|
|
}
|
|
|
|
|
|
void dismiss({bool dismiss = true}) {
|
|
if (dismiss) BotToast.closeAllLoading();
|
|
}
|
|
|
|
|