-
Notifications
You must be signed in to change notification settings - Fork 490
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
migrate brn_horizontal_steps、brn_step_line to null safety #39
Conversation
leftcoding
commented
Dec 27, 2021
•
edited
Loading
edited
- migrate brn_step_line to null safety
- optimization brn_horizontal_steps
* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null * refactor:优化theme,暴露非null引用 * theme:去除无用信息及优化部分代码 * theme:增加属性类型
* 🎨 utils-EventBus添加null-safe * 🎨 修改theme配置功能及utils/brn_tools工具函数 null-safe * 🎨 EventBus添加null-safe(其他提交请忽略,输入回退) Co-authored-by: 大脸儿 <hexintao521@hotmail.com>
* refactor brn_toast * refactor brn_toast
@@ -1,5 +1,4 @@ | |||
// @dart=2.9 | |||
|
|||
import 'package:bruno/bruno.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个建议使用单个文件,会有循环引用问题
return BrnThemeConfigurator.instance | ||
.getConfig() | ||
.commonConfig | ||
?.brandPrimary ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的两处判空应该不需要了
} | ||
|
||
Widget _buildHighLightCircle() { | ||
return _buildColorCircleWidget(widget.highlightColor ?? | ||
BrnThemeConfigurator.instance.getConfig().commonConfig.brandPrimary); | ||
BrnThemeConfigurator.instance.getConfig().commonConfig?.brandPrimary ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我改下
if (index < currentIndex) { | ||
// 当前index小于指定的活跃index | ||
/// 当前index小于指定的活跃index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//就好啦
BrnThemeConfigurator.instance | ||
.getConfig() | ||
.commonConfig | ||
.brandPrimary); | ||
?.brandPrimary ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方是 不是肯定不为null嘞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个还没合并代码之前的,我改下后面再提交一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so cool~
@leftcoding
} | ||
} | ||
|
||
class SliderWidget extends StatefulWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool!
可否将 SliderWidget
、BrnHorizontalStep
类放在 Bruno 库中~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,统一修改下
* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null * refactor:优化theme,暴露非null引用 * theme:去除无用信息及优化部分代码 * theme:增加属性类型 * 优化修复 EventBus
* migrate brn_loading to null safety * mv loading content to brnString constants
@@ -119,29 +122,29 @@ class BrnDefaultConfigUtils { | |||
/// 文本字号 | |||
/// | |||
/// 特殊数据展示,DIN Condensed数字字体,用于强吸引 | |||
fontSizeDIN: 28, | |||
fontSizeDIN: 28.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些已经优化,建议拉新代码
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
整体建议分步提,本次只提 step 相关内容可好