firset commit

This commit is contained in:
GYJ
2024-11-22 16:48:12 +08:00
commit 8d57c7f406
105 changed files with 3615 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
import 'package:flutter/material.dart';
class BaseUIModel with ChangeNotifier {
static Function? staticNotifyListeners;
BuildContext? context;
bool showProgressHUD = false;
bool initialPage = true;
/// 判断页面是否被销毁
bool disposed = false;
dismissKeyboard(BuildContext? context) {
if (context == null) {
return;
}
FocusScope.of(context).requestFocus(FocusNode());
}
showLoadingHud() {
showProgressHUD = true;
notifyListeners();
}
dismissLoadingHud() {
showProgressHUD = false;
notifyListeners();
}
@override
void notifyListeners() {
if (!hasListeners) {
return;
}
if (disposed) {
return;
}
super.notifyListeners();
}
@override
void dispose() {
disposed = true;
super.dispose();
}
}