Skip to content

Commit

Permalink
优化组件调用
Browse files Browse the repository at this point in the history
  • Loading branch information
nano71 committed Oct 10, 2024
1 parent 02b51f0 commit 28451c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions android/local.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sdk.dir=C:\\sdk\\android-sdk
flutter.sdk=C:\\sdk\\flutter
flutter.buildMode=debug
flutter.versionName=1.6.241009
flutter.versionCode=64
flutter.buildMode=release
flutter.versionName=1.6.241010
flutter.versionCode=65
13 changes: 6 additions & 7 deletions lib/common/service.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import 'package:workmanager/workmanager.dart';

import 'homeWidget.dart';

@pragma('vm:entry-point') // Mandatory if the App is obfuscated or using Flutter 3.1+
@pragma('vm:entry-point')
void callbackDispatcher() {
Workmanager().executeTask((task, inputData) async {
print("执行任务: $task");
// 在这里处理你的后台任务逻辑

try {
await backstageRefresh();
} catch (err) {
print('callbackDispatcher: ' + err.toString());
throw Exception(err);
} catch (error) {
print('callbackDispatcher: ' + error.toString());
throw Exception(error);
}
// 返回 true 代表任务成功,false 代表任务失败

return Future.value(true);
});
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "https://pub.flutter-io.cn" # Remove this line if you wish to publis
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.6.241009+64
version: 1.6.241010+65

environment:
sdk: ">=2.14.0 <4.0.0"
Expand Down

0 comments on commit 28451c0

Please sign in to comment.