diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..aca9f499 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ +#### What does this PR do? + +[TrelloCard/Issue/Story](LINK_TO_STORY) + +##### Why are we doing this? Any context or related work? + +#### Where should a reviewer start? + +#### Manual testing steps? + +#### Screenshots + +--- + +#### Database changes + +#### Deployment instructions + +#### New ENV variables diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e69de29b..aca9f499 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -0,0 +1,19 @@ +#### What does this PR do? + +[TrelloCard/Issue/Story](LINK_TO_STORY) + +##### Why are we doing this? Any context or related work? + +#### Where should a reviewer start? + +#### Manual testing steps? + +#### Screenshots + +--- + +#### Database changes + +#### Deployment instructions + +#### New ENV variables diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..905b4fab --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at zhu.yan@alibaba-inc.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..fc13245c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +[Flutter Go 共建](https://github.com/alibaba/flutter-go/blob/master/docs/contribute.md) diff --git a/lib/components/search_input.dart b/lib/components/search_input.dart index 9fdc3eff..9852c83a 100644 --- a/lib/components/search_input.dart +++ b/lib/components/search_input.dart @@ -15,13 +15,9 @@ typedef void OnSubmit(String value); ///搜索结果内容显示面板 class MaterialSearchResult extends StatelessWidget { - const MaterialSearchResult({ - Key key, - this.value, - this.text, - this.icon, - this.onTap - }) : super(key: key); + const MaterialSearchResult( + {Key key, this.value, this.text, this.icon, this.onTap}) + : super(key: key); final String value; final VoidCallback onTap; @@ -30,7 +26,6 @@ class MaterialSearchResult extends StatelessWidget { @override Widget build(BuildContext context) { - return new InkWell( onTap: this.onTap, child: new Container( @@ -38,8 +33,14 @@ class MaterialSearchResult extends StatelessWidget { padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 10.0), child: new Row( children: [ - new Container(width: 30.0, margin: EdgeInsets.only(right: 10), child: new Icon(icon)) ?? null, - new Expanded(child: new Text(value, style: Theme.of(context).textTheme.subhead)), + new Container( + width: 30.0, + margin: EdgeInsets.only(right: 10), + child: new Icon(icon)) ?? + null, + new Expanded( + child: new Text(value, + style: Theme.of(context).textTheme.subhead)), new Text(text, style: Theme.of(context).textTheme.subhead) ], ), @@ -124,6 +125,7 @@ class _MaterialSearchState extends State { } Timer _resultsTimer; + Future _getResultsDebounced() async { if (_results.length == 0) { setState(() { @@ -164,6 +166,7 @@ class _MaterialSearchState extends State { super.dispose(); _resultsTimer?.cancel(); } + Widget buildBody(List results) { if (_criteria.isEmpty) { return History(); @@ -171,16 +174,11 @@ class _MaterialSearchState extends State { return new Center( child: new Padding( padding: const EdgeInsets.only(top: 50.0), - child: new CircularProgressIndicator() - ) - ); + child: new CircularProgressIndicator())); } if (results.isNotEmpty) { - var content = new SingleChildScrollView( - child: new Column( - children: results - ) - ); + var content = + new SingleChildScrollView(child: new Column(children: results)); return content; } return Center(child: Text("暂无数据")); @@ -241,7 +239,7 @@ class _MaterialSearchState extends State { ], ), body: buildBody(results), - ); + ); } } @@ -405,34 +403,35 @@ class SearchInput extends StatelessWidget { } // wigdet干掉.=> componets - class History extends StatefulWidget { const History() : super(); @override - _History createState() => _History(); + _History createState() => _History(); } // AppBar 默认的实例,有状态 class _History extends State { SearchHistoryList searchHistoryList = new SearchHistoryList(); + bool refreshFlag; @override void initState() { super.initState(); + this.refreshFlag = true; } @override void dispose() { super.dispose(); } + buildChips(BuildContext context) { List list = []; List historyList = searchHistoryList.getList(); print("historyList> $historyList"); Color bgColor = Theme.of(context).primaryColor; historyList.forEach((SearchHistory value) { - Widget icon = CircleAvatar( backgroundColor: bgColor, child: Text( @@ -445,20 +444,28 @@ class _History extends State { } String targetRouter = value.targetRouter; - list.add( - InkWell( - onTap: () { - Application.router.navigateTo(context, "${targetRouter.toLowerCase()}", transition: TransitionType.inFromRight); - }, - child: Chip( - avatar: icon, - label: Text("${value.name}"), - ), - ) - ); + list.add(InkWell( + onTap: () { + Application.router.navigateTo( + context, "${targetRouter.toLowerCase()}", + transition: TransitionType.inFromRight); + }, + child: Chip( + avatar: icon, + label: Text("${value.name}"), + ), + )); }); return list; } + + _clearHistory() { + searchHistoryList.clear(); + this.setState(() { + this.refreshFlag = !this.refreshFlag; + }); + } + @override Widget build(BuildContext context) { List childList = buildChips(context); @@ -470,25 +477,38 @@ class _History extends State { return Column( children: [ Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.fromLTRB(12.0, 12, 12, 0), - child: InkWell( - onLongPress: () { - searchHistoryList.clear(); - }, - child: Text('历史搜索'), - ), - ), + alignment: Alignment.centerLeft, + padding: EdgeInsets.fromLTRB(12.0, 12, 12, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + InkWell( + onLongPress: () { + searchHistoryList.clear(); + }, + child: Text('历史搜索'), + ), + GestureDetector( + onTap: _clearHistory, + child: Container( + child: new Icon(Icons.delete, + size: 24.0, color: Theme.of(context).accentColor), + width: 30, + height: 30, + ), + ) + ], + )), Container( padding: EdgeInsets.only(left: 10), alignment: Alignment.topLeft, child: Wrap( - spacing: 6.0, // gap between adjacent chips - runSpacing: 0.0, // gap between lines - children: childList - ), + spacing: 6.0, // gap between adjacent chips + runSpacing: 0.0, // gap between lines + children: childList), ) ], ); } -} \ No newline at end of file +} diff --git a/lib/components/widget_demo.dart b/lib/components/widget_demo.dart index 6bc9839f..1e2d5744 100644 --- a/lib/components/widget_demo.dart +++ b/lib/components/widget_demo.dart @@ -185,7 +185,7 @@ class _WidgetDemoState extends State { new IconButton( tooltip: 'goBack home', onPressed: () { - Navigator.popUntil(context, ModalRoute.withName(Routes.home)); + Navigator.popUntil(context, ModalRoute.withName(Routes.root)); }, icon: Icon(Icons.home), ), diff --git a/lib/main.dart b/lib/main.dart index 2a5a944d..c8a0c4cd 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -203,6 +203,7 @@ void _startupJpush() async { } void main() async { + WidgetsFlutterBinding.ensureInitialized(); final provider = new Provider(); await provider.init(true); sp = await SpUtil.getInstance(); diff --git a/lib/model/search_history.dart b/lib/model/search_history.dart index da2e4cdd..ecaef036 100644 --- a/lib/model/search_history.dart +++ b/lib/model/search_history.dart @@ -73,7 +73,7 @@ class SearchHistoryList { } add(SearchHistory item) { - print("_searchHistoryList> ${_searchHistoryList.length}"); + print("add item to serach history ${item.targetRouter}"); for (SearchHistory value in _searchHistoryList) { if (value.name == item.name) { return; diff --git a/lib/page_demo_package/.demo.json b/lib/page_demo_package/.demo.json index 1967c339..ba8d68dc 100644 --- a/lib/page_demo_package/.demo.json +++ b/lib/page_demo_package/.demo.json @@ -1 +1 @@ -[{"name":"demoName","screenShot":"","author":"yourName","email":"yourEmail","desc":"这是一个测试的标准demo","id":"1a29aa8e_32ae_4241_9c8a_5c9e1f92b096"},{"name":"local","screenShot":"","author":"ab","email":"email","desc":"ags","id":"2c1d57d0_42ae_4241_9c8a_5c9e1f92b096"}] \ No newline at end of file +[{"name":"RangeSlider","screenShot":"","author":"RangeSlider","email":"hanxu317@qq.com","desc":"RangeSlider widget demo","id":"e5f958bc_52ae_4241_9c8a_5c9e1f92b096"},{"name":"demoName","screenShot":"","author":"yourName","email":"yourEmail","desc":"这是一个测试的标准demo","id":"1a29aa8e_32ae_4241_9c8a_5c9e1f92b096"},{"name":"local","screenShot":"","author":"ab","email":"email","desc":"ags","id":"2c1d57d0_42ae_4241_9c8a_5c9e1f92b096"}] \ No newline at end of file diff --git a/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/.demo.json b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/.demo.json new file mode 100644 index 00000000..10444611 --- /dev/null +++ b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/.demo.json @@ -0,0 +1,8 @@ +{ + "name": "RangeSlider", + "screenShot": "", + "author":"RangeSlider", + "email": "hanxu317@qq.com", + "desc": "RangeSlider widget demo", + "id": "e5f958bc_52ae_4241_9c8a_5c9e1f92b096" +} diff --git a/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/index.dart new file mode 100644 index 00000000..53760649 --- /dev/null +++ b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/index.dart @@ -0,0 +1,15 @@ +// +// Created with flutter go cli +// User: RangeSlider +// Time: 2019-09-12 15:11:05.512158 +// email: hanxu317@qq.com +// desc: RangeSlider widget demo +// + +import 'src/index.dart'; + +var demoWidgets = [ + new Demo() +]; + + \ No newline at end of file diff --git a/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/src/index.dart b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/src/index.dart new file mode 100644 index 00000000..bc34bf8f --- /dev/null +++ b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/src/index.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; + +class Demo extends StatefulWidget { + @override + _State createState() => _State(); +} + +class _State extends State { + RangeValues valuess = RangeValues(20.0, 50.0); + @override + Widget build(BuildContext context) { + return RangeSlider( + values: valuess, + //实际进度的位置 + inactiveColor: Colors.black12, + //进度中不活动部分的颜色 + labels: RangeLabels('12', '23'), + min: 0.0, + max: 100.0, + divisions: 1000, + activeColor: Colors.blue, + //进度中活动部分的颜色 + onChanged: (rangeValues) { + setState(() { + valuess = rangeValues; + }); + }, + ); + } +} diff --git a/lib/page_demo_package/index.dart b/lib/page_demo_package/index.dart index 1e6a4966..84aae6a0 100644 --- a/lib/page_demo_package/index.dart +++ b/lib/page_demo_package/index.dart @@ -1,6 +1,8 @@ +import 'RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardDemo_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096; import 'demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardDemo_demoName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096; import 'local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardDemo_local_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096; var demoObjects = { + 'e5f958bc_52ae_4241_9c8a_5c9e1f92b096': StandardDemo_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096.demoWidgets, '1a29aa8e_32ae_4241_9c8a_5c9e1f92b096': StandardDemo_demoName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096.demoWidgets, '2c1d57d0_42ae_4241_9c8a_5c9e1f92b096': StandardDemo_local_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096.demoWidgets }; \ No newline at end of file diff --git a/lib/standard_pages/.pages.json b/lib/standard_pages/.pages.json index 9b3a3ca9..d4aec412 100644 --- a/lib/standard_pages/.pages.json +++ b/lib/standard_pages/.pages.json @@ -1 +1 @@ -[{"name":"local","screenShot":"","author":"hnaxu","title":"本地","email":"hanxu@qq.com","desc":"desc","id":"5d7178d0_42ae_4241_9c8a_5c9e1f92b096"},{"name":"test","screenShot":"","author":"abc","title":"ya","email":"adsf.com","desc":"desc","id":"84f38e00_42ae_4241_9c8a_5c9e1f92b096"},{"name":"standard","screenShot":"","author":"sanfan","title":"介绍页","email":"hanxu317@qq.com","desc":"desc","id":"ee4feb8e_32ae_4241_9c8a_5c9e1f92b096"},{"name":"standard_for_slider","screenShot":"","author":"sanfan","title":"slider组件","email":"hanxu@qq.com","desc":"slider, new Slider","id":"8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096"}] \ No newline at end of file +[{"name":"local","screenShot":"","author":"hnaxu","title":"本地","email":"hanxu@qq.com","desc":"desc","id":"5d7178d0_42ae_4241_9c8a_5c9e1f92b096"},{"name":"test","screenShot":"","author":"abc","title":"ya","email":"adsf.com","desc":"desc","id":"84f38e00_42ae_4241_9c8a_5c9e1f92b096"},{"name":"standard","screenShot":"","author":"sanfan","title":"介绍页","email":"hanxu317@qq.com","desc":"desc","id":"ee4feb8e_32ae_4241_9c8a_5c9e1f92b096"},{"name":"standard_for_slider","screenShot":"","author":"sanfan","title":"slider组件","email":"hanxu@qq.com","desc":"slider, new Slider","id":"8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096"},{"name":"RangeSlider","screenShot":"","author":"hanxu","title":"RangeSlider","email":"hanxu317@qq.com","desc":"RangeSlider widget","id":"cbffbf7c_52ae_4241_9c8a_5c9e1f92b096"}] \ No newline at end of file diff --git a/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/.page.json b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/.page.json new file mode 100644 index 00000000..553fa67b --- /dev/null +++ b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/.page.json @@ -0,0 +1,10 @@ +{ + "name": "RangeSlider", + "screenShot": "", + "author":"hanxu", + "title":"RangeSlider", + "email": "hanxu317@qq.com", + "desc": "RangeSlider widget", + "id": "cbffbf7c_52ae_4241_9c8a_5c9e1f92b096" +} + \ No newline at end of file diff --git a/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.dart new file mode 100644 index 00000000..63850c68 --- /dev/null +++ b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.dart @@ -0,0 +1,36 @@ +String getMd() { + return """ + # RangeSlider + +> 用来选择范围性的数据 + +slider 用来选择连续性的或者非连续性的数据. 默认是在一段最大值最小值间做任意值的选择. 如果你想选择间隔性的值, 例如0.0到50.0间,选择10, 15,...50.0这样的值, 给divisions设定一个非空的整数5,, 去分割区间范围. + + +### **基本用法** + +关于slider有以下的术语: + +* **thumb** 滑块 用户可以水平拖拽移动的区域 + +* **track** 滑轨 thumb 可以滑动的线条区域 + +* **value indicator** 值指示器 当用户拖拽thumb的时候. 显示用户当前所选的属性值 + +* **active** 选中区 + +* **inactive** 非选中区 + +如果**onChanged**属性为空或者**min** .. **max**给出的范围 为空(例如如果min等于max),则将禁用滑块。 + +滑块小部件本身不保持任何状态State。相反,当滑块状态发生变化时,窗口小部件会调用 **onChanged** 回调。大多数使用滑块的小部件将侦听 **onChanged** 回调并使用新值重建滑块以更新滑块的视觉外观。要知道值何时开始更改,或何时更改,请设置可选回调**onChangeStart**或**onChangeEnd**。 + +默认情况下,滑块将尽可能宽,垂直居中。当给定无限制约束时,它将尝试使轨道宽144像素(每边有边距)并垂直收缩。 + +### 实例展示 + +[demo:e5f958bc_52ae_4241_9c8a_5c9e1f92b096]"""; + + +} + \ No newline at end of file diff --git a/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.md b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.md new file mode 100644 index 00000000..d6049358 --- /dev/null +++ b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.md @@ -0,0 +1,30 @@ +# RangeSlider + +> 用来选择范围性的数据 + +slider 用来选择连续性的或者非连续性的数据. 默认是在一段最大值最小值间做任意值的选择. 如果你想选择间隔性的值, 例如0.0到50.0间,选择10, 15,...50.0这样的值, 给divisions设定一个非空的整数5,, 去分割区间范围. + + +### **基本用法** + +关于slider有以下的术语: + +* **thumb** 滑块 用户可以水平拖拽移动的区域 + +* **track** 滑轨 thumb 可以滑动的线条区域 + +* **value indicator** 值指示器 当用户拖拽thumb的时候. 显示用户当前所选的属性值 + +* **active** 选中区 + +* **inactive** 非选中区 + +如果**onChanged**属性为空或者**min** .. **max**给出的范围 为空(例如如果min等于max),则将禁用滑块。 + +滑块小部件本身不保持任何状态State。相反,当滑块状态发生变化时,窗口小部件会调用 **onChanged** 回调。大多数使用滑块的小部件将侦听 **onChanged** 回调并使用新值重建滑块以更新滑块的视觉外观。要知道值何时开始更改,或何时更改,请设置可选回调**onChangeStart**或**onChangeEnd**。 + +默认情况下,滑块将尽可能宽,垂直居中。当给定无限制约束时,它将尝试使轨道宽144像素(每边有边距)并垂直收缩。 + +### 实例展示 + +[demo:e5f958bc_52ae_4241_9c8a_5c9e1f92b096] \ No newline at end of file diff --git a/lib/standard_pages/index.dart b/lib/standard_pages/index.dart index 6af27c34..1f0c7437 100644 --- a/lib/standard_pages/index.dart +++ b/lib/standard_pages/index.dart @@ -3,6 +3,7 @@ import 'local_hnaxu_5d7178d0_42ae_4241_9c8a_5c9e1f92b096/index.dart' as Standard import 'test_abc_84f38e00_42ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardPage_test_84f38e00_42ae_4241_9c8a_5c9e1f92b096; import 'standard_sanfan_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardPage_standard_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096; import 'standard_for_slider_sanfan_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardPage_standard_for_slider_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096; +import 'RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardPage_RangeSlider_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096; class StandardPages { Map standardPages; Map getPages() { @@ -15,6 +16,8 @@ class StandardPages { "ee4feb8e_32ae_4241_9c8a_5c9e1f92b096" : StandardPage_standard_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096.getMd() , "8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096" : StandardPage_standard_for_slider_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096.getMd() +, + "cbffbf7c_52ae_4241_9c8a_5c9e1f92b096" : StandardPage_RangeSlider_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096.getMd() }; } List> getLocalList() { @@ -27,6 +30,8 @@ class StandardPages { { "id": "ee4feb8e_32ae_4241_9c8a_5c9e1f92b096", "name": "standard", "email": "hanxu317@qq.com", "author": "sanfan"} , { "id": "8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096", "name": "standard_for_slider", "email": "hanxu@qq.com", "author": "sanfan"} +, + { "id": "cbffbf7c_52ae_4241_9c8a_5c9e1f92b096", "name": "RangeSlider", "email": "hanxu317@qq.com", "author": "hanxu"} ]; } diff --git a/lib/views/home.dart b/lib/views/home.dart index 435fc81d..f8e6815f 100644 --- a/lib/views/home.dart +++ b/lib/views/home.dart @@ -25,6 +25,8 @@ import 'package:flutter_go/model/search_history.dart'; import 'package:flutter_go/resources/widget_name_to_icon.dart'; import 'package:flutter_go/model/user_info.dart'; + + class AppPage extends StatefulWidget { final UserInformation userInfo; @@ -96,10 +98,10 @@ class _MyHomePageState extends State void onWidgetTap(WidgetPoint widgetPoint, BuildContext context) { String targetName = widgetPoint.name; - searchHistoryList.add( - SearchHistory(name: targetName, targetRouter: widgetPoint.routerName)); - print("searchHistoryList1 ${searchHistoryList.toString()}"); String targetRouter = widgetPoint.routerName; + searchHistoryList.add( + SearchHistory(name: targetName, targetRouter: targetRouter)); + print("searchHistoryList1 ${searchHistoryList.toString()}"); Application.router.navigateTo(context, targetRouter.toLowerCase(), transition: TransitionType.inFromRight); } diff --git a/lib/views/login_page/login_page.dart b/lib/views/login_page/login_page.dart index f7df960f..a24d6625 100644 --- a/lib/views/login_page/login_page.dart +++ b/lib/views/login_page/login_page.dart @@ -137,7 +137,7 @@ class _LoginPageState extends State { if (value.isEmpty) { return "登录名不可为空!"; } - return ' '; + return null; }, onSaved: (value) { setState(() { @@ -180,7 +180,7 @@ class _LoginPageState extends State { if (value == null || value.isEmpty) { return "密码不可为空!"; } - return ''; + return null; }, onSaved: (value) { setState(() { diff --git a/lib/widgets/elements/Form/Input/TextField/index.dart b/lib/widgets/elements/Form/Input/TextField/index.dart index fe5fe77b..bbb2900c 100644 --- a/lib/widgets/elements/Form/Input/TextField/index.dart +++ b/lib/widgets/elements/Form/Input/TextField/index.dart @@ -34,7 +34,7 @@ const String _textFieldText2 = """### **进阶用法** """; class Demo extends StatefulWidget { - static const String routeName = 'elements/Form/Input/TextField'; + static const String routeName = 'element/Form/Input/TextField'; @override _DemoState createState() => _DemoState();