mirror of
https://github.com/StarCitizenToolBox/app.git
synced 2026-02-06 15:10:20 +00: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