Skip to content

Conversation

@Qing-Novel
Copy link
Contributor

该pr为询问deepseek后提问,主问题:“分析这个在github上的flutter项目:https://github.com/realth000/tsdm_client,然后我需要你给一个后台常驻、后台保活的方案,这个方案可以通过软件设置里的开关控制,该功能项目需要在设置-行为里,这个功能的图标空着,方便开发者添加,这个功能的描述写 后台常驻 。我需要将该方案提交给开发者,通过pull request的形式,所以你还需要非常详细的告诉我该如何填写pull request”

gitbutler-client and others added 30 commits April 15, 2025 22:10
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
修改 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报错
@Qing-Novel Qing-Novel closed this Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants