加入低电量卡片变色提醒#158
Open
aqqkad wants to merge 1 commit into
Open
Conversation
BenderBlog
reviewed
Jul 11, 2026
| final state = controller.energyInfoStateSignal.value; | ||
| final displayInfo = controller.displayEnergyInfo.value; | ||
| final lowElectricityWarningEnabled = | ||
| !preference.contains( |
Owner
There was a problem hiding this comment.
BenderBlog
reviewed
Jul 11, 2026
| State<SettingWindow> createState() => _SettingWindowState(); | ||
| } | ||
|
|
||
| const int _defaultLowElectricityWarningThreshold = 20; |
Owner
There was a problem hiding this comment.
同理,写到 energy_controller.dart 里面。
那个控制器里面写个新信号叫 electricityWarning ,参数为 int。初始化判断逻辑如下:
- 没有开启该功能:设置为 -1 ,UI 方面设置为不理会
- 开启了,但是没有用户自定义量:设置为 20
- 开启且用户设置了自定义量:用用户的数值
Owner
|
Open
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
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.
变更内容
实现说明
errorContainer / onErrorContainerPreference枚举检查
dart analyze