-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
10 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters