mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 06:43:42 +00:00
feat: new ui (#1455)
This commit is contained in:
742 files changed
+59951
-5934
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../api/model/result.dart';
|
||||
|
||||
void showErrorMessage(msg) {
|
||||
final title = 'error'.tr;
|
||||
if (msg is Result) {
|
||||
Get.snackbar(title, msg.msg!);
|
||||
return;
|
||||
}
|
||||
if (msg is Exception) {
|
||||
final message = (msg as dynamic).message;
|
||||
if (message is Result) {
|
||||
Get.snackbar(title, ((msg as dynamic).message as Result).msg!);
|
||||
return;
|
||||
}
|
||||
if (message is String) {
|
||||
Get.snackbar(title, message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Get.snackbar(title, msg.toString());
|
||||
}
|
||||
|
||||
var _showMessageFlag = true;
|
||||
|
||||
void showMessage(title, msg) {
|
||||
if (_showMessageFlag) {
|
||||
_showMessageFlag = false;
|
||||
Get.snackbar(title, msg);
|
||||
Future.delayed(const Duration(seconds: 3), () {
|
||||
_showMessageFlag = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user