-
Notifications
You must be signed in to change notification settings - Fork 9
增加后台常驻功能,并在设置里可以通过开关控制该功能使用 #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or 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
This is placeholder commit and will be replaced by a merge of yourvirtual branches. Due to GitButler managing multiple virtual branches, you cannot switch back and forth between git branches and virtual branches easily. If you switch to another branch, GitButler will need to be reinitialized. If you commit on this branch, GitButler will throw it away. For more information about what we're doing here, check out our docs: https://docs.gitbutler.com/features/virtual-branches/integration-branch
[ci skip]
修改 pubspec.yaml 文件,添加 workmanager
创建新文件 lib/services/background_service.dart,创建后台任务逻辑
修改 lib/features/settings/view/settings_page.dart 在这个文件中添加后台常驻开关:
在 main.dart 中添加后台服务初始化
在 initialize() 方法中: 添加了 try-catch 块 添加了成功和失败的日志输出 添加了异常重新抛出 在 startBackgroundTask() 方法中: 添加了 try-catch 块 添加了 existingWorkPolicy: ExistingWorkPolicy.replace 参数 添加了成功和失败的日志输出 添加了异常重新抛出 在 stopBackgroundTask() 方法中: 添加了 try-catch 块 添加了成功和失败的日志输出 添加了异常重新抛出
添加后台服务权限
添加后台模式配置
询问deepseek解决报错问题
询问deepseek修复github报错
修复github报错
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
该pr为询问deepseek后提问,主问题:“分析这个在github上的flutter项目:https://github.com/realth000/tsdm_client,然后我需要你给一个后台常驻、后台保活的方案,这个方案可以通过软件设置里的开关控制,该功能项目需要在设置-行为里,这个功能的图标空着,方便开发者添加,这个功能的描述写 后台常驻 。我需要将该方案提交给开发者,通过pull request的形式,所以你还需要非常详细的告诉我该如何填写pull request”