From 7d48864aac38ff877a1cd93224a886f19e14c223 Mon Sep 17 00:00:00 2001 From: ryan730 Date: Thu, 10 Jan 2019 17:32:54 +0800 Subject: [PATCH 01/27] =?UTF-8?q?Modfiy:=201.=20=E5=8E=BB=E6=8E=89=20widge?= =?UTF-8?q?t-demo=20=E7=9A=84=E5=BC=95=E7=94=A8=202.=20codeUrl=203.=20?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=87=AA=E5=AE=9AcustomDemo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/widget_demo.dart | 7 +++- lib/widgets/components/Bar/AppBar/demo.dart | 4 +-- lib/widgets/components/Bar/AppBar/index.dart | 9 +++-- .../components/Bar/BottomAppBar/demo.dart | 2 -- .../components/Bar/BottomAppBar/index.dart | 9 +++-- .../components/Bar/ButtonBar/demo.dart | 3 +- .../components/Bar/ButtonBar/index.dart | 10 +++--- .../components/Bar/FlexibleSpaceBar/demo.dart | 3 +- .../Bar/FlexibleSpaceBar/index.dart | 10 +++--- .../components/Bar/SliverAppBar/demo.dart | 3 +- .../components/Bar/SliverAppBar/index.dart | 9 +++-- lib/widgets/components/Bar/SnackBar/demo.dart | 3 +- .../components/Bar/SnackBar/index.dart | 9 +++-- .../components/Bar/SnackBarAction/index.dart | 1 - lib/widgets/components/Card/Card/demo.dart | 3 +- lib/widgets/components/Card/Card/index.dart | 10 +++--- .../components/LIst/AnimatedList/index.dart | 9 +++-- .../components/LIst/ListBody/demo.dart | 3 +- .../components/LIst/ListBody/index.dart | 10 +++--- .../components/LIst/ListView/demo.dart | 3 +- .../components/LIst/ListView/index.dart | 9 +++-- .../Navigation/BottomNavigationBar/demo.dart | 3 +- .../Navigation/BottomNavigationBar/index.dart | 9 +++-- .../BottomNavigationBarItem/demo.dart | 3 +- .../BottomNavigationBarItem/index.dart | 6 ++-- .../components/Navigation/customDemo.dart | 35 ------------------- .../Form/Button/DropdownButton/index.dart | 8 ++--- .../Form/Button/FlatButton/index.dart | 8 ++--- .../Button/FloatingActionButton/index.dart | 8 ++--- .../Form/Button/IconButton/index.dart | 7 ++-- .../Form/Button/OutlineButton/index.dart | 7 ++-- .../Form/Button/PopupMenuButton/index.dart | 7 ++-- .../Form/Button/RaisedButton/index.dart | 7 ++-- .../Form/Button/RawMaterialButton/index.dart | 7 ++-- .../elements/Form/CheckBox/Checkbox/demo.dart | 4 +-- .../Form/CheckBox/Checkbox/index.dart | 7 ++-- .../Form/CheckBox/CheckboxListTile/demo.dart | 2 +- .../Form/CheckBox/CheckboxListTile/index.dart | 7 ++-- .../elements/Form/Text/RichText/index.dart | 6 ++-- .../elements/Form/Text/Text/index.dart | 6 ++-- .../elements/Frame/Axis/crossAxis/index.dart | 2 +- .../elements/Frame/Axis/flipAxis/index.dart | 2 +- .../elements/Frame/Axis/mainAxis/index.dart | 2 +- .../Media/Image/precacheImage/index.dart | 2 +- 44 files changed, 107 insertions(+), 177 deletions(-) delete mode 100644 lib/widgets/components/Navigation/customDemo.dart diff --git a/lib/common/widget_demo.dart b/lib/common/widget_demo.dart index 9747dd43..6120592c 100644 --- a/lib/common/widget_demo.dart +++ b/lib/common/widget_demo.dart @@ -16,13 +16,16 @@ class WidgetDemo extends StatefulWidget { final String docUrl; final String title; final String codeUrl; + final Widget bottomNaviBar; WidgetDemo( {Key key, @required this.title, @required this.contentList, @required this.codeUrl, - @required this.docUrl}) + @required this.docUrl, + this.bottomNaviBar, + }) : super(key: key); _WidgetDemoState createState() => _WidgetDemoState(); @@ -174,6 +177,8 @@ class _WidgetDemoState extends State { ), backgroundColor: Theme.of(context).primaryColor, ), + bottomNavigationBar: (widget.bottomNaviBar is Widget) ? widget + .bottomNaviBar : null ); } } diff --git a/lib/widgets/components/Bar/AppBar/demo.dart b/lib/widgets/components/Bar/AppBar/demo.dart index d9bf58e8..c2e4a0e5 100644 --- a/lib/widgets/components/Bar/AppBar/demo.dart +++ b/lib/widgets/components/Bar/AppBar/demo.dart @@ -11,8 +11,8 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 -* index 当前checkbox 的索引值 +* Checkbox 默认AppBar的实例 +* index 当前AppBar 的索引值 * */ class AppBarLessDefaultComplex extends StatefulWidget { const AppBarLessDefaultComplex() : super(); diff --git a/lib/widgets/components/Bar/AppBar/index.dart b/lib/widgets/components/Bar/AppBar/index.dart index 06da2b87..7a84a0bf 100644 --- a/lib/widgets/components/Bar/AppBar/index.dart +++ b/lib/widgets/components/Bar/AppBar/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: AppBar 的示例 */ -import '../../../../common/widget-demo.dart'; -import '../../../../routers/application.dart'; +import '../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -48,8 +47,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'AppBar', - codeUrl: '${Application.github['widgetsURL']}componentss/Bar/AppBar/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'componentss/Bar/AppBar/demo.dart', + contentList: [ allDemoBoxs(context, this) ], docUrl: 'https://docs.flutter.io/flutter/material/AppBar-class.html', ); } @@ -60,7 +59,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDemoBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/BottomAppBar/demo.dart b/lib/widgets/components/Bar/BottomAppBar/demo.dart index b9ebd18c..7f42a9e5 100644 --- a/lib/widgets/components/Bar/BottomAppBar/demo.dart +++ b/lib/widgets/components/Bar/BottomAppBar/demo.dart @@ -6,8 +6,6 @@ * email: zhu.yan@alibaba-inc.com * tartget: BottomAppBar 的示例 */ - -import 'dart:math'; import 'package:flutter/material.dart'; /* diff --git a/lib/widgets/components/Bar/BottomAppBar/index.dart b/lib/widgets/components/Bar/BottomAppBar/index.dart index 74c17c2f..1ae2d1b8 100644 --- a/lib/widgets/components/Bar/BottomAppBar/index.dart +++ b/lib/widgets/components/Bar/BottomAppBar/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: BottomAppBar 的示例 */ -import '../../../../common/widget-demo.dart'; -import '../../../../routers/application.dart'; +import '../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -44,8 +43,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'BottomAppBar', - codeUrl: '${Application.github['widgetsURL']}componentss/Bar/BottomAppBar/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'componentss/Bar/BottomAppBar/demo.dart', + contentList: [allDomeBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/BottomAppBar-class.html', ); } @@ -56,7 +55,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDomeBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/ButtonBar/demo.dart b/lib/widgets/components/Bar/ButtonBar/demo.dart index 74cf15b7..00c2debc 100644 --- a/lib/widgets/components/Bar/ButtonBar/demo.dart +++ b/lib/widgets/components/Bar/ButtonBar/demo.dart @@ -11,8 +11,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 -* index 当前checkbox 的索引值 +* ButtonBar 默认的实例 * */ class ButtonBarFullDefault extends StatefulWidget { const ButtonBarFullDefault() : super(); diff --git a/lib/widgets/components/Bar/ButtonBar/index.dart b/lib/widgets/components/Bar/ButtonBar/index.dart index 753cd3be..cc745120 100644 --- a/lib/widgets/components/Bar/ButtonBar/index.dart +++ b/lib/widgets/components/Bar/ButtonBar/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: ButtonBar 的示例 */ -import '../../../../common/widget-demo.dart'; -import '../../../../routers/application.dart'; +import '../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -45,9 +44,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'ButtonBar', - codeUrl: '${Application - .github['widgetsURL']}componentss//Bar/ButtonBar/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'componentss//Bar/ButtonBar/demo.dart', + contentList: [allDemoBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/ButtonBar-class.html', ); } @@ -58,7 +56,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDemoBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/FlexibleSpaceBar/demo.dart b/lib/widgets/components/Bar/FlexibleSpaceBar/demo.dart index cd4218a9..b9fac16b 100644 --- a/lib/widgets/components/Bar/FlexibleSpaceBar/demo.dart +++ b/lib/widgets/components/Bar/FlexibleSpaceBar/demo.dart @@ -11,8 +11,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 -* index 当前checkbox 的索引值 +* Checkbox 默认FlexibleSpaceBar的实例 * */ class FlexibleSpaceBarFullDefault extends StatefulWidget { const FlexibleSpaceBarFullDefault() : super(); diff --git a/lib/widgets/components/Bar/FlexibleSpaceBar/index.dart b/lib/widgets/components/Bar/FlexibleSpaceBar/index.dart index 87e43280..5c85aa3a 100644 --- a/lib/widgets/components/Bar/FlexibleSpaceBar/index.dart +++ b/lib/widgets/components/Bar/FlexibleSpaceBar/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: FlexibleSpaceBar 的示例 */ -import '../../../../common/widget-demo.dart'; -import '../../../../routers/application.dart'; +import '../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -46,9 +45,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'FlexibleSpaceBar', - codeUrl: '${Application - .github['widgetsURL']}componentss/Bar/FlexibleSpaceBar/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'Bar/FlexibleSpaceBar/demo.dart', + contentList: [allDemoBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/FlexibleSpaceBar-class.html', ); } @@ -59,7 +57,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDemoBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/SliverAppBar/demo.dart b/lib/widgets/components/Bar/SliverAppBar/demo.dart index e201af73..f99a104d 100644 --- a/lib/widgets/components/Bar/SliverAppBar/demo.dart +++ b/lib/widgets/components/Bar/SliverAppBar/demo.dart @@ -11,8 +11,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 -* index 当前checkbox 的索引值 +* Checkbox 默认SliverAppBar的实例 * */ class SliverAppBarFullDefault extends StatefulWidget { const SliverAppBarFullDefault() : super(); diff --git a/lib/widgets/components/Bar/SliverAppBar/index.dart b/lib/widgets/components/Bar/SliverAppBar/index.dart index ef6de401..7063439c 100644 --- a/lib/widgets/components/Bar/SliverAppBar/index.dart +++ b/lib/widgets/components/Bar/SliverAppBar/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: SliverAppBar 的示例 */ -import '../../../../common/widget-demo.dart'; -import '../../../../routers/application.dart'; +import '../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -41,8 +40,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'SliverAppBar', - codeUrl: '${Application.github['widgetsURL']}componentss/Bar/SliverAppBar/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'componentss/Bar/SliverAppBar/demo.dart', + contentList: [allDemoBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/widgets/SliverAppBar-class.html', ); } @@ -53,7 +52,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDemoBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/SnackBar/demo.dart b/lib/widgets/components/Bar/SnackBar/demo.dart index 6b0e9c5b..24b677d8 100644 --- a/lib/widgets/components/Bar/SnackBar/demo.dart +++ b/lib/widgets/components/Bar/SnackBar/demo.dart @@ -11,8 +11,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 -* index 当前checkbox 的索引值 +* Checkbox 默认的实例 * */ class SnackBarFullDefault extends StatefulWidget { const SnackBarFullDefault() : super(); diff --git a/lib/widgets/components/Bar/SnackBar/index.dart b/lib/widgets/components/Bar/SnackBar/index.dart index 3595af12..ddfa971a 100644 --- a/lib/widgets/components/Bar/SnackBar/index.dart +++ b/lib/widgets/components/Bar/SnackBar/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: SnackBar 的示例 */ -import '../../../../common/widget-demo.dart'; -import '../../../../routers/application.dart'; +import '../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -46,8 +45,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'SnackBar', - codeUrl: '${Application.github['widgetsURL']}componentss/Bar/SnackBar/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'componentss/Bar/SnackBar/demo.dart', + contentList: [allDemoBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/SnackBar-class.html', ); } @@ -58,7 +57,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDemoBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/SnackBarAction/index.dart b/lib/widgets/components/Bar/SnackBarAction/index.dart index 30d2fbe6..47257ead 100644 --- a/lib/widgets/components/Bar/SnackBarAction/index.dart +++ b/lib/widgets/components/Bar/SnackBarAction/index.dart @@ -7,7 +7,6 @@ * tartget: SnackBarAction 的示例 */ import '../../../../common/widget_demo.dart'; -import '../../../../routers/application.dart'; import 'dart:math'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/components/Card/Card/demo.dart b/lib/widgets/components/Card/Card/demo.dart index 7d4b4b3c..bc3c1d1f 100644 --- a/lib/widgets/components/Card/Card/demo.dart +++ b/lib/widgets/components/Card/Card/demo.dart @@ -11,8 +11,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 -* index 当前checkbox 的索引值 +* Checkbox 默认Card的实例 * */ class CardFullDefault extends StatefulWidget { const CardFullDefault() : super(); diff --git a/lib/widgets/components/Card/Card/index.dart b/lib/widgets/components/Card/Card/index.dart index 3867447d..66e2bc49 100644 --- a/lib/widgets/components/Card/Card/index.dart +++ b/lib/widgets/components/Card/Card/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: Card 的示例 */ -import '../../../../common/widget-demo.dart'; -import '../../../../routers/application.dart'; +import '../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -44,9 +43,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'Card', - codeUrl: '${Application - .github['widgetsURL']}componentss/Card/Card/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'componentss/Card/Card/demo.dart', + contentList: [allDemoBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/Card-class.html', ); } @@ -57,7 +55,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDemoBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/LIst/AnimatedList/index.dart b/lib/widgets/components/LIst/AnimatedList/index.dart index eba2c0d0..48ffdff4 100644 --- a/lib/widgets/components/LIst/AnimatedList/index.dart +++ b/lib/widgets/components/LIst/AnimatedList/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: AnimatedList 的示例 */ -import '../../../../common/widget-demo.dart'; -import '../../../../routers/application.dart'; +import '../../../../common/widget_demo.dart'; import 'package:flutter/material.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; @@ -45,8 +44,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'AnimatedList', - codeUrl: '${Application.github['widgetsURL']}componentss/List/AnimatedList/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'componentss/List/AnimatedList/demo.dart', + contentList: [allDemoBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/widgets/AnimatedList-class.html', ); } @@ -57,7 +56,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDemoBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/LIst/ListBody/demo.dart b/lib/widgets/components/LIst/ListBody/demo.dart index 8eae97bc..73dbbe13 100644 --- a/lib/widgets/components/LIst/ListBody/demo.dart +++ b/lib/widgets/components/LIst/ListBody/demo.dart @@ -11,8 +11,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 -* index 当前checkbox 的索引值 +* Checkbox 默认ListBody的实例 * */ class ListBodyFullDefault extends StatefulWidget { const ListBodyFullDefault() : super(); diff --git a/lib/widgets/components/LIst/ListBody/index.dart b/lib/widgets/components/LIst/ListBody/index.dart index 1ef2c981..e208093f 100644 --- a/lib/widgets/components/LIst/ListBody/index.dart +++ b/lib/widgets/components/LIst/ListBody/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: ListBody 的示例 */ -import '../../../../common/widget-demo.dart'; -import '../../../../routers/application.dart'; +import '../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -42,9 +41,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'ListBody', - codeUrl: '${Application - .github['widgetsURL']}/componentss/List/ListBody/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'componentss/List/ListBody/demo.dart', + contentList: [allDemoBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/widgets/ListBody-class.html', ); } @@ -55,7 +53,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDemoBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/LIst/ListView/demo.dart b/lib/widgets/components/LIst/ListView/demo.dart index bdce900b..cafab8da 100644 --- a/lib/widgets/components/LIst/ListView/demo.dart +++ b/lib/widgets/components/LIst/ListView/demo.dart @@ -11,8 +11,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 -* index 当前checkbox 的索引值 +* ListView 默认ListView的实例 * */ class ListViewFullDefault extends StatefulWidget { const ListViewFullDefault() : super(); diff --git a/lib/widgets/components/LIst/ListView/index.dart b/lib/widgets/components/LIst/ListView/index.dart index 1416e662..50e16a67 100644 --- a/lib/widgets/components/LIst/ListView/index.dart +++ b/lib/widgets/components/LIst/ListView/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: ListView 的示例 */ -import '../../../../common/widget-demo.dart'; -import '../../../../routers/application.dart'; +import '../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -69,8 +68,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'ListView', - codeUrl: '${Application.github['widgetsURL']}/componentss/List/ListView/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'componentss/List/ListView/demo.dart', + contentList: [allDemoBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/widgets/ListView-class.html', ); } @@ -81,7 +80,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDemoBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Navigation/BottomNavigationBar/demo.dart b/lib/widgets/components/Navigation/BottomNavigationBar/demo.dart index a4916e74..eb79430c 100644 --- a/lib/widgets/components/Navigation/BottomNavigationBar/demo.dart +++ b/lib/widgets/components/Navigation/BottomNavigationBar/demo.dart @@ -11,8 +11,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 -* index 当前checkbox 的索引值 +* BottomNavigationBar 默认的实例 * */ class BottomNavigationBarFullDefault extends StatefulWidget { const BottomNavigationBarFullDefault() : super(); diff --git a/lib/widgets/components/Navigation/BottomNavigationBar/index.dart b/lib/widgets/components/Navigation/BottomNavigationBar/index.dart index 072f03a5..cb40f249 100644 --- a/lib/widgets/components/Navigation/BottomNavigationBar/index.dart +++ b/lib/widgets/components/Navigation/BottomNavigationBar/index.dart @@ -6,10 +6,9 @@ * email: zhu.yan@alibaba-inc.com * tartget: BottomNavigationBar 的示例 */ -import '../customDemo.dart'; import '../../../../routers/application.dart'; -import 'dart:math'; import 'package:flutter/material.dart'; +import '../../../../common/widget_demo.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; import './demo.dart' as BottomNavigationBarDemo; @@ -41,10 +40,10 @@ class Demo extends StatefulWidget { class _DemoState extends State { @override Widget build(BuildContext context) { - return CustomDemo( + return WidgetDemo( title: 'BottomNavigationBar', codeUrl: '${Application.github['widgetsURL']}components/Navigation/BottomNavigationBar/demo.dart', - child: allCheckboxs(context, this), + contentList: [allDemoBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/BottomNavigationBar-class.html', bottomNaviBar:BottomNavigationBarDemo.BottomNavigationBarFullDefault() ); @@ -56,7 +55,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDemoBoxs(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Navigation/BottomNavigationBarItem/demo.dart b/lib/widgets/components/Navigation/BottomNavigationBarItem/demo.dart index 7f77989c..4554f235 100644 --- a/lib/widgets/components/Navigation/BottomNavigationBarItem/demo.dart +++ b/lib/widgets/components/Navigation/BottomNavigationBarItem/demo.dart @@ -11,8 +11,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 -* index 当前checkbox 的索引值 +* BottomNavigationBar 默认的实例 * */ class BottomNavigationBarItemFullDefault extends StatefulWidget { const BottomNavigationBarItemFullDefault() : super(); diff --git a/lib/widgets/components/Navigation/BottomNavigationBarItem/index.dart b/lib/widgets/components/Navigation/BottomNavigationBarItem/index.dart index 6d8f29ee..9071e9fd 100644 --- a/lib/widgets/components/Navigation/BottomNavigationBarItem/index.dart +++ b/lib/widgets/components/Navigation/BottomNavigationBarItem/index.dart @@ -6,7 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: BottomNavigationBarItem 的示例 */ -import '../../../../common/widget-demo.dart'; +import '../../../../common/widget_demo.dart'; import '../../../../routers/application.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -44,8 +44,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'BottomNavigationBarItem', - codeUrl: '${Application.github['widgetsURL']}componentss/Bar/BottomNavigationBarItem/demo.dart', - child: allCheckboxs(context, this), + codeUrl: '${Application.github['widgetsURL']}components/Bar/BottomNavigationBarItem/demo.dart', + contentList: [allCheckboxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/widgets/BottomNavigationBarItem-class.html', ); } diff --git a/lib/widgets/components/Navigation/customDemo.dart b/lib/widgets/components/Navigation/customDemo.dart deleted file mode 100644 index e584df3b..00000000 --- a/lib/widgets/components/Navigation/customDemo.dart +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Created with Android Studio. - * User: 一晟 - * Date: 2018/12/27 - * Time: 下午10:12 - * email: zhu.yan@alibaba-inc.com - * tartget: FlatButton 的示例 - */ -import '../../../common/widget-demo.dart'; -import 'package:flutter/material.dart'; - -class CustomDemo extends WidgetDemo { - - final Widget child; - final String docUrl; - final String title; - final String codeUrl; - final Widget bottomNaviBar; - CustomDemo( - {Key key, - @required this.title, - @required this.child, - @required this.codeUrl, - @required this.docUrl, - this.bottomNaviBar - }) - : super(key: key); - - @override - Widget build(BuildContext context,[bottomNavigationBar]) { - print('bottomNavigationBar:${bottomNaviBar}'); - final factory = super.build(context,bottomNaviBar); - return factory; - } -} \ No newline at end of file diff --git a/lib/widgets/elements/Form/Button/DropdownButton/index.dart b/lib/widgets/elements/Form/Button/DropdownButton/index.dart index 24fc4ce9..8bc852b0 100644 --- a/lib/widgets/elements/Form/Button/DropdownButton/index.dart +++ b/lib/widgets/elements/Form/Button/DropdownButton/index.dart @@ -7,9 +7,7 @@ * target: DropdownButton 的示例 * 对应文档地址:https://docs.flutter.io/flutter/material/DropdownButton-class.html */ -import '../../../../../common/widget-demo.dart'; -import '../../../../../routers/application.dart'; -import 'dart:math'; +import '../../../../../common/widget_demo.dart'; import 'package:flutter/material.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; @@ -51,8 +49,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'DropdownButton', - codeUrl: '${Application.github['widgetsURL']}elements/Form/Button/DropdownButton/demo.dart', - child: allDropdownButtons(context,this), + codeUrl: 'elements/Form/Button/DropdownButton/demo.dart', + contentList: [allDropdownButtons(context,this)], docUrl: 'https://docs.flutter.io/flutter/material/DropdownButton-class.html', ); } diff --git a/lib/widgets/elements/Form/Button/FlatButton/index.dart b/lib/widgets/elements/Form/Button/FlatButton/index.dart index adbb3b5b..e5f4f1c7 100644 --- a/lib/widgets/elements/Form/Button/FlatButton/index.dart +++ b/lib/widgets/elements/Form/Button/FlatButton/index.dart @@ -7,9 +7,7 @@ * target: FlatButton 的示例 * 对应文档地址:https://docs.flutter.io/flutter/material/FlatButton-class.html */ -import '../../../../../common/widget-demo.dart'; -import '../../../../../routers/application.dart'; -import 'dart:math'; +import '../../../../../common/widget_demo.dart'; import 'package:flutter/material.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; @@ -83,8 +81,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'FlatButton', - codeUrl: '${Application.github['widgetsURL']}elements/Form/Button/FlatButton/demo.dart', - child: allFlatButtons(context), + codeUrl: 'elements/Form/Button/FlatButton/demo.dart', + contentList: [allFlatButtons(context)], docUrl: 'https://docs.flutter.io/flutter/material/FlatButton-class.html', ); } diff --git a/lib/widgets/elements/Form/Button/FloatingActionButton/index.dart b/lib/widgets/elements/Form/Button/FloatingActionButton/index.dart index 6afa2f11..0c921769 100644 --- a/lib/widgets/elements/Form/Button/FloatingActionButton/index.dart +++ b/lib/widgets/elements/Form/Button/FloatingActionButton/index.dart @@ -7,8 +7,7 @@ * target: FloatingActionButton 的示例 * 对应文档地址:https://docs.flutter.io/flutter/material/FloatingActionButton-class.html */ -import '../../../../../common/widget-demo.dart'; -import '../../../../../routers/application.dart'; +import '../../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -62,9 +61,8 @@ class _DemoState extends State { return WidgetDemo( title: 'FloatingActionButton', // desc: _floatingActionTitle, - codeUrl: '${Application.github['widgetsURL']}elements/Form/Button/FloatingActionButton/demo.dart', - child: allFloatingActionButtons(context,this), - //child: Text('123'), + codeUrl: 'elements/Form/Button/FloatingActionButton/demo.dart', + contentList: [allFloatingActionButtons(context,this)], docUrl: 'https://docs.flutter.io/flutter/material/FloatingActionButton-class.html', ); } diff --git a/lib/widgets/elements/Form/Button/IconButton/index.dart b/lib/widgets/elements/Form/Button/IconButton/index.dart index 19ffdd5d..ad00008b 100644 --- a/lib/widgets/elements/Form/Button/IconButton/index.dart +++ b/lib/widgets/elements/Form/Button/IconButton/index.dart @@ -7,8 +7,7 @@ * target: IconButton 的示例 * 对应文档地址:https://docs.flutter.io/flutter/material/IconButton-class.html */ -import '../../../../../common/widget-demo.dart'; -import '../../../../../routers/application.dart'; +import '../../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -54,8 +53,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'IconButton', - codeUrl: '${Application.github['widgetsURL']}elements/Form/Button/IconButton/demo.dart', - child: allIconButtons(context,this), + codeUrl: 'elements/Form/Button/IconButton/demo.dart', + contentList: [ allIconButtons(context,this)], docUrl: 'https://docs.flutter.io/flutter/material/IconButton-class.html', ); } diff --git a/lib/widgets/elements/Form/Button/OutlineButton/index.dart b/lib/widgets/elements/Form/Button/OutlineButton/index.dart index e44cd71b..5d23c6b1 100644 --- a/lib/widgets/elements/Form/Button/OutlineButton/index.dart +++ b/lib/widgets/elements/Form/Button/OutlineButton/index.dart @@ -7,8 +7,7 @@ * target: OutlineButton 的示例 * 对应文档地址:https://docs.flutter.io/flutter/material/OutlineButton-class.html */ -import '../../../../../common/widget-demo.dart'; -import '../../../../../routers/application.dart'; +import '../../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -63,8 +62,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'OutlineButton', - codeUrl: '${Application.github['widgetsURL']}elements/Form/Button/OutlineButton/demo.dart', - child: allOutlineButtons(context,this), + codeUrl: 'elements/Form/Button/OutlineButton/demo.dart', + contentList: [allOutlineButtons(context,this)], docUrl: 'https://docs.flutter.io/flutter/material/OutlineButton-class.html', ); } diff --git a/lib/widgets/elements/Form/Button/PopupMenuButton/index.dart b/lib/widgets/elements/Form/Button/PopupMenuButton/index.dart index 719acf4e..d65e2633 100644 --- a/lib/widgets/elements/Form/Button/PopupMenuButton/index.dart +++ b/lib/widgets/elements/Form/Button/PopupMenuButton/index.dart @@ -8,8 +8,7 @@ * 对应文档地址:https://docs.flutter.io/flutter/material/PopupMenuButton-class.html */ -import '../../../../../common/widget-demo.dart'; -import '../../../../../routers/application.dart'; +import '../../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; @@ -55,8 +54,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'PopupMenuButton', - codeUrl: '${Application.github['widgetsURL']}elements/Form/Button/RaisedButton/demo.dart', - child: allPopupMenuButton(widget,this), + codeUrl: 'elements/Form/Button/RaisedButton/demo.dart', + contentList: [allPopupMenuButton(widget,this)], docUrl: 'https://docs.flutter.io/flutter/material/PopupMenuButton-class.html', ); } diff --git a/lib/widgets/elements/Form/Button/RaisedButton/index.dart b/lib/widgets/elements/Form/Button/RaisedButton/index.dart index 465ad90b..d29797ef 100644 --- a/lib/widgets/elements/Form/Button/RaisedButton/index.dart +++ b/lib/widgets/elements/Form/Button/RaisedButton/index.dart @@ -7,8 +7,7 @@ * target: RaisedButton 的示例 * 对应文档地址:https://docs.flutter.io/flutter/material/RaisedButton-class.html */ -import '../../../../../common/widget-demo.dart'; -import '../../../../../routers/application.dart'; +import '../../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -63,8 +62,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'RaisedButton', - codeUrl: '${Application.github['widgetsURL']}elements/Form/Button/RaisedButton/demo.dart', - child: allRaisedButtons(context,this), + codeUrl: 'elements/Form/Button/RaisedButton/demo.dart', + contentList: [allRaisedButtons(context,this)], docUrl: 'https://docs.flutter.io/flutter/material/RaisedButton-class.html', ); } diff --git a/lib/widgets/elements/Form/Button/RawMaterialButton/index.dart b/lib/widgets/elements/Form/Button/RawMaterialButton/index.dart index 818aeccc..982675e9 100644 --- a/lib/widgets/elements/Form/Button/RawMaterialButton/index.dart +++ b/lib/widgets/elements/Form/Button/RawMaterialButton/index.dart @@ -7,8 +7,7 @@ * target: RawMaterialButton 的示例 * 对应文档地址:https://docs.flutter.io/flutter/material/RawMaterialButton-class.html */ -import '../../../../../common/widget-demo.dart'; -import '../../../../../routers/application.dart'; +import '../../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -52,8 +51,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'RawMaterialButton', - codeUrl: '${Application.github['widgetsURL']}elements/Form/Button/RawMaterialButton/demo.dart', - child: allRawMaterialButtons(context,this), + codeUrl: 'elements/Form/Button/RawMaterialButton/demo.dart', + contentList: [allRawMaterialButtons(context,this)], docUrl: 'https://docs.flutter.io/flutter/material/RawMaterialButton-class.html', ); } diff --git a/lib/widgets/elements/Form/CheckBox/Checkbox/demo.dart b/lib/widgets/elements/Form/CheckBox/Checkbox/demo.dart index 489225d2..2e94bb8d 100644 --- a/lib/widgets/elements/Form/CheckBox/Checkbox/demo.dart +++ b/lib/widgets/elements/Form/CheckBox/Checkbox/demo.dart @@ -10,7 +10,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 +* Checkbox 默认的实例 * index 当前checkbox 的索引值 * */ class CheckboxDefault extends StatefulWidget{ @@ -39,7 +39,7 @@ class _CheckboxDefault extends State { } /* -* Checkbox 默认按钮的实例 +* Checkbox 默认的实例 * index 当前checkbox 的索引值 * */ class CheckboxSelect extends StatelessWidget { diff --git a/lib/widgets/elements/Form/CheckBox/Checkbox/index.dart b/lib/widgets/elements/Form/CheckBox/Checkbox/index.dart index 7410ce50..00f4d369 100644 --- a/lib/widgets/elements/Form/CheckBox/Checkbox/index.dart +++ b/lib/widgets/elements/Form/CheckBox/Checkbox/index.dart @@ -7,8 +7,7 @@ * target: Checkbox 的示例 * 对应文档地址:https://docs.flutter.io/flutter/material/Checkbox-class.html */ -import '../../../../../common/widget-demo.dart'; -import '../../../../../routers/application.dart'; +import '../../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -48,8 +47,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'Checkbox', - codeUrl: '${Application.github['widgetsURL']}elements/Form/Checkbox/Checkbox/demo.dart', - child: allCheckboxs(context,this), + codeUrl: 'elements/Form/Checkbox/Checkbox/demo.dart', + contentList: [allCheckboxs(context,this)], docUrl: 'https://docs.flutter.io/flutter/material/Checkbox-class.html', ); } diff --git a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/demo.dart b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/demo.dart index 5af9a5d3..eba60a7e 100644 --- a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/demo.dart +++ b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/demo.dart @@ -11,7 +11,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; /* -* Checkbox 默认按钮的实例 +* Checkbox 默认的实例 * index 当前checkbox 的索引值 * */ class CheckboxListTileStateDefault extends StatefulWidget { diff --git a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart index 87a801b4..3f6261bd 100644 --- a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart +++ b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart @@ -6,8 +6,7 @@ * email: zhu.yan@alibaba-inc.com * tartget: CheckboxListTile 的示例 */ -import '../../../../../common/widget-demo.dart'; -import '../../../../../routers/application.dart'; +import '../../../../../common/widget_demo.dart'; import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; @@ -49,8 +48,8 @@ class _DemoState extends State { Widget build(BuildContext context) { return WidgetDemo( title: 'CheckboxListTile', - codeUrl: '${Application.github['widgetsURL']}elements/Form/Checkbox/CheckboxListTile/demo.dart', - child: allCheckboxs(context, this), + codeUrl: 'elements/Form/Checkbox/CheckboxListTile/demo.dart', + contentList: [allCheckboxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/CheckboxListTile-class.html', ); } diff --git a/lib/widgets/elements/Form/Text/RichText/index.dart b/lib/widgets/elements/Form/Text/RichText/index.dart index 43811bc9..6b3c9f98 100644 --- a/lib/widgets/elements/Form/Text/RichText/index.dart +++ b/lib/widgets/elements/Form/Text/RichText/index.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; -import '../../../../../common/widget-demo.dart'; +import '../../../../../common/widget_demo.dart'; const String intro = """ # 富文本显示 @@ -67,7 +67,7 @@ class _Demo extends State { title: 'Rich Text', docUrl: 'https://docs.flutter.io/flutter/widgets/RichText-class.html', codeUrl: '', - child: new Column( + contentList: [new Column( children: [ MarkdownBody(data: markDesc['intro']), Container( @@ -87,6 +87,6 @@ class _Demo extends State { MarkdownBody(data: markDesc['diff']), ], ), - ); + ]); } } diff --git a/lib/widgets/elements/Form/Text/Text/index.dart b/lib/widgets/elements/Form/Text/Text/index.dart index 95c15584..9cfc92f5 100644 --- a/lib/widgets/elements/Form/Text/Text/index.dart +++ b/lib/widgets/elements/Form/Text/Text/index.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; //import 'package:flutter_markdown/flutter_markdown.dart'; -import '../../../../../common/widget-demo.dart'; +import '../../../../../common/widget_demo.dart'; import '../../../../../components/markdown.dart'; const String intro = """ @@ -79,7 +79,7 @@ class _Demo extends State { title: "Text", docUrl: 'flutter/widgets/Text-class.html', codeUrl: 'elements/Form/Text/Text/index.dart', - child: new Column( + contentList: [new Column( children: [ MarkdownBody(markDesc['intro']), Text( @@ -110,7 +110,7 @@ class _Demo extends State { ), ) ], - ) + )] ); } } diff --git a/lib/widgets/elements/Frame/Axis/crossAxis/index.dart b/lib/widgets/elements/Frame/Axis/crossAxis/index.dart index 55dd8402..6ed7d70c 100644 --- a/lib/widgets/elements/Frame/Axis/crossAxis/index.dart +++ b/lib/widgets/elements/Frame/Axis/crossAxis/index.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import '../../../../../common/widget-demo.dart'; +import '../../../../../common/widget_demo.dart'; class Demo extends StatefulWidget { static const String routeName = '/element/Frame/Axis/crossAxis'; diff --git a/lib/widgets/elements/Frame/Axis/flipAxis/index.dart b/lib/widgets/elements/Frame/Axis/flipAxis/index.dart index 78d2fa8d..c5d00594 100644 --- a/lib/widgets/elements/Frame/Axis/flipAxis/index.dart +++ b/lib/widgets/elements/Frame/Axis/flipAxis/index.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import '../../../../../common/widget-demo.dart'; +import '../../../../../common/widget_demo.dart'; class Demo extends StatefulWidget { static const String routeName = '/element/Frame/Axis/flipAxis'; diff --git a/lib/widgets/elements/Frame/Axis/mainAxis/index.dart b/lib/widgets/elements/Frame/Axis/mainAxis/index.dart index a957f28c..9540c54e 100644 --- a/lib/widgets/elements/Frame/Axis/mainAxis/index.dart +++ b/lib/widgets/elements/Frame/Axis/mainAxis/index.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import '../../../../../common/widget-demo.dart'; +import '../../../../../common/widget_demo.dart'; class Demo extends StatefulWidget { static const String routeName = '/element/Frame/Axis/Table'; diff --git a/lib/widgets/elements/Media/Image/precacheImage/index.dart b/lib/widgets/elements/Media/Image/precacheImage/index.dart index 814decb7..d315f08c 100644 --- a/lib/widgets/elements/Media/Image/precacheImage/index.dart +++ b/lib/widgets/elements/Media/Image/precacheImage/index.dart @@ -5,7 +5,7 @@ * @Last Modified time: 2018-11-16 15:09:12 */ import 'package:flutter/material.dart'; -import '../../../../../common/widget-demo.dart'; +import '../../../../../common/widget_demo.dart'; class Demo extends StatefulWidget { static const String routeName = '/element/Media/Image/precacheImage'; From c7b70a02f2ce6be75e7201d1d2a7ecf63c5e2aa5 Mon Sep 17 00:00:00 2001 From: ryan730 Date: Thu, 10 Jan 2019 17:33:29 +0800 Subject: [PATCH 02/27] =?UTF-8?q?Modfiy:=201.=20=E5=8E=BB=E6=8E=89=20widge?= =?UTF-8?q?t-demo=20=E7=9A=84=E5=BC=95=E7=94=A8=202.=20codeUrl=203.=20?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=87=AA=E5=AE=9AcustomDemo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/widgets/components/Bar/BottomAppBar/index.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/widgets/components/Bar/BottomAppBar/index.dart b/lib/widgets/components/Bar/BottomAppBar/index.dart index 1ae2d1b8..312fb054 100644 --- a/lib/widgets/components/Bar/BottomAppBar/index.dart +++ b/lib/widgets/components/Bar/BottomAppBar/index.dart @@ -7,7 +7,6 @@ * tartget: BottomAppBar 的示例 */ import '../../../../common/widget_demo.dart'; -import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; From d166d2113c26a39e5685d24d62a3312ae9566f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=8D=97?= Date: Fri, 11 Jan 2019 12:27:18 +0800 Subject: [PATCH 03/27] SafeArea for iPhoneX and above models --- lib/main.dart | 80 ++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 7ec4dc7b..21ec6cb9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,8 +14,6 @@ import 'model/widget.dart'; import './widgets/index.dart'; import 'package:flutter_rookie_book/components/SearchInput.dart'; - - const int ThemeColor = 0xFFC91B3A; class MyApp extends StatelessWidget { @@ -133,49 +131,53 @@ class _MyHomePageState extends State } else { return null; } - }, (value) { - }, () {}); + }, (value) {}, () {}); } @override Widget build(BuildContext context) { return new Scaffold( - appBar: new AppBar(title: buildSearchInput(context)), - body: new TabBarView(controller: controller, children: [ - new FirstPage(), - new WidgetPage(db), - new CollectionPage(), - new FourthPage() - ]), - bottomNavigationBar: new Material( - color: const Color(0xFFF0EEEF), //底部导航栏主题颜色 - child: new Container( - height: 65.0, - decoration: BoxDecoration( - color: const Color(0xFFF0F0F0), - boxShadow: [ - new BoxShadow( - color: const Color(0xFFd0d0d0), - blurRadius: 3.0, - spreadRadius: 2.0, - offset: Offset(-1.0, -1.0), - ), - ], + appBar: new AppBar(title: buildSearchInput(context)), + body: new TabBarView(controller: controller, children: [ + new FirstPage(), + new WidgetPage(db), + new CollectionPage(), + new FourthPage() + ]), + bottomNavigationBar: Material( + color: const Color(0xFFF0EEEF), //底部导航栏主题颜色 + child: SafeArea( + child: Container( + height: 65.0, + decoration: BoxDecoration( + color: const Color(0xFFF0F0F0), + boxShadow: [ + BoxShadow( + color: const Color(0xFFd0d0d0), + blurRadius: 3.0, + spreadRadius: 2.0, + offset: Offset(-1.0, -1.0), ), - child: new TabBar( - controller: controller, - indicatorColor: - Theme.of(context).primaryColor, //tab标签的下划线颜色 - // labelColor: const Color(0xFF000000), - indicatorWeight: 3.0, - labelColor: Theme.of(context).primaryColor, - unselectedLabelColor: const Color(0xFF8E8E8E), - tabs: [ - new Tab(text: '业界动态', icon: new Icon(Icons.language)), - new Tab(text: '组件', icon: new Icon(Icons.extension)), - new Tab(text: '组件收藏', icon: new Icon(Icons.star)), - new Tab(text: '关于手册', icon: new Icon(Icons.favorite)), - ])))); + ], + ), + child: TabBar( + controller: controller, + indicatorColor: Theme.of(context).primaryColor, //tab标签的下划线颜色 + // labelColor: const Color(0xFF000000), + indicatorWeight: 3.0, + labelColor: Theme.of(context).primaryColor, + unselectedLabelColor: const Color(0xFF8E8E8E), + tabs: [ + Tab(text: '业界动态', icon: Icon(Icons.language)), + Tab(text: '组件', icon: Icon(Icons.extension)), + Tab(text: '组件收藏', icon: Icon(Icons.star)), + Tab(text: '关于手册', icon: Icon(Icons.favorite)), + ], + ), + ), + ), + ), + ); } void _onTabChange() { From ae1e1d9b9a0d10ec9447c0f55ddbe423b5cc8cae Mon Sep 17 00:00:00 2001 From: ryan730 Date: Sat, 12 Jan 2019 17:50:01 +0800 Subject: [PATCH 04/27] =?UTF-8?q?Modify:=E4=BF=AE=E6=AD=A3=20bottomNavigat?= =?UTF-8?q?ionBar=20iconButton=20=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/iconNames.dart | 2 +- lib/common/widget_demo.dart | 7 ++++++- .../components/Navigation/BottomNavigationBar/index.dart | 2 +- lib/widgets/elements/Form/Button/IconButton/demo.dart | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/common/iconNames.dart b/lib/common/iconNames.dart index e8ce0e71..7d75b841 100644 --- a/lib/common/iconNames.dart +++ b/lib/common/iconNames.dart @@ -10,5 +10,5 @@ import 'package:flutter/material.dart'; class IconNames { - static List Names = [Icons.ac_unit,Icons.access_alarm,Icons.access_alarms,Icons.access_time,Icons.accessibility,Icons.accessibility_new,Icons.accessible,Icons.accessible_forward,Icons.account_balance,Icons.account_balance_wallet,Icons.account_box,Icons.account_circle,Icons.adb,Icons.add,Icons.add_a_photo,Icons.add_alarm,Icons.add_alert,Icons.add_box,Icons.add_call,Icons.add_circle,Icons.add_circle_outline,Icons.add_comment,Icons.add_location,Icons.add_photo_alternate,Icons.add_shopping_cart,Icons.add_to_home_screen,Icons.add_to_photos,Icons.add_to_queue,Icons.adjust,Icons.airline_seat_flat,Icons.airline_seat_flat_angled,Icons.airline_seat_individual_suite,Icons.airline_seat_legroom_extra,Icons.airline_seat_legroom_normal,Icons.airline_seat_legroom_reduced,Icons.airline_seat_recline_extra,Icons.airline_seat_recline_normal,Icons.airplanemode_active,Icons.airplanemode_inactive,Icons.airplay,Icons.airport_shuttle,Icons.alarm,Icons.alarm_add,Icons.alarm_off,Icons.alarm_on,Icons.album,Icons.all_inclusive,Icons.all_out,Icons.alternate_email,Icons.android,Icons.announcement,Icons.apps,Icons.archive,Icons.arrow_back,Icons.arrow_back_ios,Icons.arrow_downward,Icons.arrow_drop_down,Icons.arrow_drop_down_circle,Icons.arrow_drop_up,Icons.arrow_forward,Icons.arrow_forward_ios,Icons.arrow_left,Icons.arrow_right,Icons.arrow_upward,Icons.art_track,Icons.aspect_ratio,Icons.assessment,Icons.assignment,Icons.assignment_ind,Icons.assignment_late,Icons.assignment_return,Icons.assignment_returned,Icons.assignment_turned_in,Icons.assistant,Icons.assistant_photo,Icons.atm,Icons.attach_file,Icons.attach_money,Icons.attachment,Icons.audiotrack,Icons.autorenew,Icons.av_timer,Icons.backspace,Icons.backup,Icons.battery_alert,Icons.battery_charging_full,Icons.battery_full,Icons.battery_std,Icons.battery_unknown,Icons.beach_access,Icons.beenhere,Icons.block,Icons.bluetooth,Icons.bluetooth_audio,Icons.bluetooth_connected,Icons.bluetooth_disabled,Icons.bluetooth_searching,Icons.blur_circular,Icons.blur_linear,Icons.blur_off,Icons.blur_on,Icons.book,Icons.bookmark,Icons.bookmark_border,Icons.border_all,Icons.border_bottom,Icons.border_clear,Icons.border_color,Icons.border_horizontal,Icons.border_inner,Icons.border_left,Icons.border_outer,Icons.border_right,Icons.border_style,Icons.border_top,Icons.border_vertical,Icons.branding_watermark,Icons.brightness_1,Icons.brightness_2,Icons.brightness_3,Icons.brightness_4,Icons.brightness_5,Icons.brightness_6,Icons.brightness_7,Icons.brightness_auto,Icons.brightness_high,Icons.brightness_low,Icons.brightness_medium,Icons.broken_image,Icons.brush,Icons.bubble_chart,Icons.bug_report,Icons.build,Icons.burst_mode,Icons.business,Icons.business_center,Icons.cached,Icons.cake,Icons.calendar_today,Icons.calendar_view_day,Icons.call,Icons.call_end,Icons.call_made,Icons.call_merge,Icons.call_missed,Icons.call_missed_outgoing,Icons.call_received,Icons.call_split,Icons.call_to_action,Icons.camera,Icons.camera_alt,Icons.camera_enhance,Icons.camera_front,Icons.camera_rear,Icons.camera_roll,Icons.cancel,Icons.card_giftcard,Icons.card_membership,Icons.card_travel,Icons.casino,Icons.cast,Icons.cast_connected,Icons.category,Icons.center_focus_strong,Icons.center_focus_weak,Icons.change_history,Icons.chat,Icons.chat_bubble,Icons.chat_bubble_outline,Icons.check,Icons.check_box,Icons.check_box_outline_blank,Icons.check_circle,Icons.check_circle_outline,Icons.chevron_left,Icons.chevron_right,Icons.child_care,Icons.child_friendly,Icons.chrome_reader_mode,Icons.class_,Icons.clear,Icons.clear_all,Icons.close,Icons.closed_caption,Icons.cloud,Icons.cloud_circle,Icons.cloud_done,Icons.cloud_download,Icons.cloud_off,Icons.cloud_queue,Icons.cloud_upload,Icons.code,Icons.collections,Icons.collections_bookmark,Icons.color_lens,Icons.colorize,Icons.comment,Icons.compare,Icons.compare_arrows,Icons.computer,Icons.confirmation_number,Icons.contact_mail,Icons.contact_phone,Icons.contacts,Icons.content_copy,Icons.content_cut,Icons.content_paste,Icons.control_point,Icons.control_point_duplicate,Icons.copyright,Icons.create,Icons.create_new_folder,Icons.credit_card,Icons.crop,Icons.crop_3_2,Icons.crop_5_4,Icons.crop_7_5,Icons.crop_16_9,Icons.crop_din,Icons.crop_free,Icons.crop_landscape,Icons.crop_original,Icons.crop_portrait,Icons.crop_rotate,Icons.crop_square,Icons.dashboard,Icons.data_usage,Icons.date_range,Icons.dehaze,Icons.delete,Icons.delete_forever,Icons.delete_outline,Icons.delete_sweep,Icons.departure_board,Icons.description,Icons.desktop_mac,Icons.desktop_windows,Icons.details,Icons.developer_board,Icons.developer_mode,Icons.device_hub,Icons.device_unknown,Icons.devices,Icons.devices_other,Icons.dialer_sip,Icons.dialpad,Icons.directions,Icons.directions_bike,Icons.directions_boat,Icons.directions_bus,Icons.directions_car,Icons.directions_railway,Icons.directions_run,Icons.directions_subway,Icons.directions_transit,Icons.directions_walk,Icons.disc_full,Icons.dns,Icons.do_not_disturb,Icons.do_not_disturb_alt,Icons.do_not_disturb_off,Icons.do_not_disturb_on,Icons.dock,Icons.domain,Icons.done,Icons.done_all,Icons.done_outline,Icons.donut_large,Icons.donut_small,Icons.drafts,Icons.drag_handle,Icons.drive_eta,Icons.dvr,Icons.edit,Icons.edit_attributes,Icons.edit_location,Icons.eject,Icons.email,Icons.enhanced_encryption,Icons.equalizer,Icons.error,Icons.error_outline,Icons.euro_symbol,Icons.ev_station,Icons.event,Icons.event_available,Icons.event_busy,Icons.event_note,Icons.event_seat,Icons.exit_to_app,Icons.expand_less,Icons.expand_more,Icons.explicit,Icons.explore,Icons.exposure,Icons.exposure_neg_1,Icons.exposure_neg_2,Icons.exposure_plus_1,Icons.exposure_plus_2,Icons.exposure_zero,Icons.extension,Icons.face,Icons.fast_forward,Icons.fast_rewind,Icons.fastfood,Icons.favorite,Icons.favorite_border,Icons.featured_play_list,Icons.featured_video,Icons.feedback,Icons.fiber_dvr,Icons.fiber_manual_record,Icons.fiber_new,Icons.fiber_pin,Icons.fiber_smart_record,Icons.file_download,Icons.file_upload,Icons.filter,Icons.filter_1,Icons.filter_2,Icons.filter_3,Icons.filter_4,Icons.filter_5,Icons.filter_6,Icons.filter_7,Icons.filter_8,Icons.filter_9,Icons.filter_9_plus,Icons.filter_b_and_w,Icons.filter_center_focus,Icons.filter_drama,Icons.filter_frames,Icons.filter_hdr,Icons.filter_list,Icons.filter_none,Icons.filter_tilt_shift,Icons.filter_vintage,Icons.find_in_page,Icons.find_replace,Icons.fingerprint,Icons.first_page,Icons.fitness_center,Icons.flag,Icons.flare,Icons.flash_auto,Icons.flash_off,Icons.flash_on,Icons.flight,Icons.flight_land,Icons.flight_takeoff,Icons.flip,Icons.flip_to_back,Icons.flip_to_front,Icons.folder,Icons.folder_open,Icons.folder_shared,Icons.folder_special,Icons.font_download,Icons.format_align_center,Icons.format_align_justify,Icons.format_align_left,Icons.format_align_right,Icons.format_bold,Icons.format_clear,Icons.format_color_fill,Icons.format_color_reset,Icons.format_color_text,Icons.format_indent_decrease,Icons.format_indent_increase,Icons.format_italic,Icons.format_line_spacing,Icons.format_list_bulleted,Icons.format_list_numbered,Icons.format_list_numbered_rtl,Icons.format_paint,Icons.format_quote,Icons.format_shapes,Icons.format_size,Icons.format_strikethrough,Icons.format_textdirection_l_to_r,Icons.format_textdirection_r_to_l,Icons.format_underlined,Icons.forum,Icons.forward,Icons.forward_5,Icons.forward_10,Icons.forward_30,Icons.four_k,Icons.free_breakfast,Icons.fullscreen,Icons.fullscreen_exit,Icons.functions,Icons.g_translate,Icons.gamepad,Icons.games,Icons.gavel,Icons.gesture,Icons.get_app,Icons.gif,Icons.golf_course,Icons.gps_fixed,Icons.gps_not_fixed,Icons.gps_off,Icons.grade,Icons.gradient,Icons.grain,Icons.graphic_eq,Icons.grid_off,Icons.grid_on,Icons.group,Icons.group_add,Icons.group_work,Icons.hd,Icons.hdr_off,Icons.hdr_on,Icons.hdr_strong,Icons.hdr_weak,Icons.headset,Icons.headset_mic,Icons.headset_off,Icons.healing,Icons.hearing,Icons.help,Icons.help_outline,Icons.high_quality,Icons.highlight,Icons.highlight_off,Icons.history,Icons.home,Icons.hot_tub,Icons.hotel,Icons.hourglass_empty,Icons.hourglass_full,Icons.http,Icons.https,Icons.image,Icons.image_aspect_ratio,Icons.import_contacts,Icons.import_export,Icons.important_devices,Icons.inbox,Icons.indeterminate_check_box,Icons.info,Icons.info_outline,Icons.input,Icons.insert_chart,Icons.insert_comment,Icons.insert_drive_file,Icons.insert_emoticon,Icons.insert_invitation,Icons.insert_link,Icons.insert_photo,Icons.invert_colors,Icons.invert_colors_off,Icons.iso,Icons.keyboard,Icons.keyboard_arrow_down,Icons.keyboard_arrow_left,Icons.keyboard_arrow_right,Icons.keyboard_arrow_up,Icons.keyboard_backspace,Icons.keyboard_capslock,Icons.keyboard_hide,Icons.keyboard_return,Icons.keyboard_tab,Icons.keyboard_voice,Icons.kitchen,Icons.label,Icons.label_important,Icons.label_outline,Icons.landscape,Icons.language,Icons.laptop,Icons.laptop_chromebook,Icons.laptop_mac,Icons.laptop_windows,Icons.last_page,Icons.launch,Icons.layers,Icons.layers_clear,Icons.leak_add,Icons.leak_remove,Icons.lens,Icons.library_add,Icons.library_books,Icons.library_music,Icons.lightbulb_outline,Icons.line_style,Icons.line_weight,Icons.linear_scale,Icons.link,Icons.link_off,Icons.linked_camera,Icons.list,Icons.live_help,Icons.live_tv,Icons.local_activity,Icons.local_airport,Icons.local_atm,Icons.local_bar,Icons.local_cafe,Icons.local_car_wash,Icons.local_convenience_store,Icons.local_dining,Icons.local_drink,Icons.local_florist,Icons.local_gas_station,Icons.local_grocery_store,Icons.local_hospital,Icons.local_hotel,Icons.local_laundry_service,Icons.local_library,Icons.local_mall,Icons.local_movies,Icons.local_offer,Icons.local_parking,Icons.local_pharmacy,Icons.local_phone,Icons.local_pizza,Icons.local_play,Icons.local_post_office,Icons.local_printshop,Icons.local_see,Icons.local_shipping,Icons.local_taxi,Icons.location_city,Icons.location_disabled,Icons.location_off,Icons.location_on,Icons.location_searching,Icons.lock,Icons.lock_open,Icons.lock_outline,Icons.looks,Icons.looks_3,Icons.looks_4,Icons.looks_5,Icons.looks_6,Icons.looks_one,Icons.looks_two,Icons.loop,Icons.loupe,Icons.low_priority,Icons.loyalty,Icons.mail,Icons.mail_outline,Icons.map,Icons.markunread,Icons.markunread_mailbox,Icons.maximize,Icons.memory,Icons.menu,Icons.merge_type,Icons.message,Icons.mic,Icons.mic_none,Icons.mic_off,Icons.minimize,Icons.missed_video_call,Icons.mms,Icons.mobile_screen_share,Icons.mode_comment,Icons.mode_edit,Icons.monetization_on,Icons.money_off,Icons.monochrome_photos,Icons.mood,Icons.mood_bad,Icons.more,Icons.more_horiz,Icons.more_vert,Icons.motorcycle,Icons.mouse,Icons.move_to_inbox,Icons.movie,Icons.movie_creation,Icons.movie_filter,Icons.multiline_chart,Icons.music_note,Icons.music_video,Icons.my_location,Icons.nature,Icons.nature_people,Icons.navigate_before,Icons.navigate_next,Icons.navigation,Icons.near_me,Icons.network_cell,Icons.network_check,Icons.network_locked,Icons.network_wifi,Icons.new_releases,Icons.next_week,Icons.nfc,Icons.no_encryption,Icons.no_sim,Icons.not_interested,Icons.not_listed_location,Icons.note,Icons.note_add,Icons.notification_important,Icons.notifications,Icons.notifications_active,Icons.notifications_none,Icons.notifications_off,Icons.notifications_paused,Icons.offline_bolt,Icons.offline_pin,Icons.ondemand_video,Icons.opacity,Icons.open_in_browser,Icons.open_in_new,Icons.open_with,Icons.outlined_flag,Icons.pages,Icons.pageview,Icons.palette,Icons.pan_tool,Icons.panorama,Icons.panorama_fish_eye,Icons.panorama_horizontal,Icons.panorama_vertical,Icons.panorama_wide_angle,Icons.party_mode,Icons.pause,Icons.pause_circle_filled,Icons.pause_circle_outline,Icons.payment,Icons.people,Icons.people_outline,Icons.perm_camera_mic,Icons.perm_contact_calendar,Icons.perm_data_setting,Icons.perm_device_information,Icons.perm_identity,Icons.perm_media,Icons.perm_phone_msg,Icons.perm_scan_wifi,Icons.person,Icons.person_add,Icons.person_outline,Icons.person_pin,Icons.person_pin_circle,Icons.personal_video,Icons.pets,Icons.phone,Icons.phone_android,Icons.phone_bluetooth_speaker,Icons.phone_forwarded,Icons.phone_in_talk,Icons.phone_iphone,Icons.phone_locked,Icons.phone_missed,Icons.phone_paused,Icons.phonelink,Icons.phonelink_erase,Icons.phonelink_lock,Icons.phonelink_off,Icons.phonelink_ring,Icons.phonelink_setup,Icons.photo,Icons.photo_album,Icons.photo_camera,Icons.photo_filter,Icons.photo_library,Icons.photo_size_select_actual,Icons.photo_size_select_large,Icons.photo_size_select_small,Icons.picture_as_pdf,Icons.picture_in_picture,Icons.picture_in_picture_alt,Icons.pie_chart,Icons.pie_chart_outlined,Icons.pin_drop,Icons.place,Icons.play_arrow,Icons.play_circle_filled,Icons.play_circle_outline,Icons.play_for_work,Icons.playlist_add,Icons.playlist_add_check,Icons.playlist_play,Icons.plus_one,Icons.poll,Icons.polymer,Icons.pool,Icons.portable_wifi_off,Icons.portrait,Icons.power,Icons.power_input,Icons.power_settings_new,Icons.pregnant_woman,Icons.present_to_all,Icons.print,Icons.priority_high,Icons.public,Icons.publish,Icons.query_builder,Icons.question_answer,Icons.queue,Icons.queue_music,Icons.queue_play_next,Icons.radio,Icons.radio_button_checked,Icons.radio_button_unchecked,Icons.rate_review,Icons.receipt,Icons.recent_actors,Icons.record_voice_over,Icons.redeem,Icons.redo,Icons.refresh,Icons.remove,Icons.remove_circle,Icons.remove_circle_outline,Icons.remove_from_queue,Icons.remove_red_eye,Icons.remove_shopping_cart,Icons.reorder,Icons.repeat,Icons.repeat_one,Icons.replay,Icons.replay_5,Icons.replay_10,Icons.replay_30,Icons.reply,Icons.reply_all,Icons.report,Icons.report_off,Icons.report_problem,Icons.restaurant,Icons.restaurant_menu,Icons.restore,Icons.restore_from_trash,Icons.restore_page,Icons.ring_volume,Icons.room,Icons.room_service,Icons.rotate_90_degrees_ccw,Icons.rotate_left,Icons.rotate_right,Icons.rounded_corner,Icons.router,Icons.rowing,Icons.rss_feed,Icons.rv_hookup,Icons.satellite,Icons.save,Icons.save_alt,Icons.scanner,Icons.scatter_plot,Icons.schedule,Icons.school,Icons.score,Icons.screen_lock_landscape,Icons.screen_lock_portrait,Icons.screen_lock_rotation,Icons.screen_rotation,Icons.screen_share,Icons.sd_card,Icons.sd_storage,Icons.search,Icons.security,Icons.select_all,Icons.send,Icons.sentiment_dissatisfied,Icons.sentiment_neutral,Icons.sentiment_satisfied,Icons.sentiment_very_dissatisfied,Icons.sentiment_very_satisfied,Icons.settings,Icons.settings_applications,Icons.settings_backup_restore,Icons.settings_bluetooth,Icons.settings_brightness,Icons.settings_cell,Icons.settings_ethernet,Icons.settings_input_antenna,Icons.settings_input_component,Icons.settings_input_composite,Icons.settings_input_hdmi,Icons.settings_input_svideo,Icons.settings_overscan,Icons.settings_phone,Icons.settings_power,Icons.settings_remote,Icons.settings_system_daydream,Icons.settings_voice,Icons.share,Icons.shop,Icons.shop_two,Icons.shopping_basket,Icons.shopping_cart,Icons.short_text,Icons.show_chart,Icons.shuffle,Icons.shutter_speed,Icons.signal_cellular_4_bar,Icons.signal_cellular_connected_no_internet_4_bar,Icons.signal_cellular_no_sim,Icons.signal_cellular_null,Icons.signal_cellular_off,Icons.signal_wifi_4_bar,Icons.signal_wifi_4_bar_lock,Icons.signal_wifi_off,Icons.sim_card,Icons.sim_card_alert,Icons.skip_next,Icons.skip_previous,Icons.slideshow,Icons.slow_motion_video,Icons.smartphone,Icons.smoke_free,Icons.smoking_rooms,Icons.sms,Icons.sms_failed,Icons.snooze,Icons.sort,Icons.sort_by_alpha,Icons.spa,Icons.space_bar,Icons.speaker,Icons.speaker_group,Icons.speaker_notes,Icons.speaker_notes_off,Icons.speaker_phone,Icons.spellcheck,Icons.star,Icons.star_border,Icons.star_half,Icons.stars,Icons.stay_current_landscape,Icons.stay_current_portrait,Icons.stay_primary_landscape,Icons.stay_primary_portrait,Icons.stop,Icons.stop_screen_share,Icons.storage,Icons.store,Icons.store_mall_directory,Icons.straighten,Icons.streetview,Icons.strikethrough_s,Icons.style,Icons.subdirectory_arrow_left,Icons.subdirectory_arrow_right,Icons.subject,Icons.subscriptions,Icons.subtitles,Icons.subway,Icons.supervised_user_circle,Icons.supervisor_account,Icons.surround_sound,Icons.swap_calls,Icons.swap_horiz,Icons.swap_horizontal_circle,Icons.swap_vert,Icons.swap_vertical_circle,Icons.switch_camera,Icons.switch_video,Icons.sync,Icons.sync_disabled,Icons.sync_problem,Icons.system_update,Icons.system_update_alt,Icons.tab,Icons.tab_unselected,Icons.table_chart,Icons.tablet,Icons.tablet_android,Icons.tablet_mac,Icons.tag_faces,Icons.tap_and_play,Icons.terrain,Icons.text_fields,Icons.text_format,Icons.text_rotate_up,Icons.text_rotate_vertical,Icons.text_rotation_angledown,Icons.text_rotation_angleup,Icons.text_rotation_down,Icons.text_rotation_none,Icons.textsms,Icons.texture,Icons.theaters,Icons.threed_rotation,Icons.threesixty,Icons.thumb_down,Icons.thumb_up,Icons.thumbs_up_down,Icons.time_to_leave,Icons.timelapse,Icons.timeline,Icons.timer,Icons.timer_3,Icons.timer_10,Icons.timer_off,Icons.title,Icons.toc,Icons.today,Icons.toll,Icons.tonality,Icons.touch_app,Icons.toys,Icons.track_changes,Icons.traffic,Icons.train,Icons.tram,Icons.transfer_within_a_station,Icons.transform,Icons.transit_enterexit,Icons.translate,Icons.trending_down,Icons.trending_flat,Icons.trending_up,Icons.trip_origin,Icons.tune,Icons.turned_in,Icons.turned_in_not,Icons.tv,Icons.unarchive,Icons.undo,Icons.unfold_less,Icons.unfold_more,Icons.update,Icons.usb,Icons.verified_user,Icons.vertical_align_bottom,Icons.vertical_align_center,Icons.vertical_align_top,Icons.vibration,Icons.video_call,Icons.video_label,Icons.video_library,Icons.videocam,Icons.videocam_off,Icons.videogame_asset,Icons.view_agenda,Icons.view_array,Icons.view_carousel,Icons.view_column,Icons.view_comfy,Icons.view_compact,Icons.view_day,Icons.view_headline,Icons.view_list,Icons.view_module,Icons.view_quilt,Icons.view_stream,Icons.view_week,Icons.vignette,Icons.visibility,Icons.visibility_off,Icons.voice_chat,Icons.voicemail,Icons.volume_down,Icons.volume_mute,Icons.volume_off,Icons.volume_up,Icons.vpn_key,Icons.vpn_lock,Icons.wallpaper,Icons.warning,Icons.watch,Icons.watch_later,Icons.wb_auto,Icons.wb_cloudy,Icons.wb_incandescent,Icons.wb_iridescent,Icons.wb_sunny,Icons.wc,Icons.web,Icons.web_asset,Icons.weekend,Icons.whatshot,Icons.widgets,Icons.wifi,Icons.wifi_lock,Icons.wifi_tethering,Icons.work,Icons.wrap_text,Icons.youtube_searched_for,Icons.zoom_in,Icons.zoom_out,Icons.zoom_out_map]; + static List names = [Icons.ac_unit,Icons.access_alarm,Icons.access_alarms,Icons.access_time,Icons.accessibility,Icons.accessibility_new,Icons.accessible,Icons.accessible_forward,Icons.account_balance,Icons.account_balance_wallet,Icons.account_box,Icons.account_circle,Icons.adb,Icons.add,Icons.add_a_photo,Icons.add_alarm,Icons.add_alert,Icons.add_box,Icons.add_call,Icons.add_circle,Icons.add_circle_outline,Icons.add_comment,Icons.add_location,Icons.add_photo_alternate,Icons.add_shopping_cart,Icons.add_to_home_screen,Icons.add_to_photos,Icons.add_to_queue,Icons.adjust,Icons.airline_seat_flat,Icons.airline_seat_flat_angled,Icons.airline_seat_individual_suite,Icons.airline_seat_legroom_extra,Icons.airline_seat_legroom_normal,Icons.airline_seat_legroom_reduced,Icons.airline_seat_recline_extra,Icons.airline_seat_recline_normal,Icons.airplanemode_active,Icons.airplanemode_inactive,Icons.airplay,Icons.airport_shuttle,Icons.alarm,Icons.alarm_add,Icons.alarm_off,Icons.alarm_on,Icons.album,Icons.all_inclusive,Icons.all_out,Icons.alternate_email,Icons.android,Icons.announcement,Icons.apps,Icons.archive,Icons.arrow_back,Icons.arrow_back_ios,Icons.arrow_downward,Icons.arrow_drop_down,Icons.arrow_drop_down_circle,Icons.arrow_drop_up,Icons.arrow_forward,Icons.arrow_forward_ios,Icons.arrow_left,Icons.arrow_right,Icons.arrow_upward,Icons.art_track,Icons.aspect_ratio,Icons.assessment,Icons.assignment,Icons.assignment_ind,Icons.assignment_late,Icons.assignment_return,Icons.assignment_returned,Icons.assignment_turned_in,Icons.assistant,Icons.assistant_photo,Icons.atm,Icons.attach_file,Icons.attach_money,Icons.attachment,Icons.audiotrack,Icons.autorenew,Icons.av_timer,Icons.backspace,Icons.backup,Icons.battery_alert,Icons.battery_charging_full,Icons.battery_full,Icons.battery_std,Icons.battery_unknown,Icons.beach_access,Icons.beenhere,Icons.block,Icons.bluetooth,Icons.bluetooth_audio,Icons.bluetooth_connected,Icons.bluetooth_disabled,Icons.bluetooth_searching,Icons.blur_circular,Icons.blur_linear,Icons.blur_off,Icons.blur_on,Icons.book,Icons.bookmark,Icons.bookmark_border,Icons.border_all,Icons.border_bottom,Icons.border_clear,Icons.border_color,Icons.border_horizontal,Icons.border_inner,Icons.border_left,Icons.border_outer,Icons.border_right,Icons.border_style,Icons.border_top,Icons.border_vertical,Icons.branding_watermark,Icons.brightness_1,Icons.brightness_2,Icons.brightness_3,Icons.brightness_4,Icons.brightness_5,Icons.brightness_6,Icons.brightness_7,Icons.brightness_auto,Icons.brightness_high,Icons.brightness_low,Icons.brightness_medium,Icons.broken_image,Icons.brush,Icons.bubble_chart,Icons.bug_report,Icons.build,Icons.burst_mode,Icons.business,Icons.business_center,Icons.cached,Icons.cake,Icons.calendar_today,Icons.calendar_view_day,Icons.call,Icons.call_end,Icons.call_made,Icons.call_merge,Icons.call_missed,Icons.call_missed_outgoing,Icons.call_received,Icons.call_split,Icons.call_to_action,Icons.camera,Icons.camera_alt,Icons.camera_enhance,Icons.camera_front,Icons.camera_rear,Icons.camera_roll,Icons.cancel,Icons.card_giftcard,Icons.card_membership,Icons.card_travel,Icons.casino,Icons.cast,Icons.cast_connected,Icons.category,Icons.center_focus_strong,Icons.center_focus_weak,Icons.change_history,Icons.chat,Icons.chat_bubble,Icons.chat_bubble_outline,Icons.check,Icons.check_box,Icons.check_box_outline_blank,Icons.check_circle,Icons.check_circle_outline,Icons.chevron_left,Icons.chevron_right,Icons.child_care,Icons.child_friendly,Icons.chrome_reader_mode,Icons.class_,Icons.clear,Icons.clear_all,Icons.close,Icons.closed_caption,Icons.cloud,Icons.cloud_circle,Icons.cloud_done,Icons.cloud_download,Icons.cloud_off,Icons.cloud_queue,Icons.cloud_upload,Icons.code,Icons.collections,Icons.collections_bookmark,Icons.color_lens,Icons.colorize,Icons.comment,Icons.compare,Icons.compare_arrows,Icons.computer,Icons.confirmation_number,Icons.contact_mail,Icons.contact_phone,Icons.contacts,Icons.content_copy,Icons.content_cut,Icons.content_paste,Icons.control_point,Icons.control_point_duplicate,Icons.copyright,Icons.create,Icons.create_new_folder,Icons.credit_card,Icons.crop,Icons.crop_3_2,Icons.crop_5_4,Icons.crop_7_5,Icons.crop_16_9,Icons.crop_din,Icons.crop_free,Icons.crop_landscape,Icons.crop_original,Icons.crop_portrait,Icons.crop_rotate,Icons.crop_square,Icons.dashboard,Icons.data_usage,Icons.date_range,Icons.dehaze,Icons.delete,Icons.delete_forever,Icons.delete_outline,Icons.delete_sweep,Icons.departure_board,Icons.description,Icons.desktop_mac,Icons.desktop_windows,Icons.details,Icons.developer_board,Icons.developer_mode,Icons.device_hub,Icons.device_unknown,Icons.devices,Icons.devices_other,Icons.dialer_sip,Icons.dialpad,Icons.directions,Icons.directions_bike,Icons.directions_boat,Icons.directions_bus,Icons.directions_car,Icons.directions_railway,Icons.directions_run,Icons.directions_subway,Icons.directions_transit,Icons.directions_walk,Icons.disc_full,Icons.dns,Icons.do_not_disturb,Icons.do_not_disturb_alt,Icons.do_not_disturb_off,Icons.do_not_disturb_on,Icons.dock,Icons.domain,Icons.done,Icons.done_all,Icons.done_outline,Icons.donut_large,Icons.donut_small,Icons.drafts,Icons.drag_handle,Icons.drive_eta,Icons.dvr,Icons.edit,Icons.edit_attributes,Icons.edit_location,Icons.eject,Icons.email,Icons.enhanced_encryption,Icons.equalizer,Icons.error,Icons.error_outline,Icons.euro_symbol,Icons.ev_station,Icons.event,Icons.event_available,Icons.event_busy,Icons.event_note,Icons.event_seat,Icons.exit_to_app,Icons.expand_less,Icons.expand_more,Icons.explicit,Icons.explore,Icons.exposure,Icons.exposure_neg_1,Icons.exposure_neg_2,Icons.exposure_plus_1,Icons.exposure_plus_2,Icons.exposure_zero,Icons.extension,Icons.face,Icons.fast_forward,Icons.fast_rewind,Icons.fastfood,Icons.favorite,Icons.favorite_border,Icons.featured_play_list,Icons.featured_video,Icons.feedback,Icons.fiber_dvr,Icons.fiber_manual_record,Icons.fiber_new,Icons.fiber_pin,Icons.fiber_smart_record,Icons.file_download,Icons.file_upload,Icons.filter,Icons.filter_1,Icons.filter_2,Icons.filter_3,Icons.filter_4,Icons.filter_5,Icons.filter_6,Icons.filter_7,Icons.filter_8,Icons.filter_9,Icons.filter_9_plus,Icons.filter_b_and_w,Icons.filter_center_focus,Icons.filter_drama,Icons.filter_frames,Icons.filter_hdr,Icons.filter_list,Icons.filter_none,Icons.filter_tilt_shift,Icons.filter_vintage,Icons.find_in_page,Icons.find_replace,Icons.fingerprint,Icons.first_page,Icons.fitness_center,Icons.flag,Icons.flare,Icons.flash_auto,Icons.flash_off,Icons.flash_on,Icons.flight,Icons.flight_land,Icons.flight_takeoff,Icons.flip,Icons.flip_to_back,Icons.flip_to_front,Icons.folder,Icons.folder_open,Icons.folder_shared,Icons.folder_special,Icons.font_download,Icons.format_align_center,Icons.format_align_justify,Icons.format_align_left,Icons.format_align_right,Icons.format_bold,Icons.format_clear,Icons.format_color_fill,Icons.format_color_reset,Icons.format_color_text,Icons.format_indent_decrease,Icons.format_indent_increase,Icons.format_italic,Icons.format_line_spacing,Icons.format_list_bulleted,Icons.format_list_numbered,Icons.format_list_numbered_rtl,Icons.format_paint,Icons.format_quote,Icons.format_shapes,Icons.format_size,Icons.format_strikethrough,Icons.format_textdirection_l_to_r,Icons.format_textdirection_r_to_l,Icons.format_underlined,Icons.forum,Icons.forward,Icons.forward_5,Icons.forward_10,Icons.forward_30,Icons.four_k,Icons.free_breakfast,Icons.fullscreen,Icons.fullscreen_exit,Icons.functions,Icons.g_translate,Icons.gamepad,Icons.games,Icons.gavel,Icons.gesture,Icons.get_app,Icons.gif,Icons.golf_course,Icons.gps_fixed,Icons.gps_not_fixed,Icons.gps_off,Icons.grade,Icons.gradient,Icons.grain,Icons.graphic_eq,Icons.grid_off,Icons.grid_on,Icons.group,Icons.group_add,Icons.group_work,Icons.hd,Icons.hdr_off,Icons.hdr_on,Icons.hdr_strong,Icons.hdr_weak,Icons.headset,Icons.headset_mic,Icons.headset_off,Icons.healing,Icons.hearing,Icons.help,Icons.help_outline,Icons.high_quality,Icons.highlight,Icons.highlight_off,Icons.history,Icons.home,Icons.hot_tub,Icons.hotel,Icons.hourglass_empty,Icons.hourglass_full,Icons.http,Icons.https,Icons.image,Icons.image_aspect_ratio,Icons.import_contacts,Icons.import_export,Icons.important_devices,Icons.inbox,Icons.indeterminate_check_box,Icons.info,Icons.info_outline,Icons.input,Icons.insert_chart,Icons.insert_comment,Icons.insert_drive_file,Icons.insert_emoticon,Icons.insert_invitation,Icons.insert_link,Icons.insert_photo,Icons.invert_colors,Icons.invert_colors_off,Icons.iso,Icons.keyboard,Icons.keyboard_arrow_down,Icons.keyboard_arrow_left,Icons.keyboard_arrow_right,Icons.keyboard_arrow_up,Icons.keyboard_backspace,Icons.keyboard_capslock,Icons.keyboard_hide,Icons.keyboard_return,Icons.keyboard_tab,Icons.keyboard_voice,Icons.kitchen,Icons.label,Icons.label_important,Icons.label_outline,Icons.landscape,Icons.language,Icons.laptop,Icons.laptop_chromebook,Icons.laptop_mac,Icons.laptop_windows,Icons.last_page,Icons.launch,Icons.layers,Icons.layers_clear,Icons.leak_add,Icons.leak_remove,Icons.lens,Icons.library_add,Icons.library_books,Icons.library_music,Icons.lightbulb_outline,Icons.line_style,Icons.line_weight,Icons.linear_scale,Icons.link,Icons.link_off,Icons.linked_camera,Icons.list,Icons.live_help,Icons.live_tv,Icons.local_activity,Icons.local_airport,Icons.local_atm,Icons.local_bar,Icons.local_cafe,Icons.local_car_wash,Icons.local_convenience_store,Icons.local_dining,Icons.local_drink,Icons.local_florist,Icons.local_gas_station,Icons.local_grocery_store,Icons.local_hospital,Icons.local_hotel,Icons.local_laundry_service,Icons.local_library,Icons.local_mall,Icons.local_movies,Icons.local_offer,Icons.local_parking,Icons.local_pharmacy,Icons.local_phone,Icons.local_pizza,Icons.local_play,Icons.local_post_office,Icons.local_printshop,Icons.local_see,Icons.local_shipping,Icons.local_taxi,Icons.location_city,Icons.location_disabled,Icons.location_off,Icons.location_on,Icons.location_searching,Icons.lock,Icons.lock_open,Icons.lock_outline,Icons.looks,Icons.looks_3,Icons.looks_4,Icons.looks_5,Icons.looks_6,Icons.looks_one,Icons.looks_two,Icons.loop,Icons.loupe,Icons.low_priority,Icons.loyalty,Icons.mail,Icons.mail_outline,Icons.map,Icons.markunread,Icons.markunread_mailbox,Icons.maximize,Icons.memory,Icons.menu,Icons.merge_type,Icons.message,Icons.mic,Icons.mic_none,Icons.mic_off,Icons.minimize,Icons.missed_video_call,Icons.mms,Icons.mobile_screen_share,Icons.mode_comment,Icons.mode_edit,Icons.monetization_on,Icons.money_off,Icons.monochrome_photos,Icons.mood,Icons.mood_bad,Icons.more,Icons.more_horiz,Icons.more_vert,Icons.motorcycle,Icons.mouse,Icons.move_to_inbox,Icons.movie,Icons.movie_creation,Icons.movie_filter,Icons.multiline_chart,Icons.music_note,Icons.music_video,Icons.my_location,Icons.nature,Icons.nature_people,Icons.navigate_before,Icons.navigate_next,Icons.navigation,Icons.near_me,Icons.network_cell,Icons.network_check,Icons.network_locked,Icons.network_wifi,Icons.new_releases,Icons.next_week,Icons.nfc,Icons.no_encryption,Icons.no_sim,Icons.not_interested,Icons.not_listed_location,Icons.note,Icons.note_add,Icons.notification_important,Icons.notifications,Icons.notifications_active,Icons.notifications_none,Icons.notifications_off,Icons.notifications_paused,Icons.offline_bolt,Icons.offline_pin,Icons.ondemand_video,Icons.opacity,Icons.open_in_browser,Icons.open_in_new,Icons.open_with,Icons.outlined_flag,Icons.pages,Icons.pageview,Icons.palette,Icons.pan_tool,Icons.panorama,Icons.panorama_fish_eye,Icons.panorama_horizontal,Icons.panorama_vertical,Icons.panorama_wide_angle,Icons.party_mode,Icons.pause,Icons.pause_circle_filled,Icons.pause_circle_outline,Icons.payment,Icons.people,Icons.people_outline,Icons.perm_camera_mic,Icons.perm_contact_calendar,Icons.perm_data_setting,Icons.perm_device_information,Icons.perm_identity,Icons.perm_media,Icons.perm_phone_msg,Icons.perm_scan_wifi,Icons.person,Icons.person_add,Icons.person_outline,Icons.person_pin,Icons.person_pin_circle,Icons.personal_video,Icons.pets,Icons.phone,Icons.phone_android,Icons.phone_bluetooth_speaker,Icons.phone_forwarded,Icons.phone_in_talk,Icons.phone_iphone,Icons.phone_locked,Icons.phone_missed,Icons.phone_paused,Icons.phonelink,Icons.phonelink_erase,Icons.phonelink_lock,Icons.phonelink_off,Icons.phonelink_ring,Icons.phonelink_setup,Icons.photo,Icons.photo_album,Icons.photo_camera,Icons.photo_filter,Icons.photo_library,Icons.photo_size_select_actual,Icons.photo_size_select_large,Icons.photo_size_select_small,Icons.picture_as_pdf,Icons.picture_in_picture,Icons.picture_in_picture_alt,Icons.pie_chart,Icons.pie_chart_outlined,Icons.pin_drop,Icons.place,Icons.play_arrow,Icons.play_circle_filled,Icons.play_circle_outline,Icons.play_for_work,Icons.playlist_add,Icons.playlist_add_check,Icons.playlist_play,Icons.plus_one,Icons.poll,Icons.polymer,Icons.pool,Icons.portable_wifi_off,Icons.portrait,Icons.power,Icons.power_input,Icons.power_settings_new,Icons.pregnant_woman,Icons.present_to_all,Icons.print,Icons.priority_high,Icons.public,Icons.publish,Icons.query_builder,Icons.question_answer,Icons.queue,Icons.queue_music,Icons.queue_play_next,Icons.radio,Icons.radio_button_checked,Icons.radio_button_unchecked,Icons.rate_review,Icons.receipt,Icons.recent_actors,Icons.record_voice_over,Icons.redeem,Icons.redo,Icons.refresh,Icons.remove,Icons.remove_circle,Icons.remove_circle_outline,Icons.remove_from_queue,Icons.remove_red_eye,Icons.remove_shopping_cart,Icons.reorder,Icons.repeat,Icons.repeat_one,Icons.replay,Icons.replay_5,Icons.replay_10,Icons.replay_30,Icons.reply,Icons.reply_all,Icons.report,Icons.report_off,Icons.report_problem,Icons.restaurant,Icons.restaurant_menu,Icons.restore,Icons.restore_from_trash,Icons.restore_page,Icons.ring_volume,Icons.room,Icons.room_service,Icons.rotate_90_degrees_ccw,Icons.rotate_left,Icons.rotate_right,Icons.rounded_corner,Icons.router,Icons.rowing,Icons.rss_feed,Icons.rv_hookup,Icons.satellite,Icons.save,Icons.save_alt,Icons.scanner,Icons.scatter_plot,Icons.schedule,Icons.school,Icons.score,Icons.screen_lock_landscape,Icons.screen_lock_portrait,Icons.screen_lock_rotation,Icons.screen_rotation,Icons.screen_share,Icons.sd_card,Icons.sd_storage,Icons.search,Icons.security,Icons.select_all,Icons.send,Icons.sentiment_dissatisfied,Icons.sentiment_neutral,Icons.sentiment_satisfied,Icons.sentiment_very_dissatisfied,Icons.sentiment_very_satisfied,Icons.settings,Icons.settings_applications,Icons.settings_backup_restore,Icons.settings_bluetooth,Icons.settings_brightness,Icons.settings_cell,Icons.settings_ethernet,Icons.settings_input_antenna,Icons.settings_input_component,Icons.settings_input_composite,Icons.settings_input_hdmi,Icons.settings_input_svideo,Icons.settings_overscan,Icons.settings_phone,Icons.settings_power,Icons.settings_remote,Icons.settings_system_daydream,Icons.settings_voice,Icons.share,Icons.shop,Icons.shop_two,Icons.shopping_basket,Icons.shopping_cart,Icons.short_text,Icons.show_chart,Icons.shuffle,Icons.shutter_speed,Icons.signal_cellular_4_bar,Icons.signal_cellular_connected_no_internet_4_bar,Icons.signal_cellular_no_sim,Icons.signal_cellular_null,Icons.signal_cellular_off,Icons.signal_wifi_4_bar,Icons.signal_wifi_4_bar_lock,Icons.signal_wifi_off,Icons.sim_card,Icons.sim_card_alert,Icons.skip_next,Icons.skip_previous,Icons.slideshow,Icons.slow_motion_video,Icons.smartphone,Icons.smoke_free,Icons.smoking_rooms,Icons.sms,Icons.sms_failed,Icons.snooze,Icons.sort,Icons.sort_by_alpha,Icons.spa,Icons.space_bar,Icons.speaker,Icons.speaker_group,Icons.speaker_notes,Icons.speaker_notes_off,Icons.speaker_phone,Icons.spellcheck,Icons.star,Icons.star_border,Icons.star_half,Icons.stars,Icons.stay_current_landscape,Icons.stay_current_portrait,Icons.stay_primary_landscape,Icons.stay_primary_portrait,Icons.stop,Icons.stop_screen_share,Icons.storage,Icons.store,Icons.store_mall_directory,Icons.straighten,Icons.streetview,Icons.strikethrough_s,Icons.style,Icons.subdirectory_arrow_left,Icons.subdirectory_arrow_right,Icons.subject,Icons.subscriptions,Icons.subtitles,Icons.subway,Icons.supervised_user_circle,Icons.supervisor_account,Icons.surround_sound,Icons.swap_calls,Icons.swap_horiz,Icons.swap_horizontal_circle,Icons.swap_vert,Icons.swap_vertical_circle,Icons.switch_camera,Icons.switch_video,Icons.sync,Icons.sync_disabled,Icons.sync_problem,Icons.system_update,Icons.system_update_alt,Icons.tab,Icons.tab_unselected,Icons.table_chart,Icons.tablet,Icons.tablet_android,Icons.tablet_mac,Icons.tag_faces,Icons.tap_and_play,Icons.terrain,Icons.text_fields,Icons.text_format,Icons.text_rotate_up,Icons.text_rotate_vertical,Icons.text_rotation_angledown,Icons.text_rotation_angleup,Icons.text_rotation_down,Icons.text_rotation_none,Icons.textsms,Icons.texture,Icons.theaters,Icons.threed_rotation,Icons.threesixty,Icons.thumb_down,Icons.thumb_up,Icons.thumbs_up_down,Icons.time_to_leave,Icons.timelapse,Icons.timeline,Icons.timer,Icons.timer_3,Icons.timer_10,Icons.timer_off,Icons.title,Icons.toc,Icons.today,Icons.toll,Icons.tonality,Icons.touch_app,Icons.toys,Icons.track_changes,Icons.traffic,Icons.train,Icons.tram,Icons.transfer_within_a_station,Icons.transform,Icons.transit_enterexit,Icons.translate,Icons.trending_down,Icons.trending_flat,Icons.trending_up,Icons.trip_origin,Icons.tune,Icons.turned_in,Icons.turned_in_not,Icons.tv,Icons.unarchive,Icons.undo,Icons.unfold_less,Icons.unfold_more,Icons.update,Icons.usb,Icons.verified_user,Icons.vertical_align_bottom,Icons.vertical_align_center,Icons.vertical_align_top,Icons.vibration,Icons.video_call,Icons.video_label,Icons.video_library,Icons.videocam,Icons.videocam_off,Icons.videogame_asset,Icons.view_agenda,Icons.view_array,Icons.view_carousel,Icons.view_column,Icons.view_comfy,Icons.view_compact,Icons.view_day,Icons.view_headline,Icons.view_list,Icons.view_module,Icons.view_quilt,Icons.view_stream,Icons.view_week,Icons.vignette,Icons.visibility,Icons.visibility_off,Icons.voice_chat,Icons.voicemail,Icons.volume_down,Icons.volume_mute,Icons.volume_off,Icons.volume_up,Icons.vpn_key,Icons.vpn_lock,Icons.wallpaper,Icons.warning,Icons.watch,Icons.watch_later,Icons.wb_auto,Icons.wb_cloudy,Icons.wb_incandescent,Icons.wb_iridescent,Icons.wb_sunny,Icons.wc,Icons.web,Icons.web_asset,Icons.weekend,Icons.whatshot,Icons.widgets,Icons.wifi,Icons.wifi_lock,Icons.wifi_tethering,Icons.work,Icons.wrap_text,Icons.youtube_searched_for,Icons.zoom_in,Icons.zoom_out,Icons.zoom_out_map]; } \ No newline at end of file diff --git a/lib/common/widget_demo.dart b/lib/common/widget_demo.dart index b7c1759d..204c4ca0 100644 --- a/lib/common/widget_demo.dart +++ b/lib/common/widget_demo.dart @@ -18,13 +18,16 @@ class WidgetDemo extends StatefulWidget { final String docUrl; final String title; final String codeUrl; + final Widget bottomNaviBar; WidgetDemo( {Key key, @required this.title, @required this.contentList, @required this.codeUrl, - @required this.docUrl}) + @required this.docUrl, + this.bottomNaviBar + }) : super(key: key); _WidgetDemoState createState() => _WidgetDemoState(); @@ -207,6 +210,8 @@ class _WidgetDemoState extends State { ], ), ), + bottomNavigationBar: (widget.bottomNaviBar is Widget) ? widget + .bottomNaviBar : null ); } } diff --git a/lib/widgets/components/Navigation/BottomNavigationBar/index.dart b/lib/widgets/components/Navigation/BottomNavigationBar/index.dart index 49f57236..1dfe3880 100644 --- a/lib/widgets/components/Navigation/BottomNavigationBar/index.dart +++ b/lib/widgets/components/Navigation/BottomNavigationBar/index.dart @@ -45,7 +45,7 @@ class _DemoState extends State { codeUrl: 'components/Navigation/BottomNavigationBar/demo.dart', contentList: [allDemoBoxs(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/BottomNavigationBar-class.html', - //bottomNaviBar:BottomNavigationBarDemo.BottomNavigationBarFullDefault() + bottomNaviBar:BottomNavigationBarDemo.BottomNavigationBarFullDefault() ); } } diff --git a/lib/widgets/elements/Form/Button/IconButton/demo.dart b/lib/widgets/elements/Form/Button/IconButton/demo.dart index 8f18ef00..3fd6cb44 100644 --- a/lib/widgets/elements/Form/Button/IconButton/demo.dart +++ b/lib/widgets/elements/Form/Button/IconButton/demo.dart @@ -10,7 +10,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter_rookie_book/common/iconNames.dart'; -final int len = IconNames.Names.length; +final int len = IconNames.names.length; /* * IconButton 默认按钮的实例 @@ -56,7 +56,7 @@ class IconButtonCustom extends StatelessWidget { @override Widget build(BuildContext context) { final int iconIndex = Random.secure().nextInt(len); - final IconData type = IconNames.Names[iconIndex]; + final IconData type = IconNames.names[iconIndex]; final _onPressed = onPressed; return IconButton( // 定义图标在IconButton中的定位方式,AlignmentGeometry 如果父Widget尺寸大于child Widget尺寸,这个属性设置会起作用,有很多种对齐方式。 From e4df84c0be0200833e9e7368de5ffb05a48e8da6 Mon Sep 17 00:00:00 2001 From: ryan730 Date: Sat, 12 Jan 2019 18:09:40 +0800 Subject: [PATCH 05/27] =?UTF-8?q?Modify:=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E7=9A=84=E5=A4=A7=E5=B0=8F=E5=86=99=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/{eventBus.dart => event_bus.dart} | 0 .../{iconNames.dart => icon_names.dart} | 0 lib/common/style.dart | 29 +++++++++ .../widgetPage => components}/cate_card.dart | 6 +- .../{CompList.dart => comp_list.dart} | 2 +- .../first_page_item.dart} | 2 +- .../{homeBanner.dart => home_banner.dart} | 0 .../{ListRefresh.dart => list_refresh.dart} | 0 lib/components/pagination.dart | 63 +++++++++++++++++++ .../{SearchInput.dart => search_input.dart} | 0 lib/components/widget_item.dart | 2 +- lib/main.dart | 8 +-- lib/views/detail.dart | 22 +++++++ lib/views/{FirstPage.dart => first_page.dart} | 6 +- .../{FourthPage.dart => fourth_page.dart} | 2 +- .../{widgetPage.dart => widget_page.dart} | 2 +- .../elements/Form/Button/IconButton/demo.dart | 2 +- 17 files changed, 130 insertions(+), 16 deletions(-) rename lib/common/{eventBus.dart => event_bus.dart} (100%) rename lib/common/{iconNames.dart => icon_names.dart} (100%) create mode 100644 lib/common/style.dart rename lib/{views/widgetPage => components}/cate_card.dart (96%) rename lib/components/{CompList.dart => comp_list.dart} (98%) rename lib/{views/widgetFeature/FirstPageItem.dart => components/first_page_item.dart} (97%) rename lib/components/{homeBanner.dart => home_banner.dart} (100%) rename lib/components/{ListRefresh.dart => list_refresh.dart} (100%) create mode 100644 lib/components/pagination.dart rename lib/components/{SearchInput.dart => search_input.dart} (100%) create mode 100644 lib/views/detail.dart rename lib/views/{FirstPage.dart => first_page.dart} (91%) rename lib/views/{FourthPage.dart => fourth_page.dart} (89%) rename lib/views/{widgetPage.dart => widget_page.dart} (96%) diff --git a/lib/common/eventBus.dart b/lib/common/event_bus.dart similarity index 100% rename from lib/common/eventBus.dart rename to lib/common/event_bus.dart diff --git a/lib/common/iconNames.dart b/lib/common/icon_names.dart similarity index 100% rename from lib/common/iconNames.dart rename to lib/common/icon_names.dart diff --git a/lib/common/style.dart b/lib/common/style.dart new file mode 100644 index 00000000..31d9bb8d --- /dev/null +++ b/lib/common/style.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; + +//颜色配置 +class AppColor{ + static const int white = 0xFFFFFFFF; + static const int mainTextColor = 0xFF121917; + static const int subTextColor = 0xff959595; +} + +//文本设置 +class AppText{ + static const middleSize = 16.0; + + static const middleText = TextStyle( + color: Color(AppColor.mainTextColor), + fontSize: middleSize, + ); + + static const middleSubText = TextStyle( + color: Color(AppColor.subTextColor), + fontSize: middleSize, + ); +} +class WidgetDemoColor { + static const int fontColor = 0xFF607173; + static const int iconColor = 0xFF607173; + static const int borderColor = 0xFFEFEFEF; + +} diff --git a/lib/views/widgetPage/cate_card.dart b/lib/components/cate_card.dart similarity index 96% rename from lib/views/widgetPage/cate_card.dart rename to lib/components/cate_card.dart index 7d87e6d1..24c05948 100644 --- a/lib/views/widgetPage/cate_card.dart +++ b/lib/components/cate_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import '../../model/cat.dart'; -import '../../common/widget_name_to_icon.dart'; -import '../../components/widget_item_container.dart'; +import '../model/cat.dart'; +import '../common/widget_name_to_icon.dart'; +import '../components/widget_item_container.dart'; class CateCard extends StatefulWidget { final Cat category; diff --git a/lib/components/CompList.dart b/lib/components/comp_list.dart similarity index 98% rename from lib/components/CompList.dart rename to lib/components/comp_list.dart index 580c41da..bca5c7ca 100644 --- a/lib/components/CompList.dart +++ b/lib/components/comp_list.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_rookie_book/views/Detail.dart'; +import 'package:flutter_rookie_book/views/detail.dart'; diff --git a/lib/views/widgetFeature/FirstPageItem.dart b/lib/components/first_page_item.dart similarity index 97% rename from lib/views/widgetFeature/FirstPageItem.dart rename to lib/components/first_page_item.dart index f91ffd09..3e4e8604 100644 --- a/lib/views/widgetFeature/FirstPageItem.dart +++ b/lib/components/first_page_item.dart @@ -7,7 +7,7 @@ * tartget: FirstPageItem */ -import '../../common/Util.dart'; +import '../common/Util.dart'; class FirstPageItem { bool hot; diff --git a/lib/components/homeBanner.dart b/lib/components/home_banner.dart similarity index 100% rename from lib/components/homeBanner.dart rename to lib/components/home_banner.dart diff --git a/lib/components/ListRefresh.dart b/lib/components/list_refresh.dart similarity index 100% rename from lib/components/ListRefresh.dart rename to lib/components/list_refresh.dart diff --git a/lib/components/pagination.dart b/lib/components/pagination.dart new file mode 100644 index 00000000..2793882d --- /dev/null +++ b/lib/components/pagination.dart @@ -0,0 +1,63 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; +import './home_banner.dart'; +import '../model/story.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class Pagination extends StatelessWidget { + static final String routeName = '/material/page-selector'; + static final List icons = [ + const Icon(Icons.event, semanticLabel: 'Event'), + const Icon(Icons.home, semanticLabel: 'Home'), + const Icon(Icons.android, semanticLabel: 'Android'), + const Icon(Icons.alarm, semanticLabel: 'Alarm'), + const Icon(Icons.face, semanticLabel: 'Face'), + const Icon(Icons.language, semanticLabel: 'Language'), + ]; + + final List bannerStories = []; + + final List arr = [ + {'image': 'https://img.alicdn.com/tfs/TB1W4hMAwHqK1RjSZJnXXbNLpXa-519-260.jpg', 'type': 0, 'id': 9695909, 'url': 'https://www.zhihu.com/question/294145797/answer/551162834', 'title': '为什么阿里巴巴、腾讯和 Google 之类的企业都在使用 Flutter 开发 App?'}, + {'image': 'https://img.alicdn.com/tfs/TB1XmFIApzqK1RjSZSgXXcpAVXa-720-338.jpg', 'type': 0, 'id': 9695859, 'url': 'https://zhuanlan.zhihu.com/p/51696594', 'title': 'Flutter 1.0 正式发布: Google 的便携 UI 工具包'}, + {'image': 'https://img.alicdn.com/tfs/TB1mClCABLoK1RjSZFuXXXn0XXa-600-362.jpg', 'type': 0, 'id': 96956491409, 'url':'https://zhuanlan.zhihu.com/p/53497167','title': 'Flutter 示范应用现已开源 — 万物起源(The History of Everything)'}, + {'image': 'https://img.alicdn.com/tfs/TB1fXxIAAvoK1RjSZFNXXcxMVXa-600-362.jpg', 'type': 0, 'id': 9695816, 'url': 'https://mp.weixin.qq.com/s?__biz=MzAwODY4OTk2Mg==&mid=2652048101&idx=1&sn=20296088e4bd8ca33c5c9991167d9f7d&chksm=808caaa0b7fb23b65c0e5806209f8d86da6732f3a00a70353f3606018339518b0a8656f14dc5&mpshare=1&scene=2&srcid=0106SZapVysZdIS6Oc5AhNH6&from=timeline&ascene=2&devicetype=android-27&version=27000038&nettype=WIFI&abtest_cookie=BQABAAgACgALABMAFAAFAJ2GHgAjlx4AV5keAJuZHgCcmR4AAAA%3D&lang=zh_CN&pass_ticket=4K1%2FUpsxP4suPj2iubR17wbAP7r9LW9iYrPAC2dppTqv7j7JO5FWMXtcKeBRxueV&wx_header=1', 'title': 'Flutter 与 Material Design 双剑合璧,助您构建精美应用'} + ]; + + void _launchURL(String url) async { + if (await canLaunch(url)) { + await launch(url); + } else { + throw 'Could not launch $url'; + } + } + + List _pageSelector(BuildContext context) { + List list = []; + /// super.initState(); + arr.forEach((item) { + bannerStories.add(StoryModel.fromJson(item)); + }); + + + if (arr.length > 0) { + list.add(HomeBanner(bannerStories, (story) { + _launchURL('${story.url}'); + })); + } + return list; + } + + @override + Widget build(BuildContext context) { + return + Column( + //physics: AlwaysScrollableScrollPhysics(), + //padding: EdgeInsets.only(), + children: _pageSelector(context) + ); + } +} diff --git a/lib/components/SearchInput.dart b/lib/components/search_input.dart similarity index 100% rename from lib/components/SearchInput.dart rename to lib/components/search_input.dart diff --git a/lib/components/widget_item.dart b/lib/components/widget_item.dart index 20648fa0..444f6ba0 100644 --- a/lib/components/widget_item.dart +++ b/lib/components/widget_item.dart @@ -2,7 +2,7 @@ * @author 一凨 */ import 'package:flutter/material.dart'; -import '../common/Style.dart'; +import '../common/style.dart'; import '../common/widget_name_to_icon.dart'; class WidgetItem extends StatelessWidget { diff --git a/lib/main.dart b/lib/main.dart index 40191ce5..a85aaa6c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,16 +2,16 @@ import 'package:flutter/material.dart'; import 'package:fluro/fluro.dart'; import 'package:flutter/rendering.dart'; -import 'views/FirstPage.dart'; -import 'views/widgetPage.dart'; -import 'views/FourthPage.dart'; +import 'views/first_page.dart'; +import 'views/widget_page.dart'; +import 'views/fourth_page.dart'; import 'views/collection_page.dart'; import 'routers/routers.dart'; import 'routers/application.dart'; import 'common/provider.dart'; import 'model/widget.dart'; import './widgets/index.dart'; -import 'package:flutter_rookie_book/components/SearchInput.dart'; +import 'package:flutter_rookie_book/components/search_input.dart'; diff --git a/lib/views/detail.dart b/lib/views/detail.dart new file mode 100644 index 00000000..0677a2bc --- /dev/null +++ b/lib/views/detail.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; + +class Detail extends StatelessWidget { + + final String id ; + Detail(this.id) ; + + + @override + Widget build(BuildContext context) { + return new Scaffold( + appBar: new AppBar( + title: new Text('List Detail'), + ), + body: new Center( + child: new Text('msg:'+ 'id='+id), + ), + ) ; + } + + +} \ No newline at end of file diff --git a/lib/views/FirstPage.dart b/lib/views/first_page.dart similarity index 91% rename from lib/views/FirstPage.dart rename to lib/views/first_page.dart index 81032349..d183770d 100644 --- a/lib/views/FirstPage.dart +++ b/lib/views/first_page.dart @@ -1,9 +1,9 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_rookie_book/common/list_view_item.dart'; -import 'package:flutter_rookie_book/components/ListRefresh.dart' as listComp; -import 'package:flutter_rookie_book/components/Pagination.dart'; -import './widgetFeature/FirstPageItem.dart'; +import 'package:flutter_rookie_book/components/list_refresh.dart' as listComp; +import 'package:flutter_rookie_book/components/pagination.dart'; +import 'package:flutter_rookie_book/components/first_page_item.dart'; import '../common/net_utils.dart'; class FirstPage extends StatefulWidget { diff --git a/lib/views/FourthPage.dart b/lib/views/fourth_page.dart similarity index 89% rename from lib/views/FourthPage.dart rename to lib/views/fourth_page.dart index c4c44af3..fc48f1db 100644 --- a/lib/views/FourthPage.dart +++ b/lib/views/fourth_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import '../components/CompList.dart'; +import '../components/comp_list.dart'; class FourthPage extends StatefulWidget { diff --git a/lib/views/widgetPage.dart b/lib/views/widget_page.dart similarity index 96% rename from lib/views/widgetPage.dart rename to lib/views/widget_page.dart index c1382258..f074669e 100644 --- a/lib/views/widgetPage.dart +++ b/lib/views/widget_page.dart @@ -5,7 +5,7 @@ * @Last Modified time: 2019-01-11 14:40:09 */ import 'package:flutter/material.dart'; -import 'widgetPage/cate_card.dart'; +import 'package:flutter_rookie_book/components/cate_card.dart'; import '../model/cat.dart'; class WidgetPage extends StatefulWidget { diff --git a/lib/widgets/elements/Form/Button/IconButton/demo.dart b/lib/widgets/elements/Form/Button/IconButton/demo.dart index 3fd6cb44..1be6e065 100644 --- a/lib/widgets/elements/Form/Button/IconButton/demo.dart +++ b/lib/widgets/elements/Form/Button/IconButton/demo.dart @@ -8,7 +8,7 @@ */ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:flutter_rookie_book/common/iconNames.dart'; +import 'package:flutter_rookie_book/common/icon_names.dart'; final int len = IconNames.names.length; From d8db19bda30fa5f18137a93e6f68c1a28b7eea2e Mon Sep 17 00:00:00 2001 From: ryan730 Date: Sat, 12 Jan 2019 18:11:24 +0800 Subject: [PATCH 06/27] =?UTF-8?q?Modify:=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E7=9A=84=E5=A4=A7=E5=B0=8F=E5=86=99=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/pagination.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/pagination.dart b/lib/components/pagination.dart index 2793882d..61b3b5d4 100644 --- a/lib/components/pagination.dart +++ b/lib/components/pagination.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; -import './home_banner.dart'; +import './homeBanner.dart'; import '../model/story.dart'; import 'package:url_launcher/url_launcher.dart'; From d42c5e085f92b9ab46eceea1df5bf1404ca2db6f Mon Sep 17 00:00:00 2001 From: ryan730 Date: Sat, 12 Jan 2019 18:12:47 +0800 Subject: [PATCH 07/27] =?UTF-8?q?Modify:=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E7=9A=84=E5=A4=A7=E5=B0=8F=E5=86=99=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/Pagination.dart | 63 ---------------------------------- lib/components/pagination.dart | 2 +- 2 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 lib/components/Pagination.dart diff --git a/lib/components/Pagination.dart b/lib/components/Pagination.dart deleted file mode 100644 index 61b3b5d4..00000000 --- a/lib/components/Pagination.dart +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; -import './homeBanner.dart'; -import '../model/story.dart'; -import 'package:url_launcher/url_launcher.dart'; - -class Pagination extends StatelessWidget { - static final String routeName = '/material/page-selector'; - static final List icons = [ - const Icon(Icons.event, semanticLabel: 'Event'), - const Icon(Icons.home, semanticLabel: 'Home'), - const Icon(Icons.android, semanticLabel: 'Android'), - const Icon(Icons.alarm, semanticLabel: 'Alarm'), - const Icon(Icons.face, semanticLabel: 'Face'), - const Icon(Icons.language, semanticLabel: 'Language'), - ]; - - final List bannerStories = []; - - final List arr = [ - {'image': 'https://img.alicdn.com/tfs/TB1W4hMAwHqK1RjSZJnXXbNLpXa-519-260.jpg', 'type': 0, 'id': 9695909, 'url': 'https://www.zhihu.com/question/294145797/answer/551162834', 'title': '为什么阿里巴巴、腾讯和 Google 之类的企业都在使用 Flutter 开发 App?'}, - {'image': 'https://img.alicdn.com/tfs/TB1XmFIApzqK1RjSZSgXXcpAVXa-720-338.jpg', 'type': 0, 'id': 9695859, 'url': 'https://zhuanlan.zhihu.com/p/51696594', 'title': 'Flutter 1.0 正式发布: Google 的便携 UI 工具包'}, - {'image': 'https://img.alicdn.com/tfs/TB1mClCABLoK1RjSZFuXXXn0XXa-600-362.jpg', 'type': 0, 'id': 96956491409, 'url':'https://zhuanlan.zhihu.com/p/53497167','title': 'Flutter 示范应用现已开源 — 万物起源(The History of Everything)'}, - {'image': 'https://img.alicdn.com/tfs/TB1fXxIAAvoK1RjSZFNXXcxMVXa-600-362.jpg', 'type': 0, 'id': 9695816, 'url': 'https://mp.weixin.qq.com/s?__biz=MzAwODY4OTk2Mg==&mid=2652048101&idx=1&sn=20296088e4bd8ca33c5c9991167d9f7d&chksm=808caaa0b7fb23b65c0e5806209f8d86da6732f3a00a70353f3606018339518b0a8656f14dc5&mpshare=1&scene=2&srcid=0106SZapVysZdIS6Oc5AhNH6&from=timeline&ascene=2&devicetype=android-27&version=27000038&nettype=WIFI&abtest_cookie=BQABAAgACgALABMAFAAFAJ2GHgAjlx4AV5keAJuZHgCcmR4AAAA%3D&lang=zh_CN&pass_ticket=4K1%2FUpsxP4suPj2iubR17wbAP7r9LW9iYrPAC2dppTqv7j7JO5FWMXtcKeBRxueV&wx_header=1', 'title': 'Flutter 与 Material Design 双剑合璧,助您构建精美应用'} - ]; - - void _launchURL(String url) async { - if (await canLaunch(url)) { - await launch(url); - } else { - throw 'Could not launch $url'; - } - } - - List _pageSelector(BuildContext context) { - List list = []; - /// super.initState(); - arr.forEach((item) { - bannerStories.add(StoryModel.fromJson(item)); - }); - - - if (arr.length > 0) { - list.add(HomeBanner(bannerStories, (story) { - _launchURL('${story.url}'); - })); - } - return list; - } - - @override - Widget build(BuildContext context) { - return - Column( - //physics: AlwaysScrollableScrollPhysics(), - //padding: EdgeInsets.only(), - children: _pageSelector(context) - ); - } -} diff --git a/lib/components/pagination.dart b/lib/components/pagination.dart index 61b3b5d4..2793882d 100644 --- a/lib/components/pagination.dart +++ b/lib/components/pagination.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; -import './homeBanner.dart'; +import './home_banner.dart'; import '../model/story.dart'; import 'package:url_launcher/url_launcher.dart'; From 4e20d9c603e1f513f546143e3ba4a7afd28ab651 Mon Sep 17 00:00:00 2001 From: "sanfan.hx" Date: Sat, 12 Jan 2019 19:22:33 +0800 Subject: [PATCH 08/27] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0SearchInput?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=20=3D>=20search=5Finput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/{SearchInput.dart => search_input.dart} | 0 lib/main.dart | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename lib/components/{SearchInput.dart => search_input.dart} (100%) diff --git a/lib/components/SearchInput.dart b/lib/components/search_input.dart similarity index 100% rename from lib/components/SearchInput.dart rename to lib/components/search_input.dart diff --git a/lib/main.dart b/lib/main.dart index 40191ce5..d6cac1d5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -11,7 +11,7 @@ import 'routers/application.dart'; import 'common/provider.dart'; import 'model/widget.dart'; import './widgets/index.dart'; -import 'package:flutter_rookie_book/components/SearchInput.dart'; +import 'package:flutter_rookie_book/components/search_input.dart'; From fbbd1f67316bb81a21a8fcee732960e578c6ee21 Mon Sep 17 00:00:00 2001 From: "sanfan.hx" Date: Sat, 12 Jan 2019 19:41:03 +0800 Subject: [PATCH 09/27] update: flutter_rookie_book => flutter_go --- android/app/bin/src/main/AndroidManifest.xml | 2 +- ios/Runner/Info.plist | 2 +- lib/components/CompList.dart | 2 +- lib/main.dart | 2 +- lib/views/FirstPage.dart | 6 +++--- lib/widgets/elements/Form/Button/IconButton/demo.dart | 2 +- lib/widgets/elements/Frame/Align/index.dart | 2 +- lib/widgets/elements/Frame/Spacing/SliverPadding/index.dart | 2 +- lib/widgets/elements/Frame/Stack/index.dart | 2 +- lib/widgets/themes/Material/MaterialAccentColor/index.dart | 4 ++-- lib/widgets/themes/Material/MaterialPageRoute/index.dart | 2 +- pubspec.yaml | 4 ++-- test/widget_test.dart | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/android/app/bin/src/main/AndroidManifest.xml b/android/app/bin/src/main/AndroidManifest.xml index c9c0310c..d7921ff6 100644 --- a/android/app/bin/src/main/AndroidManifest.xml +++ b/android/app/bin/src/main/AndroidManifest.xml @@ -14,7 +14,7 @@ FlutterApplication and put your custom class here. --> CFBundleInfoDictionaryVersion 6.0 CFBundleName - flutter_rookie_book + flutter_go CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/components/CompList.dart b/lib/components/CompList.dart index 580c41da..f0b08203 100644 --- a/lib/components/CompList.dart +++ b/lib/components/CompList.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_rookie_book/views/Detail.dart'; +import 'package:flutter_go/views/Detail.dart'; diff --git a/lib/main.dart b/lib/main.dart index d6cac1d5..062ebadd 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -11,7 +11,7 @@ import 'routers/application.dart'; import 'common/provider.dart'; import 'model/widget.dart'; import './widgets/index.dart'; -import 'package:flutter_rookie_book/components/search_input.dart'; +import 'package:flutter_go/components/search_input.dart'; diff --git a/lib/views/FirstPage.dart b/lib/views/FirstPage.dart index 81032349..7b2de797 100644 --- a/lib/views/FirstPage.dart +++ b/lib/views/FirstPage.dart @@ -1,8 +1,8 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:flutter_rookie_book/common/list_view_item.dart'; -import 'package:flutter_rookie_book/components/ListRefresh.dart' as listComp; -import 'package:flutter_rookie_book/components/Pagination.dart'; +import 'package:flutter_go/common/list_view_item.dart'; +import 'package:flutter_go/components/ListRefresh.dart' as listComp; +import 'package:flutter_go/components/Pagination.dart'; import './widgetFeature/FirstPageItem.dart'; import '../common/net_utils.dart'; diff --git a/lib/widgets/elements/Form/Button/IconButton/demo.dart b/lib/widgets/elements/Form/Button/IconButton/demo.dart index 8f18ef00..e1e13eee 100644 --- a/lib/widgets/elements/Form/Button/IconButton/demo.dart +++ b/lib/widgets/elements/Form/Button/IconButton/demo.dart @@ -8,7 +8,7 @@ */ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:flutter_rookie_book/common/iconNames.dart'; +import 'package:flutter_go/common/iconNames.dart'; final int len = IconNames.Names.length; diff --git a/lib/widgets/elements/Frame/Align/index.dart b/lib/widgets/elements/Frame/Align/index.dart index 65984579..a45c6ae3 100644 --- a/lib/widgets/elements/Frame/Align/index.dart +++ b/lib/widgets/elements/Frame/Align/index.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_rookie_book/model/widget.dart'; +import 'package:flutter_go/model/widget.dart'; import './Align/index.dart' as Align; diff --git a/lib/widgets/elements/Frame/Spacing/SliverPadding/index.dart b/lib/widgets/elements/Frame/Spacing/SliverPadding/index.dart index fc536b24..451936b7 100644 --- a/lib/widgets/elements/Frame/Spacing/SliverPadding/index.dart +++ b/lib/widgets/elements/Frame/Spacing/SliverPadding/index.dart @@ -5,7 +5,7 @@ * @Last Modified time: 2018-11-28 20:39:28 */ import 'package:flutter/material.dart'; -import 'package:flutter_rookie_book/common/widget_demo.dart'; +import 'package:flutter_go/common/widget_demo.dart'; import './sliverpadding_demo.dart'; const contentDesc0 = ''' diff --git a/lib/widgets/elements/Frame/Stack/index.dart b/lib/widgets/elements/Frame/Stack/index.dart index e28b9c67..e24bf8b8 100644 --- a/lib/widgets/elements/Frame/Stack/index.dart +++ b/lib/widgets/elements/Frame/Stack/index.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_rookie_book/model/widget.dart'; +import 'package:flutter_go/model/widget.dart'; import './Stack/index.dart' as Stack; import './IndexedStack/index.dart' as IndexedStack; diff --git a/lib/widgets/themes/Material/MaterialAccentColor/index.dart b/lib/widgets/themes/Material/MaterialAccentColor/index.dart index 1d0c220e..66f39a3a 100644 --- a/lib/widgets/themes/Material/MaterialAccentColor/index.dart +++ b/lib/widgets/themes/Material/MaterialAccentColor/index.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:flutter_rookie_book/common/widget_demo.dart'; -import 'package:flutter_rookie_book/widgets/themes/Material/MaterialColor/demo.dart'; +import 'package:flutter_go/common/widget_demo.dart'; +import 'package:flutter_go/widgets/themes/Material/MaterialColor/demo.dart'; const Text0 = ''' ### **简介** diff --git a/lib/widgets/themes/Material/MaterialPageRoute/index.dart b/lib/widgets/themes/Material/MaterialPageRoute/index.dart index fee37767..0408084d 100644 --- a/lib/widgets/themes/Material/MaterialPageRoute/index.dart +++ b/lib/widgets/themes/Material/MaterialPageRoute/index.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_rookie_book/common/widget_demo.dart'; +import 'package:flutter_go/common/widget_demo.dart'; import './demo.dart'; const Text0 = ''' diff --git a/pubspec.yaml b/pubspec.yaml index 7a74f787..1d9e769d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ -name: flutter_rookie_book -description: flutter_rookie_book +name: flutter_go +description: flutter_go # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 diff --git a/test/widget_test.dart b/test/widget_test.dart index 6f5f270c..49aed263 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_rookie_book/main.dart'; +import 'package:flutter_go/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { From 164cb4fba6a5d39202b27cc6c6b5a1839fd2aaba Mon Sep 17 00:00:00 2001 From: ryan730 Date: Sat, 12 Jan 2019 20:26:28 +0800 Subject: [PATCH 10/27] =?UTF-8?q?Modify:=201.=E6=95=B4=E7=90=86=E6=96=87?= =?UTF-8?q?=E4=BB=B6=202.=E4=BF=AE=E6=AD=A3=20analysis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/widget_item.dart | 3 +- lib/widgets/components/Bar/AppBar/demo.dart | 2 +- lib/widgets/components/Bar/AppBar/index.dart | 17 ++-- .../components/Bar/BottomAppBar/index.dart | 8 +- .../components/Bar/ButtonBar/index.dart | 10 ++- .../Bar/FlexibleSpaceBar/index.dart | 10 +-- .../components/Bar/SliverAppBar/demo.dart | 2 +- .../components/Bar/SliverAppBar/index.dart | 14 ++-- .../components/Bar/SnackBar/index.dart | 10 +-- .../components/Bar/SnackBarAction/index.dart | 4 +- lib/widgets/components/Bar/TabBar/index.dart | 2 +- lib/widgets/components/Card/Card/index.dart | 4 +- .../components/Chip/FilterChip/index.dart | 2 +- .../components/LIst/ListView/demo.dart | 4 +- .../Navigation/BottomNavigationBar/index.dart | 12 +-- .../BottomNavigationBarItem/index.dart | 4 +- .../Form/Button/DropdownButton/demo.dart | 8 +- .../Form/Button/DropdownButton/index.dart | 2 +- .../Form/Button/FlatButton/index.dart | 24 +++--- .../Button/FloatingActionButton/index.dart | 10 +-- .../Form/Button/IconButton/index.dart | 10 +-- .../Form/Button/OutlineButton/index.dart | 24 +++--- .../Form/Button/PopupMenuButton/index.dart | 12 +-- .../Form/Button/RaisedButton/index.dart | 21 +++-- .../Form/Button/RawMaterialButton/index.dart | 6 +- .../Form/CheckBox/Checkbox/index.dart | 10 +-- .../Form/CheckBox/CheckboxListTile/index.dart | 12 +-- .../elements/Frame/Axis/crossAxis/index.dart | 46 ----------- .../elements/Frame/Axis/flipAxis/index.dart | 79 ------------------- .../elements/Frame/Axis/mainAxis/index.dart | 49 ------------ 30 files changed, 125 insertions(+), 296 deletions(-) delete mode 100644 lib/widgets/elements/Frame/Axis/crossAxis/index.dart delete mode 100644 lib/widgets/elements/Frame/Axis/flipAxis/index.dart delete mode 100644 lib/widgets/elements/Frame/Axis/mainAxis/index.dart diff --git a/lib/components/widget_item.dart b/lib/components/widget_item.dart index 444f6ba0..b13966cf 100644 --- a/lib/components/widget_item.dart +++ b/lib/components/widget_item.dart @@ -5,13 +5,14 @@ import 'package:flutter/material.dart'; import '../common/style.dart'; import '../common/widget_name_to_icon.dart'; +String _widgetName; + class WidgetItem extends StatelessWidget { final String title; final VoidCallback onTap; final int index; //用于计算border final int totalCount; final int rowLength; - String _widgetName; WidgetItem( {this.title, this.onTap, this.index, this.totalCount, this.rowLength}); diff --git a/lib/widgets/components/Bar/AppBar/demo.dart b/lib/widgets/components/Bar/AppBar/demo.dart index 7e596cbb..c17eb6e0 100644 --- a/lib/widgets/components/Bar/AppBar/demo.dart +++ b/lib/widgets/components/Bar/AppBar/demo.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; /* -* Checkbox 默认AppBar的实例 +* 默认 AppBar 的实例 * index 当前AppBar 的索引值 * */ class AppBarLessDefaultComplex extends StatefulWidget { diff --git a/lib/widgets/components/Bar/AppBar/index.dart b/lib/widgets/components/Bar/AppBar/index.dart index 17f11a10..3b821ee8 100644 --- a/lib/widgets/components/Bar/AppBar/index.dart +++ b/lib/widgets/components/Bar/AppBar/index.dart @@ -16,23 +16,24 @@ import './demo.dart' as AppBarDemo; const String _Text0 = """### **简介** > AppBar “应用栏” -- 应用栏由工具栏和可能的其他 widget 组成,例如 TabBar和FlexibleSpaceBar。 -- 应用栏通常用于 Scaffold.appBa r属性,该属性将应用栏放置在屏幕顶部的固定高度小部件中。 -- 对于可滚动的应用栏,请参阅SliverAppBar,它将AppBar嵌入 sliver 中以便在CustomScrollView中使用。 +- 应用栏由工具栏和可能的其他 widget 组成,例如 TabBar和FlexibleSpaceBar; +- 应用栏通常用于 Scaffold.appBar 属性,该属性将应用栏放置在屏幕顶部的固定高度小部件中; +- 对于可滚动的应用栏,请参阅SliverAppBar,它将AppBar嵌入 sliver 中以便在CustomScrollView中使用; """; const String _Text1 = """### **基本用法** > AppBar -- AppBar 在底部上方显示工具栏 widget,前导 leading ,标题 title 和操作 actions。 +- AppBar 在底部上方显示工具栏 widget,前导 leading ,标题 title 和操作 actions; """; const String _Text2 = """### **进阶用法** > AppBar -- 一个完整的 AppBar 的例子, 增加 PopupMenuButton,TabBar 的示例子。 -- 所述底部通常用于一个的TabBar。如果指定了flexibleSpace窗口小部件,则它将堆叠在工具栏和底部窗口 widget 后面。 +- 一个完整的 AppBar 的例子, 增加 PopupMenuButton,TabBar 的示例子; +- 所述底部通常用于一个的 TabBar; +- 如果指定了 flexibleSpace 窗口 widget,则它将堆叠在工具栏和底部窗口 widget 后面; """; class Demo extends StatefulWidget { @@ -48,7 +49,7 @@ class _DemoState extends State { return WidgetDemo( title: 'AppBar', codeUrl: 'componentss/Bar/AppBar/demo.dart', - contentList: [allCheckboxs(context, this)], + contentList: [allDomes(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/AppBar-class.html', ); } @@ -59,7 +60,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDomes(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/BottomAppBar/index.dart b/lib/widgets/components/Bar/BottomAppBar/index.dart index 9c6fa6a8..4e70c2f6 100644 --- a/lib/widgets/components/Bar/BottomAppBar/index.dart +++ b/lib/widgets/components/Bar/BottomAppBar/index.dart @@ -16,13 +16,13 @@ import './demo.dart' as BottomAppBarDemo; const String _Text0 = """### **简介** > BottomAppBar “底部应用栏” -- 一个通常与 Scaffold.bottomNavigationBar 一起使用的容器,可以在顶部有一个凹口,为重叠的FloatingActionButton腾出空间 。 +- 一个通常与 Scaffold.bottomNavigationBar 一起使用的容器,可以在顶部有一个凹口,为重叠的FloatingActionButton腾出空间; """; const String _Text1 = """### **基本用法** -> 通常与Scaffold和FloatingActionButton一起使用。 +> 通常与 Scaffold 和 FloatingActionButton 一起使用; """; @@ -39,7 +39,7 @@ class _DemoState extends State { return WidgetDemo( title: 'BottomAppBar', codeUrl: 'componentss/Bar/BottomAppBar/demo.dart', - contentList: [allCheckboxs(context, this)], + contentList: [allDomes(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/BottomAppBar-class.html', ); } @@ -50,7 +50,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDomes(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/ButtonBar/index.dart b/lib/widgets/components/Bar/ButtonBar/index.dart index 4fe39eba..bce2b1ce 100644 --- a/lib/widgets/components/Bar/ButtonBar/index.dart +++ b/lib/widgets/components/Bar/ButtonBar/index.dart @@ -22,8 +22,10 @@ const String _Text0 = const String _Text1 = """### **基本用法** -> 根据当前ButtonTheme中的填充水平放置按钮 。子 button 在布置行与 MainAxisAlignment.end -- 当Directionality为TextDirection.ltr时,按钮栏的子项右对齐,最后一个子项成为最右边的子项。当Directionality TextDirection.rtl时,子项被左对齐,最后一个子项成为最左边的子项。 +> 根据当前 ButtonTheme 中的填充水平放置 button +- 子 button 在布置行与 MainAxisAlignment.end; +- 当 Directionality为TextDirection.ltr 时,按钮栏的子项右对齐,最后一个子项成为最右边的子项; +- 当 Directionality TextDirection.rtl 时,子项被左对齐,最后一个子项成为最左边的子项; """; @@ -40,7 +42,7 @@ class _DemoState extends State { return WidgetDemo( title: 'ButtonBar', codeUrl: 'components/Bar/ButtonBar/demo.dart', - contentList: [allCheckboxs(context, this)], + contentList: [allDomes(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/ButtonBar-class.html', ); } @@ -51,7 +53,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDomes(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/FlexibleSpaceBar/index.dart b/lib/widgets/components/Bar/FlexibleSpaceBar/index.dart index fe39cfb0..d6dbc972 100644 --- a/lib/widgets/components/Bar/FlexibleSpaceBar/index.dart +++ b/lib/widgets/components/Bar/FlexibleSpaceBar/index.dart @@ -16,15 +16,15 @@ import './demo.dart' as FlexibleSpaceBarDemo; const String _Text0 = """### **简介** > FlexibleSpaceBar “扩展和折叠的应用栏” -- AppBar的一部分,可以扩展和折叠。 +- AppBar 的一部分,可以扩展和折叠; """; const String _Text1 = """### **基本用法** > 最常用于 SliverAppBar.flexibleSpace 字段 -- 灵活的空格键随着应用滚动而扩展和收缩,以便AppBar 从应用程序的顶部到达应用程序滚动内容的顶部。 -- 要调整 AppBar 大小,必须将其包装在 FlexibleSpaceBar.createSettings 返回的 widget 中 ,以将大小调整信息传递给 FlexibleSpaceBar。 +- 灵活的空格键随着应用滚动而扩展和收缩,以便 AppBar 从应用程序的顶部到达应用程序滚动内容的顶部; +- 要调整 AppBar 大小,必须将其包装在 FlexibleSpaceBar.createSettings 返回的 widget 中 ,以将大小调整信息传递给 FlexibleSpaceBar; """; @@ -41,7 +41,7 @@ class _DemoState extends State { return WidgetDemo( title: 'FlexibleSpaceBar', codeUrl: 'components/Bar/FlexibleSpaceBar/demo.dart', - contentList: [allCheckboxs(context, this)], + contentList: [allDomes(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/FlexibleSpaceBar-class.html', ); } @@ -52,7 +52,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDomes(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/SliverAppBar/demo.dart b/lib/widgets/components/Bar/SliverAppBar/demo.dart index 48122562..3bc2c5fb 100644 --- a/lib/widgets/components/Bar/SliverAppBar/demo.dart +++ b/lib/widgets/components/Bar/SliverAppBar/demo.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; /* -* Checkbox 默认SliverAppBar的实例 +* 默认 SliverAppBar 的实例 * */ class SliverAppBarFullDefault extends StatefulWidget { const SliverAppBarFullDefault() : super(); diff --git a/lib/widgets/components/Bar/SliverAppBar/index.dart b/lib/widgets/components/Bar/SliverAppBar/index.dart index 32992053..4205f09d 100644 --- a/lib/widgets/components/Bar/SliverAppBar/index.dart +++ b/lib/widgets/components/Bar/SliverAppBar/index.dart @@ -16,16 +16,16 @@ import './demo.dart' as SliverAppBarDemo; const String _Text0 = """### **简介** > SliverAppBar “应用栏” -- 它类似于Android中的toolbar。 +- 它类似于Android中的toolbar; """; const String _Text1 = """### **基本用法** -> 虽然基本相同,构造方法也是非常的简单,但是却不能直接使用它,由官方文档可以看到通常结合ScrollView来使用它。 -- AppBar 和 SliverAppBar 都是继承StatefulWidget 类,都代表 Toobar。 -- 二者的区别在于 AppBar 位置的固定的应用最上面的;而 SliverAppBar 是可以跟随内容滚动的。 -- 下面的示例,放在 NestedScrollView 实现上提到顶的悬停。 +> 虽然基本相同,构造方法也是非常的简单,但是却不能直接使用它,由官方文档可以看到通常结合 ScrollView 来使用它; +- AppBar 和 SliverAppBar 都是继承StatefulWidget 类,都代表 Toobar; +- 二者的区别在于 AppBar 位置的固定的应用最上面的;而 SliverAppBar 是可以跟随内容滚动的; +- 下面的示例,放在 NestedScrollView 实现上提到顶的悬停; """; class Demo extends StatefulWidget { @@ -41,7 +41,7 @@ class _DemoState extends State { return WidgetDemo( title: 'SliverAppBar', codeUrl: 'componentss/Bar/SliverAppBar/demo.dart', - contentList:[allCheckboxs(context, this)], + contentList:[allDomes(context, this)], docUrl: 'https://docs.flutter.io/flutter/widgets/SliverAppBar-class.html', ); } @@ -52,7 +52,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDomes(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/SnackBar/index.dart b/lib/widgets/components/Bar/SnackBar/index.dart index e60fe054..4e7adbb2 100644 --- a/lib/widgets/components/Bar/SnackBar/index.dart +++ b/lib/widgets/components/Bar/SnackBar/index.dart @@ -16,14 +16,14 @@ import './demo.dart' as SnackBarDemo; const String _Text0 = """### **简介** > SnackBar “屏幕底部消息” -- 带有可选操作的轻量级消息,短暂显示在屏幕底部。 -- SnackBar是用户操作后,显示提示信息的一个控件,类似Toast,会自动隐藏。 +- 带有可选操作的轻量级消息,短暂显示在屏幕底部 +- SnackBar是用户操作后,显示提示信息的一个控件,类似Toast,会自动隐藏; """; const String _Text1 = """### **基本用法** -> Scaffold.of(context).showSnackBar(),传递描述消息的SnackBar实例。 +> Scaffold.of(context).showSnackBar(),传递描述消息的 SnackBar 实例; - 要控制SnackBar保持可见的时间,请指定持续时间。 """; @@ -41,7 +41,7 @@ class _DemoState extends State { return WidgetDemo( title: 'SnackBar', codeUrl: 'componentss/Bar/SnackBar/demo.dart', - contentList: [allCheckboxs(context, this)], + contentList: [allDomes(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/SnackBar-class.html', ); } @@ -52,7 +52,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDomes(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Bar/SnackBarAction/index.dart b/lib/widgets/components/Bar/SnackBarAction/index.dart index bd4f62a0..4d213c0c 100644 --- a/lib/widgets/components/Bar/SnackBarAction/index.dart +++ b/lib/widgets/components/Bar/SnackBarAction/index.dart @@ -14,11 +14,11 @@ const String _Text0 = """ ### **简介** > SnackBarAction “屏幕底部消息右侧可操作的行为” -带有可选操作的轻量级消息,短暂显示在屏幕底部, 并提供按钮交互。 +- 带有可选操作的轻量级消息,短暂显示在屏幕底部, 并提供按钮交互。 ### **基本用法** -> 为SnackBar加入action[SnackBarAction]显示按区, 默认下是隐藏的. +> 为SnackBar加入action[SnackBarAction]显示按区, 默认下是隐藏的 """; diff --git a/lib/widgets/components/Bar/TabBar/index.dart b/lib/widgets/components/Bar/TabBar/index.dart index 78270cad..bb2b364d 100644 --- a/lib/widgets/components/Bar/TabBar/index.dart +++ b/lib/widgets/components/Bar/TabBar/index.dart @@ -15,7 +15,7 @@ const String _Text0 = """ ### **简介** > SnackBarAction 来实现并行界面的横向滑动展示 -TabBar,是材料设计中很常用的一种横向标签. 来实现并行界面的横向滑动展示,在Flutter的世界中,TabBar有着相同的作用。通常,我们会在AppBar的底部部分结合TabBarView来使用TabBar。 +- TabBar,是材料设计中很常用的一种横向标签. 来实现并行界面的横向滑动展示,在Flutter的世界中,TabBar有着相同的作用。通常,我们会在AppBar的底部部分结合TabBarView来使用TabBar; diff --git a/lib/widgets/components/Card/Card/index.dart b/lib/widgets/components/Card/Card/index.dart index 7d3586a3..45e490fa 100644 --- a/lib/widgets/components/Card/Card/index.dart +++ b/lib/widgets/components/Card/Card/index.dart @@ -39,7 +39,7 @@ class _DemoState extends State { return WidgetDemo( title: 'Card', codeUrl: 'components/Card/Card/demo.dart', - contentList: [allCheckboxs(context, this)], + contentList: [allDomes(context, this)], docUrl: 'https://docs.flutter.io/flutter/material/Card-class.html', ); } @@ -50,7 +50,7 @@ class _DemoState extends State { * context: 运行上下文 * that: 指向有状态的 StatefulWidget */ -Widget allCheckboxs(BuildContext context, _DemoState that) { +Widget allDomes(BuildContext context, _DemoState that) { return Container( //padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0), child: Column( diff --git a/lib/widgets/components/Chip/FilterChip/index.dart b/lib/widgets/components/Chip/FilterChip/index.dart index b8976379..a7a7db79 100644 --- a/lib/widgets/components/Chip/FilterChip/index.dart +++ b/lib/widgets/components/Chip/FilterChip/index.dart @@ -11,7 +11,7 @@ import 'demo.dart'; const String content0 = ''' ### **简介** > 通过使用标签或者描述性词语来过滤内容 -- FilterChip是checkbox或switch widget 的替换品。 +- FilterChip 是 checkbox 或 switch widget 的替换品。 '''; const String content1 = ''' diff --git a/lib/widgets/components/LIst/ListView/demo.dart b/lib/widgets/components/LIst/ListView/demo.dart index d4f80a1e..728db57f 100644 --- a/lib/widgets/components/LIst/ListView/demo.dart +++ b/lib/widgets/components/LIst/ListView/demo.dart @@ -134,7 +134,9 @@ class ListViewLessDefault extends StatelessWidget { ), ); break; + default: + return null; + break; } - } } \ No newline at end of file diff --git a/lib/widgets/components/Navigation/BottomNavigationBar/index.dart b/lib/widgets/components/Navigation/BottomNavigationBar/index.dart index 1dfe3880..e38bdfd4 100644 --- a/lib/widgets/components/Navigation/BottomNavigationBar/index.dart +++ b/lib/widgets/components/Navigation/BottomNavigationBar/index.dart @@ -16,18 +16,18 @@ import './demo.dart' as BottomNavigationBarDemo; const String _text0 = """### **简介** > BottomNavigationBar “底部导航栏”, -- 显示在应用程序底部的导航栏,由文本标签,图标或两者形式的多个项目组成。 -- 它提供了应用程序顶级视图之间的快速导航。 +- 显示在应用程序底部的导航栏,由文本标签,图标或两者形式的多个项目组成; +- 它提供了应用程序顶级视图之间的快速导航; """; const String _text1 = """### **基本用法** > BottomNavigationBar 底部导航栏通常与Scaffold结合使用 -- 它作为Scaffold.bottomNavigationBar参数。 -- BottomNavigationBar金支持0-4个之间个底部按钮数量,超出4个系统将会报异常。 -- 默认0-3个底部按钮数量时,BottomNavigationBar采用fixed的模式摆放底部按钮,当超过4个时默认使用 BottomNavigationBarType.shifting 模式摆放底部按钮 -- 下面的底部导航即是效果。 +- 它作为 Scaffold.bottomNavigationBar 参数; +- BottomNavigationBar 支持0-4个之间个底部按钮数量,超出4个系统将会报异常; +- 默认0-3个底部按钮数量时,BottomNavigationBar采用fixed的模式摆放底部按钮,当超过4个时默认使用 BottomNavigationBarType.shifting 模式摆放底部按钮; +- 下面的底部导航即是效果; """; class Demo extends StatefulWidget { diff --git a/lib/widgets/components/Navigation/BottomNavigationBarItem/index.dart b/lib/widgets/components/Navigation/BottomNavigationBarItem/index.dart index 5ae71489..f28b77a5 100644 --- a/lib/widgets/components/Navigation/BottomNavigationBarItem/index.dart +++ b/lib/widgets/components/Navigation/BottomNavigationBarItem/index.dart @@ -16,13 +16,13 @@ import './demo.dart' as BottomNavigationBarItemDemo; const String _Text0 = """### **简介** > BottomNavigationBarItem “底部导航应用栏” -- material 的 BottomNavigationBar 或带有图标和标题的 iOS主题 CupertinoTabBar 中的交互式按钮。 +- material 的 BottomNavigationBar 或带有图标和标题的 iOS主题 CupertinoTabBar 中的交互式按钮; """; const String _Text1 = """### **基本用法** -> 这个类很少单独使用。通常嵌入在上面的一个底部 bottom navigation widgets 中。 +> 这个类很少单独使用。通常嵌入在上面的一个底部 bottom navigation widgets 中; """; diff --git a/lib/widgets/elements/Form/Button/DropdownButton/demo.dart b/lib/widgets/elements/Form/Button/DropdownButton/demo.dart index 2bf5b846..a2a97503 100644 --- a/lib/widgets/elements/Form/Button/DropdownButton/demo.dart +++ b/lib/widgets/elements/Form/Button/DropdownButton/demo.dart @@ -12,6 +12,9 @@ import 'package:flutter/material.dart'; * DropdownButton 默认按钮的实例 * isDisabled:是否是禁用,isDisabled 默认为true * */ +var selectItValue; +var selectItemValue; + class DropdownButtonDefault extends StatelessWidget { List generateItemList() { final List items = new List(); @@ -30,15 +33,13 @@ class DropdownButtonDefault extends StatelessWidget { return items; } - var selectItemValue; - @override Widget build(BuildContext context) { return DropdownButton( hint: new Text('下拉菜单选择一个人名'), //设置这个value之后,选中对应位置的item, //再次呼出下拉菜单,会自动定位item位置在当前按钮显示的位置处 - value: selectItemValue, + value: selectItValue, items: generateItemList(), onChanged: (T){ // setState(() { @@ -103,7 +104,6 @@ List getListData(){ items.add(dropdownMenuItem10); return items; } -var selectItemValue; /* * DropdownButton 自定义的实例 diff --git a/lib/widgets/elements/Form/Button/DropdownButton/index.dart b/lib/widgets/elements/Form/Button/DropdownButton/index.dart index 156ab0a1..4274f5dc 100644 --- a/lib/widgets/elements/Form/Button/DropdownButton/index.dart +++ b/lib/widgets/elements/Form/Button/DropdownButton/index.dart @@ -18,7 +18,7 @@ import './demo.dart' as dropdownButton; const String _dropdownText0 = """### **简介** > Dropdown button “用于从项目列表中进行选择的按钮” -- 类型T是下拉菜单表示的值的类型。给定菜单中的所有条目必须表示具有一致类型的值。通常,使用枚举。每个DropdownMenuItem在项目必须专门与同类型的说法。。 +- 参数类型 T 是下拉菜单表示的值的类型。给定菜单中的所有条目必须表示具有一致类型的值。通常,使用枚举。每个DropdownMenuItem在项目必须专门与同类型的说法; """; const String _dropdownText1 = diff --git a/lib/widgets/elements/Form/Button/FlatButton/index.dart b/lib/widgets/elements/Form/Button/FlatButton/index.dart index c293eab9..58fa6ba3 100644 --- a/lib/widgets/elements/Form/Button/FlatButton/index.dart +++ b/lib/widgets/elements/Form/Button/FlatButton/index.dart @@ -18,29 +18,27 @@ import './demo.dart' as flatButton; const String _flatText0 = """### **简介** -> Flat button 是显示在(零高程)material widget上的文本标签 -- 通过填充颜色对触摸作出反应在工具栏上, -- 在对话框中使用Flat button,或与其他内容内联,但使用填充从该内容偏移,以便按钮的存在是显而易见的。 -- Flat buttons 故意不具有可见边框,因此必须依赖于它们相对于其他内容的位置以用于上下文。 -- 在对话框和卡片中,它们应该组合在一个底角中。避免使用平面按钮,它们会与其他内容混合,例如在列表中间。"""; +> FlatButton 是显示在(零高程)material widget 上的文本标签 +- 通过填充颜色对触摸作出反应在工具栏上; +- FlatButtons 故意不具有可见边框,因此必须依赖于它们相对于其他内容的位置以用于上下文; +- 在对话框和卡片中,它们应该组合在一个底角中。避免使用平面按钮,它们会与其他内容混合,例如在列表中间;"""; const String _flatText1 = """### **基本用法** -> 参数的默认的按钮和禁用按钮 -- 如果onPressed回调为null,则该按钮将被禁用,不会对触摸做出反应,并且将按 disabledColor 属性而不是color属性指定的颜色进行着色。 -- 如果您尝试更改按钮的颜色并且没有任何效果,请检查您是否正在传递非null onPressed处理程序。"""; +> 参数的默认的 button 和禁用 button +- 如果 onPressed 回调为null,则该按钮将被禁用,不会对触摸做出反应,并且将按 disabledColor 属性而不是color属性指定的颜色进行着色; +- 如果您尝试更改按钮的颜色并且没有任何效果,请检查您是否正在传递非null onPressed处理程序;。"""; const String _flatText2 = """### **进阶用法1** -> FlatButton.icon,按钮图标和标签的widget创建文本按钮。"""; +> FlatButton.icon ,button 图标和标签的 widget 创建文本按钮;"""; const String _flatText3 = """### **进阶用法2** -> 更改项参数的自定义,比如:边框,点击效果,内容文字颜色等 -- Material design Flat buttons 按钮具有全帽标签,一些内部填充和一些定义的尺寸。 -- 要使应用程序的一部分具有交互式,使用墨水溅,而不是承诺这些样式选择,请考虑使用InkWell。 -- Flat button 的最小尺寸为88.0×36.0,可以用 ButtonTheme 覆盖。该clipBehavior参数不能为空。"""; +> 更改参数的自定义,比如:边框,点击效果,内容文字颜色等; +- 要使应用程序的一部分具有交互式,使用 ink splashes,请考虑使用InkWell; +- Flat button 的最小尺寸为88.0×36.0,可以用 ButtonTheme 覆盖。该clipBehavior参数不能为空;"""; class Demo extends StatefulWidget { static const String routeName = '/element/Form/Button/FlatButton'; diff --git a/lib/widgets/elements/Form/Button/FloatingActionButton/index.dart b/lib/widgets/elements/Form/Button/FloatingActionButton/index.dart index 63768cff..efabb752 100644 --- a/lib/widgets/elements/Form/Button/FloatingActionButton/index.dart +++ b/lib/widgets/elements/Form/Button/FloatingActionButton/index.dart @@ -18,15 +18,15 @@ import './demo.dart' as floatingActionButton; const String _floatingActionText0 = """### **简介** > FloatingAction Button “浮动动作按钮” -- FloatingActionButton 按钮是一个圆形图标按钮,悬停在内容上以提升应用程序中的主要操作。浮动操作按钮最常用于Scaffold.floatingActionButton字段中。。 -- 每个屏幕最多使用一个浮动操作按钮。浮动操作按钮应用于积极操作,例如“创建”,“共享”或“导航”。 -- 一般用来处理界面中最常用,最基础的用户动作。它一般出现在屏幕内容的前面,通常是一个圆形,中间有一个图标。 FAB有三种类型:regular, mini, and extended。不要强行使用FAB,只有当使用场景符合FAB功能的时候使用才最为恰当 +- FloatingActionButton 按钮是一个圆形图标按钮,悬停在内容上以提升应用程序中的主要操作。浮动操作按钮最常用于Scaffold.floatingActionButton字段中; +- 每个屏幕最多使用一个浮动操作按钮。浮动操作按钮应用于积极操作,例如“创建”,“共享”或“导航”; +- 一般用来处理界面中最常用,最基础的用户动作。它一般出现在屏幕内容的前面,通常是一个圆形,中间有一个图标。 FAB有三种类型:regular, mini, extended。不要强行使用FAB,只有当使用场景符合FAB功能的时候使用才最为恰当; """; const String _floatingActionText1 = """### **基本用法** -> 默认参数的按钮和禁用按钮 -- 如果onPressed回调为null,则该按钮将被禁用,并且不会对触摸作出反应,不会变成灰色。 +> 默认参数的 button 和禁用 button +- 如果 onPressed 回调为null,则该 button 将被禁用,并且不会对触摸作出反应,不会变成灰色; """; const String _floatingActionText2 = diff --git a/lib/widgets/elements/Form/Button/IconButton/index.dart b/lib/widgets/elements/Form/Button/IconButton/index.dart index 8518228f..1d742771 100644 --- a/lib/widgets/elements/Form/Button/IconButton/index.dart +++ b/lib/widgets/elements/Form/Button/IconButton/index.dart @@ -18,19 +18,19 @@ import './demo.dart' as iconButton; const String _iconText0 = """### **简介** > Icon button “图标按钮” -- IconButton widget上的图片,通过填充颜色(墨水)来对触摸作出反应。 +- IconButton widget上的图片,通过填充颜色(墨水)来对触摸作出反应; """; const String _iconText1 = """### **基本用法** > 参数的默认的按钮和禁用按钮 -- 图标按钮通常在AppBar.actions字段中使用,但它们也可以在许多其他地方使用。。 -- 如果您尝试更改按钮的颜色并且没有任何效果,请检查您是否正在传递非null onPressed处理程序。"""; +- 图标按钮通常在AppBar.actions字段中使用,但它们也可以在许多其他地方使用; +- 如果您尝试更改按钮的颜色并且没有任何效果,请检查您是否正在传递非null onPressed处理程序;"""; const String _iconText2 = """### **进阶用法** -> 更改项参数的自定义,比如:边框,点击效果,内容文字,颜色,圆角等 -- 如果可能,图标按钮的命中区域的大小至少为48.0像素,与实际的iconSize无关,以满足 Material Design规范中的触摸目标大小要求。的对准控制图标本身如何定位命中区域内。 +> 更改项参数的自定义,比如:边框,点击效果,内容文字,颜色,圆角等; +- 如果可能,图标按钮的命中区域的大小至少为48.0像素,与实际的iconSize无关,以满足 Material Design规范中的触摸目标大小要求。的对准控制图标本身如何定位命中区域内; - ** 长按可弹出 tip 文字 ** """; diff --git a/lib/widgets/elements/Form/Button/OutlineButton/index.dart b/lib/widgets/elements/Form/Button/OutlineButton/index.dart index ec9f460c..8c2aaa26 100644 --- a/lib/widgets/elements/Form/Button/OutlineButton/index.dart +++ b/lib/widgets/elements/Form/Button/OutlineButton/index.dart @@ -18,29 +18,29 @@ import './demo.dart' as outlineButton; const String _outlineText0 = """### **简介** > Outline button “边框按钮” -- RaisedButton和FlatButton之间的交叉:一个有边框的按钮,当按下按钮时,其高度增加,背景变得不透明。。 -- 高程最初为0.0,其背景颜色 为透明。按下按钮时,其背景变为不透明,然后其高程增加到highlightElevation。 +- RaisedButton和FlatButton之间的交叉:一个有边框的按钮,当按下按钮时,其高度增加,背景变得不透明; +- 高程最初为0.0,其背景颜色 为透明。按下按钮时,其背景变为不透明,然后其高程增加到highlightElevation; """; const String _outlineText1 = """### **基本用法** -> 参数的默认的按钮和禁用按钮 -- 如果onPressed回调为null,则该按钮将被禁用,不会对触摸做出反应,并且将按 disabledColor 属性而不是color属性指定的颜色进行着色。 -- 如果您尝试更改按钮的颜色并且没有任何效果,请检查您是否正在传递非null onPressed处理程序。"""; +> 参数的默认的 button 和禁用 button +- 如果onPressed回调为null,则该按钮将被禁用,不会对触摸做出反应,并且将按 disabledColor 属性而不是color属性指定的颜色进行着色; +- 如果您尝试更改按钮的颜色并且没有任何效果,请检查您是否正在传递非null onPressed处理程序;"""; const String _outlineText2 = """### **进阶用法1** -> OutlineButton.icon 的用法,按钮图标和标签的widget创建文本按钮。"""; +> OutlineButton.icon 的用法,按钮图标和标签的widget创建文本按钮"""; const String _outlineText3 = """### **进阶用法2** -> 更改项参数的自定义,比如:边框,点击效果,内容文字,颜色,圆角等 -- Outline buttons 按钮有一个边框,其形状由形状定义 ,其外观由borderSide,disabledBorderColor和highlightedBorderColor定义。 -- 如果您想要水龙头的墨水效果,但又不想使用按钮,请考虑直接使用InkWell。 -- Outline buttons 的最小尺寸为88.0×36.0,可以用ButtonTheme 覆盖。 -- 通过 shape 属性的设置,改变边框样式和圆角。 -- 可以尝试长按按钮,按钮突出显示。 +> 更改参数的自定义,比如:边框,点击效果,内容文字,颜色,圆角等; +- Outline buttons 按钮有一个边框,其形状由形状定义 ,其外观由borderSide,disabledBorderColor 和 highlightedBorderColor 定义; +- 如果您想要 ink-splash 效果,但又不想使用 button ,请考虑直接使用 InkWell; +- Outline buttons 的最小尺寸为88.0×36.0,可以用 ButtonTheme 覆盖; +- 通过 shape 属性的设置,改变边框样式和圆角; +- 可以尝试长按按钮,button 突出显示; """; class Demo extends StatefulWidget { diff --git a/lib/widgets/elements/Form/Button/PopupMenuButton/index.dart b/lib/widgets/elements/Form/Button/PopupMenuButton/index.dart index 2675f690..bb708a73 100644 --- a/lib/widgets/elements/Form/Button/PopupMenuButton/index.dart +++ b/lib/widgets/elements/Form/Button/PopupMenuButton/index.dart @@ -17,21 +17,21 @@ import './demo.dart' as popupMenuButton; const String _titleText0 = """ ### **简介** > 按下时显示菜单 -- 当菜单因为选择了项目而被解除时调用onSelected。传递给onSelected的值是所选菜单项的值。 -- 可以提供 `child` 或 `icon` 中的一个,但不是能同时设置两者。如果提供了 `icon` ,则 `PopupMenuButton` 的行为类似于 `IconButton`。 -- 如果两者都为null,则创建一个标准 overflow icon(取决于平台)。 +- 当菜单因为选择了项目而被解除时调用onSelected。传递给onSelected的值是所选菜单项的值; +- 可以提供 `child` 或 `icon` 中的一个,但不是能同时设置两者。如果提供了 `icon` ,则 `PopupMenuButton` 的行为类似于 `IconButton`; +- 如果两者都为null,则创建一个标准 overflow icon(取决于平台); """; const String _titleText1 = """ ### **基本用法** > 此示例显示一个包含四个项目的菜单 -- 在枚举值之间进行选择,并_selection根据选择设置字段。 +- 在枚举值之间进行选择,并_selection根据选择设置字段; """; const String _titleText2 = """ ### **进阶用法** > 此示例尝试调整所有属性,展示出效果 -- 默认选择第二个。 -- 再次打开,`PopupMenuItem` 保留上次的选择结果。 +- 默认选择第二个; +- 再次打开,`PopupMenuItem` 保留上次的选择结果; """; class Demo extends StatefulWidget { diff --git a/lib/widgets/elements/Form/Button/RaisedButton/index.dart b/lib/widgets/elements/Form/Button/RaisedButton/index.dart index dbbd466b..26d7ad7e 100644 --- a/lib/widgets/elements/Form/Button/RaisedButton/index.dart +++ b/lib/widgets/elements/Form/Button/RaisedButton/index.dart @@ -18,29 +18,28 @@ import './demo.dart' as raisedButton; const String _raisedText0 = """### **简介** > Raised button “凸起按钮” -- Raised button 基于 a Material widget 窗口widget,按下按钮时,Material.elevation 会增加。 -- 使用 Raised button 可将尺寸添加到大多数平面布局中。 -- 例如在复杂的内容列表中,或在宽阔的空间中。避免在已经提出的内容(例如对话框或卡片)上使用 Raised button 。 +- Raised button 基于 a Material widget 窗口widget,按下 button 时,Material.elevation 会增加; +- 使用 Raised button 可将尺寸添加到大多数平面布局中; +- 例如在复杂的内容列表中,或在宽阔的空间中。避免在已经提出的内容(例如对话框或卡片)上使用 Raised button; """; const String _raisedText1 = """### **基本用法** -> 参数的默认的按钮和禁用按钮 -- 如果onPressed回调为null,则该按钮将被禁用,不会对触摸做出反应,并且将按 disabledColor 属性而不是color属性指定的颜色进行着色。 -- 如果您尝试更改按钮的颜色并且没有任何效果,请检查您是否正在传递非null onPressed处理程序。"""; +> 参数的默认的 button 和禁用 button; +- 如果onPressed回调为null,则该按钮将被禁用,不会对触摸做出反应,并且将按 disabledColor 属性而不是color属性指定的颜色进行着色; +- 如果您尝试更改按钮的颜色并且没有任何效果,请检查您是否正在传递非null onPressed处理程序;"""; const String _raisedText2 = """### **进阶用法1** -> RaisedButton.icon 的用方法,按钮图标和标签的widget创建文本按钮。"""; +> RaisedButton.icon 的用方法,按钮图标和标签的widget创建文本按钮;"""; const String _raisedText3 = """### **进阶用法2** > 更改项参数的自定义,比如:边框,点击效果,内容文字,颜色,圆角等 -- Raised buttons 按钮具有全帽标签,一些内部填充和一些定义的尺寸。 -- 如果您想要水龙头的墨水效果,但又不想使用按钮,请考虑直接使用InkWell。 -- Raised buttons 的最小尺寸为88.0×36.0,可以用ButtonTheme 覆盖。 -- 通过 shape 属性的设置,改变边框样式和圆角。 +- 如果您想要 ink-splash 的墨水效果,但又不想使用按钮,请考虑直接使用InkWell; +- Raised buttons 的最小尺寸为88.0×36.0,可以用 ButtonTheme 覆盖; +- 通过 shape 属性的设置,改变边框样式和圆角; """; class Demo extends StatefulWidget { diff --git a/lib/widgets/elements/Form/Button/RawMaterialButton/index.dart b/lib/widgets/elements/Form/Button/RawMaterialButton/index.dart index 5f982401..3bffb8cd 100644 --- a/lib/widgets/elements/Form/Button/RawMaterialButton/index.dart +++ b/lib/widgets/elements/Form/Button/RawMaterialButton/index.dart @@ -18,13 +18,13 @@ import './demo.dart' as rawMaterialButton; const String _rawMaterialText0 = """### **简介** > RawMaterial button “RawMaterial 按钮” -- 基于Semantics,Material和InkWell 小部件创建按钮。 -- 此类不使用当前Theme或ButtonTheme来计算未指定参数的默认值。它旨在用于自定义材质按钮,可选择包含主题或特定于应用程序源的默认值。 +- 基于 Semantics,Material 和InkWell 小部件创建按钮; +- 此类不使用当前 Theme 或 ButtonTheme 来计算未指定参数的默认值。它旨在用于自定义 Material button,可选择包含主题或特定于应用程序源的默认值; """; const String _rawMaterialText1 = """### **基本用法** -> 参数的默认的按钮和禁用按钮 +> 参数的默认的 button 和禁用 button """; const String _rawMaterialText2 = diff --git a/lib/widgets/elements/Form/CheckBox/Checkbox/index.dart b/lib/widgets/elements/Form/CheckBox/Checkbox/index.dart index ae8047f2..5f0d40d9 100644 --- a/lib/widgets/elements/Form/CheckBox/Checkbox/index.dart +++ b/lib/widgets/elements/Form/CheckBox/Checkbox/index.dart @@ -17,21 +17,21 @@ import './demo.dart' as checkbox; const String _checkboxText0 = """### **简介** > checkbox “复选框” -- 复选框本身不保持任何状态 -- 当复选框的状态发生变化时,窗口小部件会调用onChanged回调。 -- 大多数使用复选框的小部件将侦听onChanged回调,并使用新值重建复选框以更新复选框的可视外观。"""; +- 复选框本身不保持任何状态; +- 当复选框的状态发生变化时,窗口小部件会调用onChanged回调; +- 大多数使用复选框的小部件将侦听onChanged回调,并使用新值重建复选框以更新复选框的可视外观;"""; const String _checkboxText1 = """### **基本用法** > 下面示例展示多个颜色(随机)样式的 `checkbox` -- 一个多选的 `checkbox` +- 一个多选的 `checkbox`; """; const String _checkboxText2 = """### **进阶用法** > 下面示例展示多个颜色(随机)样式的 `checkbox` -- 一个单选 `checkbox` 操作 +- 一个单选 `checkbox` 操作; """; class Demo extends StatefulWidget { diff --git a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart index db524c76..2592135c 100644 --- a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart +++ b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart @@ -16,18 +16,18 @@ import './demo.dart' as CheckboxListTileDemo; const String _CheckboxListTileText0 = """### **简介** > CheckboxListTile “下拉复选框” -- 带有复选框的ListTile,带有标签的复选框。 -- 整个列表图块是交互式的:点击图块中的任意位置可切换复选框。 +- 带有复选框的 ListTile,带有标签的 ListTile; +- 整个列表图块是交互式的:点击图块中的任意位置可切换复选框; """; const String _CheckboxListTileText1 = """### **基本用法** > CheckboxListTile 的属性特征 -- Checkbox类似的命名属性,比如:onChanged和activeColor。 -- 和ListTile类似的命名属性,比如:title, subtitle, isThreeLine,dense。 -- selected属性和ListTile.selected 属性类似,但使用的颜色是activeColor属性,默认为当前Theme的颜色。 -- onChanged 回调函数为 null,显示禁用 +- 与 Checkbox 类似的命名属性,比如:onChanged 和 activeColor; +- 和 ListTile 类似的命名属性,比如:title, subtitle, isThreeLine,dense; +- selected 属性和 ListTile.selected 属性类似,但使用的颜色是 activeColor 属性,默认为当前 Theme 的颜色; +- onChanged 回调函数为 null,显示禁用; """; const String _CheckboxListTileText2 = diff --git a/lib/widgets/elements/Frame/Axis/crossAxis/index.dart b/lib/widgets/elements/Frame/Axis/crossAxis/index.dart deleted file mode 100644 index 804339b7..00000000 --- a/lib/widgets/elements/Frame/Axis/crossAxis/index.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:flutter/material.dart'; -import '../../../../../common/widget_demo.dart'; - -class Demo extends StatefulWidget { - static const String routeName = '/element/Frame/Axis/crossAxis'; - _DemoState createState() => _DemoState(); -} - -class _DemoState extends State { - @override - Widget build(BuildContext context) { - return WidgetDemo( - title: 'crossAxis', - contentList: [Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - ], - )], - docUrl: 'https://docs.flutter.io/flutter/widgets/Padding-class.html', - ); - } -} diff --git a/lib/widgets/elements/Frame/Axis/flipAxis/index.dart b/lib/widgets/elements/Frame/Axis/flipAxis/index.dart deleted file mode 100644 index 1928570b..00000000 --- a/lib/widgets/elements/Frame/Axis/flipAxis/index.dart +++ /dev/null @@ -1,79 +0,0 @@ -import 'package:flutter/material.dart'; -import '../../../../../common/widget_demo.dart'; - -class Demo extends StatefulWidget { - static const String routeName = '/element/Frame/Axis/flipAxis'; - _DemoState createState() => _DemoState(); -} - -class _DemoState extends State { - Axis _direction ; - - @override - void initState() { - // TODO: implement initState - super.initState(); - _direction = Axis.horizontal; - } - - Axis flipAxis() { - assert(_direction != null); - switch (_direction) { - case Axis.horizontal: - return Axis.vertical; - case Axis.vertical: - return Axis.horizontal; - } - return null; - } - - _changeDirection(){ - setState(() { - _direction=flipAxis(); - }); - } - - @override - Widget build(BuildContext context) { - return WidgetDemo( - title: 'flipAxis', - contentList: [Flex( - direction: _direction, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - RaisedButton( - child: Text('change direction'), - onPressed: _changeDirection, - ) - ], - )], - docUrl: 'https://docs.flutter.io/flutter/painting/flipAxis.html', - ); - } -} diff --git a/lib/widgets/elements/Frame/Axis/mainAxis/index.dart b/lib/widgets/elements/Frame/Axis/mainAxis/index.dart deleted file mode 100644 index 4b6e088e..00000000 --- a/lib/widgets/elements/Frame/Axis/mainAxis/index.dart +++ /dev/null @@ -1,49 +0,0 @@ -import 'package:flutter/material.dart'; -import '../../../../../common/widget_demo.dart'; - -class Demo extends StatefulWidget { - static const String routeName = '/element/Frame/Axis/Table'; - _DemoState createState() => _DemoState(); -} - -class _DemoState extends State { - @override - Widget build(BuildContext context) { - return WidgetDemo( - title: 'mainAxis', - contentList: [Flex( - direction: Axis.vertical, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - Container( - height: 20.0, - width: 20.0, - color: Colors.blueAccent, - margin: const EdgeInsets.all(10.0), - ), - ], - )], - docUrl: 'https://docs.flutter.io/flutter/material/MergeableMaterial/mainAxis.html', - ); - } -} From b58e203bbeb4af37cc368c7c018c0e4e26c8cf24 Mon Sep 17 00:00:00 2001 From: ryan730 Date: Sat, 12 Jan 2019 21:01:19 +0800 Subject: [PATCH 11/27] =?UTF-8?q?Modfiy:=20icon=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E5=86=85=E5=AE=B9=E6=9C=89=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E7=BB=99=E8=A1=A5=E5=85=85=E4=BA=86?= =?UTF-8?q?=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/widget_name_to_icon.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/common/widget_name_to_icon.dart b/lib/common/widget_name_to_icon.dart index b3436602..188e848f 100644 --- a/lib/common/widget_name_to_icon.dart +++ b/lib/common/widget_name_to_icon.dart @@ -137,8 +137,14 @@ class WidgetName2Icon { "YearPicker":Icons.event_busy, "ShowdatePicker":Icons.event, "MaterialPageRoute":Icons.album, - "MaterialAccentColor":Icons.brush, - - + "MaterialAccentColor":Icons.brush, + "SnackBarAction":Icons.assessment, + "TabBar":Icons.burst_mode, + "AlertDialog":Icons.sms_failed, + "AboutDialog":Icons.sms, + "SimpleDialog":Icons.message, + "ScaffoldState":Icons.local_bar, + "GridTile":Icons.apps, + "MergeableMaterialItem":Icons.view_list }; } From 23d0698caeb7d112243097ff747874f49c0e4817 Mon Sep 17 00:00:00 2001 From: "yifeng.yl" Date: Sat, 12 Jan 2019 21:19:47 +0800 Subject: [PATCH 12/27] modified db --- assets/app.db | Bin 53248 -> 53248 bytes lib/widgets/components/Menu/index.dart | 6 ++++++ 2 files changed, 6 insertions(+) diff --git a/assets/app.db b/assets/app.db index e4728b04ead5004b3a5596add27bad6fca257af9..d0b148d04a2aaacfd04ca10834e76ad24b19f067 100644 GIT binary patch delta 351 zcmWm7ze_?<6u|L&@4N5ikLSH9O4tv41t}=LEG#t|6e%5|F%!zf0*Qj8QA#ADRpWqz zLpl^Rw8Y(Nk`_TIi6)2sh?a(idT;r1hR->t-j(WIsX2vvH`8g{dn(@fa1~^22llnd zn8qfVn=xo>K6uee!ZUlI62}8n!#ZUaq`+f%momRGsQL_6A*f%^u{We-v$BM7CSx{{ zFdL7Xjm5YPDdIz4a^f_|N#jd$0h&oK+$Z-aUO^OwzIh0x?39d9M69L?5>*B$1Y4ef zcy(I{wOpcg@xHO_wMB6r@gZ;V6BsZ0V6m7cI4{nMH7l_X#rM${raX><;`8`Wq6ncV ztey680OX1v!j%wF%fcDqswkfaF<}LOivi^$G$Bg0j3XHUnDQ*oD`+2Xh9a(NIG{`P1_7!t)GowjgH>V+a#9X-P^DC+h zfG57W|6%gmL5FVtPA4}IT{NoMNJQh{pvF*0?zaXs83K@jud zHASis1uKp&^b8wC&|Cyj8@U9fAxAtoY3mj@)+<@$qPZqh5M~Ll@B_ZWL&)L|sGv7K zCN|<}y+nxkNW6g3lhhOOlw6XP{+OQN(CQuZpqg^QJi1d}VGeMUSWde^;x)vrd&SnI zBVr+Q1PURfUS?fzfbOhTmKa+0wsE)Dg2#KaM$NNn;8Xky4f% widgetPoints = [ @@ -46,4 +47,9 @@ List widgetPoints = [ routerName: PopupMenuItemState.Demo.routeName, buildRouter: (BuildContext context) => PopupMenuItemState.Demo(), ), + WidgetPoint( + name:'PopupMenuItem', + routerName: PopupMenuItem.Demo.routeName, + buildRouter: (BuildContext context) => PopupMenuItem.Demo(), + ), ]; \ No newline at end of file From 0b1cff580e3609f16c5560cb86c2a1c0462abc8d Mon Sep 17 00:00:00 2001 From: "sanfan.hx" Date: Sun, 13 Jan 2019 12:43:41 +0800 Subject: [PATCH 13/27] =?UTF-8?q?fix(=E4=BF=AE=E5=A4=8DDialogDemo,=20?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Dialog/Dialog/demo.dart | 49 +++++++++++++++---- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/lib/widgets/components/Dialog/Dialog/demo.dart b/lib/widgets/components/Dialog/Dialog/demo.dart index b2911327..4f7f3818 100644 --- a/lib/widgets/components/Dialog/Dialog/demo.dart +++ b/lib/widgets/components/Dialog/Dialog/demo.dart @@ -22,7 +22,21 @@ class _Demo extends State { barrierDismissible: false, // user must tap button! builder: (BuildContext context) { return Dialog( - child: Text("我是一个Dialog"), + child: Container( + height: 100, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Text('我是一个dialog'), + RaisedButton( + child: Text('取消'), + onPressed: () { + Navigator.of(context).pop(); + }, + ) + ], + ), + ) ); }, ); @@ -63,15 +77,30 @@ class _DialogMoreDemo extends State { return StatefulBuilder( builder: (context, state) { return Dialog( - child: RaisedButton( - onPressed: () { - print("print $value"); - state(() { - value += 1; - }); - }, - child: Text("我是一个Dialog, 点我更新value: $value"), - ) + child: Container( + height: 150, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Text('我是一个dialog'), + RaisedButton( + onPressed: () { + state(() { + value += 1; + }); + }, + child: Text("我是一个Dialog, 点我更新value: $value"), + ), + RaisedButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text("取消"), + ) + ], + ), + ), + ); } ); From c120fd3f94f70c97b4f42782d92aceb251780897 Mon Sep 17 00:00:00 2001 From: "sanfan.hx" Date: Sun, 13 Jan 2019 14:15:18 +0800 Subject: [PATCH 14/27] =?UTF-8?q?refactor(=E6=95=B4=E7=90=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=88=9D=E5=A7=8B=E9=80=BB=E8=BE=91,=20?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=95=B0=E6=8D=AE=E5=BA=93=E5=AE=8C=E6=95=B4?= =?UTF-8?q?=E6=80=A7):=20=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=B7=B2=E7=9F=A5=E7=9A=84cat,=20widget,=20collection?= =?UTF-8?q?=E4=B8=89=E5=BC=A0=E8=A1=A8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/provider.dart | 63 ++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/lib/common/provider.dart b/lib/common/provider.dart index 8540d671..32703214 100644 --- a/lib/common/provider.dart +++ b/lib/common/provider.dart @@ -4,37 +4,81 @@ import 'dart:typed_data'; import 'package:path/path.dart'; import 'package:sqflite/sqflite.dart'; import 'package:flutter/services.dart' show rootBundle; +//const createSql = { +// 'cat': """ +// CREATE TABLE "cat" ( +// `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, +// `name` TEXT NOT NULL UNIQUE, +// `depth` INTEGER NOT NULL DEFAULT 1, +// `parentId` INTEGER NOT NULL, +// `desc` TEXT +// ); +// """, +// 'collectio': """ +// CREATE TABLE collection (id INTEGER PRIMARY KEY NOT NULL UNIQUE, name TEXT NOT NULL, router TEXT); +// """, +// 'widget': """ +// CREATE TABLE widget (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, name TEXT NOT NULL, cnName TEXT NOT NULL, image TEXT NOT NULL, doc TEXT, demo TEXT, catId INTEGER NOT NULL REFERENCES cat (id), owner TEXT); +// """; +//}; class Provider { static Database db; + // 获取数据库中所有的表 + Future getTables() async { + if (db == null) { + return Future.value([]); + } + List tables = await db.rawQuery('SELECT name FROM sqlite_master WHERE type = "table"'); + List targetList = []; + tables.forEach((item) { + targetList.add(item['name']); + }); + return targetList; + } + + // 检查数据库中, 表是否完整, 在部份android中, 会出现表丢失的情况 + Future checkTableIsRight() async { + List expectTables = ['cat', 'widget', 'collection']; + + List tables = await getTables(); + + for(int i = 0; i < expectTables.length; i++) { + if (!tables.contains(expectTables[i])) { + print("table lost in app"); + return false; + } + } + return true; + + } + //初始化数据库 - // isCreate 用永远 copy 一个新的数据库 + Future init(bool isCreate) async { //Get a location using getDatabasesPath String databasesPath = await getDatabasesPath(); String path = join(databasesPath, 'flutter.db'); - List tables; + try { db = await openDatabase(path); - tables = await db - .rawQuery('SELECT name FROM sqlite_master WHERE type = "table"'); - print('${tables.length} 7891'); } catch (e) { print("Error $e"); } + bool tableIsRight = await this.checkTableIsRight(); - if (tables.length < 3) { - // Delete the database - await deleteDatabase(path); + if (!tableIsRight) { // 关闭上面打开的db,否则无法执行open db.close(); + // Delete the database + await deleteDatabase(path); ByteData data = await rootBundle.load(join("assets", "app.db")); List bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); await new File(path).writeAsBytes(bytes); - db = await openDatabase(path, version: 2, + db = await openDatabase(path, version: 1, onCreate: (Database db, int version) async { print('db created version is $version'); }, onOpen: (Database db) async { @@ -44,4 +88,5 @@ class Provider { print("Opening existing database"); } } + } From 7cf8d11fda6a3f466b6b3caafdfc0619d4127048 Mon Sep 17 00:00:00 2001 From: ryan730 Date: Sun, 13 Jan 2019 17:41:23 +0800 Subject: [PATCH 15/27] =?UTF-8?q?feat(=E5=A2=9E=E5=8A=A0=E5=85=8D=E8=B4=A3?= =?UTF-8?q?=E5=A3=B0=E6=98=8E):=20=E5=A3=B0=E6=98=8E=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=BC=B9=E5=87=BA=EF=BC=8C=E5=B7=A6?= =?UTF-8?q?=E4=B8=8A=E8=A7=92=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/disclaimer_msg.dart | 247 ++++++++++++++++++ lib/main.dart | 28 +- lib/model/collection_general.dart | 69 +++++ lib/views/first_page.dart | 63 ++++- .../Form/CheckBox/CheckboxListTile/index.dart | 3 +- 5 files changed, 387 insertions(+), 23 deletions(-) create mode 100644 lib/components/disclaimer_msg.dart create mode 100644 lib/model/collection_general.dart diff --git a/lib/components/disclaimer_msg.dart b/lib/components/disclaimer_msg.dart new file mode 100644 index 00000000..b65a6f2d --- /dev/null +++ b/lib/components/disclaimer_msg.dart @@ -0,0 +1,247 @@ +/** + * Created with Android Studio. + * User: 一晟 + * Date: 2019/1/12 + * Time: 下午9:19 + * email: zhu.yan@alibaba-inc.com + */ +import 'package:flutter/material.dart'; +//import 'package:flutter_rookie_book/model/collection_general.dart'; +//import 'package:flutter_rookie_book/model/collection_general.dart'; + + +const disclaimerText1 = '\r\r\r\r\r\r本APP属于个人的非赢利性开源项目,以供开源社区使用,凡本APP转载的所有的文章 、图片、音频、视频文件等资料的版权归版权所有人所有,本APP采用的非本站原创文章及图片等内容无法一一和版权者联系,如果本网所选内容的文章作者及编辑认为其作品不宜上网供大家浏览,或不应无偿使用请及时用电子邮件或电话通知我们,以迅速采取适当措施,避免给双方造成不必要的经济损失。'; +const disclaimerText2 = '\n\r\r\r\r\r\r对于已经授权本APP独家使用并提供给本站资料的版权所有人的文章、图片等资料,如需转载使用,需取得本站和版权所有人的同意。本APP所刊发、转载的文章,其版权均归原作者所有,如其他媒体、网站或个人从本网下载使用,请在转载有关文章时务必尊重该文章的著作权,保留本网注明的“稿件来源”,并自负版权等法律责任。'; + + +class DisclaimerMsg extends StatefulWidget { + final State pWidget; + DisclaimerMsg({ Key key, this.pWidget }) : super(key: key); + DisclaimerMsgState createState() => DisclaimerMsgState(); +} + +class DisclaimerMsgState extends State { + var _valBool = false; + var _page; + //CollectionControlModel _collectionControl = new CollectionControlModel(); + //List _collectionList = []; + // void init(BuildContext context) { + // Toast.show(context: context, message: "👉 APP免责声明",cb:showAlertDialog); + // } + + @override + void initState() { + super.initState(); +// _collectionList.clear(); +// _collectionControl.getAllCollection().then((resultList) { +// resultList.forEach((item) { +// _collectionList.add(item); +// print('=============db=========${item}'); +// }); +// }); + _page = widget.pWidget; + } + + + + void refs(bool value){ + if(this.mounted){ + setState(() { + _valBool=value; + _page.save(value); + }); + +// _collectionControl +// .insert(CollectionGeneral(key: 'disclaimer', values: value.toString())) +// .then((result) { +// print('result2====${result}'); +// } +// ); + } + } + + void showAlertDialog(BuildContext context) { +// new Future.delayed(Duration(seconds: 5)).then((value) { +// Navigator.of(context).pop(); +// }); + showDialog( + context: context, + barrierDismissible: false, // user must tap button! + builder: (BuildContext context) { + return AlertDialog( + title: Text('免责声明'), + content: SingleChildScrollView( + child: ListBody( + children: [ + Text(disclaimerText1), + Text(disclaimerText2), + ], + ), + ), + shape:RoundedRectangleBorder(borderRadius: new BorderRadius.circular(20.0)), // 圆角 + actions: [ + Container( + width: 270, + alignment: Alignment.centerLeft, + padding: new EdgeInsets.fromLTRB(0.0, 0.0, 30.0, 0.0), + child: + Row( + mainAxisAlignment:MainAxisAlignment.spaceAround, + //crossAxisAlignment:CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment:MainAxisAlignment.center, + children: [ + Checkbox( + activeColor: Theme.of(context).primaryColor, + tristate:false, + value: _valBool, + onChanged: (bool bol) { + refs(bol); + Navigator.of(context).pop(); // here I pop to avoid multiple Dialogs + showAlertDialog(context); //here i call the same function + } + ), + Text('不再显示',style:TextStyle(fontSize: 14)), + ], + ), + new Flexible( + flex: 1, + child: Container(width: 100,) + ), + FlatButton( + child: Text('知道了',style:TextStyle(fontSize: 16,color: Colors.white)), + color: Theme.of(context).primaryColor, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ] +// SizedBox( +// width:150, +// height:55, +// child: CheckboxListTile( +// title: Text('不再显示',style:TextStyle(fontSize: 14)), +// controlAffinity: ListTileControlAffinity.leading, +// activeColor: Colors.red, +// value: _valBool, +// onChanged: (bool value) { +// refs(value); +// Navigator.of(context).pop(); // here I pop to avoid multiple Dialogs +// showAlertDialog(context); //here i call the same function +// } +// ) +// //secondary: const Icon(Icons.hourglass_empty), +// ), +// Checkbox( +// activeColor: Colors.red, +// tristate:false, +// value: _valBool, +// onChanged: (bool bol) { +// refs(bol); +// Navigator.of(context).pop(); // here I pop to avoid multiple Dialogs +// showAlertDialog(context); //here i call the same function +// } +// ), +// Text('不再显示',style:TextStyle(fontSize: 14)), +// FlatButton( +// child: Text('知道了',style:TextStyle(fontSize: 16,color: Colors.green)), +// onPressed: () { +// Navigator.of(context).pop(); +// }, +// ), +// ], + ) + )], + ); + }, + ); + } + Widget build(BuildContext context) { + return new GestureDetector( + onTap: () { + showAlertDialog(context); + }, + child: Stack( + //alignment: const Alignment(1.6, 1.6), + children: [ + new Container( + width:90.0, + alignment: Alignment.center, + decoration: new BoxDecoration( + borderRadius:new BorderRadius.horizontal(right: Radius.circular(10)), + color: Colors.black45, + ), + child: new Text( + '🔔 免责声明', + style: new TextStyle( + fontSize: 14.0, + //fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ], + ) + ); + } + + Widget build2(BuildContext context) { + return Container( + padding: new EdgeInsets.all(0.0), + alignment:Alignment.centerRight, + child:FlatButton( + //padding: new EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0), + child: new Text( + '👉 APP免责声明', + style: new TextStyle( + fontSize: 12.0, //textsize + color: Colors.black54, // textcolor + ), + ), + //color: Theme.of(context).accentColor, + color: Theme.of(context).accentColor, + //elevation: 0.0,//shadow + //splashColor: Colors.blueGrey, + onPressed: () { + showAlertDialog(context); + //Toast.show(context: context, message: "👉 APP免责声明",cb:showAlertDialog); + }) + ); + } +} + +class Toast { + static void show({@required BuildContext context, @required String message,Function cb}) { + //创建一个OverlayEntry对象 + OverlayEntry overlayEntry = new OverlayEntry(builder: (context) { + return new Positioned( + top: MediaQuery.of(context).size.height * 0.12, + right:5.0, + child:RaisedButton( + padding: new EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + child: new Text( + '👉 APP免责声明', + style: new TextStyle( + fontSize: 14.0, //textsize + color: Colors.black54, // textcolor + ), + ), + //color: Theme.of(context).accentColor, + color: Colors.red, + //elevation: 0.0,//shadow + //splashColor: Colors.blueGrey, + onPressed: () { + if(cb is Function){ + cb(context); + } + }) + ); + }); + //往Overlay中插入插入OverlayEntry + Overlay.of(context).insert(overlayEntry); + new Future.delayed(Duration(seconds: 2)).then((value) { + //overlayEntry.remove(); + }); + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index a85aaa6c..de235248 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -121,12 +121,12 @@ class _MyHomePageState extends State return list .map((item) => new MaterialSearchResult( - value: item.name, - text: item.name, - onTap: () { - onWidgetTap(item, context); - }, - )) + value: item.name, + text: item.name, + onTap: () { + onWidgetTap(item, context); + }, + )) .toList(); } else { return null; @@ -163,7 +163,7 @@ class _MyHomePageState extends State child: new TabBar( controller: controller, indicatorColor: - Theme.of(context).primaryColor, //tab标签的下划线颜色 + Theme.of(context).primaryColor, //tab标签的下划线颜色 // labelColor: const Color(0xFF000000), indicatorWeight: 3.0, labelColor: Theme.of(context).primaryColor, @@ -184,11 +184,11 @@ class _MyHomePageState extends State } } - // void _onDataChange(val) { - // if (this.mounted) { - // setState(() { - // data = val; - // }); - // } - // } +// void _onDataChange(val) { +// if (this.mounted) { +// setState(() { +// data = val; +// }); +// } +// } } diff --git a/lib/model/collection_general.dart b/lib/model/collection_general.dart new file mode 100644 index 00000000..9e23674d --- /dev/null +++ b/lib/model/collection_general.dart @@ -0,0 +1,69 @@ +/** + * Created with Android Studio. + * User: 一晟 + * Date: 2019/1/12 + * Time: 下午9:19 + * email: zhu.yan@alibaba-inc.com + */ +import 'dart:async'; +import '../common/sql.dart'; + +abstract class CollectionInterface { + String get key; + String get values; +} + +class CollectionGeneral implements CollectionInterface { + String key; + String values; + + CollectionGeneral({this.key, this.values}); + + factory CollectionGeneral.fromJSON(Map json){ + return CollectionGeneral(key: json['name'],values: json['values']); + } + + Object toMap() { + return {'key': key, 'values': values}; + } +} + +class CollectionControlModel { + final String table = 'collectionGeneral'; + Sql sql; + + CollectionControlModel() { + sql = Sql.setTable(table); + } + + // 获取所有的收藏 + + // 插入新收藏 + Future insert(CollectionGeneral collection) { + var result = + sql.insert({'key': collection.key, 'values': collection.values}); + return result; + } + + // 获取全部的收藏 + Future> getAllCollection() async { + List list = await sql.getByCondition(); + List resultList = []; + list.forEach((item){ + print(item); + resultList.add(CollectionGeneral.fromJSON(item)); + }); + return resultList; + } + + // 通过收藏名获取router + Future getRouterByName(String key) async { + List list = await sql.getByCondition(conditions: {'key': key}); + return list; + } + + // 删除 + Future deleteByName(String key) async{ + return await sql.delete(key,'key'); + } +} diff --git a/lib/views/first_page.dart b/lib/views/first_page.dart index d183770d..c31df0a2 100644 --- a/lib/views/first_page.dart +++ b/lib/views/first_page.dart @@ -4,8 +4,12 @@ import 'package:flutter_rookie_book/common/list_view_item.dart'; import 'package:flutter_rookie_book/components/list_refresh.dart' as listComp; import 'package:flutter_rookie_book/components/pagination.dart'; import 'package:flutter_rookie_book/components/first_page_item.dart'; +import 'package:flutter_rookie_book/components/disclaimer_msg.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import '../common/net_utils.dart'; +GlobalKey key; + class FirstPage extends StatefulWidget { @override FirstPageState createState() => new FirstPageState(); @@ -13,13 +17,52 @@ class FirstPage extends StatefulWidget { class FirstPageState extends State with AutomaticKeepAliveClientMixin{ - @override - bool get wantKeepAlive => true; + bool get wantKeepAlive => true; + + save(bool flag) async{ + //print('=============save=========$flag'); + SharedPreferences prefs = await SharedPreferences.getInstance(); + prefs.setString('disclaimer', flag.toString()); + } + + Future get() async { + var value; + SharedPreferences prefs = await SharedPreferences.getInstance(); + value = prefs.getString('disclaimer'); + return value; + } @override void initState() { super.initState(); + if(key == null) { + //print('=============111=========${key}'); + delayed(); + } + key = GlobalKey(); + + } + + /* + * 判断是否需要弹出免责声明,已经勾选过不在显示,就不会主动弹 + * */ + Future delayed() async { + await new Future.delayed(const Duration(seconds: 1)); +// if (this.mounted) { +// setState(() { +// print('test=======>${key.currentState}'); +// key.currentState.showAlertDialog(context); +// //key.currentState.init(context); +// }); +// } + Future flag = get(); + flag.then((String value) { + //print('=============get=========$value'); + if(value.toString() == 'false'){ // 如果没有勾选下次开启 + key.currentState.showAlertDialog(context); + } + }); } Future getIndexListData([Map params]) async { @@ -52,7 +95,6 @@ class FirstPageState extends State with AutomaticKeepAliveClientMixin var myTitle = '${item.title}'; var myUsername = '${'👲'}: ${item.username} '; var codeUrl = '${item.detailUrl}'; - return new ListViewItem(itemUrl:codeUrl,itemTitle: myTitle,data: myUsername,); } @@ -61,14 +103,21 @@ class FirstPageState extends State with AutomaticKeepAliveClientMixin super.build(context); return new Column( children: [ - new Container( - child: new Pagination(), - ), + new Stack( + //alignment: const FractionalOffset(0.9, 0.1),//方法一 + children: [ + Pagination(), + Positioned(//方法二 + top: 10.0, + left: 0.0, + child: DisclaimerMsg(key:key,pWidget:this) + ), + ]), SizedBox(height: 2, child:Container(color: Theme.of(context).primaryColor)), new Expanded( //child: new List(), child: listComp.ListRefresh(getIndexListData,makeCard) - ), + ) ] ); diff --git a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart index 2592135c..a5e48eb8 100644 --- a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart +++ b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart @@ -34,10 +34,9 @@ const String _CheckboxListTileText2 = """### **进阶用法** > CheckboxListTile 单选和全选的示例 """; - +var valBool = true; class Demo extends StatefulWidget { static const String routeName = '/element/Form/Checkbox/CheckboxListTile'; - final bool valBool = true; @override _DemoState createState() => _DemoState(); } From f4aac4941e0ed15ba354e2e7d04635f42c82008d Mon Sep 17 00:00:00 2001 From: ryan730 Date: Sun, 13 Jan 2019 18:13:38 +0800 Subject: [PATCH 16/27] =?UTF-8?q?Modfiy:=E8=87=AA=E5=8A=A8=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/disclaimer_msg.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/disclaimer_msg.dart b/lib/components/disclaimer_msg.dart index b65a6f2d..2862e3e4 100644 --- a/lib/components/disclaimer_msg.dart +++ b/lib/components/disclaimer_msg.dart @@ -102,7 +102,7 @@ class DisclaimerMsgState extends State { showAlertDialog(context); //here i call the same function } ), - Text('不再显示',style:TextStyle(fontSize: 14)), + Text('不再自动提示',style:TextStyle(fontSize: 14)), ], ), new Flexible( From 5d88d0c088fe417197d4ae7512779c97a8653e10 Mon Sep 17 00:00:00 2001 From: ryan730 Date: Sun, 13 Jan 2019 19:06:08 +0800 Subject: [PATCH 17/27] Modify: checkbosListTile bug --- lib/widgets/elements/Form/CheckBox/CheckboxListTile/demo.dart | 4 ++-- .../elements/Form/CheckBox/CheckboxListTile/index.dart | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/demo.dart b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/demo.dart index bae9572c..ce63afa7 100644 --- a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/demo.dart +++ b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/demo.dart @@ -119,9 +119,9 @@ class CheckboxListTileDefault extends StatelessWidget { return CheckboxListTile( title: Text('一个简单的例子'), activeColor: Colors.red, - value: widget.valBool, + value: widget.valBool['val'], onChanged: (bool value) { - parant.setState(()=> widget.valBool = value); + parant.setState(()=> widget.valBool['val'] = value); }, secondary: const Icon(Icons.hourglass_empty), ); diff --git a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart index a5e48eb8..a38f9cbc 100644 --- a/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart +++ b/lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart @@ -34,9 +34,10 @@ const String _CheckboxListTileText2 = """### **进阶用法** > CheckboxListTile 单选和全选的示例 """; -var valBool = true; + class Demo extends StatefulWidget { static const String routeName = '/element/Form/Checkbox/CheckboxListTile'; + final Map valBool = {'val':true}; @override _DemoState createState() => _DemoState(); } From 0a3bd9bd1159acc364fa2c66e37a1d92699467e5 Mon Sep 17 00:00:00 2001 From: "sanfan.hx" Date: Sun, 13 Jan 2019 19:57:50 +0800 Subject: [PATCH 18/27] grid view --- .../components/Grid/GridView/index.dart | 38 +++++++++++++++++-- lib/widgets/components/Grid/index.dart | 7 +++- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/lib/widgets/components/Grid/GridView/index.dart b/lib/widgets/components/Grid/GridView/index.dart index 45b75165..dac9fcd2 100644 --- a/lib/widgets/components/Grid/GridView/index.dart +++ b/lib/widgets/components/Grid/GridView/index.dart @@ -12,12 +12,41 @@ import 'demo.dart'; const String _Text0 = """ ### **简介** -> GridView 通常用来做GridTile的header与footer组件; +> GridView在移动端上非常的常见的滚动列表, 会占满给出的空间区域. ### **基本用法** -> 1231 +> 创建一个列表 + +属性介绍 + +- scrollDirection:滚动的方向,有垂直和水平两种,默认为垂直方向(Axis.vertical)。 + +- reverse:默认是从上或者左向下或者右滚动的,这个属性控制是否反向,默认值为false,不反向滚动。 + +- controller:控制child滚动时候的位置。 + +- primary:是否是与父节点的PrimaryScrollController所关联的主滚动视图。 + +- physics:滚动的视图如何响应用户的输入。 + +- shrinkWrap:滚动方向的滚动视图内容是否应该由正在查看的内容所决定。 + +- padding:四周的空白区域。 + +- gridDelegate:控制GridView中子节点布局的delegate。 + +- cacheExtent:缓存区域。 + +### **进阶用法** + +> GridView 提供其他四种构造方法 + +- GridView.builder +- GridView.custom +- GridView.count +- GridView.extent """; @@ -33,11 +62,14 @@ class _DemoState extends State { @override Widget build(BuildContext context) { return WidgetDemo( - title: 'GridTileBar', + title: 'GridView', codeUrl: 'components/Grid/GridView/demo.dart', contentList: [ _Text0, GridTileDemo(), + SizedBox( + height: 100.0, + ) ], docUrl: 'https://docs.flutter.io/flutter/material/GridView-class.html', ); diff --git a/lib/widgets/components/Grid/index.dart b/lib/widgets/components/Grid/index.dart index 0cc69956..4b109f8b 100644 --- a/lib/widgets/components/Grid/index.dart +++ b/lib/widgets/components/Grid/index.dart @@ -10,7 +10,7 @@ import "package:flutter/material.dart"; import '../../../model/widget.dart'; import 'GridTile/index.dart' as GridTile; - +import 'GridView/index.dart' as GridView; import 'GridTileBar/index.dart' as GridTileBar; List widgetPoints = [ WidgetPoint( @@ -22,5 +22,10 @@ List widgetPoints = [ name: 'GridTileBar', routerName: GridTileBar.Demo.routeName, buildRouter: (BuildContext context) => GridTileBar.Demo(), + ), + WidgetPoint( + name: 'GridView', + routerName: GridView.Demo.routeName, + buildRouter: (BuildContext context) => GridView.Demo(), ) ]; From 640e12c9bf4cdd091c20d2254a136b610ff79cd3 Mon Sep 17 00:00:00 2001 From: "yifeng.yl" Date: Sun, 13 Jan 2019 20:57:32 +0800 Subject: [PATCH 19/27] =?UTF-8?q?refactor:=E5=88=A0=E9=99=A4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=EF=BC=9ATabBarView?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/app.db | Bin 53248 -> 53248 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/app.db b/assets/app.db index d0b148d04a2aaacfd04ca10834e76ad24b19f067..275ce7889962f34946efddc102dccf71d0d271e3 100644 GIT binary patch delta 87 zcmV-d0I2_fpaX!Q1CSd5!jT+90m89hq#pr!lLa7;la?Tdvl}6f3;_a@sx4Rq4kiE$ tvj#5yF$yyQSpW~v50(#XlMrBJvvOcx3jqeR(rYvW1ONa4X0r-!_F&|?8+!l% delta 92 zcmV-i0HgnapaX!Q1CSd5!I2z80l~3gq#pr#lLa7;0uBO`lpu$*9U+Vi0SJ?-Em#Bv y0|5cE1}^?F3^V~*01wa)mJe(X29pk8WV3W&T?+v?v(jrc0|YQ!2>`PSZ}wm*BpcBH From 2e4c0bebc96c39f5ae211edbdf20b97248d2a6c2 Mon Sep 17 00:00:00 2001 From: "yifeng.yl" Date: Sun, 13 Jan 2019 21:11:14 +0800 Subject: [PATCH 20/27] refactor:modified db --- assets/app.db | Bin 53248 -> 53248 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/app.db b/assets/app.db index 275ce7889962f34946efddc102dccf71d0d271e3..08c3142f56c0e43894b001a1da94fb6a8a2e79cd 100644 GIT binary patch delta 228 zcmZozz}&Ead4e?Kv57LyjK?-6ERkm{pUkQ-Y4Ti!IQ9e{Fr1_)yIE4viJO;$VHU$I zc4j6fhItJ0HfQKKFf#GJn!HNaL4c2mK`0>sNb Q*)Puu#0c2jlUI@m0G#4QF8}}l delta 187 zcmZozz}&Ead4e?Kp@}lijE6QRERkodoXn~)iS--r2i{kcrzylwW>%D%%&*9?Sys`G zn^%Bg7Q-x_1q>VvGZ|)X&d_mSWa49*yh_(WfR&k%F(Cm&#>a!m&A)U%2r|yy{Muep zfQy+wn1O#ge+_@|Wj1d8-+~$&m7;Ywh mw#}EaHJDiZ5;z$q|I77Zv55yV{PL_={NgwnHuvO}Bmw|i=QiB{ From 2c2b7e7cd70ef21599aa89f910b47353bfc907d9 Mon Sep 17 00:00:00 2001 From: "yifeng.yl" Date: Sun, 13 Jan 2019 21:20:23 +0800 Subject: [PATCH 21/27] refactor:modified db --- assets/app.db | Bin 53248 -> 53248 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/app.db b/assets/app.db index 08c3142f56c0e43894b001a1da94fb6a8a2e79cd..a59b04be9eebb3f68acc42592a396850da90e3d8 100644 GIT binary patch delta 97 zcmV-n0G|JVpaX!Q1CSd5$B`UE0mrdmq#prxlLa8yliwg70br6L9kUrBuL~3m*Z>Fs zi~x)W0|Ej7ivWuaFaQX%+$<mb?VBrG-1lyBUWQGI>1OPj;-((?c D=lC8q delta 110 zcmZozz}&Ead4e?Kv57LyjK?-6ERkm{pUkRogYm}XI|}lX85LzVODeAC7U4Bu;9%%s z=wWAOVq)lK=myc7@91b4Ga5{0O$g$@%`$_9jd?56K_)52`;7B8rzN~)W@2ZV9GcR` OV$sOOx%qyIVm1IhbRfR~ From 095387f2d1349e49a85117d26baaa2112548decb Mon Sep 17 00:00:00 2001 From: "sanfan.hx" Date: Sun, 13 Jan 2019 21:30:04 +0800 Subject: [PATCH 22/27] =?UTF-8?q?feat(=E5=8A=A0=E5=85=A5GridPaper&SliverGr?= =?UTF-8?q?id):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Grid/GridPaper/demo.dart | 62 ++++++++++++++++++ .../components/Grid/GridPaper/index.dart | 44 +++++++++++++ .../components/Grid/SliverGrid/demo.dart | 63 +++++++++++++++++++ .../components/Grid/SliverGrid/index.dart | 54 ++++++++++++++++ lib/widgets/components/Grid/index.dart | 12 ++++ 5 files changed, 235 insertions(+) create mode 100644 lib/widgets/components/Grid/GridPaper/demo.dart create mode 100644 lib/widgets/components/Grid/GridPaper/index.dart create mode 100644 lib/widgets/components/Grid/SliverGrid/demo.dart create mode 100644 lib/widgets/components/Grid/SliverGrid/index.dart diff --git a/lib/widgets/components/Grid/GridPaper/demo.dart b/lib/widgets/components/Grid/GridPaper/demo.dart new file mode 100644 index 00000000..5a0f17e8 --- /dev/null +++ b/lib/widgets/components/Grid/GridPaper/demo.dart @@ -0,0 +1,62 @@ +/** + * Created with Android Studio. + * User: 三帆 + * Date: 07/01/2019 + * Time: 10:31 + * email: sanfan.hx@alibaba-inc.com + * tartget: xxx + */ + +import 'package:flutter/material.dart'; + + +class GridPaperDemo extends StatefulWidget { + _Demo createState() => _Demo(); +} + +class _Demo extends State { + + + Widget build(BuildContext context) { + return Container( + height: 400, + color: Color(0xffc91b3a), + child: new GridView.count( + crossAxisCount: 2, + mainAxisSpacing: 10.0, + crossAxisSpacing: 4.0, + padding: const EdgeInsets.all(4.0), + childAspectRatio: 1.3, + children: [ + GridTile( + header: GridTileBar( + title: Text('title'), + subtitle: Text('subtitle'), + leading: Icon(Icons.add), + trailing: Text("trailing"), + ), + child: Container(), + + ), + GridPaper( + color: Colors.red, + child: new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + ), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + new Image.network('https://flutter.io/assets/homepage/news-2-599aefd56e8aa903ded69500ef4102cdd8f988dab8d9e4d570de18bdb702ffd4.png', scale: 1, fit: BoxFit.cover), + ], + ) + ); + } +} diff --git a/lib/widgets/components/Grid/GridPaper/index.dart b/lib/widgets/components/Grid/GridPaper/index.dart new file mode 100644 index 00000000..1044d44a --- /dev/null +++ b/lib/widgets/components/Grid/GridPaper/index.dart @@ -0,0 +1,44 @@ +/** + * Created with Android Studio. + * User: 三帆 + * Date: 07/01/2019 + * Time: 10:26 + * email: sanfan.hx@alibaba-inc.com + * tartget: xxx + */ +import '../../../../common/widget_demo.dart'; +import 'package:flutter/material.dart'; +import 'demo.dart'; + +const String _Text0 = """ +### **简介** +> GridViewPaper是GridView中的item的一种展现形式, 会在上层浮现一层网络. + +"""; + + + +class Demo extends StatefulWidget { + static const String routeName = '/components/Grid/GridPaper'; + + @override + _DemoState createState() => _DemoState(); +} + +class _DemoState extends State { + @override + Widget build(BuildContext context) { + return WidgetDemo( + title: 'GridPaper', + codeUrl: 'components/Grid/GridPaper/demo.dart', + contentList: [ + _Text0, + GridPaperDemo(), + SizedBox( + height: 100.0, + ) + ], + docUrl: 'https://docs.flutter.io/flutter/material/GridPaper-class.html', + ); + } +} diff --git a/lib/widgets/components/Grid/SliverGrid/demo.dart b/lib/widgets/components/Grid/SliverGrid/demo.dart new file mode 100644 index 00000000..8950e17f --- /dev/null +++ b/lib/widgets/components/Grid/SliverGrid/demo.dart @@ -0,0 +1,63 @@ +/** + * Created with Android Studio. + * User: 三帆 + * Date: 07/01/2019 + * Time: 10:31 + * email: sanfan.hx@alibaba-inc.com + * tartget: xxx + */ + +import 'package:flutter/material.dart'; + + +class SliverGridDemo extends StatefulWidget { + _Demo createState() => _Demo(); +} + +class _Demo extends State { + + Widget showCustomScrollView() { + return new CustomScrollView( + slivers: [ + new SliverGrid( + gridDelegate: new SliverGridDelegateWithMaxCrossAxisExtent( + maxCrossAxisExtent: 200.0, + mainAxisSpacing: 10.0, + crossAxisSpacing: 10.0, + childAspectRatio: 4.0, + ), + delegate: new SliverChildBuilderDelegate( + (BuildContext context, int index) { + return new Container( + alignment: Alignment.center, + color: Colors.cyan[100 * (index % 5)], + child: new Text('grid item $index'), + ); + }, + childCount: 20, + ), + ), +// new SliverFixedExtentList( +// itemExtent: 100.0, +// delegate: new SliverChildBuilderDelegate( +// (BuildContext context, int index) { +// return new Container( +// alignment: Alignment.center, +// color: Colors.lightBlue[100 * (index % 9)], +// child: new Text('list item $index'), +// ); +// }, +// ), +// ), + ], + ); + } + + Widget build(BuildContext context) { + return Container( + height: 400, + color: Color(0xffc91b3a), + child: showCustomScrollView() + ); + } +} diff --git a/lib/widgets/components/Grid/SliverGrid/index.dart b/lib/widgets/components/Grid/SliverGrid/index.dart new file mode 100644 index 00000000..6b8c2a6a --- /dev/null +++ b/lib/widgets/components/Grid/SliverGrid/index.dart @@ -0,0 +1,54 @@ +/** + * Created with Android Studio. + * User: 三帆 + * Date: 07/01/2019 + * Time: 10:26 + * email: sanfan.hx@alibaba-inc.com + * tartget: xxx + */ +import '../../../../common/widget_demo.dart'; +import 'package:flutter/material.dart'; +import 'demo.dart'; + +const String _Text0 = """ +### **简介** +> SliverGrid 将多个item以每行二个的形式, 进行排列. + +### **基本用法** + +> 创建 + +在排列列表时,将基于现有的小部件, 延迟创建可见子项的元素、状态和呈现对象。 也就是只有视口中的元素, 才会被创建, 类似于我们网页中的懒加载. + +> 销毁 + +当元素滚动到视图之外时,关联的元素子树、状态和渲染对象将被销毁, 进入视觉窗口的元素将以懒加载的形式进行创建。 + +"""; + + + +class Demo extends StatefulWidget { + static const String routeName = '/components/Grid/SliverGrid'; + + @override + _DemoState createState() => _DemoState(); +} + +class _DemoState extends State { + @override + Widget build(BuildContext context) { + return WidgetDemo( + title: 'SliverGrid', + codeUrl: 'components/Grid/GridPaper/demo.dart', + contentList: [ + _Text0, + SliverGridDemo(), + SizedBox( + height: 100.0, + ) + ], + docUrl: 'https://docs.flutter.io/flutter/material/SliverGrid-class.html', + ); + } +} diff --git a/lib/widgets/components/Grid/index.dart b/lib/widgets/components/Grid/index.dart index 4b109f8b..f2f4b06c 100644 --- a/lib/widgets/components/Grid/index.dart +++ b/lib/widgets/components/Grid/index.dart @@ -12,6 +12,8 @@ import '../../../model/widget.dart'; import 'GridTile/index.dart' as GridTile; import 'GridView/index.dart' as GridView; import 'GridTileBar/index.dart' as GridTileBar; +import 'GridPaper/index.dart' as GridPaper; +import 'SliverGrid/index.dart' as SliverGrid; List widgetPoints = [ WidgetPoint( name: 'GridTile', @@ -27,5 +29,15 @@ List widgetPoints = [ name: 'GridView', routerName: GridView.Demo.routeName, buildRouter: (BuildContext context) => GridView.Demo(), + ), + WidgetPoint( + name: 'GridPaper', + routerName: GridPaper.Demo.routeName, + buildRouter: (BuildContext context) => GridPaper.Demo(), + ), + WidgetPoint( + name: 'SliverGrid', + routerName: SliverGrid.Demo.routeName, + buildRouter: (BuildContext context) => SliverGrid.Demo(), ) ]; From 051d765d139149a80816d64a7d63cb205e6d1c61 Mon Sep 17 00:00:00 2001 From: "xiaojia22326@163.com" Date: Sun, 13 Jan 2019 21:51:27 +0800 Subject: [PATCH 23/27] add some input describe --- lib/widgets/components/Bar/AppBar/index.dart | 2 +- lib/widgets/components/Card/Card/index.dart | 2 +- .../components/Chip/ChipThemeData/index.dart | 2 +- .../components/Dialog/AboutDialog/index.dart | 7 ++++--- .../components/Dialog/AlertDialog/index.dart | 14 +++++--------- lib/widgets/components/Dialog/Dialog/index.dart | 7 ++----- .../components/Dialog/SimpleDialog/index.dart | 3 +++ .../components/Menu/PopupMenuButton/index.dart | 2 +- .../Navigation/BottomNavigationBar/index.dart | 4 ++-- 9 files changed, 20 insertions(+), 23 deletions(-) diff --git a/lib/widgets/components/Bar/AppBar/index.dart b/lib/widgets/components/Bar/AppBar/index.dart index 3b821ee8..eda42fc0 100644 --- a/lib/widgets/components/Bar/AppBar/index.dart +++ b/lib/widgets/components/Bar/AppBar/index.dart @@ -16,7 +16,7 @@ import './demo.dart' as AppBarDemo; const String _Text0 = """### **简介** > AppBar “应用栏” -- 应用栏由工具栏和可能的其他 widget 组成,例如 TabBar和FlexibleSpaceBar; +- 应用栏由工具栏组成,或者是工具栏和其他 widget 组合形成,例如 TabBar和FlexibleSpaceBar; - 应用栏通常用于 Scaffold.appBar 属性,该属性将应用栏放置在屏幕顶部的固定高度小部件中; - 对于可滚动的应用栏,请参阅SliverAppBar,它将AppBar嵌入 sliver 中以便在CustomScrollView中使用; """; diff --git a/lib/widgets/components/Card/Card/index.dart b/lib/widgets/components/Card/Card/index.dart index 45e490fa..0ee2d452 100644 --- a/lib/widgets/components/Card/Card/index.dart +++ b/lib/widgets/components/Card/Card/index.dart @@ -16,7 +16,7 @@ import './demo.dart' as CardDemo; const String _Text0 = """### **简介** > Card “卡片” -- 卡片是用于表示一些相关信息的一张材料,例如相册,地理位置,用餐,联系方式等 +- 卡片用于表示一些相关信息,例如相册,地理位置,用餐,联系方式等 """; diff --git a/lib/widgets/components/Chip/ChipThemeData/index.dart b/lib/widgets/components/Chip/ChipThemeData/index.dart index 11cef164..908b4c6f 100644 --- a/lib/widgets/components/Chip/ChipThemeData/index.dart +++ b/lib/widgets/components/Chip/ChipThemeData/index.dart @@ -17,7 +17,7 @@ const String content0 = ''' const String content1 = ''' ### **基本用法** - 创建ChipThemeData最简单的方法是使用copyWith您从得到一个ChipTheme.of, -或创建一个全新的一个具有 ChipThemeData..fromDefaults。。 +或创建一个全新的一个具有 ChipThemeData..fromDefaults '''; class Demo extends StatefulWidget { diff --git a/lib/widgets/components/Dialog/AboutDialog/index.dart b/lib/widgets/components/Dialog/AboutDialog/index.dart index 47d1bfca..6b88c60c 100644 --- a/lib/widgets/components/Dialog/AboutDialog/index.dart +++ b/lib/widgets/components/Dialog/AboutDialog/index.dart @@ -13,12 +13,13 @@ import 'demo.dart'; const String _Text0 = """ ### **简介** > AboutDialog 通常用于传递企业或者app的官方信息 - +- 这个对话框包含应用程序的图标,名称,版本号,版权和应用程序使用到的软件许可证的按钮 ### **基本用法** - -> 通常作为子窗口小部件传递给showDialog,后者显示对话框。 +> 要显示的AboutDialog,使用showAboutDialog。 +- 如果应用程序具有Drawer,则AboutListTile可以使显示AboutDialog的过程更简单。 +- AboutDialog通过showAboutDialog 显示按钮调用 showLicensePage。 """; diff --git a/lib/widgets/components/Dialog/AlertDialog/index.dart b/lib/widgets/components/Dialog/AlertDialog/index.dart index 4022860c..e9364564 100644 --- a/lib/widgets/components/Dialog/AlertDialog/index.dart +++ b/lib/widgets/components/Dialog/AlertDialog/index.dart @@ -12,18 +12,14 @@ import 'demo.dart'; const String _Text0 = """ ### **简介** -> AlertDialog 向用户传递信息的弹出层。 - - +> AlertDialog 向用户传递信息的弹出层。警报对话框 +- 一般使用在通知用户需要确认的情况,具有可选标题和可选的操纵列表。标题显示在上方,操纵内容显示在内容区域,即下方 ### **基本用法** - > 通常作为子窗口小部件传递给showDialog,后者显示对话框。 - -当**AlertDialog**的的元素过多过长时, 请优先考虑**SingleChildScrollView** 用来避免内容溢出 - - - +- 当**AlertDialog**的的元素过多过长时, 请优先考虑**SingleChildScrollView** 用来避免内容溢出 +- 需要注意的是,由于AlertDialog 通常使用child的大小来调整自身大小,所以使用一些widget(如ListView,GridView和CustomScrollView)将无法正常工作 +- 当需要给用户提供多个选项的供选择时,请使用SimpleDialog """; diff --git a/lib/widgets/components/Dialog/Dialog/index.dart b/lib/widgets/components/Dialog/Dialog/index.dart index 268802f1..626cdc92 100644 --- a/lib/widgets/components/Dialog/Dialog/index.dart +++ b/lib/widgets/components/Dialog/Dialog/index.dart @@ -12,17 +12,14 @@ import 'demo.dart'; const String _Text0 = """ ### **简介** -> AlertDialog 向用户传递信息的弹出层。 - -这个组件没有任何可操作的选项. 相比使用这个组件, 通常我们更喜欢使用 **AlertDialog**或者**SimpleDialog** +> Dialog 向用户传递信息的弹出层。 +-这个组件没有任何可操作的选项. 相比使用这个组件, 通常我们更喜欢使用 **AlertDialog**或者**SimpleDialog** ### **基本用法** - > 通常作为子窗口小部件传递给showDialog,后者显示对话框。 - """; const String _Text1 = """ diff --git a/lib/widgets/components/Dialog/SimpleDialog/index.dart b/lib/widgets/components/Dialog/SimpleDialog/index.dart index 641b9e5a..4f607d73 100644 --- a/lib/widgets/components/Dialog/SimpleDialog/index.dart +++ b/lib/widgets/components/Dialog/SimpleDialog/index.dart @@ -13,12 +13,15 @@ import 'demo.dart'; const String _Text0 = """ ### **简介** > SimpleDialog 是一个用于向用户传递确定信息并提供选项的弹出层 +- SimpleDialog 可为用户提供多个选项选择。有一个可选的标题,显示在选项上方 ### **基本用法** > 通常作为子窗口小部件传递给showDialog,后者显示对话框。 +- 选择通常使用SimpleDialogOption表示 +- 对于通知用户情况的对话框,请考虑使用 AlertDialog。 """; diff --git a/lib/widgets/components/Menu/PopupMenuButton/index.dart b/lib/widgets/components/Menu/PopupMenuButton/index.dart index 61466760..ae6b45e9 100644 --- a/lib/widgets/components/Menu/PopupMenuButton/index.dart +++ b/lib/widgets/components/Menu/PopupMenuButton/index.dart @@ -12,7 +12,7 @@ const String content0 = ''' ### **简介** > 一个提供菜单栏弹出对话框的按钮 - 点击的时候弹出菜单栏对话框,当选择其中一项后会调用 onSelected方法。传递其所选的菜单项的值 -- 可以提供child子widget或者一个icon给它,但是并不能两者都提供 +- 可以提供一个child widget或者提供一个icon给它,但是并不能两者都提供 - 如果什么都没有提供给 PopupMenuButton ,则会根据运行平台创建一个overflow icon '''; diff --git a/lib/widgets/components/Navigation/BottomNavigationBar/index.dart b/lib/widgets/components/Navigation/BottomNavigationBar/index.dart index e38bdfd4..d5241c19 100644 --- a/lib/widgets/components/Navigation/BottomNavigationBar/index.dart +++ b/lib/widgets/components/Navigation/BottomNavigationBar/index.dart @@ -15,7 +15,7 @@ import './demo.dart' as BottomNavigationBarDemo; const String _text0 = """### **简介** -> BottomNavigationBar “底部导航栏”, +> BottomNavigationBar “底部导航栏” - 显示在应用程序底部的导航栏,由文本标签,图标或两者形式的多个项目组成; - 它提供了应用程序顶级视图之间的快速导航; """; @@ -26,7 +26,7 @@ const String _text1 = > BottomNavigationBar 底部导航栏通常与Scaffold结合使用 - 它作为 Scaffold.bottomNavigationBar 参数; - BottomNavigationBar 支持0-4个之间个底部按钮数量,超出4个系统将会报异常; -- 默认0-3个底部按钮数量时,BottomNavigationBar采用fixed的模式摆放底部按钮,当超过4个时默认使用 BottomNavigationBarType.shifting 模式摆放底部按钮; +- 默认0-3个底部按钮数量时,BottomNavigationBar采用fixed的模式摆放底部按钮,当有4个时默认使用 BottomNavigationBarType.shifting 模式摆放底部按钮; - 下面的底部导航即是效果; """; From b43cd20deb78447ddb2e7134f9f21e11b24fb4be Mon Sep 17 00:00:00 2001 From: ryan730 Date: Sun, 13 Jan 2019 23:54:16 +0800 Subject: [PATCH 24/27] =?UTF-8?q?Modfiy:=20=E9=A6=96=E9=A1=B5=20=E8=BD=AE?= =?UTF-8?q?=E6=92=AD=E5=9B=BE=20=E4=B8=8D=E7=BD=AE=E9=A1=B6=20=E5=85=8D?= =?UTF-8?q?=E8=B4=A3=20=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/disclaimer_msg.dart | 34 ++++++++++++++++------ lib/components/list_refresh.dart | 10 +++++-- lib/views/first_page.dart | 45 ++++++++++++++++++++++-------- 3 files changed, 66 insertions(+), 23 deletions(-) diff --git a/lib/components/disclaimer_msg.dart b/lib/components/disclaimer_msg.dart index 2862e3e4..999056f1 100644 --- a/lib/components/disclaimer_msg.dart +++ b/lib/components/disclaimer_msg.dart @@ -69,15 +69,33 @@ class DisclaimerMsgState extends State { barrierDismissible: false, // user must tap button! builder: (BuildContext context) { return AlertDialog( - title: Text('免责声明'), - content: SingleChildScrollView( - child: ListBody( - children: [ - Text(disclaimerText1), - Text(disclaimerText2), - ], + //title: Text('免责声明'), + content:SingleChildScrollView( + child: ListBody( + children: [ + Container( + padding: EdgeInsets.fromLTRB(5.0, 5.0, 10.0, 10.0), + //width: 100, + height: 35, + child: Text('免责声明',style:TextStyle(fontSize: 18,fontWeight:FontWeight.w700 )), + decoration: BoxDecoration( + //color: Colors.blue, + image: DecorationImage( + fit: BoxFit.fitWidth, + image: AssetImage('assets/images/paimaiLogo.png') + ), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + //alignment: Alignment.bottomRight, + ) + ), + SizedBox(height:20), + Text(disclaimerText1), + Text(disclaimerText2), + ], + ), ), - ), shape:RoundedRectangleBorder(borderRadius: new BorderRadius.circular(20.0)), // 圆角 actions: [ Container( diff --git a/lib/components/list_refresh.dart b/lib/components/list_refresh.dart index 32c11d71..6a8cd00a 100644 --- a/lib/components/list_refresh.dart +++ b/lib/components/list_refresh.dart @@ -11,8 +11,9 @@ import 'package:flutter/material.dart'; class ListRefresh extends StatefulWidget { final renderItem; final requestApi; + final headerView; - const ListRefresh([this.requestApi, this.renderItem]) : super(); + const ListRefresh([this.requestApi, this.renderItem, this.headerView]) : super(); @override State createState() => _ListRefreshState(); @@ -167,7 +168,11 @@ class _ListRefreshState extends State { itemCount: items.length + 1, itemBuilder: (context, index) { if (index == 0 && index != items.length) { - return Container(height: 0); + if(widget.headerView is Function){ + return widget.headerView(); + }else { + return Container(height: 0); + } } if (index == items.length) { //return _buildLoadText(); @@ -178,7 +183,6 @@ class _ListRefreshState extends State { if (widget.renderItem is Function) { return widget.renderItem(index, items[index]); } - //return makeCard(index,items[index]); } }, controller: _scrollController, diff --git a/lib/views/first_page.dart b/lib/views/first_page.dart index c31df0a2..59ffe0db 100644 --- a/lib/views/first_page.dart +++ b/lib/views/first_page.dart @@ -98,25 +98,46 @@ class FirstPageState extends State with AutomaticKeepAliveClientMixin return new ListViewItem(itemUrl:codeUrl,itemTitle: myTitle,data: myUsername,); } - @override - Widget build(BuildContext context) { - super.build(context); - return new Column( + headerView(){ + return + Column( + children: [ + Stack( + //alignment: const FractionalOffset(0.9, 0.1),//方法一 children: [ - new Stack( - //alignment: const FractionalOffset(0.9, 0.1),//方法一 - children: [ Pagination(), Positioned(//方法二 - top: 10.0, - left: 0.0, - child: DisclaimerMsg(key:key,pWidget:this) + top: 10.0, + left: 0.0, + child: DisclaimerMsg(key:key,pWidget:this) ), ]), - SizedBox(height: 2, child:Container(color: Theme.of(context).primaryColor)), + SizedBox(height: 1, child:Container(color: Theme.of(context).primaryColor)), + SizedBox(height: 10), + ], + ); + + } + + @override + Widget build(BuildContext context) { + super.build(context); + return new Column( + children: [ +// new Stack( +// //alignment: const FractionalOffset(0.9, 0.1),//方法一 +// children: [ +// Pagination(), +// Positioned(//方法二 +// top: 10.0, +// left: 0.0, +// child: DisclaimerMsg(key:key,pWidget:this) +// ), +// ]), +// SizedBox(height: 2, child:Container(color: Theme.of(context).primaryColor)), new Expanded( //child: new List(), - child: listComp.ListRefresh(getIndexListData,makeCard) + child: listComp.ListRefresh(getIndexListData,makeCard,headerView) ) ] From fa3bec4bf1aa6e1cdd359b559de1040f6d257def Mon Sep 17 00:00:00 2001 From: ryan730 Date: Mon, 14 Jan 2019 01:02:29 +0800 Subject: [PATCH 25/27] =?UTF-8?q?Modify:=20List=20=E5=8A=A0=20header=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/pagination.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/components/pagination.dart b/lib/components/pagination.dart index 2793882d..67cde6f6 100644 --- a/lib/components/pagination.dart +++ b/lib/components/pagination.dart @@ -18,8 +18,6 @@ class Pagination extends StatelessWidget { const Icon(Icons.language, semanticLabel: 'Language'), ]; - final List bannerStories = []; - final List arr = [ {'image': 'https://img.alicdn.com/tfs/TB1W4hMAwHqK1RjSZJnXXbNLpXa-519-260.jpg', 'type': 0, 'id': 9695909, 'url': 'https://www.zhihu.com/question/294145797/answer/551162834', 'title': '为什么阿里巴巴、腾讯和 Google 之类的企业都在使用 Flutter 开发 App?'}, {'image': 'https://img.alicdn.com/tfs/TB1XmFIApzqK1RjSZSgXXcpAVXa-720-338.jpg', 'type': 0, 'id': 9695859, 'url': 'https://zhuanlan.zhihu.com/p/51696594', 'title': 'Flutter 1.0 正式发布: Google 的便携 UI 工具包'}, @@ -37,6 +35,7 @@ class Pagination extends StatelessWidget { List _pageSelector(BuildContext context) { List list = []; + List bannerStories = []; /// super.initState(); arr.forEach((item) { bannerStories.add(StoryModel.fromJson(item)); @@ -55,6 +54,7 @@ class Pagination extends StatelessWidget { Widget build(BuildContext context) { return Column( + key:Key('__header__'), //physics: AlwaysScrollableScrollPhysics(), //padding: EdgeInsets.only(), children: _pageSelector(context) From 2464c39a7a24990fd8321c1b4d8d65106e51b83a Mon Sep 17 00:00:00 2001 From: "sanfan.hx" Date: Mon, 14 Jan 2019 14:36:04 +0800 Subject: [PATCH 26/27] temp --- lib/components/pagination.dart | 2 +- lib/components/search_input.dart | 36 +++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/lib/components/pagination.dart b/lib/components/pagination.dart index 2793882d..474d239e 100644 --- a/lib/components/pagination.dart +++ b/lib/components/pagination.dart @@ -24,7 +24,7 @@ class Pagination extends StatelessWidget { {'image': 'https://img.alicdn.com/tfs/TB1W4hMAwHqK1RjSZJnXXbNLpXa-519-260.jpg', 'type': 0, 'id': 9695909, 'url': 'https://www.zhihu.com/question/294145797/answer/551162834', 'title': '为什么阿里巴巴、腾讯和 Google 之类的企业都在使用 Flutter 开发 App?'}, {'image': 'https://img.alicdn.com/tfs/TB1XmFIApzqK1RjSZSgXXcpAVXa-720-338.jpg', 'type': 0, 'id': 9695859, 'url': 'https://zhuanlan.zhihu.com/p/51696594', 'title': 'Flutter 1.0 正式发布: Google 的便携 UI 工具包'}, {'image': 'https://img.alicdn.com/tfs/TB1mClCABLoK1RjSZFuXXXn0XXa-600-362.jpg', 'type': 0, 'id': 96956491409, 'url':'https://zhuanlan.zhihu.com/p/53497167','title': 'Flutter 示范应用现已开源 — 万物起源(The History of Everything)'}, - {'image': 'https://img.alicdn.com/tfs/TB1fXxIAAvoK1RjSZFNXXcxMVXa-600-362.jpg', 'type': 0, 'id': 9695816, 'url': 'https://mp.weixin.qq.com/s?__biz=MzAwODY4OTk2Mg==&mid=2652048101&idx=1&sn=20296088e4bd8ca33c5c9991167d9f7d&chksm=808caaa0b7fb23b65c0e5806209f8d86da6732f3a00a70353f3606018339518b0a8656f14dc5&mpshare=1&scene=2&srcid=0106SZapVysZdIS6Oc5AhNH6&from=timeline&ascene=2&devicetype=android-27&version=27000038&nettype=WIFI&abtest_cookie=BQABAAgACgALABMAFAAFAJ2GHgAjlx4AV5keAJuZHgCcmR4AAAA%3D&lang=zh_CN&pass_ticket=4K1%2FUpsxP4suPj2iubR17wbAP7r9LW9iYrPAC2dppTqv7j7JO5FWMXtcKeBRxueV&wx_header=1', 'title': 'Flutter 与 Material Design 双剑合璧,助您构建精美应用'} + {'image': 'https://img.alicdn.com/tfs/TB1fXxIAAvoK1RjSZFNXXcxMVXa-600-362.jpg', 'type': 0, 'id': 9695816, 'url': 'https://mp.weixin.qq.com/s?__biz=MzAwODY4OTk2Mg==&mid=2652048101&idx=1&sn=20296088e4bd8ca33c5c9991167d9f7d&chksm=808caaa0b7fb23b65c0e5806209f8d86da6732f3a00a70353f3606018339518b0a8656f14dc5&mpsshare=1&scene=2&srcid=0106SZapVysZdIS6Oc5AhNH6&from=timeline&ascene=2&devicetype=android-27&version=27000038&nettype=WIFI&abtest_cookie=BQABAAgACgALABMAFAAFAJ2GHgAjlx4AV5keAJuZHgCcmR4AAAA%3D&lang=zh_CN&pass_ticket=4K1%2FUpsxP4suPj2iubR17wbAP7r9LW9iYrPAC2dppTqv7j7JO5FWMXtcKeBRxueV&wx_header=1', 'title': 'Flutter 与 Material Design 双剑合璧,助您构建精美应用'} ]; void _launchURL(String url) async { diff --git a/lib/components/search_input.dart b/lib/components/search_input.dart index 36155575..a62bce1e 100644 --- a/lib/components/search_input.dart +++ b/lib/components/search_input.dart @@ -159,7 +159,9 @@ class _MaterialSearchState extends State { _resultsTimer?.cancel(); } Widget buildBody(List results) { - if (_loading) { + if (_criteria.isEmpty) { + return History(); + } else if (_loading) { return new Center( child: new Padding( padding: const EdgeInsets.only(top: 50.0), @@ -396,3 +398,35 @@ class SearchInput extends StatelessWidget { } } // wigdet干掉.=> componets + + +class History extends StatefulWidget { + const History() : super(); + + @override + _History createState() => _History(); +} + +/* +* AppBar 默认的实例,有状态 +* */ +class _History extends State { + + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return new Center( + child: Text('这是一个即将完善的历史记录的面板'), + ); + } +} \ No newline at end of file From c94fab68b616b6f79bdf608462504cbd4dc6bce3 Mon Sep 17 00:00:00 2001 From: "sanfan.hx" Date: Mon, 14 Jan 2019 14:50:23 +0800 Subject: [PATCH 27/27] feat(add search history board;): --- lib/components/search_input.dart | 36 +++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/lib/components/search_input.dart b/lib/components/search_input.dart index 36155575..a62bce1e 100644 --- a/lib/components/search_input.dart +++ b/lib/components/search_input.dart @@ -159,7 +159,9 @@ class _MaterialSearchState extends State { _resultsTimer?.cancel(); } Widget buildBody(List results) { - if (_loading) { + if (_criteria.isEmpty) { + return History(); + } else if (_loading) { return new Center( child: new Padding( padding: const EdgeInsets.only(top: 50.0), @@ -396,3 +398,35 @@ class SearchInput extends StatelessWidget { } } // wigdet干掉.=> componets + + +class History extends StatefulWidget { + const History() : super(); + + @override + _History createState() => _History(); +} + +/* +* AppBar 默认的实例,有状态 +* */ +class _History extends State { + + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return new Center( + child: Text('这是一个即将完善的历史记录的面板'), + ); + } +} \ No newline at end of file