mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 10:14:45 +08:00
feat:riverpod 迁移 LocalizationUIModel
This commit is contained in:
12
lib/common/utils/async.dart
Normal file
12
lib/common/utils/async.dart
Normal file
@ -0,0 +1,12 @@
|
||||
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||
|
||||
extension AsyncError on Future {
|
||||
Future<T?> unwrap<T>() async {
|
||||
try {
|
||||
return await this;
|
||||
} catch (e) {
|
||||
dPrint("unwrap error:$e");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user