mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 10:14:45 +08:00
feat:riverpod 迁移 ToolsUI
This commit is contained in:
@ -1,11 +1,16 @@
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:starcitizen_doctor/common/utils/base_utils.dart';
|
||||
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||
|
||||
extension AsyncError on Future {
|
||||
Future<T?> unwrap<T>() async {
|
||||
Future<T?> unwrap<T>({BuildContext? context}) async {
|
||||
try {
|
||||
return await this;
|
||||
} catch (e) {
|
||||
dPrint("unwrap error:$e");
|
||||
if (context != null) {
|
||||
showToast(context, "出现错误: $e");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user