diff --git a/.ci/Dockerfile b/.ci/Dockerfile
new file mode 100644
index 00000000..eb7247dc
--- /dev/null
+++ b/.ci/Dockerfile
@@ -0,0 +1,30 @@
+FROM cirrusci/flutter:stable
+
+RUN sudo apt-get update -y
+
+RUN sudo apt-get install -y --no-install-recommends gnupg
+
+# Add repo for gcloud sdk and install it
+RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \
+ sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
+
+RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
+ sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
+
+RUN sudo apt-get update && sudo apt-get install -y google-cloud-sdk && \
+ gcloud config set core/disable_usage_reporting true && \
+ gcloud config set component_manager/disable_update_check true
+
+RUN yes | sdkmanager \
+ "platforms;android-29" \
+ "build-tools;29.0.2" \
+ "extras;google;m2repository" \
+ "extras;android;m2repository"
+
+RUN yes | sdkmanager \
+ "platforms;android-28" \
+ "build-tools;28.0.3" \
+ "extras;google;m2repository" \
+ "extras;android;m2repository"
+
+RUN yes | sdkmanager --licenses
diff --git a/.cirrus.yml b/.cirrus.yml
new file mode 100644
index 00000000..8ddb027e
--- /dev/null
+++ b/.cirrus.yml
@@ -0,0 +1,32 @@
+task:
+ use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == ''
+ container:
+ dockerfile: .ci/Dockerfile
+ cpu: 8
+ memory: 16G
+ pub_cache:
+ folder: ~/.pub-cache
+ setup_script:
+ - flutter channel stable
+ - flutter upgrade
+ build_script:
+ - flutter build apk
+ test_script: flutter test
+
+task:
+ use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
+ osx_instance:
+ #image: mojave-xcode-10.2-flutter
+ image: mojave-flutter
+ pub_cache:
+ folder: ~/.pub-cache
+ setup_script:
+ - pod repo update
+ - flutter channel stable
+ - flutter upgrade
+ create_simulator_script:
+ - xcrun simctl list
+ - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-12-2 | xargs xcrun simctl boot
+ build_script:
+ - flutter build ios --no-codesign
+ test_script: flutter test
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/.gitignore b/.gitignore
index e99c7b82..bdc2c7bc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,7 +20,7 @@
# IntelliJ related
-*.iml
+
*.ipr
*.iws
.idea/
diff --git a/CHANGE-LOG.md b/CHANGE-LOG.md
index a625fbfe..88b73e46 100644
--- a/CHANGE-LOG.md
+++ b/CHANGE-LOG.md
@@ -1,86 +1,358 @@
## 更新日志
-
+#### 8/28/2019
+ - [x] Modify: IsOpen 的移步判断
+ - [x] Update index.md
+ - [x] Update index.dart
+#### 5/28/2019
+ - [x] change:async master
+ - [x] modfiy:应用商店
+ - [x] Merge pull request #222 from DeckeDeng/develop
+ - [x] add home scaffold
+#### 8/22/2019
+ - [x] Merge pull request #322 from alibaba/beta
+ - [x] Modify: web view 方法回退
+ - [x] Merge pull request #321 from alibaba/beta
+ - [x] Merge pull request #317 from alibaba/beta
+ - [x] Merge branch 'master' into beta
+ - [x] Update contribute.md
+#### 8/12/2019
+ - [x] update: doc & tpl
+ - [x] Update tpl.md
+ - [x] Merge pull request #313 from Nealyang/beta
+ - [x] 添加登陆错误提醒
+#### 3/11/2019
+ - [x] Update README-en.md
+#### 8/15/2019
+ - [x] update: router path
+ - [x] ci
+ - [x] update: view remote code
+ - [x] 整理文件
+#### 8/13/2019
+ - [x] Modify
+ - [x] Modfiy:
+ - [x] update: page issue template
+#### 8/1/2019
+ - [x] merge code
+#### 7/29/2019
+ - [x] Merge branch 'master' of github.com:alibaba/flutter-go into beta
+ - [x] delete .github no use file
+ - [x] docs(update: pr template):
+ - [x] del: no use file
+ - [x] Merge branch 'master' of github.com:alibaba/flutter-go
+ - [x] docs(add widget about issue):
+ - [x] Merge branch 'temp' into beta
+ - [x] 迁移位置
+ - [x] update: template
+ - [x] update: 处理合并导致的总理2
+#### 8/7/2019
+ - [x] fix bug
+ - [x] Merge pull request #302 from Nealyang/beta
+ - [x] remove get collection
+ - [x] tep
+ - [x] update: 完成markdown动态更新
+#### 8/8/2019
+ - [x] remove user appBar
+ - [x] bottomBar 添加个人中心
+ - [x] Merge pull request #309 from DeckeDeng/beta2
+ - [x] ios project.pbxproj
+ - [x] Merge pull request #308 from DeckeDeng/beta2
+ - [x] Merge pull request #304 from Nealyang/beta
+ - [x] 修改 ios 配置文件
+ - [x] update: 临时增加code-review页
+#### 6/28/2019
+ - [x] Merge pull request #264 from DeckeDeng/beta2
+ - [x] Merge pull request #263 from DeckeDeng/beta2
+ - [x] Merge branch 'beta' into beta2
+ - [x] 消息反馈页面
+#### 2/1/2019
+ - [x] Merge branch 'develop' of https://github.com/alibaba/flutter-go into develop
+ - [x] feat:android splash
+ - [x] feat:add android splash
+ - [x] Merge pull request #116 from hanxu317317/develop
+ - [x] docs(更新Readme中环境信息):
+ - [x] Merge pull request #115 from hanxu317317/develop
+ - [x] feat(首页欢迎图, 加入第一次访问判断.):
+ - [x] Merge branch 'develop' into sptil
+ - [x] update: ios启动图描述
+ - [x] fix:yaml
+ - [x] fix:
+ - [x] Merge pull request #113 from hanxu317317/develop
+ - [x] fix:mtl buidl apk test
+ - [x] refactor(conflict):
+ - [x] add sp
+ - [x] fix(解决由于flutter 版本问题导致的报错):
+ - [x] fix:back
+ - [x] fix:package err
+ - [x] fix:modify github package name fail and test
+ - [x] fix:build before modify package's name
+#### 7/12/2019
+ - [x] Merge pull request #279 from Nealyang/beta
+ - [x] add
+ - [x] d
+#### 8/6/2019
+ - [x] issuse message
+ - [x] Merge pull request #294 from Nealyang/beta
+ - [x] 修改为线上地址
+ - [x] 个人中心、收藏、搜索
+#### 7/25/2019
+ - [x] Merge branch 'beta' of github.com:alibaba/flutter-go
+#### 7/23/2019
+ - [x] zefyr
+#### 7/22/2019
+ - [x] feature:个人设置
+#### 7/15/2019
+ - [x] appstore 反馈错误
+ - [x] readme错误
+ - [x] 标题错误,跳转错误
+#### 7/11/2019
+ - [x] update: 迁移新老数据结构与收藏
+ - [x] update: 增加环境配置. 挂载在application静态属性上
+ - [x] update: 修改文章
+#### 4/8/2019
+ - [x] flutter project switch ios or android by androidstudio
+ - [x] android permission
+ - [x] remove extra files
+#### 6/18/2019
+ - [x] 推送,ios/android,test
+#### 6/15/2019
+ - [x] 删除node相关
+ - [x] Merge branch 'develop' of github.com:alibaba/flutter-common-widgets-app into web
+ - [x] update: 完善demo
+ - [x] update: 界面增加title属性
+ - [x] add: cli使用说明
+#### 6/11/2019
+ - [x] update: 替换markdown包引入方式
+ - [x] add: 加入标准page模板
+ - [x] 加入标准page
+ - [x] 加入初始化demo
+ - [x] 引入三方flutter_markdown gi
+#### 6/10/2019
+ - [x] Merge pull request #249 from Nealyang/beta
+ - [x] 添加收藏功能
+ - [x] update: 标准化代码.
+ - [x] goCli 完成90%
+#### 6/4/2019
+ - [x] markdown
+ - [x] 加入初始gocli
+ - [x] add page demo
+ - [x] 增加page的统一入口
+ - [x] add demos packges
+ - [x] Merge pull request #240 from Nealyang/beta
+ - [x] 退出登陆、feedback 测试
+#### 5/31/2019
+ - [x] 添加个人中心
+#### 5/30/2019
+ - [x] 首页不刷新
+ - [x] Merge pull request #1 from forever-713/zuston-patch-1
+ - [x] Fix App name error
+#### 5/29/2019
+ - [x] 添加 github oAuth 认证,添加错误提醒
+#### 5/23/2019
+ - [x] readme.md
+ - [x] Merge pull request #219 from weikx/develop
+ - [x] Merge pull request #215 from DeckeDeng/develop
+ - [x] delete firstPage
+ - [x] de
+ - [x] Test:测试分支
+ - [x] Merge branch 'develop' of https://github.com/weikx/flutter-go into develop
+ - [x] Change word 'Free' into 'Three'
+ - [x] Chang word 'Free' into 'Three'
+#### 5/17/2019
+ - [x] Merge pull request #216 from alibaba/master
+#### 5/14/2019
+ - [x] update version
+#### 2/3/2019
+ - [x] fix(解决ios报错):
+ - [x] Merge pull request #119 from Nealyang/master
+ - [x] fix:fix code conflic
+ - [x] fix: code conflict
+ - [x] Merge branch 'develop' into master
+ - [x] fix:view code
+ - [x] Merge pull request #118 from alibaba/dev/yisheng
+#### 5/9/2019
+ - [x] test version
+#### 5/7/2019
+ - [x] merge origin
+ - [x] add update test
+ - [x] Merge branch 'develop' of github.com:alibaba/flutter-go
+ - [x] cookie 校验
+ - [x] modify home.dart bottom tab
+ - [x] session 验证
+ - [x] merge develop
+ - [x] 登陆
+ - [x] Merge pull request #205 from alibaba/dev/sanl
+ - [x] modify bottom tab
+ - [x] delete ios file
+ - [x] add apk
+ - [x] Login 登陆界面
+#### 5/6/2019
+ - [x] add login
+#### 5/1/2019
+ - [x] Modfiy: 改造业内资讯页面
+#### 4/30/2019
+ - [x] Add:二期开发-重构首页布局
+ - [x] gradle 4.10.2 包添加AndroidX配置
+#### 2/19/2019
+ - [x] packagename
+ - [x] Merge pull request #148 from alibaba/dev/yisheng
+ - [x] refactor:按照代码规范调整import 文件
+ - [x] update: 规范
+ - [x] Merge pull request #147 from Nealyang/master
+ - [x] fix:修复TabBar demo
+ - [x] Merge pull request #146 from Nealyang/master
+ - [x] refactor: 根据规范重构代码
+ - [x] Merge pull request #145 from alibaba/dev/yisheng
+ - [x] refactor:按照代码规范调整markdow解析
+ - [x] refactor(规范化代码):
+ - [x] Merge pull request #143 from Nealyang/master
+ - [x] refactor:按规范修改代码、注释等
+ - [x] Merge pull request #142 from Nealyang/master
+ - [x] commit
+ - [x] Merge pull request #141 from Nealyang/master
+ - [x] Merge pull request #140 from Nealyang/master
+ - [x] Merge pull request #135 from hanxu317317/develop
+ - [x] Merge branch 'develop' into develop
+ - [x] Merge pull request #139 from Nealyang/master
+ - [x] Merge branch 'develop' of github.com:alibaba/flutter-common-widgets-app
+ - [x] refactor:根据规范,重构代码
+ - [x] modify code comments
+ - [x] Merge pull request #138 from alibaba/dev/yisheng
+ - [x] refactor:按照代码规范调整注释文件
+#### 4/29/2019
+ - [x] test app store
+ - [x] Merge branch 'master' into dev/sanl
+ - [x] 修改bug
+#### 4/26/2019
+ - [x] Debug: GoogleService-Info.plist 位置问题 导致错误
+ - [x] change LICENSE date
+ - [x] 变更许可
+ - [x] Merge pull request #189 from alibaba/develop
+ - [x] change License
+#### 4/22/2019
+ - [x] release apk
+ - [x] Merge pull request #192 from alibaba/dev/yisheng
+ - [x] 格式化
+ - [x] Merge pull request #191 from alibaba/dev/yisheng
+ - [x] Delete:删除 .gradle 文件夹
+ - [x] Merge pull request #188 from alibaba/dev/yisheng
+#### 4/17/2019
+ - [x] gridView 网格效果 图片流
+ - [x] 添加渐变效果/网络图片覆盖图层渲染/图片填充
+#### 1/31/2019
+ - [x] Merge pull request #112 from alibaba/dev/yisheng
+ - [x] Debug:canvas 路由问题
+ - [x] Merge pull request #111 from alibaba/dev/yisheng
+ - [x] feat: Canvas 细化各种方法
+ - [x] add file
+ - [x] fix:code
+ - [x] feat(加入启动图, 时间2秒):
+#### 4/12/2019
+ - [x] update: 修改错字
+ - [x] Merge pull request #180 from alibaba/develop
+ - [x] add: doc roadmap
+#### 4/1/2019
+ - [x] remove recruit
+ - [x] move recruit
+#### 3/31/2019
+ - [x] 增加模板
+ - [x] Create pull_request_template.md
+ - [x] Delete .github
+ - [x] Create .github
+ - [x] Merge pull request #173 from alibaba/master
+#### 2/2/2019
+ - [x] fix: 部分代码添加 mounted
+ - [x] Merge pull request #117 from alibaba/dev/yisheng
+ - [x] fix:修复Canvas组件收藏的bug
+#### 2/20/2019
+ - [x] 同步文件
+ - [x] Merge pull request #152 from hanxu317317/develop
+ - [x] 更新跳转页方式
+ - [x] modify logo
+ - [x] Merge pull request #149 from hanxu317317/develop
+ - [x] fix(解决返回首页报错的问题):
+#### 2/11/2019
+ - [x] fix: 部分代码 analysis 解决
#### 2019-2-5
- - [x] 处理因为flutter版本导致的项目运行不起来
- - [x] 更新readme, 加入开发日志, 与相关说明
- - [x] 加入 首页欢迎效果图
- - [x] refactor(整理richText的说明):
- - [x] 解决一些页面的code演示打不开的问题
- - [x] add:开发规范
- - [x] add:版本更新历史链接
- - [x] Update README.md
- - [x] add:添加版本号
- - [x] feat:添加代码开发规范
- - [x] refactor(update: version & fiexed warns):
- - [x] fix(solve conflict):
- - [x] modify:toast and andrid apk label
- - [x] Add:自动 pr 工具抓取器,抓取两周前至今的,提交数据,并去重
- - [x] fix:fluttetToast backHome
- - [x] fix:modified the style of toast && remote files
- - [x] chore(删除tools/log.json):
- - [x] 重构文件结构
- - [x] 关于手册图标更换
- - [x] 增加demo: CupertinoNavigationBar CupertinoPageRoute CupertinoPageScaffold CupertinoPicker,CupertinoPopupSurface CupertinoTimerPickerDemo
+- [x] 处理因为flutter版本导致的项目运行不起来
+- [x] 更新readme, 加入开发日志, 与相关说明
+- [x] 加入 首页欢迎效果图
+- [x] refactor(整理richText的说明):
+- [x] 解决一些页面的code演示打不开的问题
+- [x] add:开发规范
+- [x] add:版本更新历史链接
+- [x] Update README.md
+- [x] add:添加版本号
+- [x] feat:添加代码开发规范
+- [x] refactor(update: version & fiexed warns):
+- [x] fix(solve conflict):
+- [x] modify:toast and andrid apk label
+- [x] Add:自动 pr 工具抓取器,抓取两周前至今的,提交数据,并去重
+- [x] fix:fluttetToast backHome
+- [x] fix:modified the style of toast && remote files
+- [x] chore(删除tools/log.json):
+- [x] 重构文件结构
+- [x] 关于手册图标更换
+- [x] 增加demo: CupertinoNavigationBar CupertinoPageRoute CupertinoPageScaffold CupertinoPicker,CupertinoPopupSurface CupertinoTimerPickerDemo
#### 2019-1-24
- - [x] 功能:更新小部件的图标
- - [x] 功能:添加CupertinoTimerPickerDemo
- - [x] 调试:消除警告
- - [x] 修复:关于手册图标更换
- - [x] 添加:文案描述
- - [x] 添加:CupertinoPicker,CupertinoPopupSurface
+- [x] 功能:更新小部件的图标
+- [x] 功能:添加CupertinoTimerPickerDemo
+- [x] 调试:消除警告
+- [x] 修复:关于手册图标更换
+- [x] 添加:文案描述
+- [x] 添加:CupertinoPicker,CupertinoPopupSurface
#### 2019-1-23
- - [x] 修复: 导航栏home返回报错
- - [x] 修复:收集错误
- - [x] 添加:CupertinoNavigationBar CupertinoPageRoute CupertinoPageScaffold
+- [x] 修复: 导航栏home返回报错
+- [x] 修复:收集错误
+- [x] 添加:CupertinoNavigationBar CupertinoPageRoute CupertinoPageScaffold
#### 2019-1-22
- - [x] 功能:在Allsimon拉请求中添加英文简介
+- [x] 功能:在Allsimon拉请求中添加英文简介
#### 2019-1-21
- - [x] 功能:Cupertino的子项
+- [x] 功能:Cupertino的子项
#### 2019-1-20
- - [x] 功能:CupertinoSwitch演示
- - [x] 功能:为搜索列表加入图标
- - [x] 功能:CupertinoSliverRefreshControl演示
- - [x] 功能:CupertinoSliverNavigationBar演示
+- [x] 功能:CupertinoSwitch演示
+- [x] 功能:为搜索列表加入图标
+- [x] 功能:CupertinoSliverRefreshControl演示
+- [x] 功能:CupertinoSliverNavigationBar演示
#### 2019-1-18
- - [x] 更新:SharedPreferences保存数据和android设备布局溢出
- - [x] 功能:添加CupertinoScrollbar演示
- - [x] 功能:第四页暂时用欢迎页替代。后期再开发
+- [x] 更新:SharedPreferences保存数据和android设备布局溢出
+- [x] 功能:添加CupertinoScrollbar演示
+- [x] 功能:第四页暂时用欢迎页替代。后期再开发
#### 2019-1-17
- - [x] 添加:+许可证
+- [x] 添加:+许可证
#### 2019-1-16
- - [x] 转换:将README翻译为En语言环境
- - [x] 功能:CupertinoScrollbar演示
+- [x] 转换:将README翻译为En语言环境
+- [x] 功能:CupertinoScrollbar演示
#### 2019-1-14
- - [x] 添加:增加手册页面
- - [x] 功能:文字演示
- - [x] 重构:修改过的图标
- - [x] 重构:文档,文章,组件收藏,新增webView
- - [x] 重构:修改过的演示
- - [x] 重构:代码视图
- - [x] 更新:版本 和readme.md
- - [x] 修改:添加代码视图
- - [x] 功能:添加搜索历史记录板
- - [x] 修改:列出加标头错误
+- [x] 添加:增加手册页面
+- [x] 功能:文字演示
+- [x] 重构:修改过的图标
+- [x] 重构:文档,文章,组件收藏,新增webView
+- [x] 重构:修改过的演示
+- [x] 重构:代码视图
+- [x] 更新:版本 和readme.md
+- [x] 修改:添加代码视图
+- [x] 功能:添加搜索历史记录板
+- [x] 修改:列出加标头错误
#### 2019-1-15
- - [x] 功能:welcomepage
+- [x] 功能:welcomepage
#### 2019-1-13
- - [x] 添加:一些输入描述
- - [x] 功能:加入GridPaper&SliverGrid
- - [x] 重构:修改db
- - [x] 重构:删除数据库 TabBarView
- - [x] 添加:网格视图
- - [x] 修改:checkbosListTile 错误
- - [x] 修改:自动提示文案
- - [x] 功能:增加免责声明,声明组件,自动弹出,左上角入口
- - [x] 重构:整理数据库初始逻辑,判断数据库完整性,判断是否存在已知的cat,widget,collection 三张表。
- - [x] 修复:DialogDemo,无法关闭的问题
+- [x] 添加:一些输入描述
+- [x] 功能:加入GridPaper&SliverGrid
+- [x] 重构:修改db
+- [x] 重构:删除数据库 TabBarView
+- [x] 添加:网格视图
+- [x] 修改:checkbosListTile 错误
+- [x] 修改:自动提示文案
+- [x] 功能:增加免责声明,声明组件,自动弹出,左上角入口
+- [x] 重构:整理数据库初始逻辑,判断数据库完整性,判断是否存在已知的cat,widget,collection 三张表。
+- [x] 修复:DialogDemo,无法关闭的问题
#### 2019-1-12
- - [x] 修复:icon没有,但内容有的,组件,给补充了icon
- - [x] 修改:1.整理文件 2.修正分析
- - [x] 更新:flutter_rookie_book => flutter_go
- - [x] 更新:更新SearchInput文件名=> search_input
- - [x] 修改:文件名称的大小写规范
- - [x] 修改:修正bottomNavigationBar iconButton警告
+- [x] 修复:icon没有,但内容有的,组件,给补充了icon
+- [x] 修改:1.整理文件 2.修正分析
+- [x] 更新:flutter_rookie_book => flutter_go
+- [x] 更新:更新SearchInput文件名=> search_input
+- [x] 修改:文件名称的大小写规范
+- [x] 修改:修正bottomNavigationBar iconButton警告
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..905b4fab
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,76 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, sex characteristics, gender identity and expression,
+level of experience, education, socio-economic status, nationality, personal
+appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+ advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at zhu.yan@alibaba-inc.com. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see
+https://www.contributor-covenant.org/faq
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..fc13245c
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1 @@
+[Flutter Go 共建](https://github.com/alibaba/flutter-go/blob/master/docs/contribute.md)
diff --git a/README-en.md b/README-en.md
index 7862edad..3f540afd 100644
--- a/README-en.md
+++ b/README-en.md
@@ -1,24 +1,97 @@
-## Flutter Go
+# Flutter Go
+[中文简体](https://github.com/alibaba/flutter-go/blob/master/README.md) | Language: [English](https://github.com/alibaba/flutter-go/blob/master/README-en.md)

-> Help developers get started quickly Flutter **Flutter Go 1.0 Android has been released**
+> Help developers get started quickly Flutter
+## News
+### 🔥 `Flutter Go 2.0` released
+> Flutter Go 2.0 according to [The Flutter-Go Roadmap for 2019](https://github.com/alibaba/flutter-go#the-flutter-go-roadmap%E8%B7%AF%E7%BA%BF%E5%9B%BE-for-2019) beginning of the year, the new feature is:
-## Download URL
+
mark:✔ is this version
-Android download URL:
+- [x] [ `Flutter Go` website ](https://flutter-go.pub/website/) (news,publish,learn)
+- [x] [ `Flutter Go web` ](https://github.com/alibaba/flutter-go/tree/web/flutter-go-web-0.0.1) (web version to learn)
+ - [online preview ](https://flutter-go.pub/flutter_go_web/)
+ - [resource ](https://github.com/alibaba/flutter-go/tree/web/flutter-go-web-0.0.1)
-
+- [x] [ `Flutter Go Widget` `pull request` rules ( the third )](https://github.com/alibaba/flutter-go/blob/master/docs/contribute.md)
-Iphone download URL:
-No
+- [x] user center (yourself `widget`)
+ - login (with `GitHub`)
+ - search (search about `Flutter`)
+ - favorite component (save online)
+ - issues (APP online `ISSUES`)
+ - favorite (APP favorite)
+- [x] [ `go-cli` tool ](https://github.com/alibaba/flutter-go/blob/master/docs/widget.md)
+ - `Flutter Go` `pull request` tools
+ - [ build `Flutter Go Widget` standard template with terminal ](https://github.com/alibaba/flutter-go/blob/beta/docs/widget.md)
+ - `markdown` template (when merge master breach)
+- [x] ` Flutter Go ` `APP` auto upgrade
+- [ ] template sync ( pc, native )
+- [ ] `Flutter Go` store
+
+## Third part build
+
+Because the content of ** flutter ** is updated faster, we can't enrich the content of the project faster, If you are willing to contribute to the development and learning of flutter, please see the [build instructions](https://github.com/alibaba/flutter-go/blob/master/docs/contribute.md) before you start, we will put the builder's avatar and nick to the websit.
+
+## Logs
+
+[resource](https://github.com/alibaba/flutter-go/blob/develop/CHANGE-LOG.md)
+
+## Development specification
+> we are based on the official [dart language specification](https://www.dartlang.org)。
+
+[<< Flutter Go development specification >>](https://github.com/alibaba/flutter-go/blob/develop/Flutter_Go%20%E4%BB%A3%E7%A0%81%E5%BC%80%E5%8F%91%E8%A7%84%E8%8C%83.md)
+
+## The Flutter-Go Roadmap for 2019
+> Considering Flutter's future changes and strategy variability, roadmap does not rule out some adjustments, but overall it will not change much.
+
+
+
+## How to use
+
+- checkout version
+```dart
+ flutter --version
+```
+- run doctor
+```dart
+ flutter doctor
+```
+- start app
+```dart
+ flutter packages get
+ flutter run
+```
+
+- other issues
+ - https://flutterchina.club/setup-macos/
+ - https://flutter.dev/docs/get-started/install/macos
+
+## Release
+
+### Android:
+
+- [Download](https://github.com/alibaba/flutter-go/blob/master/android/app/release/app-release.apk)
+
+### Ios:
+
+- AppStore search "Fluttergo"
## Development Environment
This Project need latest package, please update regularly.
-- dart(version: 2.0.0)
-- flutter(version: v1.0.0)
+```dart
+flutter --version
+dart --version
+pub --version
+
+// Flutter (Channel beta, v1.7.8)
+// Dart VM version: 2.4.0
+// Pub 2.4.0
+```
### Background
@@ -85,4 +158,4 @@ The advantages of Flutter mainly include:
-Powered by Alibaba Auction Front-end Team
+Powered by Alibaba Auction Front-end Team
\ No newline at end of file
diff --git a/README.md b/README.md
index 33ed6406..1f1eae24 100644
--- a/README.md
+++ b/README.md
@@ -1,192 +1,17 @@
-# Flutter Go
-Language: [English](https://github.com/alibaba/flutter-go/blob/master/README-en.md) | [中文简体](https://github.com/alibaba/flutter-go/blob/master/README.md)
+# FlutterGo
-
+感谢大家一直以来对 FlutterGo 的支持与反馈。
-> 一个帮助开发者快速上手的 `APP`
-## 最新动态
-### 🔥 `Flutter Go 2.0` 即将发布
-> Flutter Go 2.0 秉承年初发布的 [The Flutter-Go Roadmap(路线图) for 2019](https://github.com/alibaba/flutter-go#the-flutter-go-roadmap%E8%B7%AF%E7%BA%BF%E5%9B%BE-for-2019) 已经做了新版本的迭代,新版本如下新功能:
-注:✔是本次发布内容
+但是 **由于团队内部组织调整变更**,很遗憾的宣布 FlutterGo 目前**暂停维护**。
-- [x] [ `Flutter Go` 官方网站 ](https://flutter-go.pub/website/) (官方消息,发布,学习)
-- [x] [ `Flutter Go web` 版本](https://github.com/alibaba/flutter-go/tree/web/flutter-go-web-0.0.1) (web 版本学习帮助)
- - [线上预览版 ](https://flutter-go.pub/flutter_go_web/)
- - [项目地址 ](https://github.com/alibaba/flutter-go/tree/web/flutter-go-web-0.0.1)
-- [x] [ `Flutter Go Widget` 的 `pull request` 提交规范(第三方共建)](https://github.com/alibaba/flutter-go/blob/master/docs/contribute.md)
-- [x] 用户中心 (专属个人的`widget`案例)
- - 用户登录(通过`GitHub`账户)
- - 全网搜索 (全网搜索 `Flutter` 资讯)
- - 收藏个人组件(保存到远端)
- - 反馈建议 (APP 在线 `ISSUES`)
- - 分享链接 (APP分享)
-- [x] [ `go-cli` 工具 ](https://github.com/alibaba/flutter-go/blob/master/docs/widget.md)
- - `Flutter Go` 的 `pull request` 工具
- - [命令行 生成 `Flutter Go Widget` 标准公共模版](https://github.com/alibaba/flutter-go/blob/beta/docs/widget.md)
- - `markdown` 模版动态化生成(合并到master分支后)
-- [x] ` Flutter Go ` 官方 `APP` 版本自动升级
-- [ ] 多端模版同步( pc端,native端同步 )
-- [ ] `Flutter Go` store
+但是后期我们会再升级迭代 FlutterGo 新版本,也同时希望更多Flutter爱好者参与加入。
-## 三方共建说明
-
-由于 **flutter** 内容更新较快. 我们无法更快的丰富项目的内容. 如果您愿意为国内flutter的发展与学习贡献自己的力量, 请参考我们的 [共建说明](https://github.com/alibaba/flutter-go/blob/master/docs/contribute.md), 我们会将共建者的头像姓名贡献至我们的官网.
-
-
-
-## 版本更新历史
-> 按时间顺序,展示重要的提交更新内容。
-
-[地址](https://github.com/alibaba/flutter-go/blob/develop/CHANGE-LOG.md)
-
-## 开发规范
-> 由于类似 javascript, java, object-c,等开发者的语言习惯不同而产生歧义,我们依据官方提供的 [dart 语言规范](https://www.dartlang.org) 定制。
-
-[<< Flutter Go 开发规范第一版 >>](https://github.com/alibaba/flutter-go/blob/develop/Flutter_Go%20%E4%BB%A3%E7%A0%81%E5%BC%80%E5%8F%91%E8%A7%84%E8%8C%83.md)
-
-## The Flutter-Go Roadmap(路线图) for 2019
-> 考虑到 Flutter 未来的变化和策略的可变性, roadmap 不排除有一定调整,但总体不会变化太大。
-
-
-
-## 运行方式
-
-- 查看一下版本号是否正确
-```dart
- flutter --version
-```
-- 运行以下命令查看是否需要安装其它依赖项来完成安装
-```dart
- flutter doctor
-```
-- 运行启动您的应用
-```dart
- flutter packages get
- flutter run
-```
-
-- 如果有其他问题,请参考
- - https://flutterchina.club/setup-macos/
- - https://flutter.dev/docs/get-started/install/macos
-
-## Release安装包下载地址
-
-### android正式版,下载地址:
-
-- 华为市场已上线,华为应用市场搜索 "Fluttergo"或者直接[点击下载](https://appstore.huawei.com/search/fluttergo)
-- [直接 apk 文件下载](https://github.com/alibaba/flutter-go/releases/download/0.0.5/app-release.apk)
-
-
-### iphone正式版,下载地址:
-
-- AppStore 搜索 "Fluttergo" 或者直接[点击下载](https://itunes.apple.com/cn/app/flutter-go/id1462026296?mt=8)
-
-
-
-## 基础环境
-本项目环境持续更新. 请定期更新各依赖包.
-
-```dart
-// 运行如下命令
-flutter --version
-dart --version
-pub --version
-
-// 正确环境如下
-// Flutter (Channel beta, v1.7.8)
-// Dart VM version: 2.4.0
-// Pub 2.4.0
-```
-
-
-### 背景
-
-#### Flutter 是什么?
-
-2018年6月21日Google发布Flutter首个release预览版,作为Google 大力推出的一种全新的响应式,跨平台,高性能的移动开发框架。Flutter是一个跨平台的移动UI框架,旨在帮助开发者使用一套代码开发高性能、高保真的Android和iOS应用。
-
-flutter优点主要包括:
-- 跨平台
-- 开源
-- Hot Reload、响应式框架、及其丰富的控件以及开发工具
-- 灵活的界面设计以及控件组合
-- 借助可以移植的GPU加速的渲染引擎以及高性能ARM代码运行时已达到高质量的用户体验
-
-#### Flutter Go 的由来
-
-- Flutter学习资料太少,对于英文不好的同学相对来说比较困难
-- 官网文档示例不够健全,不够直观
-- 各个 widget 的用法各异,属性纷繁,要运行一个 widget 的 demo 往往要到处翻阅各种资料
-
-#### Flutter Go 的优势
-
-- 详解常用 widget 多达 **140+** 个
-- 配套 Demo 详解 widget 常规用法
-- 集中整合 widget 案例,一个 APP 搞定所有常用 widget 的用法
-- 持续迭代 ‘追新’ 官方版本
-
-### app 预览
-
-
-
-
-### Core Team
-
-
-
-### 版权说明
-- 感谢大家对 `flutter go` 的支持和下载,但近期发现,有类似直接被发布到苹果 app store 上的行为,并未注明真实来源,copyright 和 项目的 github 地址,以及开发者的版权相关信息( 包括删除"首页栏的版权声明"和"关于我们"的行为 );
-
-- 上述行为,打击了 `flutter go` 开发者的积极性,同时干扰了 flutter go app 的正常发布渠道,基于 app 开源项目的发布特殊性,特更新 [LICENSE](LICENSE) 「 开源许可证 」,由 MIT 协议 更改为 BSD 协议, 同时建议不要随意发布到公共渠道的应用商店,影响官方 `flutter go` 的app版本迭代;
-
-- 大家可以继续放心的开源使用,但是要求注意和遵守以下许可前提:
-```
- * 版权声明样式
- //Copyright (c) 2018-present, Alibaba Group Holding Limited. All rights reserved.
-
- * 源代码的重新分发必须保留上述版权声明,条件清单和免责声明。
-
- * 二进制形式的再分发必须复制上述版权声明,此条件列表以及文档中的以下免责声明和/或随分发提供的其他材料。
-```
-- 由于本开源项目是供大家学习和交流 flutter 之用,里面耗费了开发人员大量的心血,精力和热情,请尊重开发者的劳动成果,以及相关许可证之规定;
-
-- 大家的互相信任,尊重与支持,才是开源社区前进的动力和来源.
-
-Powered by 阿里拍卖前端团队
-
+- 简历投递 邮箱:yifeng.yl@alibaba-inc.com
+- 钉钉扫码直接连接:
+-
diff --git a/analysis_options.yaml b/analysis_options.yaml
new file mode 100644
index 00000000..25bfbc4e
--- /dev/null
+++ b/analysis_options.yaml
@@ -0,0 +1,45 @@
+analyzer:
+ strong-mode:
+ implicit-casts: false
+ errors:
+ avoid_returning_null_for_future: warning
+ cancel_subscriptions: warning
+ dead_code: warning
+ override_on_non_overriding_method: warning
+ unused_element: warning
+ unused_import: warning
+ avoid_empty_else: warning
+ exclude:
+ - test/**
+linter:
+ rules:
+ - camel_case_types
+ - library_names
+ - library_prefixes
+ - file_names
+ - package_names
+ - non_constant_identifier_names
+ - constant_identifier_names
+ - sort_pub_dependencies
+ - directives_ordering
+ - curly_braces_in_flow_control_structures
+ - slash_for_doc_comments
+ - package_api_docs
+ - public_member_api_docs
+ - comment_references
+ - prefer_adjacent_string_concatenation
+ - prefer_interpolation_to_compose_strings
+ - unnecessary_brace_in_string_interps
+ - prefer_collection_literals
+ - prefer_is_empty
+ - prefer_is_not_empty
+ - prefer_for_elements_to_map_fromIterable
+ - avoid_function_literals_in_foreach_calls
+ - prefer_equal_for_default_values
+ - avoid_init_to_null
+ - unnecessary_getters_setters
+ - unnecessary_this
+ - prefer_initializing_formals
+ - unnecessary_new
+ - unnecessary_await_in_return
+ - avoid_void_async
\ No newline at end of file
diff --git a/docs/needWidget.md b/docs/needWidget.md
new file mode 100644
index 00000000..c17d73e6
--- /dev/null
+++ b/docs/needWidget.md
@@ -0,0 +1,39 @@
+#待加入的组件
+
+以下是flutter go 中缺失的部分组件. 欢迎大家共建.参与方式请看[共建说明](https://github.com/alibaba/flutter-go/blob/master/docs/contribute.md)
+注:✔表明已加入
+
+- [x] Scaffold
+- [ ] Hero
+- [ ] Listener
+- [ ] Safearea
+- [ ] ClipRect
+- [ ] WillPopScope
+- [ ] FutureBuilder
+- [ ] StreamBuilder
+- [ ] Notification
+- [ ] runZoned
+- [ ] IgnorePointer
+- [ ] AbsorbPointer
+- [ ] FlutterLogo
+- [ ] Placeholder
+- [ ] Offstage
+- [ ] Visibility
+- [ ] Baseline
+- [ ] CustomPainter
+- [ ] Border
+- [ ] Wrap
+- [ ] Transform
+- [ ] SingleChildScrollView
+- [ ] Positioned
+- [ ] InheritedWidget
+- [ ] PageView
+- [ ] LayoutBuilder
+- [ ] MediaQuery
+- [ ] RefreshIndicator
+- [ ] Opacity
+- [ ] ExcludeSemantics
+- [ ] DataTable
+- [ ] Tooltip
+- [ ] Form
+- [ ] FormField
\ No newline at end of file
diff --git a/docs/widget.md b/docs/widget.md
index 715b3e85..08fe6492 100644
--- a/docs/widget.md
+++ b/docs/widget.md
@@ -109,7 +109,7 @@ lib/standard_pages/standard_for_slider_sanfan_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b0
当我们的本地功能调试没有问题. 想要申请合并到主分支时.需要按以下流程进行
-1.新建issue, 按照widget page类型模板, 填写需要的相关数据
+1.新建issue, 按照page about类型模板, 填写需要的相关数据

diff --git a/go-cli/src/cli_command_runder.dart b/go-cli/src/cli_command_runder.dart
index 4fea5a2f..5a42f5f8 100644
--- a/go-cli/src/cli_command_runder.dart
+++ b/go-cli/src/cli_command_runder.dart
@@ -1,5 +1,5 @@
import 'dart:async';
-
+import 'dart:io';
import 'package:args/args.dart';
import 'package:args/command_runner.dart';
//import './version.dart';
@@ -20,11 +20,18 @@ class _CommandRunner extends CommandRunner {
addCommand(CreatePageCommand());
addCommand(WatchCommand());
addCommand(Build());
-
}
@override
Future runCommand(ArgResults topLevelResults) async {
+ bool isProject = await Directory('./go-cli').exists();
+ // 防止用户在gocli下运行
+
+ if (!isProject) {
+ print("请在fluttergo项目根目录中运行,而不是go-cli目录中");
+ return 0;
+ }
+
if (topLevelResults['version'] as bool) {
return 0;
}
diff --git a/go-cli/src/command/create_page.dart b/go-cli/src/command/create_page.dart
index aa7b4f62..d3ebdb21 100644
--- a/go-cli/src/command/create_page.dart
+++ b/go-cli/src/command/create_page.dart
@@ -74,7 +74,7 @@ void createPage() async {
// 创建root文件
await createFile(demoPath);
- pageMarkdown = await readeFile("${environmentVars['PWD']}/go-cli/utils/tpl.md");
+ pageMarkdown = await readeFile("go-cli/utils/tpl.md");
writeContent2Path('$demoPath/', 'index.dart', """
String getMd() {
diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh
new file mode 100755
index 00000000..c9c6343b
--- /dev/null
+++ b/ios/Flutter/flutter_export_environment.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+# This is a generated file; do not edit or check into version control.
+export "FLUTTER_ROOT=/Users/xj.deng/development/flutter"
+export "FLUTTER_APPLICATION_PATH=/Users/xj.deng/alibaba/xj_fluttergo/flutter-go"
+export "FLUTTER_TARGET=lib/main.dart"
+export "FLUTTER_BUILD_DIR=build"
+export "SYMROOT=${SOURCE_ROOT}/../build/ios"
+export "FLUTTER_FRAMEWORK_DIR=/Users/xj.deng/development/flutter/bin/cache/artifacts/engine/ios-release"
+export "FLUTTER_BUILD_NAME=1.0.6"
+export "FLUTTER_BUILD_NUMBER=1.0.6"
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 2b500e72..110536b3 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -352,7 +352,7 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
- "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
+ "${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
@@ -553,7 +553,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ CURRENT_PROJECT_VERSION = 125;
DEVELOPMENT_TEAM = 4WLT68XRNA;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -566,11 +566,12 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
+ MARKETING_VERSION = 1.2.5;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.alibaba.fluttergo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
- TARGETED_DEVICE_FAMILY = "1,2";
+ TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
@@ -584,7 +585,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ CURRENT_PROJECT_VERSION = 125;
DEVELOPMENT_TEAM = 4WLT68XRNA;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -597,11 +598,12 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
+ MARKETING_VERSION = 1.2.5;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.alibaba.fluttergo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
- TARGETED_DEVICE_FAMILY = "1,2";
+ TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024*1024@as.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024x1024@as.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/1024*1024@as.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/1024x1024@as.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/120*120@2x-1.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/120x120@2x-1.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/120*120@2x-1.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/120x120@2x-1.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/120*120@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/120x120@2x.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/120*120@2x.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/120x120@2x.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/152*152.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/152x152.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/152*152.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/152x152.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/167*167.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/167x167.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/167*167.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/167x167.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/180*180@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/180x180@3x.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/180*180@3x.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/180x180@3x.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/20*20.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/20x20.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/20*20.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/20x20.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/29*29@1x-2.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/29x29@1x-2.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/29*29@1x-2.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/29x29@1x-2.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/29*29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/29x29@1x.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/29*29@1x.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/29x29@1x.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/40*40@1x-1.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/40x40@1x-1.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/40*40@1x-1.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/40x40@1x-1.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/40*40@1x-2.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/40x40@1x-2.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/40*40@1x-2.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/40x40@1x-2.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/40*40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/40x40@1x.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/40*40@1x.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/40x40@1x.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/58*58@2x-1.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/58x58@2x-1.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/58*58@2x-1.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/58x58@2x-1.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/58*58@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/58x58@2x.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/58*58@2x.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/58x58@2x.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/60*60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/60x60@3x.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/60*60@3x.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/60x60@3x.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/76*76.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/76x76.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/76*76.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/76x76.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/80*80@2x-1.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/80x80@2x-1.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/80*80@2x-1.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/80x80@2x-1.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/80*80@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/80x80@2x.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/80*80@2x.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/80x80@2x.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/87*87.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/87x87.png
similarity index 100%
rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/87*87.png
rename to ios/Runner/Assets.xcassets/AppIcon.appiconset/87x87.png
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
index 7fbfe11e..07cf334f 100644
--- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -3,115 +3,115 @@
{
"size" : "20x20",
"idiom" : "iphone",
- "filename" : "40*40@1x.png",
+ "filename" : "40x40@1x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
- "filename" : "60*60@3x.png",
+ "filename" : "60x60@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
- "filename" : "29*29@1x.png",
+ "filename" : "29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
- "filename" : "58*58@2x.png",
+ "filename" : "58x58@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
- "filename" : "87*87.png",
+ "filename" : "87x87.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
- "filename" : "80*80@2x.png",
+ "filename" : "80x80@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
- "filename" : "120*120@2x.png",
+ "filename" : "120x120@2x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
- "filename" : "120*120@2x-1.png",
+ "filename" : "120x120@2x-1.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
- "filename" : "180*180@3x.png",
+ "filename" : "180x180@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
- "filename" : "20*20.png",
+ "filename" : "20x20.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
- "filename" : "40*40@1x-2.png",
+ "filename" : "40x40@1x-2.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
- "filename" : "29*29@1x-2.png",
+ "filename" : "29x29@1x-2.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
- "filename" : "58*58@2x-1.png",
+ "filename" : "58x58@2x-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
- "filename" : "40*40@1x-1.png",
+ "filename" : "40x40@1x-1.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
- "filename" : "80*80@2x-1.png",
+ "filename" : "80x80@2x-1.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
- "filename" : "76*76.png",
+ "filename" : "76x76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
- "filename" : "152*152.png",
+ "filename" : "152x152.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
- "filename" : "167*167.png",
+ "filename" : "167x167.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
- "filename" : "1024*1024@as.png",
+ "filename" : "1024x1024@as.png",
"scale" : "1x"
}
],
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index c6bb52b8..68c927b9 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -17,23 +17,37 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- $(FLUTTER_BUILD_NAME)
+ $(MARKETING_VERSION)
CFBundleSignature
????
CFBundleVersion
- $(FLUTTER_BUILD_NUMBER)
+ $(CURRENT_PROJECT_VERSION)
LSApplicationCategoryType
LSRequiresIPhoneOS
+ NSAppleMusicUsageDescription
+ Apple音乐
+ NSCalendarsUsageDescription
+ 测试所用相机权限
NSCameraUsageDescription
测试拍照
+ NSContactsUsageDescription
+ 测试所用用户权限
+ NSLocationAlwaysUsageDescription
+ 测试所用地理权限
+ NSLocationWhenInUseUsageDescription
+ 测试所用位置权限
NSMicrophoneUsageDescription
测试麦克风
+ NSMotionUsageDescription
+ 测试所用内存权限
NSPhotoLibraryAddUsageDescription
测试选择图片
NSPhotoLibraryUsageDescription
-
+ 测试所用照片权限
+ NSSpeechRecognitionUsageDescription
+ 测试所用语音识别权限
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
@@ -53,5 +67,7 @@
UIViewControllerBasedStatusBarAppearance
+ kTCCServiceMediaLibrary
+ 测试所用音乐权限
diff --git a/lib/api/api.dart b/lib/api/api.dart
index 748e3422..65c9d0ae 100644
--- a/lib/api/api.dart
+++ b/lib/api/api.dart
@@ -1,36 +1,36 @@
-class Api{
+class Api {
// static const String BASE_URL = 'http://flutter-go.alibaba.net/';
static const String BASE_URL = 'https://flutter-go.pub/api/';
- static const String DO_LOGIN = BASE_URL+'doLogin';//登陆
+ static const String DO_LOGIN = BASE_URL + 'doLogin'; //登陆
- static const String CHECK_LOGIN = BASE_URL+'checkLogin';//验证登陆
-
- static const String LOGOUT = BASE_URL+'logout';//退出登陆
+ static const String CHECK_LOGIN = BASE_URL + 'checkLogin'; //验证登陆
- static const String GET_USER_INFO = BASE_URL+'getUserInfo';//获取用户信息
+ static const String LOGOUT = BASE_URL + 'logout'; //退出登陆
+ static const String GET_USER_INFO = BASE_URL + 'getUserInfo'; //获取用户信息
- static const String VERSION = BASE_URL+'getAppVersion';//检查版本
+ static const String VERSION = BASE_URL + 'getAppVersion'; //检查版本
- static const String FEEDBACK = BASE_URL+'auth/feedback';//建议反馈
+ static const String FEEDBACK = BASE_URL + 'auth/feedback'; //建议反馈
// static const String LOTOUT = BASE_URL+'logout';//退出登陆
- static const String GET_ALL_COLLECTION = BASE_URL+'auth/getAllUserCollection';//获取全部收藏
+ static const String GET_ALL_COLLECTION =
+ BASE_URL + 'auth/getAllUserCollection'; //获取全部收藏
- static const String REMOVE_COLLECTION = BASE_URL+'auth/removeCollection';//移除收藏
+ static const String REMOVE_COLLECTION =
+ BASE_URL + 'auth/removeCollection'; //移除收藏
- static const String ADD_COLLECTION = BASE_URL+'auth/addCollection';//添加收藏
-
- static const String CHECK_COLLECTED = BASE_URL+'checkCollected';//校验收藏
+ static const String ADD_COLLECTION = BASE_URL + 'auth/addCollection'; //添加收藏
- static const String SET_THEMECOLOR = BASE_URL+'auth/setThemeColor';//设置主题颜色
+ static const String CHECK_COLLECTED = BASE_URL + 'checkCollected'; //校验收藏
- static const String GET_THEMECOLOR = BASE_URL +'/getThemeColor';//获取主题颜色
+ static const String SET_THEMECOLOR = BASE_URL + 'auth/setThemeColor'; //设置主题颜色
- static const String GET_WIDGET_TREE = BASE_URL + 'getCateList';//获取widget列表树
+ static const String GET_THEMECOLOR = BASE_URL + '/getThemeColor'; //获取主题颜色
- static const String SEARCH_WIDGET = BASE_URL+'searchWidget';//搜索组件
-}
+ static const String GET_WIDGET_TREE = BASE_URL + 'getCateList'; //获取widget列表树
+ static const String SEARCH_WIDGET = BASE_URL + 'searchWidget'; //搜索组件
+}
diff --git a/lib/blocs/industry_api.dart b/lib/blocs/industry_api.dart
index 7b271ca0..0dac3431 100644
--- a/lib/blocs/industry_api.dart
+++ b/lib/blocs/industry_api.dart
@@ -12,6 +12,7 @@ import 'package:html/parser.dart' show parse;
import './search_result.dart';
var dio = new Dio();
+
//class Api2 {
// /// 关键字提示(起点)
// Future> suggestion(String query) async {
@@ -42,9 +43,11 @@ class Api {
// http.Response response = await http.get(
// "https://www.qidian.com/ajax/Search/AutoComplete?siteid=1&query=$query");
/// var response = await dio.get("https://www.qidian.com/ajax/Search/AutoComplete?siteid=1&query=$query", data: {});
- var response = await dio.get("https://www.so.com/s?ie=utf-8&q=$query flutter");
+ var response =
+ await dio.get("https://www.so.com/s?ie=utf-8&q=$query flutter");
var document = parse(response.data);
var app = document.querySelectorAll('.res-title a');
+
///print('1=====>${query}');
///print('2=====>${response.data}');
////print('3=====>${app}');
@@ -59,11 +62,11 @@ class Api {
);
});
- return Future.delayed(Duration(seconds:2), () {
+ return Future.delayed(Duration(seconds: 2), () {
return res;
});
//return suggestion;
}
}
-Api api = Api();
\ No newline at end of file
+Api api = Api();
diff --git a/lib/blocs/industry_bloc.dart b/lib/blocs/industry_bloc.dart
index 1757f3b4..06a065aa 100644
--- a/lib/blocs/industry_bloc.dart
+++ b/lib/blocs/industry_bloc.dart
@@ -16,8 +16,8 @@ class SuggestionBloc extends Bloc {
@override
SuggestionState get initialState => SuggestionUninitialized();
@override
- Stream mapEventToState(SuggestionEvent event)async* {
- //Stream mapEventToState(SuggestionState currentState, SuggestionEvent event,) async* {
+ Stream mapEventToState(SuggestionEvent event) async* {
+ //Stream mapEventToState(SuggestionState currentState, SuggestionEvent event,) async* {
if (event is SuggestionFetch) {
//print('event==>${event}');
try {
diff --git a/lib/blocs/industry_event.dart b/lib/blocs/industry_event.dart
index b54e7940..e606a24c 100644
--- a/lib/blocs/industry_event.dart
+++ b/lib/blocs/industry_event.dart
@@ -23,4 +23,4 @@ class SuggestionClearFetch extends SuggestionEvent {
@override
String toString() => 'SuggestionClearFetch:清空界面';
-}
\ No newline at end of file
+}
diff --git a/lib/blocs/industry_main.dart b/lib/blocs/industry_main.dart
index fa49fac5..e331babb 100644
--- a/lib/blocs/industry_main.dart
+++ b/lib/blocs/industry_main.dart
@@ -8,6 +8,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import './industry_bloc.dart';
+
/// import './industry_event.dart';
import './industry_state.dart';
@@ -15,7 +16,7 @@ final SuggestionBloc suggestion = SuggestionBloc();
class IndustryPage extends StatefulWidget {
final Function itemTitle;
- IndustryPage({Key key,this.itemTitle}) : super(key: key);
+ IndustryPage({Key key, this.itemTitle}) : super(key: key);
@override
_IndustryState createState() => _IndustryState();
@@ -40,15 +41,13 @@ class _IndustryState extends State {
return Center(
child: Text('没有适合的结果,更换查询条件试试'),
);
- }else {
+ } else {
if (widget.itemTitle is Function) {
return widget.itemTitle(state);
}
}
}
- return Center(
- child: Text('没有适合的结果,更换查询条件试试')
- );
+ return Center(child: Text('没有适合的结果,更换查询条件试试'));
}
@override
@@ -59,7 +58,7 @@ class _IndustryState extends State {
Expanded(
child: BlocBuilder(
bloc: suggestion,
- builder: (BuildContext context, SuggestionState state){
+ builder: (BuildContext context, SuggestionState state) {
/// print('BlocBuilder----${state}');
return renderItem(state);
},
@@ -75,4 +74,4 @@ class _IndustryState extends State {
//suggestion.dispose();//添加这个第二次进入会失灵
super.dispose();
}
-}
\ No newline at end of file
+}
diff --git a/lib/blocs/industry_model.dart b/lib/blocs/industry_model.dart
index 550d29c7..74577c07 100644
--- a/lib/blocs/industry_model.dart
+++ b/lib/blocs/industry_model.dart
@@ -69,4 +69,4 @@ class Data {
data['category'] = this.category;
return data;
}
-}
\ No newline at end of file
+}
diff --git a/lib/blocs/search_result.dart b/lib/blocs/search_result.dart
index bf64d1b1..753619df 100644
--- a/lib/blocs/search_result.dart
+++ b/lib/blocs/search_result.dart
@@ -11,4 +11,4 @@ class SearchResult {
String source;
SearchResult({this.title, this.source});
-}
\ No newline at end of file
+}
diff --git a/lib/components/cate_card.dart b/lib/components/cate_card.dart
index aab9fa48..108a5e76 100644
--- a/lib/components/cate_card.dart
+++ b/lib/components/cate_card.dart
@@ -21,8 +21,6 @@ class _CateCardState extends State {
_firstChildList = widget.category.children;
}
-
-
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
@@ -100,14 +98,11 @@ class _CateCardState extends State {
padding: const EdgeInsets.only(bottom: 10.0, top: 5.0),
decoration: BoxDecoration(
image: DecorationImage(
- image: AssetImage('assets/images/paimaiLogo.png'),
- alignment: Alignment.bottomRight
- ),
+ image: AssetImage('assets/images/paimaiLogo.png'),
+ alignment: Alignment.bottomRight),
),
child: WidgetItemContainer(
- commonItems: this._firstChildList,
- columnCount: 3
- ),
+ commonItems: this._firstChildList, columnCount: 3),
);
}
}
diff --git a/lib/components/category.dart b/lib/components/category.dart
index eee1035e..c6c20ca6 100644
--- a/lib/components/category.dart
+++ b/lib/components/category.dart
@@ -3,18 +3,16 @@ import 'dart:async';
import 'package:flutter/material.dart';
import '../routers/application.dart';
+
/// import '../model/cat.dart';
import '../model/widget.dart';
import '../widgets/index.dart';
import '../components/widget_item_container.dart';
-
-
class CategoryHome extends StatefulWidget {
CategoryHome(this.token);
final String token;
-
@override
_CategoryHome createState() => new _CategoryHome();
}
@@ -26,7 +24,6 @@ class _CategoryHome extends State {
List widgetPoints = [];
List catHistory = new List();
-
// 所有的可用demos;
List widgetDemosList = new WidgetDemoList().getDemos();
@@ -39,26 +36,13 @@ class _CategoryHome extends State {
CommonItem targetGroup = Application.widgetTree.find(widget.token) ?? [];
print("targetGroup::: $targetGroup");
- catHistory.add(
- targetGroup
- );
+ catHistory.add(targetGroup);
this.setState(() {
items = targetGroup.children;
});
searchCatOrWidget();
}
-
-
- Future back() {
-// if (catHistory.length == 1) {
-// return Future.value(true);
-// }
-// catHistory.removeLast();
-// searchCatOrWidget();
- return Future.value(true);
- }
-
void go(CommonItem cat) {
catHistory.add(cat);
searchCatOrWidget();
@@ -66,10 +50,9 @@ class _CategoryHome extends State {
void searchCatOrWidget() async {
/// CommonItem widgetTree = Application.widgetTree;
- // 假设进入这个界面的parent一定存在
+ // 假设进入这个界面的parent一定存在
CommonItem targetGroup = catHistory.last;
-
this.setState(() {
title = targetGroup.name;
});
@@ -79,14 +62,9 @@ class _CategoryHome extends State {
go(cat);
}
-
-
Widget _buildContent() {
- WidgetItemContainer wiContaienr = WidgetItemContainer(
- columnCount: 3,
- commonItems: items
- );
-
+ WidgetItemContainer wiContaienr =
+ WidgetItemContainer(columnCount: 3, commonItems: items);
return Container(
padding: const EdgeInsets.only(bottom: 10.0, top: 5.0),
@@ -102,26 +80,15 @@ class _CategoryHome extends State {
@override
Widget build(BuildContext context) {
-
-
return Scaffold(
appBar: AppBar(
title: Text("$title"),
),
- body: WillPopScope(
-
- onWillPop: () {
- return back();
- },
-
- child: ListView(
- children: [
- _buildContent(),
- ],
- ),
- // child: Container(color: Colors.blue,child: Text('123'),),
+ body: ListView(
+ children: [
+ _buildContent(),
+ ],
),
);
}
}
-
diff --git a/lib/components/disclaimer_msg.dart b/lib/components/disclaimer_msg.dart
index 78ebb0a5..a2383815 100644
--- a/lib/components/disclaimer_msg.dart
+++ b/lib/components/disclaimer_msg.dart
@@ -9,7 +9,6 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
-
const disclaimerText1 =
'\r\r\r\r\r\r本APP属于个人的非赢利性开源项目,以供开源社区使用,凡本APP转载的所有的文章 、图片、音频、视频文件等资料的版权归版权所有人所有,本APP采用的非本站原创文章及图片等内容无法一一和版权者联系,如果本网所选内容的文章作者及编辑认为其作品不宜上网供大家浏览,或不应无偿使用请及时用电子邮件或电话通知我们,以迅速采取适当措施,避免给双方造成不必要的经济损失。';
const disclaimerText2 =
@@ -33,9 +32,12 @@ class DisclaimerMsgState extends State {
void refs(bool value) async {
final SharedPreferences prefs = await _prefs;
final bool unKnow = value;
+ _valBool = value;
+ _readed = value;
if (mounted) {
setState(() {
- _unKnow = prefs.setBool("disclaimer::Boolean", unKnow).then((bool success) {
+ _unKnow =
+ prefs.setBool("disclaimer::Boolean", unKnow).then((bool success) {
return unKnow;
});
});
@@ -60,51 +62,66 @@ class DisclaimerMsgState extends State {
context: context,
barrierDismissible: false, // user must tap button!
builder: (BuildContext context) {
- return AlertDialog(
- //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: [
- new Container(
- width: 250,
- child: _create(),
- )
- ],
- );
+ return DisclaimerMsgDialog(_valBool, _readed, (b) {
+ refs(b);
+ });
},
);
}
+ Widget build(BuildContext context) {
+ return GestureDetector(
+ onTap: () {
+ showAlertDialog(context);
+ },
+ child: Stack(
+ //alignment: const Alignment(1.6, 1.6),
+ children: [
+ Container(
+ width: 90.0,
+ alignment: Alignment.center,
+ decoration: BoxDecoration(
+ borderRadius:
+ BorderRadius.horizontal(right: Radius.circular(10)),
+ color: Colors.black45,
+ ),
+ child: Text(
+ '🔔 免责声明',
+ style: TextStyle(
+ fontSize: 14.0,
+ //fontWeight: FontWeight.bold,
+ color: Colors.white,
+ ),
+ ),
+ ),
+ ],
+ ));
+ }
+}
+
+class DisclaimerMsgDialog extends StatefulWidget {
+ final bool valBool;
+ final bool readed;
+ final ValueChanged onValueChanged;
+
+ DisclaimerMsgDialog(this.valBool, this.readed, this.onValueChanged);
+
+ @override
+ _DisclaimerMsgDialogState createState() => _DisclaimerMsgDialogState();
+}
+
+class _DisclaimerMsgDialogState extends State {
+ bool readBool;
+
+ @override
+ void initState() {
+ super.initState();
+ readBool = widget.valBool;
+ }
+
Row _create() {
//已读
- if (_readed) {
+ if (widget.readed) {
return Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
@@ -125,72 +142,91 @@ class DisclaimerMsgState extends State {
);
}
+ /// 选中状态更新,并返回数据
+ checkChanged() {
+ if (mounted) {
+ setState(() {
+ readBool = !readBool;
+ });
+ }
+ }
+
//第一次读取
return 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) {
- if(mounted) {
- setState(() {
- _valBool = 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)),
- ],
+ GestureDetector(
+ onTap: () {
+ checkChanged();
+ },
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Checkbox(
+ activeColor: Theme.of(context).primaryColor,
+ tristate: false,
+ value: readBool,
+ onChanged: (bool bol) {
+ checkChanged();
+ }),
+ Text('不再自动提示', style: TextStyle(fontSize: 14)),
+ ],
+ ),
),
FlatButton(
child: Text('知道了',
style: TextStyle(fontSize: 16, color: Colors.white)),
//可点击
- color: _valBool
+ color: readBool
? Theme.of(context).primaryColor
: Theme.of(context).primaryColor.withAlpha(800),
onPressed: () {
- // if (_valBool) {
- refs(_valBool);
+ widget.onValueChanged(readBool);
Navigator.of(context).pop();
- // }
},
),
]);
}
+ @override
Widget build(BuildContext context) {
- return GestureDetector(
- onTap: () {
- showAlertDialog(context);
- },
- child: Stack(
- //alignment: const Alignment(1.6, 1.6),
- children: [
+ return AlertDialog(
+ //title: Text('免责声明'),
+ content: SingleChildScrollView(
+ child: ListBody(
+ children: [
Container(
- width: 90.0,
- alignment: Alignment.center,
- decoration: BoxDecoration(
- borderRadius:
- BorderRadius.horizontal(right: Radius.circular(10)),
- color: Colors.black45,
- ),
- child: Text(
- '🔔 免责声明',
- style: TextStyle(
- fontSize: 14.0,
- //fontWeight: FontWeight.bold,
- color: Colors.white,
- ),
- ),
- ),
+ 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: [
+ new Container(
+ width: 250,
+ child: _create(),
+ )
+ ],
+ );
}
}
diff --git a/lib/components/flutter_markdown/lib/src/builder.dart b/lib/components/flutter_markdown/lib/src/builder.dart
index 089e83c3..ba1f533f 100644
--- a/lib/components/flutter_markdown/lib/src/builder.dart
+++ b/lib/components/flutter_markdown/lib/src/builder.dart
@@ -44,18 +44,18 @@ class _BlockElement {
/// A collection of widgets that should be placed adjacent to (inline with)
/// other inline elements in the same parent block.
-///
-/// Inline elements can be textual (a/em/strong) represented by [RichText]
+///
+/// Inline elements can be textual (a/em/strong) represented by [RichText]
/// widgets or images (img) represented by [Image.network] widgets.
-///
+///
/// Inline elements can be nested within other inline elements, inheriting their
/// parent's style along with the style of the block they are in.
-///
-/// When laying out inline widgets, first, any adjacent RichText widgets are
+///
+/// When laying out inline widgets, first, any adjacent RichText widgets are
/// merged, then, all inline widgets are enclosed in a parent [Wrap] widget.
class _InlineElement {
_InlineElement(this.tag, {this.style});
-
+
final String tag;
/// Created by merging the style defined for this element's [tag] in the
@@ -85,12 +85,8 @@ abstract class MarkdownBuilderDelegate {
/// * [Markdown], which is a widget that parses and displays Markdown.
class MarkdownBuilder implements md.NodeVisitor {
/// Creates an object that builds a [Widget] tree from parsed Markdown.
- MarkdownBuilder({
- this.delegate,
- this.styleSheet,
- this.imageDirectory,
- this.demoParser
- });
+ MarkdownBuilder(
+ {this.delegate, this.styleSheet, this.imageDirectory, this.demoParser});
/// A delegate that controls how link and `pre` elements behave.
final MarkdownBuilderDelegate delegate;
@@ -99,6 +95,7 @@ class MarkdownBuilder implements md.NodeVisitor {
final MarkdownStyleSheet styleSheet;
final DemoBuilder demoParser;
+
/// The base directory holding images referenced by Img tags with local file paths.
final Directory imageDirectory;
@@ -107,7 +104,6 @@ class MarkdownBuilder implements md.NodeVisitor {
final List<_InlineElement> _inlines = <_InlineElement>[];
final List _linkHandlers = [];
-
/// Returns widgets that display the given Markdown nodes.
///
/// The returned widgets are typically used as children in a [ListView].
@@ -136,12 +132,12 @@ class MarkdownBuilder implements md.NodeVisitor {
_addParentInlineIfNeeded(_blocks.last.tag);
final TextSpan span = _blocks.last.tag == 'pre'
- ? delegate.formatText(styleSheet, text.text)
- : new TextSpan(
- style: _inlines.last.style,
- text: text.text,
- recognizer: _linkHandlers.isNotEmpty ? _linkHandlers.last : null,
- );
+ ? delegate.formatText(styleSheet, text.text)
+ : new TextSpan(
+ style: _inlines.last.style,
+ text: text.text,
+ recognizer: _linkHandlers.isNotEmpty ? _linkHandlers.last : null,
+ );
_inlines.last.children.add(new RichText(
textScaleFactor: styleSheet.textScaleFactor,
@@ -155,8 +151,7 @@ class MarkdownBuilder implements md.NodeVisitor {
final String tag = element.tag;
if (_isBlockTag(tag)) {
_addAnonymousBlockIfNeeded(styleSheet.styles[tag]);
- if (_isListTag(tag))
- _listIndents.add(tag);
+ if (_isListTag(tag)) _listIndents.add(tag);
_blocks.add(new _BlockElement(tag));
} else {
_addParentInlineIfNeeded(_blocks.last.tag);
@@ -232,7 +227,6 @@ class MarkdownBuilder implements md.NodeVisitor {
}
_addBlockChild(child);
} else {
-
final _InlineElement current = _inlines.removeLast();
final _InlineElement parent = _inlines.last;
@@ -245,12 +239,12 @@ class MarkdownBuilder implements md.NodeVisitor {
current.children.add(_buildGoDemos(element.attributes));
}
-
if (current.children.isNotEmpty) {
parent.children.addAll(current.children);
}
}
}
+
Widget _buildGoDemos(Map attrs) {
Widget targetGoDemos;
@@ -263,8 +257,7 @@ class MarkdownBuilder implements md.NodeVisitor {
Widget _buildImage(String src) {
final List parts = src.split('#');
- if (parts.isEmpty)
- return const SizedBox();
+ if (parts.isEmpty) return const SizedBox();
final String path = parts.first;
double width;
@@ -300,10 +293,12 @@ class MarkdownBuilder implements md.NodeVisitor {
}
}
- Widget _handleDataSchemeUri(Uri uri, final double width, final double height) {
+ Widget _handleDataSchemeUri(
+ Uri uri, final double width, final double height) {
final String mimeType = uri.data.mimeType;
if (mimeType.startsWith('image/')) {
- return new Image.memory(uri.data.contentAsBytes(), width: width, height: height);
+ return new Image.memory(uri.data.contentAsBytes(),
+ width: width, height: height);
} else if (mimeType.startsWith('text/')) {
return new Text(uri.data.contentAsString());
}
@@ -312,12 +307,14 @@ class MarkdownBuilder implements md.NodeVisitor {
Widget _buildBullet(String listTag) {
if (listTag == 'ul')
- return new Text('•', textAlign: TextAlign.center, style: styleSheet.styles['li']);
+ return new Text('•',
+ textAlign: TextAlign.center, style: styleSheet.styles['li']);
final int index = _blocks.last.nextListIndex;
return new Padding(
padding: const EdgeInsets.only(right: 5.0),
- child: new Text('${index + 1}.', textAlign: TextAlign.right, style: styleSheet.styles['li']),
+ child: new Text('${index + 1}.',
+ textAlign: TextAlign.right, style: styleSheet.styles['li']),
);
}
@@ -356,7 +353,9 @@ class MarkdownBuilder implements md.NodeVisitor {
List _mergeInlineChildren(_InlineElement inline) {
List mergedTexts = [];
for (Widget child in inline.children) {
- if (mergedTexts.isNotEmpty && mergedTexts.last is RichText && child is RichText) {
+ if (mergedTexts.isNotEmpty &&
+ mergedTexts.last is RichText &&
+ child is RichText) {
RichText previous = mergedTexts.removeLast();
List children = previous.text.children != null
? new List.from(previous.text.children)
diff --git a/lib/components/flutter_markdown/lib/src/style_sheet.dart b/lib/components/flutter_markdown/lib/src/style_sheet.dart
index 6c44b773..4750284d 100644
--- a/lib/components/flutter_markdown/lib/src/style_sheet.dart
+++ b/lib/components/flutter_markdown/lib/src/style_sheet.dart
@@ -7,45 +7,45 @@ import 'package:flutter/material.dart';
/// Defines which [TextStyle] objects to use for which Markdown elements.
class MarkdownStyleSheet {
/// Creates an explicit mapping of [TextStyle] objects to Markdown elements.
- MarkdownStyleSheet({
- this.a,
- this.p,
- this.code,
- this.h1,
- this.h2,
- this.h3,
- this.h4,
- this.h5,
- this.h6,
- this.em,
- this.strong,
- this.blockquote,
- this.img,
- this.blockSpacing,
- this.listIndent,
- this.blockquotePadding,
- this.blockquoteDecoration,
- this.codeblockPadding,
- this.codeblockDecoration,
- this.horizontalRuleDecoration,
- this.textScaleFactor = 1.0
- }) : _styles = {
- 'a': a,
- 'p': p,
- 'li': p,
- 'code': code,
- 'pre': p,
- 'h1': h1,
- 'h2': h2,
- 'h3': h3,
- 'h4': h4,
- 'h5': h5,
- 'h6': h6,
- 'em': em,
- 'strong': strong,
- 'blockquote': blockquote,
- 'img': img,
- };
+ MarkdownStyleSheet(
+ {this.a,
+ this.p,
+ this.code,
+ this.h1,
+ this.h2,
+ this.h3,
+ this.h4,
+ this.h5,
+ this.h6,
+ this.em,
+ this.strong,
+ this.blockquote,
+ this.img,
+ this.blockSpacing,
+ this.listIndent,
+ this.blockquotePadding,
+ this.blockquoteDecoration,
+ this.codeblockPadding,
+ this.codeblockDecoration,
+ this.horizontalRuleDecoration,
+ this.textScaleFactor = 1.0})
+ : _styles = {
+ 'a': a,
+ 'p': p,
+ 'li': p,
+ 'code': code,
+ 'pre': p,
+ 'h1': h1,
+ 'h2': h2,
+ 'h3': h3,
+ 'h4': h4,
+ 'h5': h5,
+ 'h6': h6,
+ 'em': em,
+ 'strong': strong,
+ 'blockquote': blockquote,
+ 'img': img,
+ };
/// Creates a [MarkdownStyleSheet] from the [TextStyle]s in the provided [ThemeData].
factory MarkdownStyleSheet.fromTheme(ThemeData theme) {
@@ -54,10 +54,9 @@ class MarkdownStyleSheet {
a: const TextStyle(color: Colors.blue),
p: theme.textTheme.body1,
code: new TextStyle(
- color: Colors.grey.shade700,
- fontFamily: "monospace",
- fontSize: theme.textTheme.body1.fontSize * 0.85
- ),
+ color: Colors.grey.shade700,
+ fontFamily: "monospace",
+ fontSize: theme.textTheme.body1.fontSize * 0.85),
h1: theme.textTheme.headline,
h2: theme.textTheme.title,
h3: theme.textTheme.subhead,
@@ -72,18 +71,15 @@ class MarkdownStyleSheet {
listIndent: 32.0,
blockquotePadding: 8.0,
blockquoteDecoration: new BoxDecoration(
- color: Colors.blue.shade100,
- borderRadius: new BorderRadius.circular(2.0)
- ),
+ color: Colors.blue.shade100,
+ borderRadius: new BorderRadius.circular(2.0)),
codeblockPadding: 8.0,
codeblockDecoration: new BoxDecoration(
- color: Colors.grey.shade100,
- borderRadius: new BorderRadius.circular(2.0)
- ),
+ color: Colors.grey.shade100,
+ borderRadius: new BorderRadius.circular(2.0)),
horizontalRuleDecoration: new BoxDecoration(
border: new Border(
- top: new BorderSide(width: 5.0, color: Colors.grey.shade300)
- ),
+ top: new BorderSide(width: 5.0, color: Colors.grey.shade300)),
),
);
}
@@ -97,10 +93,9 @@ class MarkdownStyleSheet {
a: const TextStyle(color: Colors.blue),
p: theme.textTheme.body1,
code: new TextStyle(
- color: Colors.grey.shade700,
- fontFamily: "monospace",
- fontSize: theme.textTheme.body1.fontSize * 0.85
- ),
+ color: Colors.grey.shade700,
+ fontFamily: "monospace",
+ fontSize: theme.textTheme.body1.fontSize * 0.85),
h1: theme.textTheme.display3,
h2: theme.textTheme.display2,
h3: theme.textTheme.display1,
@@ -115,18 +110,15 @@ class MarkdownStyleSheet {
listIndent: 32.0,
blockquotePadding: 8.0,
blockquoteDecoration: new BoxDecoration(
- color: Colors.blue.shade100,
- borderRadius: new BorderRadius.circular(2.0)
- ),
+ color: Colors.blue.shade100,
+ borderRadius: new BorderRadius.circular(2.0)),
codeblockPadding: 8.0,
codeblockDecoration: new BoxDecoration(
- color: Colors.grey.shade100,
- borderRadius: new BorderRadius.circular(2.0)
- ),
+ color: Colors.grey.shade100,
+ borderRadius: new BorderRadius.circular(2.0)),
horizontalRuleDecoration: new BoxDecoration(
border: new Border(
- top: new BorderSide(width: 5.0, color: Colors.grey.shade300)
- ),
+ top: new BorderSide(width: 5.0, color: Colors.grey.shade300)),
),
);
}
@@ -176,8 +168,9 @@ class MarkdownStyleSheet {
blockquoteDecoration: blockquoteDecoration ?? this.blockquoteDecoration,
codeblockPadding: codeblockPadding ?? this.codeblockPadding,
codeblockDecoration: codeblockDecoration ?? this.codeblockDecoration,
- horizontalRuleDecoration: horizontalRuleDecoration ?? this.horizontalRuleDecoration,
- textScaleFactor : textScaleFactor ?? this.textScaleFactor,
+ horizontalRuleDecoration:
+ horizontalRuleDecoration ?? this.horizontalRuleDecoration,
+ textScaleFactor: textScaleFactor ?? this.textScaleFactor,
);
}
@@ -250,32 +243,30 @@ class MarkdownStyleSheet {
@override
bool operator ==(dynamic other) {
- if (identical(this, other))
- return true;
- if (other.runtimeType != MarkdownStyleSheet)
- return false;
+ if (identical(this, other)) return true;
+ if (other.runtimeType != MarkdownStyleSheet) return false;
final MarkdownStyleSheet typedOther = other;
- return typedOther.a == a
- && typedOther.p == p
- && typedOther.code == code
- && typedOther.h1 == h1
- && typedOther.h2 == h2
- && typedOther.h3 == h3
- && typedOther.h4 == h4
- && typedOther.h5 == h5
- && typedOther.h6 == h6
- && typedOther.em == em
- && typedOther.strong == strong
- && typedOther.blockquote == blockquote
- && typedOther.img == img
- && typedOther.blockSpacing == blockSpacing
- && typedOther.listIndent == listIndent
- && typedOther.blockquotePadding == blockquotePadding
- && typedOther.blockquoteDecoration == blockquoteDecoration
- && typedOther.codeblockPadding == codeblockPadding
- && typedOther.codeblockDecoration == codeblockDecoration
- && typedOther.horizontalRuleDecoration == horizontalRuleDecoration
- && typedOther.textScaleFactor == textScaleFactor;
+ return typedOther.a == a &&
+ typedOther.p == p &&
+ typedOther.code == code &&
+ typedOther.h1 == h1 &&
+ typedOther.h2 == h2 &&
+ typedOther.h3 == h3 &&
+ typedOther.h4 == h4 &&
+ typedOther.h5 == h5 &&
+ typedOther.h6 == h6 &&
+ typedOther.em == em &&
+ typedOther.strong == strong &&
+ typedOther.blockquote == blockquote &&
+ typedOther.img == img &&
+ typedOther.blockSpacing == blockSpacing &&
+ typedOther.listIndent == listIndent &&
+ typedOther.blockquotePadding == blockquotePadding &&
+ typedOther.blockquoteDecoration == blockquoteDecoration &&
+ typedOther.codeblockPadding == codeblockPadding &&
+ typedOther.codeblockDecoration == codeblockDecoration &&
+ typedOther.horizontalRuleDecoration == horizontalRuleDecoration &&
+ typedOther.textScaleFactor == textScaleFactor;
}
@override
diff --git a/lib/components/flutter_markdown/lib/src/widget.dart b/lib/components/flutter_markdown/lib/src/widget.dart
index c9d5cbaf..269e7bbb 100644
--- a/lib/components/flutter_markdown/lib/src/widget.dart
+++ b/lib/components/flutter_markdown/lib/src/widget.dart
@@ -11,6 +11,7 @@ import 'package:meta/meta.dart';
import 'builder.dart';
import 'style_sheet.dart';
+
//
typedef Widget ItemDemoBuilder(Map attrs);
@@ -22,7 +23,8 @@ typedef void MarkdownTapLinkCallback(String href);
/// Creates a format [TextSpan] given a string.
///
/// Used by [MarkdownWidget] to highlight the contents of `pre` elements.
-abstract class SyntaxHighlighter { // ignore: one_member_abstracts
+abstract class SyntaxHighlighter {
+ // ignore: one_member_abstracts
/// Returns the formated [TextSpan] for the given string.
TextSpan format(String source);
}
@@ -49,8 +51,8 @@ abstract class MarkdownWidget extends StatefulWidget {
this.onTapLink,
this.imageDirectory,
this.demoBuilder,
- }) : assert(data != null),
- super(key: key);
+ }) : assert(data != null),
+ super(key: key);
/// The Markdown to display.
final String data;
@@ -72,6 +74,7 @@ abstract class MarkdownWidget extends StatefulWidget {
final Directory imageDirectory;
final ItemDemoBuilder demoBuilder;
+
/// Subclasses should override this function to display the given children,
/// which are the parsed representation of [data].
@protected
@@ -91,7 +94,8 @@ class DemosSyntax extends md.InlineSyntax {
}
}
-class _MarkdownWidgetState extends State implements MarkdownBuilderDelegate {
+class _MarkdownWidgetState extends State
+ implements MarkdownBuilderDelegate {
List _children;
final List _recognizers = [];
@@ -104,9 +108,8 @@ class _MarkdownWidgetState extends State implements MarkdownBuil
@override
void didUpdateWidget(MarkdownWidget oldWidget) {
super.didUpdateWidget(oldWidget);
- if (widget.data != oldWidget.data
- || widget.styleSheet != oldWidget.styleSheet)
- _parseMarkdown();
+ if (widget.data != oldWidget.data ||
+ widget.styleSheet != oldWidget.styleSheet) _parseMarkdown();
}
@override
@@ -116,44 +119,43 @@ class _MarkdownWidgetState extends State implements MarkdownBuil
}
void _parseMarkdown() {
- final MarkdownStyleSheet styleSheet = widget.styleSheet ?? new MarkdownStyleSheet.fromTheme(Theme.of(context));
+ final MarkdownStyleSheet styleSheet = widget.styleSheet ??
+ new MarkdownStyleSheet.fromTheme(Theme.of(context));
_disposeRecognizers();
// TODO: This can be optimized by doing the split and removing \r at the same time
final List lines = widget.data.replaceAll('\r\n', '\n').split('\n');
final md.ExtensionSet extens = new md.ExtensionSet([
- md.FencedCodeBlockSyntax()
+ md.FencedCodeBlockSyntax()
], [
new DemosSyntax(),
new md.InlineHtmlSyntax(),
]);
- final md.Document document = new md.Document(encodeHtml: false, extensionSet: extens);
+ final md.Document document =
+ new md.Document(encodeHtml: false, extensionSet: extens);
final MarkdownBuilder builder = new MarkdownBuilder(
- delegate: this,
- styleSheet: styleSheet,
- imageDirectory: widget.imageDirectory,
- demoParser: widget.demoBuilder
- );
+ delegate: this,
+ styleSheet: styleSheet,
+ imageDirectory: widget.imageDirectory,
+ demoParser: widget.demoBuilder);
_children = builder.build(document.parseLines(lines));
}
void _disposeRecognizers() {
- if (_recognizers.isEmpty)
- return;
- final List localRecognizers = new List.from(_recognizers);
+ if (_recognizers.isEmpty) return;
+ final List localRecognizers =
+ new List.from(_recognizers);
_recognizers.clear();
- for (GestureRecognizer recognizer in localRecognizers)
- recognizer.dispose();
+ for (GestureRecognizer recognizer in localRecognizers) recognizer.dispose();
}
@override
GestureRecognizer createLink(String href) {
final TapGestureRecognizer recognizer = new TapGestureRecognizer()
..onTap = () {
- if (widget.onTapLink != null)
- widget.onTapLink(href);
- };
+ if (widget.onTapLink != null) widget.onTapLink(href);
+ };
_recognizers.add(recognizer);
return recognizer;
}
@@ -189,19 +191,17 @@ class MarkdownBody extends MarkdownWidget {
Directory imageDirectory,
ItemDemoBuilder demoBuilder,
}) : super(
- key: key,
- data: data,
- styleSheet: styleSheet,
- syntaxHighlighter: syntaxHighlighter,
- onTapLink: onTapLink,
- imageDirectory: imageDirectory,
- demoBuilder: demoBuilder
- );
+ key: key,
+ data: data,
+ styleSheet: styleSheet,
+ syntaxHighlighter: syntaxHighlighter,
+ onTapLink: onTapLink,
+ imageDirectory: imageDirectory,
+ demoBuilder: demoBuilder);
@override
Widget build(BuildContext context, List children) {
- if (children.length == 1)
- return children.single;
+ if (children.length == 1) return children.single;
return new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: children,
@@ -229,13 +229,13 @@ class Markdown extends MarkdownWidget {
Directory imageDirectory,
this.padding: const EdgeInsets.all(16.0),
}) : super(
- key: key,
- data: data,
- styleSheet: styleSheet,
- syntaxHighlighter: syntaxHighlighter,
- onTapLink: onTapLink,
- imageDirectory: imageDirectory,
- );
+ key: key,
+ data: data,
+ styleSheet: styleSheet,
+ syntaxHighlighter: syntaxHighlighter,
+ onTapLink: onTapLink,
+ imageDirectory: imageDirectory,
+ );
/// The amount of space by which to inset the children.
final EdgeInsets padding;
diff --git a/lib/components/full_screen_code_dialog.dart b/lib/components/full_screen_code_dialog.dart
index 5a40d9cf..c9eddcce 100644
--- a/lib/components/full_screen_code_dialog.dart
+++ b/lib/components/full_screen_code_dialog.dart
@@ -1,5 +1,5 @@
-/// @Author: 一凨
-/// @Date: 2019-01-14 11:42:32
+/// @Author: 一凨
+/// @Date: 2019-01-14 11:42:32
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-14 14:42:00
@@ -24,7 +24,8 @@ class _FullScreenCodeDialogState extends State {
void didChangeDependencies() {
print('widget.filePath=======${widget.filePath}');
if (widget.filePath != null) {
- getExampleCode(context,'${widget.filePath}', DefaultAssetBundle.of(context))
+ getExampleCode(
+ context, '${widget.filePath}', DefaultAssetBundle.of(context))
.then((String code) {
if (mounted) {
setState(() {
@@ -48,6 +49,7 @@ class _FullScreenCodeDialogState extends State {
});
}
}
+
@override
Widget build(BuildContext context) {
final SyntaxHighlighterStyle style =
@@ -60,16 +62,17 @@ class _FullScreenCodeDialogState extends State {
body = const Center(child: CircularProgressIndicator());
} else {
Widget _codeWidget;
- try{
+ try {
DartSyntaxHighlighter(style).format(_exampleCode);
_codeWidget = RichText(
text: TextSpan(
- style: const TextStyle(fontFamily: 'monospace', fontSize: 10.0),
- children: [
- DartSyntaxHighlighter(style).format(_exampleCode)
- ],),
+ style: const TextStyle(fontFamily: 'monospace', fontSize: 10.0),
+ children: [
+ DartSyntaxHighlighter(style).format(_exampleCode)
+ ],
+ ),
);
- }catch (err){
+ } catch (err) {
_codeWidget = Text(_exampleCode);
}
body = SingleChildScrollView(
diff --git a/lib/components/home_banner.dart b/lib/components/home_banner.dart
index 36345cbe..23d46e69 100644
--- a/lib/components/home_banner.dart
+++ b/lib/components/home_banner.dart
@@ -8,8 +8,7 @@ class HomeBanner extends StatefulWidget {
final List bannerStories;
final OnTapBannerItem onTap;
- HomeBanner(this.bannerStories, this.onTap, {Key key})
- :super(key: key);
+ HomeBanner(this.bannerStories, this.onTap, {Key key}) : super(key: key);
@override
State createState() {
@@ -27,11 +26,11 @@ class _BannerState extends State {
void initState() {
super.initState();
controller = PageController(initialPage: realIndex);
- timer = Timer.periodic(Duration(seconds: 5), (timer) { // 自动滚动
+ timer = Timer.periodic(Duration(seconds: 5), (timer) {
+ // 自动滚动
/// print(realIndex);
controller.animateToPage(realIndex + 1,
- duration: Duration(milliseconds: 300),
- curve: Curves.linear);
+ duration: Duration(milliseconds: 300), curve: Curves.linear);
});
}
@@ -50,7 +49,10 @@ class _BannerState extends State {
margin: EdgeInsets.only(top: 10.0, right: 5.0),
padding: EdgeInsets.symmetric(horizontal: 6.0, vertical: 2.0),
child: Text("${++index}/$itemCount",
- style: TextStyle( color: Colors.white70, fontSize: 12.0, fontWeight:FontWeight.bold )),
+ style: TextStyle(
+ color: Colors.white70,
+ fontSize: 12.0,
+ fontWeight: FontWeight.bold)),
);
}
@@ -58,43 +60,45 @@ class _BannerState extends State {
Widget build(BuildContext context) {
return Container(
height: 226.0,
- child: Stack(
- alignment: Alignment.bottomCenter,
- children: [
- PageView(
- controller: controller,
- onPageChanged: _onPageChanged,
- children: _buildItems(),),
- _buildIndicator(), // 下面的小点
- Positioned(//方法二
- top: 0.0,
- right: 0.0,
- child: _numberIndicator(context,virtualIndex,widget.bannerStories.length),
- )
- ]),
+ child: Stack(alignment: Alignment.bottomCenter, children: [
+ PageView(
+ controller: controller,
+ onPageChanged: _onPageChanged,
+ children: _buildItems(),
+ ),
+ _buildIndicator(), // 下面的小点
+ Positioned(
+ //方法二
+ top: 0.0,
+ right: 0.0,
+ child: _numberIndicator(
+ context, virtualIndex, widget.bannerStories.length),
+ )
+ ]),
);
}
- List _buildItems() { // 排列轮播数组
+ List _buildItems() {
+ // 排列轮播数组
List items = [];
if (widget.bannerStories.length > 0) {
// 头部添加一个尾部Item,模拟循环
items.add(
_buildItem(widget.bannerStories[widget.bannerStories.length - 1]));
// 正常添加Item
- items.addAll(
- widget.bannerStories.map((story) => _buildItem(story)).toList(
- growable: false));
+ items.addAll(widget.bannerStories
+ .map((story) => _buildItem(story))
+ .toList(growable: false));
// 尾部
- items.add(
- _buildItem(widget.bannerStories[0]));
+ items.add(_buildItem(widget.bannerStories[0]));
}
return items;
}
Widget _buildItem(StoryModel story) {
return GestureDetector(
- onTap: () { // 按下
+ onTap: () {
+ // 按下
if (widget.onTap != null) {
widget.onTap(story);
}
@@ -102,14 +106,17 @@ class _BannerState extends State {
child: Stack(
fit: StackFit.expand,
children: [
- Image.network(story.image, fit: BoxFit.cover),
+ Image.network(story.image, fit: BoxFit.cover),
_buildItemTitle(story.title), // 内容文字,大意
- ],),);
+ ],
+ ),
+ );
}
Widget _buildItemTitle(String title) {
return Container(
- decoration: BoxDecoration( /// 背景的渐变色
+ decoration: BoxDecoration(
+ /// 背景的渐变色
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: const Alignment(0.0, -0.8),
@@ -120,7 +127,10 @@ class _BannerState extends State {
child: Container(
margin: EdgeInsets.symmetric(vertical: 22.0, horizontal: 16.0),
child: Text(
- title, style: TextStyle(color: Colors.white, fontSize: 18.0),),),
+ title,
+ style: TextStyle(color: Colors.white, fontSize: 18.0),
+ ),
+ ),
);
}
@@ -136,8 +146,7 @@ class _BannerState extends State {
color: i == virtualIndex ? Colors.white : Colors.grey)));
}
return Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: indicators);
+ mainAxisAlignment: MainAxisAlignment.center, children: indicators);
}
_onPageChanged(int index) {
@@ -156,4 +165,4 @@ class _BannerState extends State {
}
}
-typedef void OnTapBannerItem(StoryModel story);
\ No newline at end of file
+typedef void OnTapBannerItem(StoryModel story);
diff --git a/lib/components/list_refresh.dart b/lib/components/list_refresh.dart
index c5d3b0d8..22229de3 100644
--- a/lib/components/list_refresh.dart
+++ b/lib/components/list_refresh.dart
@@ -14,7 +14,8 @@ class ListRefresh extends StatefulWidget {
final requestApi;
final headerView;
- const ListRefresh([this.requestApi, this.renderItem, this.headerView]) : super();
+ const ListRefresh([this.requestApi, this.renderItem, this.headerView])
+ : super();
@override
State createState() => _ListRefreshState();
@@ -91,6 +92,7 @@ class _ListRefreshState extends State {
});
}
}
+
// 下拉加载的事件,清空之前list内容,取前X个
// 其实就是列表重置
Future _handleRefresh() async {
@@ -158,9 +160,9 @@ class _ListRefreshState extends State {
itemCount: items.length + 1,
itemBuilder: (context, index) {
if (index == 0 && index != items.length) {
- if(widget.headerView is Function){
+ if (widget.headerView is Function) {
return widget.headerView();
- }else {
+ } else {
return Container(height: 0);
}
}
diff --git a/lib/components/list_view_item.dart b/lib/components/list_view_item.dart
index c8aa682d..58d515ed 100644
--- a/lib/components/list_view_item.dart
+++ b/lib/components/list_view_item.dart
@@ -1,5 +1,7 @@
-/// @Author: 一凨
-/// @Date: 2019-01-14 17:53:54
+import 'package:fluro/fluro.dart';
+
+/// @Author: 一凨
+/// @Date: 2019-01-14 17:53:54
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-14 17:57:51
@@ -8,7 +10,6 @@ import '../routers/application.dart';
import '../routers/routers.dart';
import 'dart:core';
-
class ListViewItem extends StatelessWidget {
final String itemUrl;
final String itemTitle;
@@ -17,7 +18,6 @@ class ListViewItem extends StatelessWidget {
const ListViewItem({Key key, this.itemUrl, this.itemTitle, this.data})
: super(key: key);
-
@override
Widget build(BuildContext context) {
return Card(
@@ -27,7 +27,11 @@ class ListViewItem extends StatelessWidget {
child: ListTile(
onTap: () {
// _launchURL(itemUrl, context);
- Application.router.navigateTo(context, '${Routes.webViewPage}?title=${Uri.encodeComponent(itemTitle)}&url=${Uri.encodeComponent(itemUrl)}');
+ Application.router.navigateTo(
+ context,
+ '${Routes.webViewPage}?title=${Uri.encodeComponent(itemTitle)}&url=${Uri.encodeComponent(itemUrl)}',
+ transition: TransitionType.nativeModal,
+ );
},
title: Padding(
child: Text(
diff --git a/lib/components/loading.dart b/lib/components/loading.dart
index 659b2ff8..b2c30719 100644
--- a/lib/components/loading.dart
+++ b/lib/components/loading.dart
@@ -19,11 +19,11 @@ class NetLoadingDialog extends StatefulWidget {
NetLoadingDialog(
{Key key,
- this.loadingText = "loading...",
- this.outsideDismiss = true,
- this.dismissCallback,
- this.loading,
- this.requestCallBack})
+ this.loadingText = "loading...",
+ this.outsideDismiss = true,
+ this.dismissCallback,
+ this.loading,
+ this.requestCallBack})
: super(key: key);
@override
diff --git a/lib/components/markdown.dart b/lib/components/markdown.dart
index af055381..6a70666e 100644
--- a/lib/components/markdown.dart
+++ b/lib/components/markdown.dart
@@ -6,21 +6,18 @@ import 'package:flutter_go/utils/high_light_code.dart';
/// 使用方法
/// MarkdownBody(markdown)
final hightlighter = new HighLight();
+
class HighLight extends md.SyntaxHighlighter {
@override
TextSpan format(String source) {
- final SyntaxHighlighterStyle style = SyntaxHighlighterStyle.lightThemeStyle();
+ final SyntaxHighlighterStyle style =
+ SyntaxHighlighterStyle.lightThemeStyle();
return TextSpan(
style: const TextStyle(fontSize: 10.0),
- children: [
- DartSyntaxHighlighter(style).format(source)
- ]
- );
+ children: [DartSyntaxHighlighter(style).format(source)]);
}
}
-
-
class MarkdownBody extends StatelessWidget {
final String data;
MarkdownBody(this.data);
@@ -28,4 +25,4 @@ class MarkdownBody extends StatelessWidget {
Widget build(BuildContext context) {
return md.MarkdownBody(data: data, syntaxHighlighter: new HighLight());
}
-}
\ No newline at end of file
+}
diff --git a/lib/components/pagination.dart b/lib/components/pagination.dart
index e7fdd379..8b8f579d 100644
--- a/lib/components/pagination.dart
+++ b/lib/components/pagination.dart
@@ -20,10 +20,39 @@ class Pagination extends StatelessWidget {
];
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&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 双剑合璧,助您构建精美应用'}
+ {
+ '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&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 {
@@ -37,12 +66,12 @@ class Pagination extends StatelessWidget {
List _pageSelector(BuildContext context) {
List list = [];
List bannerStories = [];
+
/// super.initState();
arr.forEach((item) {
bannerStories.add(StoryModel.fromJson(item));
});
-
if (arr.length > 0) {
list.add(HomeBanner(bannerStories, (story) {
_launchURL('${story.url}');
@@ -53,12 +82,10 @@ class Pagination extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return
- Column(
- key:Key('__header__'),
+ return Column(
+ key: Key('__header__'),
//physics: AlwaysScrollableScrollPhysics(),
//padding: EdgeInsets.only(),
- children: _pageSelector(context)
- );
+ children: _pageSelector(context));
}
}
diff --git a/lib/components/search_input.dart b/lib/components/search_input.dart
index 9fdc3eff..9d9bfe9f 100644
--- a/lib/components/search_input.dart
+++ b/lib/components/search_input.dart
@@ -15,13 +15,9 @@ typedef void OnSubmit(String value);
///搜索结果内容显示面板
class MaterialSearchResult extends StatelessWidget {
- const MaterialSearchResult({
- Key key,
- this.value,
- this.text,
- this.icon,
- this.onTap
- }) : super(key: key);
+ const MaterialSearchResult(
+ {Key key, this.value, this.text, this.icon, this.onTap})
+ : super(key: key);
final String value;
final VoidCallback onTap;
@@ -30,7 +26,6 @@ class MaterialSearchResult extends StatelessWidget {
@override
Widget build(BuildContext context) {
-
return new InkWell(
onTap: this.onTap,
child: new Container(
@@ -38,8 +33,14 @@ class MaterialSearchResult extends StatelessWidget {
padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 10.0),
child: new Row(
children: [
- new Container(width: 30.0, margin: EdgeInsets.only(right: 10), child: new Icon(icon)) ?? null,
- new Expanded(child: new Text(value, style: Theme.of(context).textTheme.subhead)),
+ new Container(
+ width: 30.0,
+ margin: EdgeInsets.only(right: 10),
+ child: new Icon(icon)) ??
+ null,
+ new Expanded(
+ child: new Text(value,
+ style: Theme.of(context).textTheme.subhead)),
new Text(text, style: Theme.of(context).textTheme.subhead)
],
),
@@ -124,6 +125,7 @@ class _MaterialSearchState extends State {
}
Timer _resultsTimer;
+
Future _getResultsDebounced() async {
if (_results.length == 0) {
setState(() {
@@ -164,6 +166,7 @@ class _MaterialSearchState extends State {
super.dispose();
_resultsTimer?.cancel();
}
+
Widget buildBody(List results) {
if (_criteria.isEmpty) {
return History();
@@ -171,16 +174,11 @@ class _MaterialSearchState extends State {
return new Center(
child: new Padding(
padding: const EdgeInsets.only(top: 50.0),
- child: new CircularProgressIndicator()
- )
- );
+ child: new CircularProgressIndicator()));
}
if (results.isNotEmpty) {
- var content = new SingleChildScrollView(
- child: new Column(
- children: results
- )
- );
+ var content =
+ new SingleChildScrollView(child: new Column(children: results));
return content;
}
return Center(child: Text("暂无数据"));
@@ -241,7 +239,7 @@ class _MaterialSearchState extends State {
],
),
body: buildBody(results),
- );
+ );
}
}
@@ -405,34 +403,35 @@ class SearchInput extends StatelessWidget {
}
// wigdet干掉.=> componets
-
class History extends StatefulWidget {
const History() : super();
@override
- _History createState() => _History();
+ _History createState() => _History();
}
// AppBar 默认的实例,有状态
class _History extends State {
SearchHistoryList searchHistoryList = new SearchHistoryList();
+ bool refreshFlag;
@override
void initState() {
super.initState();
+ this.refreshFlag = true;
}
@override
void dispose() {
super.dispose();
}
+
buildChips(BuildContext context) {
List list = [];
List historyList = searchHistoryList.getList();
print("historyList> $historyList");
Color bgColor = Theme.of(context).primaryColor;
historyList.forEach((SearchHistory value) {
-
Widget icon = CircleAvatar(
backgroundColor: bgColor,
child: Text(
@@ -445,20 +444,28 @@ class _History extends State {
}
String targetRouter = value.targetRouter;
- list.add(
- InkWell(
- onTap: () {
- Application.router.navigateTo(context, "${targetRouter.toLowerCase()}", transition: TransitionType.inFromRight);
- },
- child: Chip(
- avatar: icon,
- label: Text("${value.name}"),
- ),
- )
- );
+ list.add(InkWell(
+ onTap: () {
+ Application.router.navigateTo(
+ context, "${targetRouter.toLowerCase()}",
+ transition: TransitionType.native);
+ },
+ child: Chip(
+ avatar: icon,
+ label: Text("${value.name}"),
+ ),
+ ));
});
return list;
}
+
+ _clearHistory() {
+ searchHistoryList.clear();
+ this.setState(() {
+ this.refreshFlag = !this.refreshFlag;
+ });
+ }
+
@override
Widget build(BuildContext context) {
List childList = buildChips(context);
@@ -470,25 +477,38 @@ class _History extends State {
return Column(
children: [
Container(
- alignment: Alignment.centerLeft,
- padding: EdgeInsets.fromLTRB(12.0, 12, 12, 0),
- child: InkWell(
- onLongPress: () {
- searchHistoryList.clear();
- },
- child: Text('历史搜索'),
- ),
- ),
+ alignment: Alignment.centerLeft,
+ padding: EdgeInsets.fromLTRB(12.0, 12, 12, 0),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ InkWell(
+ onLongPress: () {
+ searchHistoryList.clear();
+ },
+ child: Text('历史搜索'),
+ ),
+ GestureDetector(
+ onTap: _clearHistory,
+ child: Container(
+ child: new Icon(Icons.delete,
+ size: 24.0, color: Theme.of(context).accentColor),
+ width: 30,
+ height: 30,
+ ),
+ )
+ ],
+ )),
Container(
padding: EdgeInsets.only(left: 10),
alignment: Alignment.topLeft,
child: Wrap(
- spacing: 6.0, // gap between adjacent chips
- runSpacing: 0.0, // gap between lines
- children: childList
- ),
+ spacing: 6.0, // gap between adjacent chips
+ runSpacing: 0.0, // gap between lines
+ children: childList),
)
],
);
}
-}
\ No newline at end of file
+}
diff --git a/lib/components/single_theme_color.dart b/lib/components/single_theme_color.dart
index 8a9088a0..5ab67e73 100644
--- a/lib/components/single_theme_color.dart
+++ b/lib/components/single_theme_color.dart
@@ -13,10 +13,11 @@ class SingleThemeColor extends StatelessWidget {
@override
Widget build(BuildContext context) {
return InkWell(
- onTap: (){
- if(ApplicationEvent.event != null){
+ onTap: () {
+ if (ApplicationEvent.event != null) {
print('fire ${this.themeColor}');
- ApplicationEvent.event.fire(UserSettingThemeColorEvent(this.themeColor));
+ ApplicationEvent.event
+ .fire(UserSettingThemeColorEvent(this.themeColor));
Navigator.of(context).pop();
}
},
diff --git a/lib/components/widget_demo.dart b/lib/components/widget_demo.dart
index e2c783d3..befb6aeb 100644
--- a/lib/components/widget_demo.dart
+++ b/lib/components/widget_demo.dart
@@ -3,12 +3,14 @@
import 'dart:core';
+import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter_go/utils/data_utils.dart';
import '../routers/application.dart';
import '../routers/routers.dart';
import '../components/markdown.dart';
+
/// import '../model/collection.dart';
import '../widgets/index.dart';
import '../event/event_bus.dart';
@@ -35,6 +37,7 @@ class WidgetDemo extends StatefulWidget {
class _WidgetDemoState extends State {
bool _hasCollected = false;
+
/// CollectionControlModel _collectionControl = new CollectionControlModel();
var _collectionIcons;
List widgetDemosList = new WidgetDemoList().getDemos();
@@ -134,45 +137,49 @@ class _WidgetDemoState extends State {
void _selectValue(value) {
if (value == 'doc') {
// _launchURL(widget.docUrl);
- Application.router.navigateTo(context,
- '${Routes.webViewPage}?title=${Uri.encodeComponent(widget.title)} Doc&&url=${Uri.encodeComponent(widget.docUrl)}');
+ Application.router.navigateTo(
+ context,
+ '${Routes.webViewPage}?title=${Uri.encodeComponent(widget.title)} Doc&&url=${Uri.encodeComponent(widget.docUrl)}',
+ transition: TransitionType.nativeModal,
+ );
} else if (value == 'code') {
- Application.router.navigateTo(context,
- '${Routes.codeView}?filePath=${Uri.encodeComponent(widget.codeUrl)}');
+ Application.router.navigateTo(
+ context,
+ '${Routes.codeView}?filePath=${Uri.encodeComponent(widget.codeUrl)}',
+ transition: TransitionType.nativeModal,
+ );
}
}
+
List> buildPopupMenu() {
List> comps = [];
if (widget.docUrl != null) {
- comps.add(
- PopupMenuItem(
- value: 'doc',
- child: ListTile(
- leading: Icon(
- Icons.library_books,
- size: 22.0,
- ),
- title: Text('查看文档'),
- ),
- )
- );
+ comps.add(PopupMenuItem(
+ value: 'doc',
+ child: ListTile(
+ leading: Icon(
+ Icons.library_books,
+ size: 22.0,
+ ),
+ title: Text('查看文档'),
+ ),
+ ));
}
if (widget.codeUrl != null) {
- comps.add(
- PopupMenuItem(
- value: 'code',
- child: ListTile(
- leading: Icon(
- Icons.code,
- size: 22.0,
- ),
- title: Text('查看Demo'),
- ),
- )
- );
+ comps.add(PopupMenuItem(
+ value: 'code',
+ child: ListTile(
+ leading: Icon(
+ Icons.code,
+ size: 22.0,
+ ),
+ title: Text('查看Demo'),
+ ),
+ ));
}
return comps;
}
+
@override
Widget build(BuildContext context) {
if (_hasCollected) {
@@ -185,7 +192,7 @@ class _WidgetDemoState extends State {
new IconButton(
tooltip: 'goBack home',
onPressed: () {
- Navigator.popUntil(context, ModalRoute.withName('/'));
+ Navigator.popUntil(context, ModalRoute.withName(Routes.root));
},
icon: Icon(Icons.home),
),
@@ -196,12 +203,10 @@ class _WidgetDemoState extends State {
),
];
if (menus.length > 0) {
- actions.add(
- PopupMenuButton(
- onSelected: _selectValue,
- itemBuilder: (BuildContext context) => menus,
- )
- );
+ actions.add(PopupMenuButton(
+ onSelected: _selectValue,
+ itemBuilder: (BuildContext context) => menus,
+ ));
}
return Scaffold(
key: _scaffoldKey,
diff --git a/lib/components/widget_item_container.dart b/lib/components/widget_item_container.dart
index d7438790..1cca41c1 100644
--- a/lib/components/widget_item_container.dart
+++ b/lib/components/widget_item_container.dart
@@ -13,23 +13,21 @@ class WidgetItemContainer extends StatelessWidget {
// 所有的可用demos;
final List widgetDemosList = new WidgetDemoList().getDemos();
- WidgetItemContainer(
- {Key key,
- @required this.commonItems,
- @required this.columnCount,
+ WidgetItemContainer({
+ Key key,
+ @required this.commonItems,
+ @required this.columnCount,
// @required this.isWidgetPoint
- })
- : super(key: key);
+ }) : super(key: key);
/// 跳转goup
void tapToGroup(CategoryComponent cate, BuildContext context) {
- Application.router
- .navigateTo(context, "/category/${cate.token}", transition: TransitionType.inFromRight);
+ Application.router.navigateTo(context, "/category/${cate.token}",
+ transition: TransitionType.native);
}
/// 跳转到老的widget界面
void tapToOldWidget(WidgetLeaf leaf, BuildContext context) {
-
String targetName = leaf.name;
String targetRouter = '/category/error/404';
widgetDemosList.forEach((item) {
@@ -38,13 +36,21 @@ class WidgetItemContainer extends StatelessWidget {
targetRouter = targetRouter.toLowerCase();
}
});
- Application.router.navigateTo(context, targetRouter, transition: TransitionType.inFromRight);
+ Application.router.navigateTo(
+ context,
+ targetRouter,
+ transition: TransitionType.native,
+ );
}
/// 跳转到新的标准页
void tapToStandardPage(WidgetLeaf leaf, BuildContext context) {
String targetRouter = '/standard-page/${leaf.pageId}';
- Application.router.navigateTo(context, targetRouter, transition: TransitionType.inFromRight);
+ Application.router.navigateTo(
+ context,
+ targetRouter,
+ transition: TransitionType.native,
+ );
}
List _buildColumns(context) {
@@ -58,37 +64,37 @@ class WidgetItemContainer extends StatelessWidget {
if (addI < length) {
CommonItem item = commonItems[addI];
-
_listRows.add(
Expanded(
flex: 1,
child: WidgetItem(
- title: item.name,
- onTap: () {
- String type = item.type;
+ title: item.name,
+ onTap: () {
+ String type = item.type;
- if (type == "category") {
- return tapToGroup(item as CategoryComponent, context);
- }
- if (type == "widget") {
- WidgetLeaf leaf = item as WidgetLeaf;
+ if (type == "category") {
+ return tapToGroup(item as CategoryComponent, context);
+ }
+ if (type == "widget") {
+ WidgetLeaf leaf = item as WidgetLeaf;
- if (leaf.display == "standard") {
- return tapToStandardPage(leaf, context);
- } else {
- return tapToOldWidget(leaf, context);
+ if (leaf.display == "standard") {
+ return tapToStandardPage(leaf, context);
+ } else {
+ return tapToOldWidget(leaf, context);
+ }
}
- }
- Application.router
- .navigateTo(context, "/category/error/404", transition: TransitionType.inFromRight);
- },
- index: addI,
- totalCount: length,
- rowLength: columnCount,
- /// textSize: true ? 'middle' : 'small',
- textSize: 'middle'
- ),
+ Application.router.navigateTo(
+ context, "/category/error/404",
+ transition: TransitionType.native);
+ },
+ index: addI,
+ totalCount: length,
+ rowLength: columnCount,
+
+ /// textSize: true ? 'middle' : 'small',
+ textSize: 'middle'),
),
);
} else {
@@ -116,4 +122,3 @@ class WidgetItemContainer extends StatelessWidget {
);
}
}
-
diff --git a/lib/event/event_bus.dart b/lib/event/event_bus.dart
index d51e9b10..aafb908e 100644
--- a/lib/event/event_bus.dart
+++ b/lib/event/event_bus.dart
@@ -1,5 +1,5 @@
import 'package:event_bus/event_bus.dart';
-class ApplicationEvent{
+class ApplicationEvent {
static EventBus event;
}
diff --git a/lib/event/event_model.dart b/lib/event/event_model.dart
index ca753ec9..f8062688 100644
--- a/lib/event/event_model.dart
+++ b/lib/event/event_model.dart
@@ -1,19 +1,19 @@
-class CollectionEvent{
+class CollectionEvent {
final String widgetName;
final String router;
final bool isRemove;
// token uid...
- CollectionEvent(this.widgetName,this.router,this.isRemove);
+ CollectionEvent(this.widgetName, this.router, this.isRemove);
}
-class UserGithubOAuthEvent{
+class UserGithubOAuthEvent {
final String loginName;
final String token;
final bool isSuccess;
- UserGithubOAuthEvent(this.loginName,this.token,this.isSuccess);
+ UserGithubOAuthEvent(this.loginName, this.token, this.isSuccess);
}
-class UserSettingThemeColorEvent{
+class UserSettingThemeColorEvent {
final int settingThemeColor;
UserSettingThemeColorEvent(this.settingThemeColor);
-}
\ No newline at end of file
+}
diff --git a/lib/main.dart b/lib/main.dart
index 2a5a944d..ea351b28 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -54,14 +54,17 @@ class _MyAppState extends State {
Future _reqsMainPageIsOpen() async {
const reqs = 'https://flutter-go.pub/api/isInfoOpen';
var response;
- try{
+ try {
response = await NetUtils.get(reqs, {});
- print('response-$response');
- if(response['status'] == 200 && response['success'] ==true && response['data'] is Map && response['data']['isOpen'] == true) {
+ print('response-$response');
+ if (response['status'] == 200 &&
+ response['success'] == true &&
+ response['data'] is Map &&
+ response['data']['isOpen'] == true) {
Application.pageIsOpen = true;
print('是否需要展开【业界动态】${Application.pageIsOpen}');
}
- }catch(e){
+ } catch (e) {
print('response-$e');
}
return response;
@@ -203,17 +206,18 @@ void _startupJpush() async {
}
void main() async {
+ WidgetsFlutterBinding.ensureInitialized();
final provider = new Provider();
await provider.init(true);
sp = await SpUtil.getInstance();
new SearchHistoryList(sp);
await DataUtils.getWidgetTreeList().then((List json) {
- List data = WidgetTree.insertDevPagesToList(json, StandardPages().getLocalList());
+ List data =
+ WidgetTree.insertDevPagesToList(json, StandardPages().getLocalList());
Application.widgetTree = WidgetTree.buildWidgetTree(data);
print("Application.widgetTree>>>> ${Application.widgetTree}");
});
db = Provider.db;
runApp(new MyApp());
}
-
diff --git a/lib/model/base.dart b/lib/model/base.dart
index 43cb7a55..626409b9 100644
--- a/lib/model/base.dart
+++ b/lib/model/base.dart
@@ -1,10 +1,10 @@
import 'package:sqflite/sqflite.dart';
-class BaseModel{
- Database db;
- final String table = '';
- var query;
- BaseModel(this.db){
- query = db.query;
- }
-}
\ No newline at end of file
+class BaseModel {
+ Database db;
+ final String table = '';
+ var query;
+ BaseModel(this.db) {
+ query = db.query;
+ }
+}
diff --git a/lib/model/collection.dart b/lib/model/collection.dart
index 49233bbe..cdc90642 100644
--- a/lib/model/collection.dart
+++ b/lib/model/collection.dart
@@ -1,5 +1,5 @@
-/// @Author: 一凨
-/// @Date: 2019-01-07 16:24:42
+/// @Author: 一凨
+/// @Date: 2019-01-07 16:24:42
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-08 17:37:42
@@ -18,8 +18,8 @@ class Collection implements CollectionInterface {
Collection({this.name, this.router});
- factory Collection.fromJSON(Map json){
- return Collection(name: json['name'],router: json['router']);
+ factory Collection.fromJSON(Map json) {
+ return Collection(name: json['name'], router: json['router']);
}
Object toMap() {
@@ -48,7 +48,7 @@ class CollectionControlModel {
Future> getAllCollection() async {
List list = await sql.getByCondition();
List resultList = [];
- list.forEach((item){
+ list.forEach((item) {
print('collection item =>> $item');
resultList.add(Collection.fromJSON(item));
});
@@ -68,11 +68,12 @@ class CollectionControlModel {
}
// 删除
- Future deleteByName(String name) async{
- return await sql.delete(name,'name');
+ Future deleteByName(String name) async {
+ return await sql.delete(name, 'name');
}
+
// 通过path删除
- Future deleteByPath(String path) async{
- return await sql.delete(path,'router');
+ Future deleteByPath(String path) async {
+ return await sql.delete(path, 'router');
}
}
diff --git a/lib/model/responseData.dart b/lib/model/responseData.dart
index 1b5327e5..b311138c 100644
--- a/lib/model/responseData.dart
+++ b/lib/model/responseData.dart
@@ -1,25 +1,20 @@
-class ResponseData{
+class ResponseData {
int status;
bool success;
String message;
- ResponseData(this.status, this.success,this.message);
+ ResponseData(this.status, this.success, this.message);
ResponseData.fromJson(Map json)
: status = json['status'],
success = json['success'],
- message=json['message'];
+ message = json['message'];
Map toJson() =>
- {
- 'status': status,
- 'success': success,
- 'messsage': message
- };
-
+ {'status': status, 'success': success, 'messsage': message};
+
@override
String toString() {
return 'status: $status ,success: $success,message: ${message.toString()}';
}
-
-}
\ No newline at end of file
+}
diff --git a/lib/model/search_history.dart b/lib/model/search_history.dart
index da2e4cdd..26f761db 100644
--- a/lib/model/search_history.dart
+++ b/lib/model/search_history.dart
@@ -12,7 +12,6 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_go/utils/shared_preferences.dart';
-
class SearchHistory {
final String name;
final String targetRouter;
@@ -73,7 +72,7 @@ class SearchHistoryList {
}
add(SearchHistory item) {
- print("_searchHistoryList> ${_searchHistoryList.length}");
+ print("add item to serach history ${item.targetRouter}");
for (SearchHistory value in _searchHistoryList) {
if (value.name == item.name) {
return;
diff --git a/lib/model/story.dart b/lib/model/story.dart
index c8bfbab2..6080d255 100644
--- a/lib/model/story.dart
+++ b/lib/model/story.dart
@@ -4,20 +4,21 @@ class StoryModel {
final int id;
final String url;
- StoryModel(this.id, this.title, {this.image,this.url});
+ StoryModel(this.id, this.title, {this.image, this.url});
StoryModel.fromJson(Map json)
- : this(json['id'], json['title'],
- image: json['image'] != null ? json['image'] : (json['images'] != null ? json['images'][0] : null),
- url: json['url'] != null ? json['url'] : (json['url'] != null ? json['url'][0] : null),
- );
+ : this(
+ json['id'],
+ json['title'],
+ image: json['image'] != null
+ ? json['image']
+ : (json['images'] != null ? json['images'][0] : null),
+ url: json['url'] != null
+ ? json['url']
+ : (json['url'] != null ? json['url'][0] : null),
+ );
Map toJson() {
- return {
- 'id': id,
- 'title': title,
- 'image': image,
- 'url':url
- };
+ return {'id': id, 'title': title, 'image': image, 'url': url};
}
-}
\ No newline at end of file
+}
diff --git a/lib/model/user_info.dart b/lib/model/user_info.dart
index 5007e512..39db2b10 100644
--- a/lib/model/user_info.dart
+++ b/lib/model/user_info.dart
@@ -14,13 +14,13 @@ class UserInformation {
factory UserInformation.fromJson(Map json) {
print('fromJOSN $json ${json['id'].runtimeType}');
String name = json['name'];
- int userId ;
- if(json['name'] == null){
+ int userId;
+ if (json['name'] == null) {
name = json['url_name'];
}
- if(json['id'].runtimeType == int){
+ if (json['id'].runtimeType == int) {
userId = json['id'];
- }else{
+ } else {
userId = int.parse(json['id']);
}
return UserInformation(
diff --git a/lib/model/user_info_cache.dart b/lib/model/user_info_cache.dart
index 8bfe018c..20112882 100644
--- a/lib/model/user_info_cache.dart
+++ b/lib/model/user_info_cache.dart
@@ -1,5 +1,5 @@
-/// @Author: 一凨
-/// @Date: 2019-01-07 16:24:42
+/// @Author: 一凨
+/// @Date: 2019-01-07 16:24:42
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-08 17:37:42
@@ -18,8 +18,8 @@ class UserInfo implements UserInfoInterface {
UserInfo({this.username, this.password});
- factory UserInfo.fromJSON(Map json){
- return UserInfo(username: json['username'],password: json['password']);
+ factory UserInfo.fromJSON(Map json) {
+ return UserInfo(username: json['username'], password: json['password']);
}
Object toMap() {
@@ -39,8 +39,8 @@ class UserInfoControlModel {
// 插入新的缓存
Future insert(UserInfo userInfo) {
- var result =
- sql.insert({'username': userInfo.username, 'password': userInfo.password});
+ var result = sql
+ .insert({'username': userInfo.username, 'password': userInfo.password});
return result;
}
@@ -48,7 +48,7 @@ class UserInfoControlModel {
Future> getAllInfo() async {
List list = await sql.getByCondition();
List resultList = [];
- list.forEach((item){
+ list.forEach((item) {
print(item);
resultList.add(UserInfo.fromJSON(item));
});
@@ -56,9 +56,7 @@ class UserInfoControlModel {
}
// 清空表中数据
- Future deleteAll() async{
+ Future deleteAll() async {
return await sql.deleteAll();
}
-
-
}
diff --git a/lib/model/widget.dart b/lib/model/widget.dart
index c0f37d0d..936b01da 100644
--- a/lib/model/widget.dart
+++ b/lib/model/widget.dart
@@ -1,14 +1,10 @@
-
import 'dart:async';
import "package:flutter/material.dart";
import "package:flutter_go/routers/application.dart";
import 'package:flutter_go/utils/sql.dart';
-enum treeNode {
- CategoryComponent,
- WidgetLeaf
-}
+enum treeNode { CategoryComponent, WidgetLeaf }
//typedef aaa
@@ -135,6 +131,7 @@ class WidgetControlModel {
}
return new WidgetPoint.fromJSON(json.first);
}
+
Future> search(String name) async {
List json = await sql.search(conditions: {'name': name});
@@ -149,6 +146,7 @@ class WidgetControlModel {
return widgets;
}
}
+
// 抽象类
abstract class CommonItem {
int id;
@@ -179,19 +177,17 @@ class CategoryComponent extends CommonItem {
CommonItem parent;
String token;
-
List children = [];
String type = 'category';
- CategoryComponent({
- @required this.id,
- @required this.name,
- @required this.parentId,
- this.type = 'categoryw',
- this.children,
- this.parent
- });
+ CategoryComponent(
+ {@required this.id,
+ @required this.name,
+ @required this.parentId,
+ this.type = 'categoryw',
+ this.children,
+ this.parent});
CategoryComponent.fromJson(Map json) {
if (json['id'] != null && json['id'].runtimeType == String) {
this.id = int.parse(json['id']);
@@ -206,27 +202,25 @@ class CategoryComponent extends CommonItem {
if (item is CategoryComponent) {
CategoryComponent cate = item;
cate.parent = this;
- this.children.add(
- cate
- );
+ this.children.add(cate);
}
if (item is WidgetLeaf) {
WidgetLeaf widget = item;
widget.parent = this;
- this.children.add(
- widget
- );
+ this.children.add(widget);
}
}
+
@override
CommonItem getChild(String token) {
- return children.firstWhere((CommonItem item) => item.token == token, orElse: () => null);
+ return children.firstWhere((CommonItem item) => item.token == token,
+ orElse: () => null);
}
@override
CommonItem find(String token, [CommonItem node]) {
CommonItem ret;
- if (node !=null) {
+ if (node != null) {
if (node.token == token) {
return node;
} else {
@@ -260,14 +254,13 @@ class WidgetLeaf extends CommonItem {
CommonItem parent;
String type = 'widget';
- WidgetLeaf({
- @required this.id,
- @required this.name,
- @required this.display,
- this.author,
- this.path,
- this.pageId
- });
+ WidgetLeaf(
+ {@required this.id,
+ @required this.name,
+ @required this.display,
+ this.author,
+ this.path,
+ this.pageId});
WidgetLeaf.fromJson(Map json) {
if (json['id'] != null && json['id'].runtimeType == String) {
@@ -286,25 +279,27 @@ class WidgetLeaf extends CommonItem {
CommonItem getChild(String token) {
return null;
}
+
@override
addChildren(Object item) {
// TODO: implement addChildren
return null;
}
- CommonItem find(String token, [CommonItem node]){
+ CommonItem find(String token, [CommonItem node]) {
return null;
}
}
class WidgetTree {
// 构建树型结构
- static CategoryComponent buildWidgetTree(List json, [parent]){
+ static CategoryComponent buildWidgetTree(List json, [parent]) {
CategoryComponent current;
if (parent != null) {
current = parent;
} else {
- current = CategoryComponent(id: 0, name: 'root', parentId: null, children: []);
+ current =
+ CategoryComponent(id: 0, name: 'root', parentId: null, children: []);
}
json.forEach((item) {
// 归属分类级别
@@ -357,10 +352,13 @@ class WidgetTree {
});
return list;
}
- static CategoryComponent getCommonItemById(List path, CategoryComponent root) {
+
+ static CategoryComponent getCommonItemById(
+ List path, CategoryComponent root) {
print("getCommonItemByPath $path");
print("root $root");
CommonItem childLeaf;
+
/// int first = path.first;
path = path.sublist(1);
print("path:::: $path");
@@ -368,7 +366,6 @@ class WidgetTree {
// childLeaf = root.getChild(path.first);
}
-
return childLeaf;
}
-}
\ No newline at end of file
+}
diff --git a/lib/page_demo_package/.demo.json b/lib/page_demo_package/.demo.json
index 1967c339..ff076189 100644
--- a/lib/page_demo_package/.demo.json
+++ b/lib/page_demo_package/.demo.json
@@ -1 +1 @@
-[{"name":"demoName","screenShot":"","author":"yourName","email":"yourEmail","desc":"这是一个测试的标准demo","id":"1a29aa8e_32ae_4241_9c8a_5c9e1f92b096"},{"name":"local","screenShot":"","author":"ab","email":"email","desc":"ags","id":"2c1d57d0_42ae_4241_9c8a_5c9e1f92b096"}]
\ No newline at end of file
+[{"name":"PullToRefresh","screenShot":"","author":"chenfeihu","email":"763551832@qq.com","desc":"刷新组件","id":"5553db80_52ae_4241_9c8a_5c9e1f92b096"},{"name":"RangeSlider","screenShot":"","author":"RangeSlider","email":"hanxu317@qq.com","desc":"RangeSlider widget demo","id":"e5f958bc_52ae_4241_9c8a_5c9e1f92b096"},{"name":"demoName","screenShot":"","author":"yourName","email":"yourEmail","desc":"这是一个测试的标准demo","id":"1a29aa8e_32ae_4241_9c8a_5c9e1f92b096"},{"name":"local","screenShot":"","author":"ab","email":"email","desc":"ags","id":"2c1d57d0_42ae_4241_9c8a_5c9e1f92b096"}]
\ No newline at end of file
diff --git a/lib/page_demo_package/PullToRefresh_chenfeihu_5553db80_52ae_4241_9c8a_5c9e1f92b096/.demo.json b/lib/page_demo_package/PullToRefresh_chenfeihu_5553db80_52ae_4241_9c8a_5c9e1f92b096/.demo.json
new file mode 100644
index 00000000..1fe09bd0
--- /dev/null
+++ b/lib/page_demo_package/PullToRefresh_chenfeihu_5553db80_52ae_4241_9c8a_5c9e1f92b096/.demo.json
@@ -0,0 +1,9 @@
+{
+ "name": "PullToRefresh",
+ "screenShot": "",
+ "author":"chenfeihu",
+ "email": "763551832@qq.com",
+ "desc": "刷新组件",
+ "id": "5553db80_52ae_4241_9c8a_5c9e1f92b096"
+}
+
\ No newline at end of file
diff --git a/lib/page_demo_package/PullToRefresh_chenfeihu_5553db80_52ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/page_demo_package/PullToRefresh_chenfeihu_5553db80_52ae_4241_9c8a_5c9e1f92b096/index.dart
new file mode 100644
index 00000000..18597449
--- /dev/null
+++ b/lib/page_demo_package/PullToRefresh_chenfeihu_5553db80_52ae_4241_9c8a_5c9e1f92b096/index.dart
@@ -0,0 +1,11 @@
+//
+// Created with flutter go cli
+// User: chenfeihu
+// Time: 2019-09-24 12:11:14.085126
+// email: 763551832@qq.com
+// desc: 刷新组件
+//
+
+import 'src/index.dart';
+
+var demoWidgets = [new Demo()];
diff --git a/lib/page_demo_package/PullToRefresh_chenfeihu_5553db80_52ae_4241_9c8a_5c9e1f92b096/src/index.dart b/lib/page_demo_package/PullToRefresh_chenfeihu_5553db80_52ae_4241_9c8a_5c9e1f92b096/src/index.dart
new file mode 100644
index 00000000..2ebe44e3
--- /dev/null
+++ b/lib/page_demo_package/PullToRefresh_chenfeihu_5553db80_52ae_4241_9c8a_5c9e1f92b096/src/index.dart
@@ -0,0 +1,246 @@
+import 'dart:math';
+
+import 'package:flutter/material.dart';
+import 'package:pull_to_refresh/pull_to_refresh.dart';
+
+class Demo extends StatefulWidget {
+ @override
+ _State createState() => _State();
+}
+
+class _State extends State {
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ margin: EdgeInsets.all(5.0),
+ width: double.infinity,
+ height: 600.0,
+ child: Pulltorefresh(),
+ );
+ }
+}
+
+class Pulltorefresh extends StatefulWidget {
+ @override
+ _PulltorefreshState createState() => _PulltorefreshState();
+}
+
+class _PulltorefreshState extends State {
+ List datas = ListData.getList();
+ RefreshController _controller = RefreshController(initialRefresh: false);
+
+ void _onRefresh() async {
+ await Future.delayed(Duration(milliseconds: 1000));
+ _controller.refreshCompleted();
+ }
+
+ void _onLoading() async {
+ await Future.delayed(Duration(milliseconds: 1500));
+ ItemModel model = ItemModel(getRandomColor(), Icons.airplanemode_active,
+ "军事新闻", "俄军大秀战略", "酝酿已久的俄罗斯“中部-2019”战略演习于16日正式启动", 5000);
+
+ this.datas.add(Item(getRandomColor(), model.icon, model.mainTitle,
+ model.subTitle, model.des, model.readCount));
+ this.datas.add(Item(getRandomColor(), model.icon, model.mainTitle,
+ model.subTitle, model.des, model.readCount));
+ this.datas.add(Item(getRandomColor(), model.icon, model.mainTitle,
+ model.subTitle, model.des, model.readCount));
+ this.datas.add(Item(getRandomColor(), model.icon, model.mainTitle,
+ model.subTitle, model.des, model.readCount));
+ this.datas.add(Item(getRandomColor(), model.icon, model.mainTitle,
+ model.subTitle, model.des, model.readCount));
+ this.datas.add(Item(getRandomColor(), model.icon, model.mainTitle,
+ model.subTitle, model.des, model.readCount));
+ this.datas.add(Item(getRandomColor(), model.icon, model.mainTitle,
+ model.subTitle, model.des, model.readCount));
+ this.datas.add(Item(getRandomColor(), model.icon, model.mainTitle,
+ model.subTitle, model.des, model.readCount));
+ if (mounted) setState(() {});
+ _controller.loadComplete();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ Widget _itemBuilder(BuildContext context, int position) {
+ return Card(child: this.datas[position]);
+ }
+
+ return Scaffold(
+ appBar: AppBar(
+ title: Text("Pulltorefresh"),
+ ),
+ body: SmartRefresher(
+ enablePullDown: true,
+ enablePullUp: true,
+ header: WaterDropHeader(),
+ footer: ClassicFooter(
+ loadStyle: LoadStyle.ShowAlways,
+ completeDuration: Duration(microseconds: 50),
+ ),
+ onRefresh: _onRefresh,
+ onLoading: _onLoading,
+ controller: _controller,
+ child: ListView.builder(
+ itemBuilder: _itemBuilder, itemCount: this.datas.length),
+ ),
+ );
+ }
+
+ Color getRandomColor() {
+ List colors = [
+ Colors.deepOrange,
+ Colors.amber,
+ Colors.cyan,
+ Colors.green,
+ Colors.red,
+ Colors.yellow
+ ];
+ int randomValue = Random().nextInt(colors.length);
+ if (randomValue == colors.length) {
+ randomValue = colors.length - 1;
+ }
+ return colors[randomValue];
+ }
+}
+
+class Item extends StatelessWidget {
+ Color color;
+ IconData icon;
+ String mainTitle;
+ String subTitle;
+ String des;
+ int readCount;
+
+ Item(this.color, this.icon, this.mainTitle, this.subTitle, this.des,
+ this.readCount);
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
+ height: 90.0,
+ child: Row(
+ children: [
+ Container(
+ width: 90.0,
+ color: color,
+ alignment: Alignment.center,
+ child: Icon(icon, color: Colors.white),
+ ),
+ SizedBox(width: 10),
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Expanded(
+ child: Text(mainTitle,
+ style: TextStyle(
+ fontWeight: FontWeight.bold, fontSize: 18.0))),
+ Expanded(child: Text(subTitle, style: TextStyle(fontSize: 14.0))),
+ Expanded(
+ child: Text(
+ des,
+ style: TextStyle(fontSize: 13.0),
+ overflow: TextOverflow.ellipsis,
+ )),
+ Expanded(
+ child: Text("阅读量:${readCount.toString()}",
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 14.0,
+ color: Colors.redAccent))),
+ ],
+ ))
+ ],
+ ),
+ );
+ }
+}
+
+class ItemModel {
+ Color _color;
+ IconData _icon;
+ String _mainTitle;
+ String _subTitle;
+ String _des;
+ int _readCount;
+
+ ItemModel(this._color, this._icon, this._mainTitle, this._subTitle, this._des,
+ this._readCount);
+
+ int get readCount => _readCount;
+
+ set readCount(int value) {
+ _readCount = value;
+ }
+
+ String get des => _des;
+
+ set des(String value) {
+ _des = value;
+ }
+
+ String get subTitle => _subTitle;
+
+ set subTitle(String value) {
+ _subTitle = value;
+ }
+
+ String get mainTitle => _mainTitle;
+
+ set mainTitle(String value) {
+ _mainTitle = value;
+ }
+
+ IconData get icon => _icon;
+
+ set icon(IconData value) {
+ _icon = value;
+ }
+
+ Color get color => _color;
+
+ set color(Color value) {
+ _color = value;
+ }
+}
+
+class ListData {
+ static List getList() {
+ List models = [];
+ ItemModel model1 = ItemModel(Colors.red, Icons.airplanemode_active, "军事新闻",
+ "俄军大秀战略", "酝酿已久的俄罗斯“中部-2019”战略演习于16日正式启动", 2999);
+ ItemModel model2 = ItemModel(Colors.red, Icons.airplanemode_active, "军事新闻",
+ "俄“中部”演习", "俄罗斯卫星网报道称,俄罗斯国防部长绍伊古表示,“中央-2019”战略演习是", 4588);
+ ItemModel model3 = ItemModel(Colors.red, Icons.airplanemode_active, "军事新闻",
+ "中国2.7万吨坞登舰", "据印度新德里电视台16日报道,印度海军发现7艘中国军舰在印度洋", 7777);
+ ItemModel model4 = ItemModel(Colors.red, Icons.airplanemode_active, "军事新闻",
+ "针对中国?", "美国空军着力打造军用5G网络,5G+VR,飞行员无需上天就能操控战机;美军濒海", 8888);
+ ItemModel model5 = ItemModel(Colors.red, Icons.airplanemode_active, "军事新闻",
+ "“凯旋”防空导弹系统", "俄罗斯卫星通讯社报道,俄罗斯北方舰队(Russian Northern Fleet)新闻处", 9999);
+ ItemModel model6 = ItemModel(Colors.red, Icons.airplanemode_active, "军事新闻",
+ "火箭军还有骑兵连", "迅速对禁区“敌特分子”活动区域进行侦察定位,战斗小分队", 104754);
+ ItemModel model7 = ItemModel(Colors.red, Icons.airplanemode_active, "军事新闻",
+ "侦察兵跨越冰川", "在海拔5000多米的雪域高原,第77集团军某合成旅的侦察兵们正在进行野外驻训", 47545);
+ ItemModel model8 = ItemModel(Colors.red, Icons.airplanemode_active, "军事新闻",
+ "香港被护商船", "新京报快讯 据北海舰队官微消息:“感谢海军!”“祖国万岁!”,当地时", 124574);
+
+ models.add(Item(model1.color, model1.icon, model1.mainTitle,
+ model1.subTitle, model1.des, model1.readCount));
+ models.add(Item(model2.color, model2.icon, model2.mainTitle,
+ model2.subTitle, model2.des, model2.readCount));
+ models.add(Item(model3.color, model3.icon, model3.mainTitle,
+ model3.subTitle, model3.des, model3.readCount));
+ models.add(Item(model4.color, model4.icon, model4.mainTitle,
+ model4.subTitle, model4.des, model4.readCount));
+ models.add(Item(model5.color, model5.icon, model5.mainTitle,
+ model5.subTitle, model5.des, model5.readCount));
+ models.add(Item(model6.color, model6.icon, model6.mainTitle,
+ model6.subTitle, model6.des, model6.readCount));
+ models.add(Item(model7.color, model7.icon, model7.mainTitle,
+ model7.subTitle, model7.des, model7.readCount));
+ models.add(Item(model8.color, model8.icon, model8.mainTitle,
+ model8.subTitle, model8.des, model8.readCount));
+ return models;
+ }
+}
diff --git a/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/.demo.json b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/.demo.json
new file mode 100644
index 00000000..10444611
--- /dev/null
+++ b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/.demo.json
@@ -0,0 +1,8 @@
+{
+ "name": "RangeSlider",
+ "screenShot": "",
+ "author":"RangeSlider",
+ "email": "hanxu317@qq.com",
+ "desc": "RangeSlider widget demo",
+ "id": "e5f958bc_52ae_4241_9c8a_5c9e1f92b096"
+}
diff --git a/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/index.dart
new file mode 100644
index 00000000..210ca1e5
--- /dev/null
+++ b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/index.dart
@@ -0,0 +1,11 @@
+//
+// Created with flutter go cli
+// User: RangeSlider
+// Time: 2019-09-12 15:11:05.512158
+// email: hanxu317@qq.com
+// desc: RangeSlider widget demo
+//
+
+import 'src/index.dart';
+
+var demoWidgets = [new Demo()];
diff --git a/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/src/index.dart b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/src/index.dart
new file mode 100644
index 00000000..bc34bf8f
--- /dev/null
+++ b/lib/page_demo_package/RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/src/index.dart
@@ -0,0 +1,30 @@
+import 'package:flutter/material.dart';
+
+class Demo extends StatefulWidget {
+ @override
+ _State createState() => _State();
+}
+
+class _State extends State {
+ RangeValues valuess = RangeValues(20.0, 50.0);
+ @override
+ Widget build(BuildContext context) {
+ return RangeSlider(
+ values: valuess,
+ //实际进度的位置
+ inactiveColor: Colors.black12,
+ //进度中不活动部分的颜色
+ labels: RangeLabels('12', '23'),
+ min: 0.0,
+ max: 100.0,
+ divisions: 1000,
+ activeColor: Colors.blue,
+ //进度中活动部分的颜色
+ onChanged: (rangeValues) {
+ setState(() {
+ valuess = rangeValues;
+ });
+ },
+ );
+ }
+}
diff --git a/lib/page_demo_package/demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/page_demo_package/demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/index.dart
index 68193686..e2767909 100644
--- a/lib/page_demo_package/demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/index.dart
+++ b/lib/page_demo_package/demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/index.dart
@@ -8,8 +8,4 @@
import 'src/index.dart';
-var demoWidgets = [
- new Demo()
-];
-
-
\ No newline at end of file
+var demoWidgets = [new Demo()];
diff --git a/lib/page_demo_package/demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/src/index.dart b/lib/page_demo_package/demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/src/index.dart
index e2992379..331dc4c9 100644
--- a/lib/page_demo_package/demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/src/index.dart
+++ b/lib/page_demo_package/demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/src/index.dart
@@ -9,8 +9,6 @@ class _State extends State {
@override
Widget build(BuildContext context) {
return Container(
- child: RaisedButton(onPressed: () {}, child: Text('我是md中引入的demo'))
- );
+ child: RaisedButton(onPressed: () {}, child: Text('我是md中引入的demo')));
}
}
-
\ No newline at end of file
diff --git a/lib/page_demo_package/index.dart b/lib/page_demo_package/index.dart
index 1e6a4966..42fb0c10 100644
--- a/lib/page_demo_package/index.dart
+++ b/lib/page_demo_package/index.dart
@@ -1,6 +1,20 @@
-import 'demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardDemo_demoName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096;
-import 'local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardDemo_local_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096;
-var demoObjects = {
- '1a29aa8e_32ae_4241_9c8a_5c9e1f92b096': StandardDemo_demoName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096.demoWidgets,
- '2c1d57d0_42ae_4241_9c8a_5c9e1f92b096': StandardDemo_local_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096.demoWidgets
-};
\ No newline at end of file
+import 'PullToRefresh_chenfeihu_5553db80_52ae_4241_9c8a_5c9e1f92b096/index.dart'
+ as StandardDemo_PullToRefresh_5553db80_52ae_4241_9c8a_5c9e1f92b096;
+import 'RangeSlider_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096/index.dart'
+ as StandardDemo_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096;
+import 'demoName_yourName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096/index.dart'
+ as StandardDemo_demoName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096;
+import 'local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/index.dart'
+ as StandardDemo_local_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096;
+
+var demoObjects = {
+ '5553db80_52ae_4241_9c8a_5c9e1f92b096':
+ StandardDemo_PullToRefresh_5553db80_52ae_4241_9c8a_5c9e1f92b096
+ .demoWidgets,
+ 'e5f958bc_52ae_4241_9c8a_5c9e1f92b096':
+ StandardDemo_RangeSlider_e5f958bc_52ae_4241_9c8a_5c9e1f92b096.demoWidgets,
+ '1a29aa8e_32ae_4241_9c8a_5c9e1f92b096':
+ StandardDemo_demoName_1a29aa8e_32ae_4241_9c8a_5c9e1f92b096.demoWidgets,
+ '2c1d57d0_42ae_4241_9c8a_5c9e1f92b096':
+ StandardDemo_local_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096.demoWidgets
+};
diff --git a/lib/page_demo_package/local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/page_demo_package/local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/index.dart
index 4e315373..75063a13 100644
--- a/lib/page_demo_package/local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/index.dart
+++ b/lib/page_demo_package/local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/index.dart
@@ -8,8 +8,4 @@
import 'src/index.dart';
-var demoWidgets = [
- new Demo()
-];
-
-
\ No newline at end of file
+var demoWidgets = [new Demo()];
diff --git a/lib/page_demo_package/local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/src/index.dart b/lib/page_demo_package/local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/src/index.dart
index d0d3921e..510fb6de 100644
--- a/lib/page_demo_package/local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/src/index.dart
+++ b/lib/page_demo_package/local_ab_2c1d57d0_42ae_4241_9c8a_5c9e1f92b096/src/index.dart
@@ -13,4 +13,3 @@ class _State extends State {
);
}
}
-
\ No newline at end of file
diff --git a/lib/resources/icon_names.dart b/lib/resources/icon_names.dart
index e7562778..a2764f14 100644
--- a/lib/resources/icon_names.dart
+++ b/lib/resources/icon_names.dart
@@ -9,9 +9,1110 @@ import 'package:flutter/material.dart';
import 'package:flutter/cupertino.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
+ ];
}
class CupertinoIIconNames {
- static List names = [CupertinoIcons.add,CupertinoIcons.add_circled,CupertinoIcons.add_circled_solid,CupertinoIcons.back,CupertinoIcons.battery_25_percent,CupertinoIcons.battery_75_percent,CupertinoIcons.battery_charging,CupertinoIcons.battery_empty,CupertinoIcons.battery_full,CupertinoIcons.bluetooth,CupertinoIcons.book,CupertinoIcons.book_solid,CupertinoIcons.bookmark,CupertinoIcons.bookmark_solid,CupertinoIcons.check_mark,CupertinoIcons.check_mark_circled,CupertinoIcons.check_mark_circled_solid,CupertinoIcons.clear,CupertinoIcons.clear_circled,CupertinoIcons.clear_circled_solid,CupertinoIcons.clear_thick,CupertinoIcons.clear_thick_circled,CupertinoIcons.clock,CupertinoIcons.clock_solid,CupertinoIcons.collections,CupertinoIcons.collections_solid,CupertinoIcons.conversation_bubble,CupertinoIcons.create,CupertinoIcons.create_solid,CupertinoIcons.delete,CupertinoIcons.delete_simple,CupertinoIcons.delete_solid,CupertinoIcons.down_arrow,CupertinoIcons.ellipsis,CupertinoIcons.eye,CupertinoIcons.eye_solid,CupertinoIcons.flag,CupertinoIcons.folder,CupertinoIcons.folder_open,CupertinoIcons.folder_solid,CupertinoIcons.forward,CupertinoIcons.fullscreen,CupertinoIcons.fullscreen_exit,CupertinoIcons.gear,CupertinoIcons.gear_big,CupertinoIcons.gear_solid,CupertinoIcons.group,CupertinoIcons.group_solid,CupertinoIcons.home,CupertinoIcons.info,CupertinoIcons.left_chevron,CupertinoIcons.location,CupertinoIcons.location_solid,CupertinoIcons.loop,CupertinoIcons.loop_thick,CupertinoIcons.mail,CupertinoIcons.mail_solid,CupertinoIcons.mic,CupertinoIcons.mic_off,CupertinoIcons.mic_solid,CupertinoIcons.minus_circled,CupertinoIcons.music_note,CupertinoIcons.padlock,CupertinoIcons.padlock_solid,CupertinoIcons.pause,CupertinoIcons.pause_solid,CupertinoIcons.pen,CupertinoIcons.pencil,CupertinoIcons.person,CupertinoIcons.person_add,CupertinoIcons.person_add_solid,CupertinoIcons.person_solid,CupertinoIcons.phone,CupertinoIcons.phone_solid,CupertinoIcons.photo_camera,CupertinoIcons.photo_camera_solid,CupertinoIcons.play_arrow,CupertinoIcons.play_arrow_solid,CupertinoIcons.plus_circled,CupertinoIcons.profile_circled,CupertinoIcons.refresh,CupertinoIcons.refresh_bold,CupertinoIcons.refresh_circled,CupertinoIcons.refresh_circled_solid,CupertinoIcons.refresh_thick,CupertinoIcons.refresh_thin,CupertinoIcons.reply,CupertinoIcons.reply_all,CupertinoIcons.reply_thick_solid,CupertinoIcons.restart,CupertinoIcons.right_chevron,CupertinoIcons.search,CupertinoIcons.settings,CupertinoIcons.settings_solid,CupertinoIcons.share,CupertinoIcons.share_solid,CupertinoIcons.share_up,CupertinoIcons.shopping_cart,CupertinoIcons.shuffle_thick,CupertinoIcons.switch_camera,CupertinoIcons.switch_camera_solid,CupertinoIcons.tag,CupertinoIcons.tag_solid,CupertinoIcons.tags,CupertinoIcons.tags_solid,CupertinoIcons.time,CupertinoIcons.time_solid,CupertinoIcons.up_arrow,CupertinoIcons.video_camera,CupertinoIcons.video_camera_solid,CupertinoIcons.volume_down,CupertinoIcons.volume_mute,CupertinoIcons.volume_off,CupertinoIcons.volume_up];
-}
\ No newline at end of file
+ static List names = [
+ CupertinoIcons.add,
+ CupertinoIcons.add_circled,
+ CupertinoIcons.add_circled_solid,
+ CupertinoIcons.back,
+ CupertinoIcons.battery_25_percent,
+ CupertinoIcons.battery_75_percent,
+ CupertinoIcons.battery_charging,
+ CupertinoIcons.battery_empty,
+ CupertinoIcons.battery_full,
+ CupertinoIcons.bluetooth,
+ CupertinoIcons.book,
+ CupertinoIcons.book_solid,
+ CupertinoIcons.bookmark,
+ CupertinoIcons.bookmark_solid,
+ CupertinoIcons.check_mark,
+ CupertinoIcons.check_mark_circled,
+ CupertinoIcons.check_mark_circled_solid,
+ CupertinoIcons.clear,
+ CupertinoIcons.clear_circled,
+ CupertinoIcons.clear_circled_solid,
+ CupertinoIcons.clear_thick,
+ CupertinoIcons.clear_thick_circled,
+ CupertinoIcons.clock,
+ CupertinoIcons.clock_solid,
+ CupertinoIcons.collections,
+ CupertinoIcons.collections_solid,
+ CupertinoIcons.conversation_bubble,
+ CupertinoIcons.create,
+ CupertinoIcons.create_solid,
+ CupertinoIcons.delete,
+ CupertinoIcons.delete_simple,
+ CupertinoIcons.delete_solid,
+ CupertinoIcons.down_arrow,
+ CupertinoIcons.ellipsis,
+ CupertinoIcons.eye,
+ CupertinoIcons.eye_solid,
+ CupertinoIcons.flag,
+ CupertinoIcons.folder,
+ CupertinoIcons.folder_open,
+ CupertinoIcons.folder_solid,
+ CupertinoIcons.forward,
+ CupertinoIcons.fullscreen,
+ CupertinoIcons.fullscreen_exit,
+ CupertinoIcons.gear,
+ CupertinoIcons.gear_big,
+ CupertinoIcons.gear_solid,
+ CupertinoIcons.group,
+ CupertinoIcons.group_solid,
+ CupertinoIcons.home,
+ CupertinoIcons.info,
+ CupertinoIcons.left_chevron,
+ CupertinoIcons.location,
+ CupertinoIcons.location_solid,
+ CupertinoIcons.loop,
+ CupertinoIcons.loop_thick,
+ CupertinoIcons.mail,
+ CupertinoIcons.mail_solid,
+ CupertinoIcons.mic,
+ CupertinoIcons.mic_off,
+ CupertinoIcons.mic_solid,
+ CupertinoIcons.minus_circled,
+ CupertinoIcons.music_note,
+ CupertinoIcons.padlock,
+ CupertinoIcons.padlock_solid,
+ CupertinoIcons.pause,
+ CupertinoIcons.pause_solid,
+ CupertinoIcons.pen,
+ CupertinoIcons.pencil,
+ CupertinoIcons.person,
+ CupertinoIcons.person_add,
+ CupertinoIcons.person_add_solid,
+ CupertinoIcons.person_solid,
+ CupertinoIcons.phone,
+ CupertinoIcons.phone_solid,
+ CupertinoIcons.photo_camera,
+ CupertinoIcons.photo_camera_solid,
+ CupertinoIcons.play_arrow,
+ CupertinoIcons.play_arrow_solid,
+ CupertinoIcons.plus_circled,
+ CupertinoIcons.profile_circled,
+ CupertinoIcons.refresh,
+ CupertinoIcons.refresh_bold,
+ CupertinoIcons.refresh_circled,
+ CupertinoIcons.refresh_circled_solid,
+ CupertinoIcons.refresh_thick,
+ CupertinoIcons.refresh_thin,
+ CupertinoIcons.reply,
+ CupertinoIcons.reply_all,
+ CupertinoIcons.reply_thick_solid,
+ CupertinoIcons.restart,
+ CupertinoIcons.right_chevron,
+ CupertinoIcons.search,
+ CupertinoIcons.settings,
+ CupertinoIcons.settings_solid,
+ CupertinoIcons.share,
+ CupertinoIcons.share_solid,
+ CupertinoIcons.share_up,
+ CupertinoIcons.shopping_cart,
+ CupertinoIcons.shuffle_thick,
+ CupertinoIcons.switch_camera,
+ CupertinoIcons.switch_camera_solid,
+ CupertinoIcons.tag,
+ CupertinoIcons.tag_solid,
+ CupertinoIcons.tags,
+ CupertinoIcons.tags_solid,
+ CupertinoIcons.time,
+ CupertinoIcons.time_solid,
+ CupertinoIcons.up_arrow,
+ CupertinoIcons.video_camera,
+ CupertinoIcons.video_camera_solid,
+ CupertinoIcons.volume_down,
+ CupertinoIcons.volume_mute,
+ CupertinoIcons.volume_off,
+ CupertinoIcons.volume_up
+ ];
+}
diff --git a/lib/resources/shared_preferences_keys.dart b/lib/resources/shared_preferences_keys.dart
index ad7398ae..940485ea 100644
--- a/lib/resources/shared_preferences_keys.dart
+++ b/lib/resources/shared_preferences_keys.dart
@@ -1,4 +1,3 @@
-
// Created with Android Studio.
// User: 三帆
// Date: 31/01/2019
@@ -7,7 +6,6 @@
// target: xxx
//
-
//enum DateType {
// Int,
// Double,
@@ -27,12 +25,12 @@ class SharedPreferencesKeys {
/// boolean
/// 用于欢迎页面. 只有第一次访问才会显示. 或者手动将这个值设为false
static String showWelcome = 'loginWelcone';
- /// json
+
+ /// json
/// 用于存放搜索页的搜索数据.
/// [{
/// name: 'name'
- ///
+ ///
/// }]
static String searchHistory = 'searchHistory';
}
-
diff --git a/lib/resources/widget_name_to_icon.dart b/lib/resources/widget_name_to_icon.dart
index 82f2593f..5519b822 100644
--- a/lib/resources/widget_name_to_icon.dart
+++ b/lib/resources/widget_name_to_icon.dart
@@ -1,165 +1,166 @@
import 'package:flutter/material.dart';
+
class WidgetName2Icon {
- static Map icons = {
+ static Map icons = {
"Developer": Icons.developer_mode,
- "Standard": Icons.pages ,
- "Element":Icons.explicit,
- "Components":Icons.extension,
- "Theme":Icons.filter_b_and_w,
- "Form":Icons.table_chart,
- "Frame":Icons.aspect_ratio,
- "Media":Icons.subscriptions,
- "Input":Icons.input,
- "TextField":Icons.text_fields,
- "Checkbox":Icons.check_box,
- "CheckboxListTile":Icons.playlist_add_check,
- "Button":Icons.aspect_ratio,
- "FlatButton":Icons.outlined_flag,
- "RaisedButton":Icons.picture_in_picture_alt,
- "IconButton":Icons.import_contacts,
- "PopupMenuButton":Icons.power_input,
- "FloatingActionButton":Icons.flash_off,
- "RawMaterialButton":Icons.rowing,
- "DropdownButton":Icons.drag_handle,
- "OutlineButton":Icons.done_outline,
- "Text":Icons.text_format,
- "RichText":Icons.text_rotation_angleup,
- "Radio":Icons.radio_button_checked,
- "RadioListTile":Icons.list,
- "Slider":Icons.slideshow,
- "SliderTheme":Icons.theaters,
- "SliderComponentShape":Icons.format_shapes,
- "SliderThemeData":Icons.data_usage,
- "Switch":Icons.switch_camera,
- "SwitchListTile":Icons.switch_video,
- "AnimatedSwitcher":Icons.airplanemode_active,
- "Align":Icons.format_align_left,
- "Stack":Icons.storage,
- "IndexedStack":Icons.star,
- "Layout":Icons.layers,
- "Row":Icons.recent_actors,
- "Column":Icons.cloud_off,
- "Container":Icons.edit_location,
- "Center":Icons.gesture,
- "Box":Icons.hdr_strong,
- "ConstrainedBox":Icons.account_box,
- "OverflowBox":Icons.email,
- "DecoratedBox":Icons.settings_overscan,
- "FittedBox":Icons.data_usage,
- "LimitedBox":Icons.format_align_justify,
- "RenderBox":Icons.error,
- "RotateBox":Icons.navigate_next,
- "SizedOverflowBox":Icons.undo,
- "TextBox":Icons.wallpaper,
- "UnconstrainedBox":Icons.account_box,
- "Axis":Icons.access_alarm,
- "MainAxis":Icons.add_circle,
- "CrossAxis":Icons.dehaze,
- "FlipAxis":Icons.zoom_out,
- "Expanded":Icons.all_out,
- "Spacing":Icons.crop_free,
- "Padding":Icons.crop,
- "SliverPadding":Icons.euro_symbol,
- "AnimatedPadding":Icons.zoom_out_map,
- "Table":Icons.table_chart,
- "Image":Icons.image,
- "AssetImage":Icons.image_aspect_ratio,
- "DecorationImage":Icons.picture_in_picture,
- "DecorationImagePainter":Icons.image,
- "ExactAssetImage":Icons.assessment,
- "FadeInImage":Icons.flip,
- "FileImage":Icons.filter,
- "NetworkImage":Icons.network_wifi,
- "RawImage":Icons.text_rotation_down,
- "PaintImage":Icons.format_paint,
- "PrecacheImage":Icons.perm_camera_mic,
- "MemoryImage":Icons.memory,
- "Icon":Icons.event_available,
- "ImageIcon":Icons.image,
- "IconTheme":Icons.table_chart,
- "IconData":Icons.date_range,
- "IconThemeData":Icons.insert_comment,
- "Canvas":Icons.edit,
- "PainterPath":Icons.gesture,
- "CircleProgressBarPainter":Icons.av_timer,
- "PainterSketch":Icons.touch_app,
- "Material":Icons.android,
- "MaterialApp":Icons.android,
- "MaterialButton":Icons.speaker,
- "MaterialGap":Icons.view_week,
- "MaterialSlice":Icons.format_list_numbered_rtl ,
- "MaterialColor":Icons.color_lens,
- "Cupertino":Icons.phone_iphone,
- "Scroll":Icons.swap_vertical_circle,
- "Tab":Icons.tab,
- "Menu":Icons.menu,
- "PopupMenuDivider":Icons.remove,
- "PopupMenuEntry":Icons.menu,
- "CheckedPopupMenuItem":Icons.playlist_add_check,
- "DropdownMenuItem":Icons.playlist_play,
- "Grid":Icons.grid_on,
- "Scaffold":Icons.local_convenience_store,
- "Dialog":Icons.add_alert,
- "Bar":Icons.border_horizontal,
- "Card":Icons.credit_card,
- "Panel":Icons.video_label,
- "Navigation":Icons.navigation,
- "List":Icons.list,
- "ScrollView":Icons.move_to_inbox,
- "Scrollable":Icons.swap_vertical_circle,
- "ScrollbarPainter":Icons.format_paint,
- "ScrollMetrics":Icons.camera,
- "ScrollPhysics":Icons.control_point_duplicate,
- "BoxScrollView":Icons.inbox,
- "Chip":Icons.sim_card,
- "ChipTheme":Icons.sd_card,
- "CustomScrollView":Icons.autorenew,
- "NestedScrollView":Icons.panorama_fish_eye,
- "ChipThemeData":Icons.sim_card_alert,
- "ChoiceChip":Icons.insert_drive_file,
- "FilterChip":Icons.note_add,
- "InputChip":Icons.restore_page,
- "RawChip":Icons.save,
- "LinearProgressIndicator":Icons.trending_flat ,
- "CircularProgressIndicator":Icons.rotate_left ,
- "ExpansionPanel":Icons.view_stream,
- "ExpansionPanelList":Icons.view_headline,
- "BottomNavigationBar":Icons.call_to_action,
- "ListView":Icons.view_list ,
- "ListBody":Icons.list ,
- "AnimatedList":Icons.format_line_spacing ,
- "SliverAppBar":Icons.content_paste,
- "AppBar":Icons.card_membership,
- "BottomAppBar":Icons.call_to_action,
- "BottomNavigationBarItem":Icons.crop_original,
- "FlexibleSpaceBar":Icons.aspect_ratio,
- "ButtonBar":Icons.branding_watermark,
- "SnackBar":Icons.sms_failed,
- "Progress":Icons.sync,
- "Pick":Icons.event_note,
- "DayPicker":Icons.calendar_today,
- "MonthPicker":Icons.date_range,
- "YearPicker":Icons.event_busy,
- "ShowdatePicker":Icons.event,
- "MaterialPageRoute":Icons.album,
- "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,
- "CupertinoApp":Icons.face,
- "CupertinoButton":Icons.crop_7_5,
- "CupertinoColors":Icons.color_lens,
- "CupertinoIcons":Icons.insert_emoticon,
- "CupertinoNavigationBar":Icons.payment,
- "CupertinoPageRoute":Icons.router,
- "CupertinoPageScaffold":Icons.pages,
- "CupertinoPicker":Icons.add_alarm,
- "CupertinoPopupSurface":Icons.center_focus_weak,
+ "Standard": Icons.pages,
+ "Element": Icons.explicit,
+ "Components": Icons.extension,
+ "Theme": Icons.filter_b_and_w,
+ "Form": Icons.table_chart,
+ "Frame": Icons.aspect_ratio,
+ "Media": Icons.subscriptions,
+ "Input": Icons.input,
+ "TextField": Icons.text_fields,
+ "Checkbox": Icons.check_box,
+ "CheckboxListTile": Icons.playlist_add_check,
+ "Button": Icons.aspect_ratio,
+ "FlatButton": Icons.outlined_flag,
+ "RaisedButton": Icons.picture_in_picture_alt,
+ "IconButton": Icons.import_contacts,
+ "PopupMenuButton": Icons.power_input,
+ "FloatingActionButton": Icons.flash_off,
+ "RawMaterialButton": Icons.rowing,
+ "DropdownButton": Icons.drag_handle,
+ "OutlineButton": Icons.done_outline,
+ "Text": Icons.text_format,
+ "RichText": Icons.text_rotation_angleup,
+ "Radio": Icons.radio_button_checked,
+ "RadioListTile": Icons.list,
+ "Slider": Icons.slideshow,
+ "SliderTheme": Icons.theaters,
+ "SliderComponentShape": Icons.format_shapes,
+ "SliderThemeData": Icons.data_usage,
+ "Switch": Icons.switch_camera,
+ "SwitchListTile": Icons.switch_video,
+ "AnimatedSwitcher": Icons.airplanemode_active,
+ "Align": Icons.format_align_left,
+ "Stack": Icons.storage,
+ "IndexedStack": Icons.star,
+ "Layout": Icons.layers,
+ "Row": Icons.recent_actors,
+ "Column": Icons.cloud_off,
+ "Container": Icons.edit_location,
+ "Center": Icons.gesture,
+ "Box": Icons.hdr_strong,
+ "ConstrainedBox": Icons.account_box,
+ "OverflowBox": Icons.email,
+ "DecoratedBox": Icons.settings_overscan,
+ "FittedBox": Icons.data_usage,
+ "LimitedBox": Icons.format_align_justify,
+ "RenderBox": Icons.error,
+ "RotateBox": Icons.navigate_next,
+ "SizedOverflowBox": Icons.undo,
+ "TextBox": Icons.wallpaper,
+ "UnconstrainedBox": Icons.account_box,
+ "Axis": Icons.access_alarm,
+ "MainAxis": Icons.add_circle,
+ "CrossAxis": Icons.dehaze,
+ "FlipAxis": Icons.zoom_out,
+ "Expanded": Icons.all_out,
+ "Spacing": Icons.crop_free,
+ "Padding": Icons.crop,
+ "SliverPadding": Icons.euro_symbol,
+ "AnimatedPadding": Icons.zoom_out_map,
+ "Table": Icons.table_chart,
+ "Image": Icons.image,
+ "AssetImage": Icons.image_aspect_ratio,
+ "DecorationImage": Icons.picture_in_picture,
+ "DecorationImagePainter": Icons.image,
+ "ExactAssetImage": Icons.assessment,
+ "FadeInImage": Icons.flip,
+ "FileImage": Icons.filter,
+ "NetworkImage": Icons.network_wifi,
+ "RawImage": Icons.text_rotation_down,
+ "PaintImage": Icons.format_paint,
+ "PrecacheImage": Icons.perm_camera_mic,
+ "MemoryImage": Icons.memory,
+ "Icon": Icons.event_available,
+ "ImageIcon": Icons.image,
+ "IconTheme": Icons.table_chart,
+ "IconData": Icons.date_range,
+ "IconThemeData": Icons.insert_comment,
+ "Canvas": Icons.edit,
+ "PainterPath": Icons.gesture,
+ "CircleProgressBarPainter": Icons.av_timer,
+ "PainterSketch": Icons.touch_app,
+ "Material": Icons.android,
+ "MaterialApp": Icons.android,
+ "MaterialButton": Icons.speaker,
+ "MaterialGap": Icons.view_week,
+ "MaterialSlice": Icons.format_list_numbered_rtl,
+ "MaterialColor": Icons.color_lens,
+ "Cupertino": Icons.phone_iphone,
+ "Scroll": Icons.swap_vertical_circle,
+ "Tab": Icons.tab,
+ "Menu": Icons.menu,
+ "PopupMenuDivider": Icons.remove,
+ "PopupMenuEntry": Icons.menu,
+ "CheckedPopupMenuItem": Icons.playlist_add_check,
+ "DropdownMenuItem": Icons.playlist_play,
+ "Grid": Icons.grid_on,
+ "Scaffold": Icons.local_convenience_store,
+ "Dialog": Icons.add_alert,
+ "Bar": Icons.border_horizontal,
+ "Card": Icons.credit_card,
+ "Panel": Icons.video_label,
+ "Navigation": Icons.navigation,
+ "List": Icons.list,
+ "ScrollView": Icons.move_to_inbox,
+ "Scrollable": Icons.swap_vertical_circle,
+ "ScrollbarPainter": Icons.format_paint,
+ "ScrollMetrics": Icons.camera,
+ "ScrollPhysics": Icons.control_point_duplicate,
+ "BoxScrollView": Icons.inbox,
+ "Chip": Icons.sim_card,
+ "ChipTheme": Icons.sd_card,
+ "CustomScrollView": Icons.autorenew,
+ "NestedScrollView": Icons.panorama_fish_eye,
+ "ChipThemeData": Icons.sim_card_alert,
+ "ChoiceChip": Icons.insert_drive_file,
+ "FilterChip": Icons.note_add,
+ "InputChip": Icons.restore_page,
+ "RawChip": Icons.save,
+ "LinearProgressIndicator": Icons.trending_flat,
+ "CircularProgressIndicator": Icons.rotate_left,
+ "ExpansionPanel": Icons.view_stream,
+ "ExpansionPanelList": Icons.view_headline,
+ "BottomNavigationBar": Icons.call_to_action,
+ "ListView": Icons.view_list,
+ "ListBody": Icons.list,
+ "AnimatedList": Icons.format_line_spacing,
+ "SliverAppBar": Icons.content_paste,
+ "AppBar": Icons.card_membership,
+ "BottomAppBar": Icons.call_to_action,
+ "BottomNavigationBarItem": Icons.crop_original,
+ "FlexibleSpaceBar": Icons.aspect_ratio,
+ "ButtonBar": Icons.branding_watermark,
+ "SnackBar": Icons.sms_failed,
+ "Progress": Icons.sync,
+ "Pick": Icons.event_note,
+ "DayPicker": Icons.calendar_today,
+ "MonthPicker": Icons.date_range,
+ "YearPicker": Icons.event_busy,
+ "ShowdatePicker": Icons.event,
+ "MaterialPageRoute": Icons.album,
+ "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,
+ "CupertinoApp": Icons.face,
+ "CupertinoButton": Icons.crop_7_5,
+ "CupertinoColors": Icons.color_lens,
+ "CupertinoIcons": Icons.insert_emoticon,
+ "CupertinoNavigationBar": Icons.payment,
+ "CupertinoPageRoute": Icons.router,
+ "CupertinoPageScaffold": Icons.pages,
+ "CupertinoPicker": Icons.add_alarm,
+ "CupertinoPopupSurface": Icons.center_focus_weak,
"CupertinoScrollbar": Icons.fullscreen,
"CupertinoSlider": Icons.switch_camera,
"CupertinoSegmentedControl": Icons.business_center,
diff --git a/lib/routers/application.dart b/lib/routers/application.dart
index 0724ad89..08144b61 100644
--- a/lib/routers/application.dart
+++ b/lib/routers/application.dart
@@ -3,10 +3,12 @@ import 'package:fluro/fluro.dart';
import 'package:flutter_go/utils/shared_preferences.dart';
import '../model/widget.dart';
+
enum ENV {
PRODUCTION,
DEV,
}
+
class Application {
/// 通过Application设计环境变量
static ENV env = ENV.DEV;
@@ -18,20 +20,20 @@ class Application {
static bool pageIsOpen = false;
static Map github = {
- 'widgetsURL':'https://github.com/alibaba/flutter-go/blob/develop/lib/widgets/',
+ 'widgetsURL':
+ 'https://github.com/alibaba/flutter-go/blob/develop/lib/widgets/',
//'develop':'https://github.com/alibaba-paimai-frontend/flutter-common-widgets-app/tree/develop/lib/widgets/',
//'master':'https://github.com/alibaba-paimai-frontend/flutter-common-widgets-app/tree/master/lib/widgets/'
};
/// 所有获取配置的唯一入口
Map get config {
- if (Application.env == ENV.PRODUCTION) {
- return {};
- }
- if (Application.env == ENV.DEV) {
- return {};
- }
+ if (Application.env == ENV.PRODUCTION) {
return {};
+ }
+ if (Application.env == ENV.DEV) {
+ return {};
+ }
+ return {};
}
-
}
diff --git a/lib/routers/router_handler.dart b/lib/routers/router_handler.dart
index 2e718d40..41a06ae9 100644
--- a/lib/routers/router_handler.dart
+++ b/lib/routers/router_handler.dart
@@ -21,18 +21,16 @@ var homeHandler = new Handler(
);
var collectionFullHandler = new Handler(
- handlerFunc: (BuildContext context,Map> params){
- bool hasLogined = params['hasLogin']?.first == 'true';
- return CollectionFullPage(hasLogined: hasLogined);
- }
-);
+ handlerFunc: (BuildContext context, Map> params) {
+ bool hasLogined = params['hasLogin']?.first == 'true';
+ return CollectionFullPage(hasLogined: hasLogined);
+});
var collectionHandler = new Handler(
- handlerFunc: (BuildContext context,Map> params){
- bool hasLogined = params['hasLogin']?.first == 'true';
- return CollectionPage(hasLogined: hasLogined);
- }
-);
+ handlerFunc: (BuildContext context, Map> params) {
+ bool hasLogined = params['hasLogin']?.first == 'true';
+ return CollectionPage(hasLogined: hasLogined);
+});
var categoryHandler = new Handler(
handlerFunc: (BuildContext context, Map> params) {
@@ -44,29 +42,28 @@ var categoryHandler = new Handler(
var widgetNotFoundHandler = new Handler(
handlerFunc: (BuildContext context, Map> params) {
- return new WidgetNotFound();
- });
+ return new WidgetNotFound();
+});
var loginPageHandler = new Handler(
handlerFunc: (BuildContext context, Map> params) {
- return LoginPage();
- });
+ return LoginPage();
+});
var fullScreenCodeDialog = new Handler(
handlerFunc: (BuildContext context, Map> params) {
- String path = params['filePath']?.first;
- return new FullScreenCodeDialog(
- filePath: path,
- );
- });
-
+ String path = params['filePath']?.first;
+ return new FullScreenCodeDialog(
+ filePath: path,
+ );
+});
var githubCodeDialog = new Handler(
handlerFunc: (BuildContext context, Map> params) {
- String path = params['remotePath']?.first;
- return new FullScreenCodeDialog(
- remoteFilePath: path,
- );
- });
+ String path = params['remotePath']?.first;
+ return new FullScreenCodeDialog(
+ remoteFilePath: path,
+ );
+});
var webViewPageHand = new Handler(
handlerFunc: (BuildContext context, Map> params) {
@@ -75,16 +72,13 @@ var webViewPageHand = new Handler(
return new WebViewPage(url, title);
});
-
var standardPageHandler = new Handler(
- handlerFunc: (BuildContext context, Map> params) {
- String id = params['id']?.first;
- return StandardView(id: id);
- }
-);
-
+ handlerFunc: (BuildContext context, Map> params) {
+ String id = params['id']?.first;
+ return StandardView(id: id);
+});
var issuesMessageHandler = new Handler(
handlerFunc: (BuildContext context, Map> params) {
- return IssuesMessagePage();
- });
+ return IssuesMessagePage();
+});
diff --git a/lib/routers/routers.dart b/lib/routers/routers.dart
index 32d6b9c2..72169e46 100644
--- a/lib/routers/routers.dart
+++ b/lib/routers/routers.dart
@@ -1,9 +1,9 @@
-
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter_go/utils/analytics.dart' show analytics;
import '../widgets/index.dart';
import './router_handler.dart';
+
/// import '../standard_pages/index.dart';
class Routes {
static String root = "/";
@@ -13,7 +13,7 @@ class Routes {
static String githubCodeView = '/github-code-view';
static String webViewPage = '/web-view-page';
static String loginPage = '/loginpage';
- static String issuesMessage='/issuesMessage';
+ static String issuesMessage = '/issuesMessage';
static String collectionPage = '/collection-page';
static String collectionFullPage = '/collection-full-page';
static String standardPage = '/standard-page/:id';
@@ -25,24 +25,24 @@ class Routes {
// }
// );
router.define(home, handler: homeHandler);
- router.define(collectionPage,handler:collectionHandler);
- router.define(collectionFullPage,handler:collectionFullHandler);
+ router.define(collectionPage, handler: collectionHandler);
+ router.define(collectionFullPage, handler: collectionFullHandler);
router.define('/category/:ids', handler: categoryHandler);
router.define('/category/error/404', handler: widgetNotFoundHandler);
router.define(loginPage, handler: loginPageHandler);
- router.define(codeView,handler:fullScreenCodeDialog);
- router.define(githubCodeView,handler:githubCodeDialog);
- router.define(webViewPage,handler:webViewPageHand);
+ router.define(codeView, handler: fullScreenCodeDialog);
+ router.define(githubCodeView, handler: githubCodeDialog);
+ router.define(webViewPage, handler: webViewPageHand);
router.define(issuesMessage, handler: issuesMessageHandler);
- router.define(standardPage,handler:standardPageHandler);
+ router.define(standardPage, handler: standardPageHandler);
widgetDemosList.forEach((demo) {
- Handler handler = new Handler(
- handlerFunc: (BuildContext context, Map> params) {
- print('组件路由params=$params widgetsItem=${demo.routerName}');
- analytics.logEvent(
- name: 'component', parameters: {'name': demo.routerName });
- return demo.buildRouter(context);
- });
+ Handler handler = new Handler(handlerFunc:
+ (BuildContext context, Map> params) {
+ print('组件路由params=$params widgetsItem=${demo.routerName}');
+ analytics
+ .logEvent(name: 'component', parameters: {'name': demo.routerName});
+ return demo.buildRouter(context);
+ });
String path = demo.routerName;
router.define('${path.toLowerCase()}', handler: handler);
});
diff --git a/lib/standard_pages/.pages.json b/lib/standard_pages/.pages.json
index 9b3a3ca9..fa8e84db 100644
--- a/lib/standard_pages/.pages.json
+++ b/lib/standard_pages/.pages.json
@@ -1 +1 @@
-[{"name":"local","screenShot":"","author":"hnaxu","title":"本地","email":"hanxu@qq.com","desc":"desc","id":"5d7178d0_42ae_4241_9c8a_5c9e1f92b096"},{"name":"test","screenShot":"","author":"abc","title":"ya","email":"adsf.com","desc":"desc","id":"84f38e00_42ae_4241_9c8a_5c9e1f92b096"},{"name":"standard","screenShot":"","author":"sanfan","title":"介绍页","email":"hanxu317@qq.com","desc":"desc","id":"ee4feb8e_32ae_4241_9c8a_5c9e1f92b096"},{"name":"standard_for_slider","screenShot":"","author":"sanfan","title":"slider组件","email":"hanxu@qq.com","desc":"slider, new Slider","id":"8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096"}]
\ No newline at end of file
+[{"name":"PullToRefresh","screenShot":"","author":"chenfeihu","title":"PullToRefresh","email":"763551832@qq.com","desc":"Refresh conponent","id":"cd9b8b80_52ae_4241_9c8a_5c9e1f92b096"},{"name":"local","screenShot":"","author":"hnaxu","title":"本地","email":"hanxu@qq.com","desc":"desc","id":"5d7178d0_42ae_4241_9c8a_5c9e1f92b096"},{"name":"test","screenShot":"","author":"abc","title":"ya","email":"adsf.com","desc":"desc","id":"84f38e00_42ae_4241_9c8a_5c9e1f92b096"},{"name":"standard","screenShot":"","author":"sanfan","title":"介绍页","email":"hanxu317@qq.com","desc":"desc","id":"ee4feb8e_32ae_4241_9c8a_5c9e1f92b096"},{"name":"standard_for_slider","screenShot":"","author":"sanfan","title":"slider组件","email":"hanxu@qq.com","desc":"slider, new Slider","id":"8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096"},{"name":"RangeSlider","screenShot":"","author":"hanxu","title":"RangeSlider","email":"hanxu317@qq.com","desc":"RangeSlider widget","id":"cbffbf7c_52ae_4241_9c8a_5c9e1f92b096"}]
\ No newline at end of file
diff --git a/lib/standard_pages/PullToRefresh_chenfeihu_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096/.page.json b/lib/standard_pages/PullToRefresh_chenfeihu_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096/.page.json
new file mode 100644
index 00000000..b007469b
--- /dev/null
+++ b/lib/standard_pages/PullToRefresh_chenfeihu_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096/.page.json
@@ -0,0 +1,10 @@
+{
+ "name": "PullToRefresh",
+ "screenShot": "",
+ "author":"chenfeihu",
+ "title":"PullToRefresh",
+ "email": "763551832@qq.com",
+ "desc": "Refresh conponent",
+ "id": "cd9b8b80_52ae_4241_9c8a_5c9e1f92b096"
+}
+
\ No newline at end of file
diff --git a/lib/standard_pages/PullToRefresh_chenfeihu_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/standard_pages/PullToRefresh_chenfeihu_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096/index.dart
new file mode 100644
index 00000000..19aadf0b
--- /dev/null
+++ b/lib/standard_pages/PullToRefresh_chenfeihu_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096/index.dart
@@ -0,0 +1,86 @@
+String getMd() {
+ return """
+# PullToRefresh
+
+> 下拉刷新 上拉加载
+
+PullToRefresh 是一个刷新列表组件,借助于pull_to_refresh库实现,感觉这是目前最好的一款三方刷新库,它的可定制性比较好,刷新样式多样化,已经满足大部分的开发需求。
+
+### **基本用法**
+
+* 添加依赖 pull_to_refresh: ^1.5.6
+* ListView包裹一层SmartRefresher
+
+
+
+### **SmartRefresher常用属性说明**
+
+* **enablePullDown** 允许下拉刷新
+* **enablePullUp** 允许上拉加载
+* **header** 下拉刷新头部样式
+* **footer** 上拉加载底部样式
+* **onRefresh** 下拉刷新的回调
+* **onLoading** 上拉加载的回调
+* **controller** 刷新控件的控制器,用来处理回调状态等
+
+
+### **国际化显示**
+
+ ```
+ 需要添加语言本地化SDK,不然刷新库头部与底部显示加载提示内容为英文
+
+ 添加依赖 flutter_localizations:
+ sdk: flutter
+
+ main.dart中MateriaApp里面添加以下内容
+
+ localizationsDelegates: [
+ // 这行是关键
+ RefreshLocalizations.delegate,
+ GlobalWidgetsLocalizations.delegate,
+ GlobalMaterialLocalizations.delegate
+ ],
+ supportedLocales: [
+ const Locale('en'),
+ const Locale('zh'),
+ ],
+ localeResolutionCallback:
+ (Locale locale, Iterable supportedLocales) {
+ //print("change language");
+ return locale;
+ },
+
+ ```
+
+
+### **全局配置**
+ 全局配置RefreshConfiguration,配置子树下的所有SmartRefresher表现,一般存放于MaterialApp的根部
+
+ ```
+ RefreshConfiguration(
+ headerBuilder: () => WaterDropHeader(), // 配置默认头部指示器,假如你每个页面的头部指示器都一样的话,你需要设置这个
+ footerBuilder: () => ClassicFooter(), // 配置默认底部指示器
+ headerTriggerDistance: 80.0, // 头部触发刷新的越界距离
+ springDescription:SpringDescription(stiffness: 170, damping: 16, mass: 1.9), // 自定义回弹动画,三个属性值意义请查询flutter api
+ maxOverScrollExtent :100, //头部最大可以拖动的范围,如果发生冲出视图范围区域,请设置这个属性
+ maxUnderScrollExtent:0, // 底部最大可以拖动的范围
+ enableScrollWhenRefreshCompleted: true, //这个属性不兼容PageView和TabBarView,如果你特别需要TabBarView左右滑动,你需要把它设置为true
+ enableLoadingWhenFailed : true, //在加载失败的状态下,用户仍然可以通过手势上拉来触发加载更多
+ hideFooterWhenNotFull: false, // Viewport不满一屏时,禁用上拉加载更多功能
+ enableBallisticLoad: true, // 可以通过惯性滑动触发加载更多
+ child: MaterialApp(
+ ........
+ )
+ );
+
+ ```
+
+
+### 实例展示
+
+[demo:5553db80_52ae_4241_9c8a_5c9e1f92b096]
+
+
+
+""";
+}
diff --git a/lib/standard_pages/PullToRefresh_chenfeihu_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096/index.md b/lib/standard_pages/PullToRefresh_chenfeihu_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096/index.md
new file mode 100644
index 00000000..1dca085b
--- /dev/null
+++ b/lib/standard_pages/PullToRefresh_chenfeihu_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096/index.md
@@ -0,0 +1,82 @@
+# PullToRefresh
+
+> 下拉刷新 上拉加载
+
+PullToRefresh 是一个刷新列表组件,借助于pull_to_refresh库实现,感觉这是目前最好的一款三方刷新库,它的可定制性比较好,刷新样式多样化,已经满足大部分的开发需求。
+
+### **基本用法**
+
+* 添加依赖 pull_to_refresh: ^1.5.6
+* ListView包裹一层SmartRefresher
+
+
+
+### **SmartRefresher常用属性说明**
+
+* **enablePullDown** 允许下拉刷新
+* **enablePullUp** 允许上拉加载
+* **header** 下拉刷新头部样式
+* **footer** 上拉加载底部样式
+* **onRefresh** 下拉刷新的回调
+* **onLoading** 上拉加载的回调
+* **controller** 刷新控件的控制器,用来处理回调状态等
+
+
+### **国际化显示**
+
+ ```
+ 需要添加语言本地化SDK,不然刷新库头部与底部显示加载提示内容为英文
+
+ 添加依赖 flutter_localizations:
+ sdk: flutter
+
+ main.dart中MateriaApp里面添加以下内容
+
+ localizationsDelegates: [
+ // 这行是关键
+ RefreshLocalizations.delegate,
+ GlobalWidgetsLocalizations.delegate,
+ GlobalMaterialLocalizations.delegate
+ ],
+ supportedLocales: [
+ const Locale('en'),
+ const Locale('zh'),
+ ],
+ localeResolutionCallback:
+ (Locale locale, Iterable supportedLocales) {
+ //print("change language");
+ return locale;
+ },
+
+ ```
+
+
+### **全局配置**
+ 全局配置RefreshConfiguration,配置子树下的所有SmartRefresher表现,一般存放于MaterialApp的根部
+
+ ```
+ RefreshConfiguration(
+ headerBuilder: () => WaterDropHeader(), // 配置默认头部指示器,假如你每个页面的头部指示器都一样的话,你需要设置这个
+ footerBuilder: () => ClassicFooter(), // 配置默认底部指示器
+ headerTriggerDistance: 80.0, // 头部触发刷新的越界距离
+ springDescription:SpringDescription(stiffness: 170, damping: 16, mass: 1.9), // 自定义回弹动画,三个属性值意义请查询flutter api
+ maxOverScrollExtent :100, //头部最大可以拖动的范围,如果发生冲出视图范围区域,请设置这个属性
+ maxUnderScrollExtent:0, // 底部最大可以拖动的范围
+ enableScrollWhenRefreshCompleted: true, //这个属性不兼容PageView和TabBarView,如果你特别需要TabBarView左右滑动,你需要把它设置为true
+ enableLoadingWhenFailed : true, //在加载失败的状态下,用户仍然可以通过手势上拉来触发加载更多
+ hideFooterWhenNotFull: false, // Viewport不满一屏时,禁用上拉加载更多功能
+ enableBallisticLoad: true, // 可以通过惯性滑动触发加载更多
+ child: MaterialApp(
+ ........
+ )
+ );
+
+ ```
+
+
+### 实例展示
+
+[demo:5553db80_52ae_4241_9c8a_5c9e1f92b096]
+
+
+
\ No newline at end of file
diff --git a/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/.page.json b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/.page.json
new file mode 100644
index 00000000..553fa67b
--- /dev/null
+++ b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/.page.json
@@ -0,0 +1,10 @@
+{
+ "name": "RangeSlider",
+ "screenShot": "",
+ "author":"hanxu",
+ "title":"RangeSlider",
+ "email": "hanxu317@qq.com",
+ "desc": "RangeSlider widget",
+ "id": "cbffbf7c_52ae_4241_9c8a_5c9e1f92b096"
+}
+
\ No newline at end of file
diff --git a/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.dart
new file mode 100644
index 00000000..955ef81f
--- /dev/null
+++ b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.dart
@@ -0,0 +1,33 @@
+String getMd() {
+ return """
+ # RangeSlider
+
+> 用来选择范围性的数据
+
+slider 用来选择连续性的或者非连续性的数据. 默认是在一段最大值最小值间做任意值的选择. 如果你想选择间隔性的值, 例如0.0到50.0间,选择10, 15,...50.0这样的值, 给divisions设定一个非空的整数5,, 去分割区间范围.
+
+
+### **基本用法**
+
+关于slider有以下的术语:
+
+* **thumb** 滑块 用户可以水平拖拽移动的区域
+
+* **track** 滑轨 thumb 可以滑动的线条区域
+
+* **value indicator** 值指示器 当用户拖拽thumb的时候. 显示用户当前所选的属性值
+
+* **active** 选中区
+
+* **inactive** 非选中区
+
+如果**onChanged**属性为空或者**min** .. **max**给出的范围 为空(例如如果min等于max),则将禁用滑块。
+
+滑块小部件本身不保持任何状态State。相反,当滑块状态发生变化时,窗口小部件会调用 **onChanged** 回调。大多数使用滑块的小部件将侦听 **onChanged** 回调并使用新值重建滑块以更新滑块的视觉外观。要知道值何时开始更改,或何时更改,请设置可选回调**onChangeStart**或**onChangeEnd**。
+
+默认情况下,滑块将尽可能宽,垂直居中。当给定无限制约束时,它将尝试使轨道宽144像素(每边有边距)并垂直收缩。
+
+### 实例展示
+
+[demo:e5f958bc_52ae_4241_9c8a_5c9e1f92b096]""";
+}
diff --git a/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.md b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.md
new file mode 100644
index 00000000..d6049358
--- /dev/null
+++ b/lib/standard_pages/RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.md
@@ -0,0 +1,30 @@
+# RangeSlider
+
+> 用来选择范围性的数据
+
+slider 用来选择连续性的或者非连续性的数据. 默认是在一段最大值最小值间做任意值的选择. 如果你想选择间隔性的值, 例如0.0到50.0间,选择10, 15,...50.0这样的值, 给divisions设定一个非空的整数5,, 去分割区间范围.
+
+
+### **基本用法**
+
+关于slider有以下的术语:
+
+* **thumb** 滑块 用户可以水平拖拽移动的区域
+
+* **track** 滑轨 thumb 可以滑动的线条区域
+
+* **value indicator** 值指示器 当用户拖拽thumb的时候. 显示用户当前所选的属性值
+
+* **active** 选中区
+
+* **inactive** 非选中区
+
+如果**onChanged**属性为空或者**min** .. **max**给出的范围 为空(例如如果min等于max),则将禁用滑块。
+
+滑块小部件本身不保持任何状态State。相反,当滑块状态发生变化时,窗口小部件会调用 **onChanged** 回调。大多数使用滑块的小部件将侦听 **onChanged** 回调并使用新值重建滑块以更新滑块的视觉外观。要知道值何时开始更改,或何时更改,请设置可选回调**onChangeStart**或**onChangeEnd**。
+
+默认情况下,滑块将尽可能宽,垂直居中。当给定无限制约束时,它将尝试使轨道宽144像素(每边有边距)并垂直收缩。
+
+### 实例展示
+
+[demo:e5f958bc_52ae_4241_9c8a_5c9e1f92b096]
\ No newline at end of file
diff --git a/lib/standard_pages/index.dart b/lib/standard_pages/index.dart
index 6af27c34..12cba175 100644
--- a/lib/standard_pages/index.dart
+++ b/lib/standard_pages/index.dart
@@ -1,35 +1,77 @@
+import 'PullToRefresh_chenfeihu_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096/index.dart'
+ as StandardPage_PullToRefresh_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096;
+import 'local_hnaxu_5d7178d0_42ae_4241_9c8a_5c9e1f92b096/index.dart'
+ as StandardPage_local_5d7178d0_42ae_4241_9c8a_5c9e1f92b096;
+import 'test_abc_84f38e00_42ae_4241_9c8a_5c9e1f92b096/index.dart'
+ as StandardPage_test_84f38e00_42ae_4241_9c8a_5c9e1f92b096;
+import 'standard_sanfan_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096/index.dart'
+ as StandardPage_standard_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096;
+import 'standard_for_slider_sanfan_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096/index.dart'
+ as StandardPage_standard_for_slider_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096;
+import 'RangeSlider_hanxu_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096/index.dart'
+ as StandardPage_RangeSlider_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096;
-import 'local_hnaxu_5d7178d0_42ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardPage_local_5d7178d0_42ae_4241_9c8a_5c9e1f92b096;
-import 'test_abc_84f38e00_42ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardPage_test_84f38e00_42ae_4241_9c8a_5c9e1f92b096;
-import 'standard_sanfan_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardPage_standard_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096;
-import 'standard_for_slider_sanfan_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096/index.dart' as StandardPage_standard_for_slider_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096;
class StandardPages {
Map standardPages;
Map getPages() {
return {
- "0": "0" ,
- "5d7178d0_42ae_4241_9c8a_5c9e1f92b096" : StandardPage_local_5d7178d0_42ae_4241_9c8a_5c9e1f92b096.getMd()
-,
- "84f38e00_42ae_4241_9c8a_5c9e1f92b096" : StandardPage_test_84f38e00_42ae_4241_9c8a_5c9e1f92b096.getMd()
-,
- "ee4feb8e_32ae_4241_9c8a_5c9e1f92b096" : StandardPage_standard_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096.getMd()
-,
- "8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096" : StandardPage_standard_for_slider_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096.getMd()
+ "0": "0",
+ "cd9b8b80_52ae_4241_9c8a_5c9e1f92b096":
+ StandardPage_PullToRefresh_cd9b8b80_52ae_4241_9c8a_5c9e1f92b096
+ .getMd(),
+ "5d7178d0_42ae_4241_9c8a_5c9e1f92b096":
+ StandardPage_local_5d7178d0_42ae_4241_9c8a_5c9e1f92b096.getMd(),
+ "84f38e00_42ae_4241_9c8a_5c9e1f92b096":
+ StandardPage_test_84f38e00_42ae_4241_9c8a_5c9e1f92b096.getMd(),
+ "ee4feb8e_32ae_4241_9c8a_5c9e1f92b096":
+ StandardPage_standard_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096.getMd(),
+ "8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096":
+ StandardPage_standard_for_slider_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096
+ .getMd(),
+ "cbffbf7c_52ae_4241_9c8a_5c9e1f92b096":
+ StandardPage_RangeSlider_cbffbf7c_52ae_4241_9c8a_5c9e1f92b096.getMd()
};
}
+
List> getLocalList() {
return [
{},
- { "id": "5d7178d0_42ae_4241_9c8a_5c9e1f92b096", "name": "local", "email": "hanxu@qq.com", "author": "hnaxu"}
-,
- { "id": "84f38e00_42ae_4241_9c8a_5c9e1f92b096", "name": "test", "email": "adsf.com", "author": "abc"}
-,
- { "id": "ee4feb8e_32ae_4241_9c8a_5c9e1f92b096", "name": "standard", "email": "hanxu317@qq.com", "author": "sanfan"}
-,
- { "id": "8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096", "name": "standard_for_slider", "email": "hanxu@qq.com", "author": "sanfan"}
+ {
+ "id": "cd9b8b80_52ae_4241_9c8a_5c9e1f92b096",
+ "name": "PullToRefresh",
+ "email": "763551832@qq.com",
+ "author": "chenfeihu"
+ },
+ {
+ "id": "5d7178d0_42ae_4241_9c8a_5c9e1f92b096",
+ "name": "local",
+ "email": "hanxu@qq.com",
+ "author": "hnaxu"
+ },
+ {
+ "id": "84f38e00_42ae_4241_9c8a_5c9e1f92b096",
+ "name": "test",
+ "email": "adsf.com",
+ "author": "abc"
+ },
+ {
+ "id": "ee4feb8e_32ae_4241_9c8a_5c9e1f92b096",
+ "name": "standard",
+ "email": "hanxu317@qq.com",
+ "author": "sanfan"
+ },
+ {
+ "id": "8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096",
+ "name": "standard_for_slider",
+ "email": "hanxu@qq.com",
+ "author": "sanfan"
+ },
+ {
+ "id": "cbffbf7c_52ae_4241_9c8a_5c9e1f92b096",
+ "name": "RangeSlider",
+ "email": "hanxu317@qq.com",
+ "author": "hanxu"
+ }
];
}
-
}
-
-
\ No newline at end of file
diff --git a/lib/standard_pages/local_hnaxu_5d7178d0_42ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/standard_pages/local_hnaxu_5d7178d0_42ae_4241_9c8a_5c9e1f92b096/index.dart
index 6e506d10..8ff3798f 100644
--- a/lib/standard_pages/local_hnaxu_5d7178d0_42ae_4241_9c8a_5c9e1f92b096/index.dart
+++ b/lib/standard_pages/local_hnaxu_5d7178d0_42ae_4241_9c8a_5c9e1f92b096/index.dart
@@ -48,5 +48,4 @@ goCLi createDemo
```
[demo: 1a29aa8e_32ae_4241_9c8a_5c9e1f92b096]
```""";
-
}
diff --git a/lib/standard_pages/standard_for_slider_sanfan_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/standard_pages/standard_for_slider_sanfan_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096/index.dart
index bd222ee8..46d46bd3 100644
--- a/lib/standard_pages/standard_for_slider_sanfan_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096/index.dart
+++ b/lib/standard_pages/standard_for_slider_sanfan_8ab2b5c2_42ae_4241_9c8a_5c9e1f92b096/index.dart
@@ -55,7 +55,4 @@ goCLi createDemo
调用效果:
[demo:1a29aa8e_32ae_4241_9c8a_5c9e1f92b096]""";
-
-
}
-
\ No newline at end of file
diff --git a/lib/standard_pages/standard_sanfan_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/standard_pages/standard_sanfan_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096/index.dart
index be0e2607..58a2066f 100644
--- a/lib/standard_pages/standard_sanfan_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096/index.dart
+++ b/lib/standard_pages/standard_sanfan_ee4feb8e_32ae_4241_9c8a_5c9e1f92b096/index.dart
@@ -50,7 +50,4 @@ goCLi createDemo
```
[demo: 1a29aa8e_32ae_4241_9c8a_5c9e1f92b096]
```""";
-
-
}
-
\ No newline at end of file
diff --git a/lib/standard_pages/test_abc_84f38e00_42ae_4241_9c8a_5c9e1f92b096/index.dart b/lib/standard_pages/test_abc_84f38e00_42ae_4241_9c8a_5c9e1f92b096/index.dart
index 6e506d10..8ff3798f 100644
--- a/lib/standard_pages/test_abc_84f38e00_42ae_4241_9c8a_5c9e1f92b096/index.dart
+++ b/lib/standard_pages/test_abc_84f38e00_42ae_4241_9c8a_5c9e1f92b096/index.dart
@@ -48,5 +48,4 @@ goCLi createDemo
```
[demo: 1a29aa8e_32ae_4241_9c8a_5c9e1f92b096]
```""";
-
}
diff --git a/lib/utils/data_utils.dart b/lib/utils/data_utils.dart
index 921f95ff..f609d73e 100644
--- a/lib/utils/data_utils.dart
+++ b/lib/utils/data_utils.dart
@@ -5,6 +5,7 @@ import 'package:flutter_go/model/collection.dart';
import 'package:flutter_go/model/version.dart';
import 'package:flutter_go/model/widget.dart';
import 'package:package_info/package_info.dart';
+
/// import 'package:flutter_go/model/responseData.dart';
import './net_utils.dart';
@@ -190,7 +191,9 @@ class DataUtils {
"name": json['name'],
"cnName": json['name'],
"routerName": routerName,
- "catId": json['parentId'].runtimeType == String ? int.parse(json['parentId']) : json['parentId']
+ "catId": json['parentId'].runtimeType == String
+ ? int.parse(json['parentId'])
+ : json['parentId']
};
list.add(WidgetPoint.fromJSON(tempMap));
}
diff --git a/lib/utils/example_code_parser.dart b/lib/utils/example_code_parser.dart
index 7b09b532..eab2a0c9 100644
--- a/lib/utils/example_code_parser.dart
+++ b/lib/utils/example_code_parser.dart
@@ -1,5 +1,5 @@
-/// @Author: 一凨
-/// @Date: 2019-01-14 11:42:36
+/// @Author: 一凨
+/// @Date: 2019-01-14 11:42:36
/// @Last Modified by: 一凨
/// @Last Modified time: 2019-01-14 16:53:11
@@ -11,7 +11,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_go/routers/application.dart';
-
Map _exampleCode;
String _code;
@@ -23,12 +22,14 @@ void _launchURL(String url) async {
}
}
-Future getExampleCode(context,String filePath, AssetBundle bundle) async {
- if (_exampleCode == null) await _parseExampleCode(context,filePath, bundle);
+Future getExampleCode(
+ context, String filePath, AssetBundle bundle) async {
+ if (_exampleCode == null) await _parseExampleCode(context, filePath, bundle);
return _code;
}
-Future _parseExampleCode(context,String filePath, AssetBundle bundle) async {
+Future _parseExampleCode(
+ context, String filePath, AssetBundle bundle) async {
String code;
try {
code = await bundle.loadString('lib/widgets/$filePath');
diff --git a/lib/utils/high_light_code.dart b/lib/utils/high_light_code.dart
index 1ac0fdcd..5e1a7f3b 100644
--- a/lib/utils/high_light_code.dart
+++ b/lib/utils/high_light_code.dart
@@ -9,16 +9,15 @@ import 'package:string_scanner/string_scanner.dart';
/// DartSyntaxHighlighter(style).format(source)
class SyntaxHighlighterStyle {
- SyntaxHighlighterStyle({
- this.baseStyle,
- this.numberStyle,
- this.commentStyle,
- this.keywordStyle,
- this.stringStyle,
- this.punctuationStyle,
- this.classStyle,
- this.constantStyle
- });
+ SyntaxHighlighterStyle(
+ {this.baseStyle,
+ this.numberStyle,
+ this.commentStyle,
+ this.keywordStyle,
+ this.stringStyle,
+ this.punctuationStyle,
+ this.classStyle,
+ this.constantStyle});
static SyntaxHighlighterStyle lightThemeStyle() {
return SyntaxHighlighterStyle(
@@ -29,8 +28,7 @@ class SyntaxHighlighterStyle {
stringStyle: const TextStyle(color: Color(0xFF43A047)),
punctuationStyle: const TextStyle(color: Color(0xFF000000)),
classStyle: const TextStyle(color: Color(0xFF512DA8)),
- constantStyle: const TextStyle(color: Color(0xFF795548))
- );
+ constantStyle: const TextStyle(color: Color(0xFF795548)));
}
static SyntaxHighlighterStyle darkThemeStyle() {
@@ -42,8 +40,7 @@ class SyntaxHighlighterStyle {
stringStyle: const TextStyle(color: Color(0xFF009688)),
punctuationStyle: const TextStyle(color: Color(0xFFFFFFFF)),
classStyle: const TextStyle(color: Color(0xFF009688)),
- constantStyle: const TextStyle(color: Color(0xFF795548))
- );
+ constantStyle: const TextStyle(color: Color(0xFF795548)));
}
final TextStyle baseStyle;
@@ -56,7 +53,8 @@ class SyntaxHighlighterStyle {
final TextStyle constantStyle;
}
-abstract class Highlighter { // ignore: one_member_abstracts
+abstract class Highlighter {
+ // ignore: one_member_abstracts
TextSpan format(String src);
}
@@ -69,17 +67,66 @@ class DartSyntaxHighlighter extends Highlighter {
SyntaxHighlighterStyle _style;
static const List _keywords = [
- 'abstract', 'as', 'assert', 'async', 'await', 'break', 'case', 'catch',
- 'class', 'const', 'continue', 'default', 'deferred', 'do', 'dynamic', 'else',
- 'enum', 'export', 'external', 'extends', 'factory', 'false', 'final',
- 'finally', 'for', 'get', 'if', 'implements', 'import', 'in', 'is', 'library',
- 'new', 'null', 'operator', 'part', 'rethrow', 'return', 'set', 'static',
- 'super', 'switch', 'sync', 'this', 'throw', 'true', 'try', 'typedef', 'var',
- 'void', 'while', 'with', 'yield'
+ 'abstract',
+ 'as',
+ 'assert',
+ 'async',
+ 'await',
+ 'break',
+ 'case',
+ 'catch',
+ 'class',
+ 'const',
+ 'continue',
+ 'default',
+ 'deferred',
+ 'do',
+ 'dynamic',
+ 'else',
+ 'enum',
+ 'export',
+ 'external',
+ 'extends',
+ 'factory',
+ 'false',
+ 'final',
+ 'finally',
+ 'for',
+ 'get',
+ 'if',
+ 'implements',
+ 'import',
+ 'in',
+ 'is',
+ 'library',
+ 'new',
+ 'null',
+ 'operator',
+ 'part',
+ 'rethrow',
+ 'return',
+ 'set',
+ 'static',
+ 'super',
+ 'switch',
+ 'sync',
+ 'this',
+ 'throw',
+ 'true',
+ 'try',
+ 'typedef',
+ 'var',
+ 'void',
+ 'while',
+ 'with',
+ 'yield'
];
static const List _builtInTypes = [
- 'int', 'double', 'num', 'bool'
+ 'int',
+ 'double',
+ 'num',
+ 'bool'
];
String _src;
@@ -99,15 +146,18 @@ class DartSyntaxHighlighter extends Highlighter {
for (_HighlightSpan span in _spans) {
if (currentPosition != span.start)
- formattedText.add(TextSpan(text: _src.substring(currentPosition, span.start)));
+ formattedText
+ .add(TextSpan(text: _src.substring(currentPosition, span.start)));
- formattedText.add(TextSpan(style: span.textStyle(_style), text: span.textForSpan(_src)));
+ formattedText.add(TextSpan(
+ style: span.textStyle(_style), text: span.textForSpan(_src)));
currentPosition = span.end;
}
if (currentPosition != _src.length)
- formattedText.add(TextSpan(text: _src.substring(currentPosition, _src.length)));
+ formattedText
+ .add(TextSpan(text: _src.substring(currentPosition, _src.length)));
return TextSpan(style: _style.baseStyle, children: formattedText);
} else {
@@ -125,11 +175,8 @@ class DartSyntaxHighlighter extends Highlighter {
// Block comments
if (_scanner.scan(RegExp(r'/\*(.|\n)*\*/'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.comment,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.comment,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
@@ -146,115 +193,81 @@ class DartSyntaxHighlighter extends Highlighter {
endComment = _src.length;
}
- _spans.add(_HighlightSpan(
- _HighlightType.comment,
- startComment,
- endComment
- ));
+ _spans.add(
+ _HighlightSpan(_HighlightType.comment, startComment, endComment));
- if (eof)
- break;
+ if (eof) break;
continue;
}
// Raw r"String"
if (_scanner.scan(RegExp(r'r".*"'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Raw r'String'
if (_scanner.scan(RegExp(r"r'.*'"))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Multiline """String"""
if (_scanner.scan(RegExp(r'"""(?:[^"\\]|\\(.|\n))*"""'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Multiline '''String'''
if (_scanner.scan(RegExp(r"'''(?:[^'\\]|\\(.|\n))*'''"))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// "String"
if (_scanner.scan(RegExp(r'"(?:[^"\\]|\\.)*"'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// 'String'
if (_scanner.scan(RegExp(r"'(?:[^'\\]|\\.)*'"))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Double
if (_scanner.scan(RegExp(r'\d+\.\d+'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.number,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.number,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Integer
if (_scanner.scan(RegExp(r'\d+'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.number,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end)
- );
+ _spans.add(_HighlightSpan(_HighlightType.number,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Punctuation
if (_scanner.scan(RegExp(r'[\[\]{}().!=<>&\|\?\+\-\*/%\^~;:,]'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.punctuation,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.punctuation,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Meta data
if (_scanner.scan(RegExp(r'@\w+'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.keyword,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.keyword,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
@@ -263,8 +276,7 @@ class DartSyntaxHighlighter extends Highlighter {
_HighlightType type;
String word = _scanner.lastMatch[0];
- if (word.startsWith('_'))
- word = word.substring(1);
+ if (word.startsWith('_')) word = word.substring(1);
if (_keywords.contains(word))
type = _HighlightType.keyword;
@@ -272,15 +284,14 @@ class DartSyntaxHighlighter extends Highlighter {
type = _HighlightType.keyword;
else if (_firstLetterIsUpperCase(word))
type = _HighlightType.klass;
- else if (word.length >= 2 && word.startsWith('k') && _firstLetterIsUpperCase(word.substring(1)))
+ else if (word.length >= 2 &&
+ word.startsWith('k') &&
+ _firstLetterIsUpperCase(word.substring(1)))
type = _HighlightType.constant;
if (type != null) {
_spans.add(_HighlightSpan(
- type,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ type, _scanner.lastMatch.start, _scanner.lastMatch.end));
}
}
@@ -298,12 +309,10 @@ class DartSyntaxHighlighter extends Highlighter {
void _simplify() {
for (int i = _spans.length - 2; i >= 0; i -= 1) {
- if (_spans[i].type == _spans[i + 1].type && _spans[i].end == _spans[i + 1].start) {
- _spans[i] = _HighlightSpan(
- _spans[i].type,
- _spans[i].start,
- _spans[i + 1].end
- );
+ if (_spans[i].type == _spans[i + 1].type &&
+ _spans[i].end == _spans[i + 1].start) {
+ _spans[i] =
+ _HighlightSpan(_spans[i].type, _spans[i].start, _spans[i + 1].end);
_spans.removeAt(i + 1);
}
}
diff --git a/lib/utils/provider.dart b/lib/utils/provider.dart
index 89003886..ac1b43a9 100644
--- a/lib/utils/provider.dart
+++ b/lib/utils/provider.dart
@@ -32,9 +32,10 @@ class Provider {
if (db == null) {
return Future.value([]);
}
- List tables = await db.rawQuery('SELECT name FROM sqlite_master WHERE type = "table"');
+ List tables = await db
+ .rawQuery('SELECT name FROM sqlite_master WHERE type = "table"');
List targetList = [];
- tables.forEach((item) {
+ tables.forEach((item) {
targetList.add(item['name']);
});
return targetList;
@@ -46,13 +47,12 @@ class Provider {
List tables = await getTables();
- for(int i = 0; i < expectTables.length; i++) {
+ for (int i = 0; i < expectTables.length; i++) {
if (!tables.contains(expectTables[i])) {
return false;
}
}
- return true;
-
+ return true;
}
//初始化数据库
@@ -89,5 +89,4 @@ class Provider {
print("Opening existing database");
}
}
-
}
diff --git a/lib/utils/shared_preferences.dart b/lib/utils/shared_preferences.dart
index 81f7dc70..9a71a954 100644
--- a/lib/utils/shared_preferences.dart
+++ b/lib/utils/shared_preferences.dart
@@ -1,4 +1,3 @@
-
import 'dart:async';
import 'package:shared_preferences/shared_preferences.dart';
@@ -14,18 +13,18 @@ class SpUtil {
static SharedPreferences _spf;
-
SpUtil._();
Future _init() async {
_spf = await SharedPreferences.getInstance();
}
- static Future getInstance() async {
+ static Future getInstance() async {
if (_instance == null) {
_instance = new SpUtil._();
+ }
+ if (_spf == null) {
await _instance._init();
-
}
return _instance;
}
@@ -36,6 +35,7 @@ class SpUtil {
}
return false;
}
+
// 判断是否存在数据
bool hasKey(String key) {
Set keys = getKeys();
@@ -106,8 +106,6 @@ class SpUtil {
return _spf.get(key);
}
-
-
Future remove(String key) {
if (_beforeCheck()) return null;
return _spf.remove(key);
@@ -117,4 +115,4 @@ class SpUtil {
if (_beforeCheck()) return null;
return _spf.clear();
}
-}
\ No newline at end of file
+}
diff --git a/lib/utils/sql.dart b/lib/utils/sql.dart
index d932415b..3ab98660 100644
--- a/lib/utils/sql.dart
+++ b/lib/utils/sql.dart
@@ -1,14 +1,12 @@
-
-
import 'package:sqflite/sqflite.dart';
import './provider.dart';
-class BaseModel{
+class BaseModel {
Database db;
final String table = '';
var query;
- BaseModel(this.db){
+ BaseModel(this.db) {
query = db.query;
}
}
@@ -20,18 +18,21 @@ class Sql extends BaseModel {
super(Provider.db);
// sdf
- Future get() async{
+ Future get() async {
return await this.query(tableName);
}
- String getTableName () {
+
+ String getTableName() {
return tableName;
}
- Future delete(String value,String key) async{
- return await this.db.delete(tableName,where:'$key = ?',whereArgs:[value]);
+ Future delete(String value, String key) async {
+ return await this
+ .db
+ .delete(tableName, where: '$key = ?', whereArgs: [value]);
}
- Future deleteAll() async{
+ Future deleteAll() async {
return await this.db.delete(tableName);
}
@@ -44,7 +45,7 @@ class Sql extends BaseModel {
int index = 0;
conditions.forEach((key, value) {
if (value == null) {
- return ;
+ return;
}
if (value.runtimeType == String) {
stringConditions = '$stringConditions $key = "$value"';
@@ -53,7 +54,7 @@ class Sql extends BaseModel {
stringConditions = '$stringConditions $key = $value';
}
- if (index >= 0 && index < conditions.length -1) {
+ if (index >= 0 && index < conditions.length - 1) {
stringConditions = '$stringConditions and';
}
index++;
@@ -61,18 +62,21 @@ class Sql extends BaseModel {
// print("this is string condition for sql > $stringConditions");
return await this.query(tableName, where: stringConditions);
}
+
Future> insert(Map json) async {
var id = await this.db.insert(tableName, json);
json['id'] = id;
return json;
}
+
///
/// 搜索
/// @param Object condition
/// @mods [And, Or] default is Or
/// search({'name': "hanxu', 'id': 1};
///
- Future search({Map conditions, String mods = 'Or'}) async {
+ Future search(
+ {Map conditions, String mods = 'Or'}) async {
if (conditions == null || conditions.isEmpty) {
return this.get();
}
@@ -80,7 +84,7 @@ class Sql extends BaseModel {
int index = 0;
conditions.forEach((key, value) {
if (value == null) {
- return ;
+ return;
}
if (value.runtimeType == String) {
@@ -90,7 +94,7 @@ class Sql extends BaseModel {
stringConditions = '$stringConditions $key = "%$value%"';
}
- if (index >= 0 && index < conditions.length -1) {
+ if (index >= 0 && index < conditions.length - 1) {
stringConditions = '$stringConditions $mods';
}
index++;
@@ -98,4 +102,4 @@ class Sql extends BaseModel {
return await this.query(tableName, where: stringConditions);
}
-}
\ No newline at end of file
+}
diff --git a/lib/utils/style.dart b/lib/utils/style.dart
index 31d9bb8d..a991c3c5 100644
--- a/lib/utils/style.dart
+++ b/lib/utils/style.dart
@@ -1,14 +1,14 @@
import 'package:flutter/material.dart';
//颜色配置
-class AppColor{
+class AppColor {
static const int white = 0xFFFFFFFF;
static const int mainTextColor = 0xFF121917;
static const int subTextColor = 0xff959595;
}
//文本设置
-class AppText{
+class AppText {
static const middleSize = 16.0;
static const middleText = TextStyle(
@@ -21,9 +21,9 @@ class AppText{
fontSize: middleSize,
);
}
+
class WidgetDemoColor {
static const int fontColor = 0xFF607173;
static const int iconColor = 0xFF607173;
static const int borderColor = 0xFFEFEFEF;
-
}
diff --git a/lib/utils/syntax_highlighter.dart b/lib/utils/syntax_highlighter.dart
index 1b36f07c..3b0971f1 100644
--- a/lib/utils/syntax_highlighter.dart
+++ b/lib/utils/syntax_highlighter.dart
@@ -1,47 +1,44 @@
-/// @Author: 一凨
-/// @Date: 2019-01-14 11:42:39
-/// @Last Modified by: 一凨
-/// @Last Modified time: 2019-01-14 11:42:39
+/// @Author: 一凨
+/// @Date: 2019-01-14 11:42:39
+/// @Last Modified by: 一凨
+/// @Last Modified time: 2019-01-14 11:42:39
import 'package:flutter/material.dart';
import 'package:string_scanner/string_scanner.dart';
class SyntaxHighlighterStyle {
- SyntaxHighlighterStyle({
- this.baseStyle,
- this.numberStyle,
- this.commentStyle,
- this.keywordStyle,
- this.stringStyle,
- this.punctuationStyle,
- this.classStyle,
- this.constantStyle
- });
+ SyntaxHighlighterStyle(
+ {this.baseStyle,
+ this.numberStyle,
+ this.commentStyle,
+ this.keywordStyle,
+ this.stringStyle,
+ this.punctuationStyle,
+ this.classStyle,
+ this.constantStyle});
static SyntaxHighlighterStyle lightThemeStyle() {
return SyntaxHighlighterStyle(
- baseStyle: const TextStyle(color: Color(0xFF000000)),
- numberStyle: const TextStyle(color: Color(0xFF1565C0)),
- commentStyle: const TextStyle(color: Color(0xFF9E9E9E)),
- keywordStyle: const TextStyle(color: Color(0xFF9C27B0)),
- stringStyle: const TextStyle(color: Color(0xFF43A047)),
- punctuationStyle: const TextStyle(color: Color(0xFF000000)),
- classStyle: const TextStyle(color: Color(0xFF512DA8)),
- constantStyle: const TextStyle(color: Color(0xFF795548))
- );
+ baseStyle: const TextStyle(color: Color(0xFF000000)),
+ numberStyle: const TextStyle(color: Color(0xFF1565C0)),
+ commentStyle: const TextStyle(color: Color(0xFF9E9E9E)),
+ keywordStyle: const TextStyle(color: Color(0xFF9C27B0)),
+ stringStyle: const TextStyle(color: Color(0xFF43A047)),
+ punctuationStyle: const TextStyle(color: Color(0xFF000000)),
+ classStyle: const TextStyle(color: Color(0xFF512DA8)),
+ constantStyle: const TextStyle(color: Color(0xFF795548)));
}
static SyntaxHighlighterStyle darkThemeStyle() {
return SyntaxHighlighterStyle(
- baseStyle: const TextStyle(color: Color(0xFFFFFFFF)),
- numberStyle: const TextStyle(color: Color(0xFF1565C0)),
- commentStyle: const TextStyle(color: Color(0xFF9E9E9E)),
- keywordStyle: const TextStyle(color: Color(0xFF80CBC4)),
- stringStyle: const TextStyle(color: Color(0xFF009688)),
- punctuationStyle: const TextStyle(color: Color(0xFFFFFFFF)),
- classStyle: const TextStyle(color: Color(0xFF009688)),
- constantStyle: const TextStyle(color: Color(0xFF795548))
- );
+ baseStyle: const TextStyle(color: Color(0xFFFFFFFF)),
+ numberStyle: const TextStyle(color: Color(0xFF1565C0)),
+ commentStyle: const TextStyle(color: Color(0xFF9E9E9E)),
+ keywordStyle: const TextStyle(color: Color(0xFF80CBC4)),
+ stringStyle: const TextStyle(color: Color(0xFF009688)),
+ punctuationStyle: const TextStyle(color: Color(0xFFFFFFFF)),
+ classStyle: const TextStyle(color: Color(0xFF009688)),
+ constantStyle: const TextStyle(color: Color(0xFF795548)));
}
final TextStyle baseStyle;
@@ -54,7 +51,8 @@ class SyntaxHighlighterStyle {
final TextStyle constantStyle;
}
-abstract class SyntaxHighlighter { // ignore: one_member_abstracts
+abstract class SyntaxHighlighter {
+ // ignore: one_member_abstracts
TextSpan format(String src);
}
@@ -67,17 +65,66 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
SyntaxHighlighterStyle _style;
static const List _keywords = [
- 'abstract', 'as', 'assert', 'async', 'await', 'break', 'case', 'catch',
- 'class', 'const', 'continue', 'default', 'deferred', 'do', 'dynamic', 'else',
- 'enum', 'export', 'external', 'extends', 'factory', 'false', 'final',
- 'finally', 'for', 'get', 'if', 'implements', 'import', 'in', 'is', 'library',
- 'new', 'null', 'operator', 'part', 'rethrow', 'return', 'set', 'static',
- 'super', 'switch', 'sync', 'this', 'throw', 'true', 'try', 'typedef', 'var',
- 'void', 'while', 'with', 'yield'
+ 'abstract',
+ 'as',
+ 'assert',
+ 'async',
+ 'await',
+ 'break',
+ 'case',
+ 'catch',
+ 'class',
+ 'const',
+ 'continue',
+ 'default',
+ 'deferred',
+ 'do',
+ 'dynamic',
+ 'else',
+ 'enum',
+ 'export',
+ 'external',
+ 'extends',
+ 'factory',
+ 'false',
+ 'final',
+ 'finally',
+ 'for',
+ 'get',
+ 'if',
+ 'implements',
+ 'import',
+ 'in',
+ 'is',
+ 'library',
+ 'new',
+ 'null',
+ 'operator',
+ 'part',
+ 'rethrow',
+ 'return',
+ 'set',
+ 'static',
+ 'super',
+ 'switch',
+ 'sync',
+ 'this',
+ 'throw',
+ 'true',
+ 'try',
+ 'typedef',
+ 'var',
+ 'void',
+ 'while',
+ 'with',
+ 'yield'
];
static const List _builtInTypes = [
- 'int', 'double', 'num', 'bool'
+ 'int',
+ 'double',
+ 'num',
+ 'bool'
];
String _src;
@@ -97,15 +144,18 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
for (_HighlightSpan span in _spans) {
if (currentPosition != span.start)
- formattedText.add(TextSpan(text: _src.substring(currentPosition, span.start)));
+ formattedText
+ .add(TextSpan(text: _src.substring(currentPosition, span.start)));
- formattedText.add(TextSpan(style: span.textStyle(_style), text: span.textForSpan(_src)));
+ formattedText.add(TextSpan(
+ style: span.textStyle(_style), text: span.textForSpan(_src)));
currentPosition = span.end;
}
if (currentPosition != _src.length)
- formattedText.add(TextSpan(text: _src.substring(currentPosition, _src.length)));
+ formattedText
+ .add(TextSpan(text: _src.substring(currentPosition, _src.length)));
return TextSpan(style: _style.baseStyle, children: formattedText);
} else {
@@ -123,11 +173,8 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
// Block comments
if (_scanner.scan(RegExp(r'/\*(.|\n)*\*/'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.comment,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.comment,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
@@ -144,115 +191,81 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
endComment = _src.length;
}
- _spans.add(_HighlightSpan(
- _HighlightType.comment,
- startComment,
- endComment
- ));
+ _spans.add(
+ _HighlightSpan(_HighlightType.comment, startComment, endComment));
- if (eof)
- break;
+ if (eof) break;
continue;
}
// Raw r"String"
if (_scanner.scan(RegExp(r'r".*"'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Raw r'String'
if (_scanner.scan(RegExp(r"r'.*'"))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Multiline """String"""
if (_scanner.scan(RegExp(r'"""(?:[^"\\]|\\(.|\n))*"""'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Multiline '''String'''
if (_scanner.scan(RegExp(r"'''(?:[^'\\]|\\(.|\n))*'''"))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// "String"
if (_scanner.scan(RegExp(r'"(?:[^"\\]|\\.)*"'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// 'String'
if (_scanner.scan(RegExp(r"'(?:[^'\\]|\\.)*'"))) {
- _spans.add(_HighlightSpan(
- _HighlightType.string,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.string,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Double
if (_scanner.scan(RegExp(r'\d+\.\d+'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.number,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.number,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Integer
if (_scanner.scan(RegExp(r'\d+'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.number,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end)
- );
+ _spans.add(_HighlightSpan(_HighlightType.number,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Punctuation
if (_scanner.scan(RegExp(r'[\[\]{}().!=<>&\|\?\+\-\*/%\^~;:,]'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.punctuation,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.punctuation,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
// Meta data
if (_scanner.scan(RegExp(r'@\w+'))) {
- _spans.add(_HighlightSpan(
- _HighlightType.keyword,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ _spans.add(_HighlightSpan(_HighlightType.keyword,
+ _scanner.lastMatch.start, _scanner.lastMatch.end));
continue;
}
@@ -261,8 +274,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_HighlightType type;
String word = _scanner.lastMatch[0];
- if (word.startsWith('_'))
- word = word.substring(1);
+ if (word.startsWith('_')) word = word.substring(1);
if (_keywords.contains(word))
type = _HighlightType.keyword;
@@ -270,15 +282,14 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
type = _HighlightType.keyword;
else if (_firstLetterIsUpperCase(word))
type = _HighlightType.klass;
- else if (word.length >= 2 && word.startsWith('k') && _firstLetterIsUpperCase(word.substring(1)))
+ else if (word.length >= 2 &&
+ word.startsWith('k') &&
+ _firstLetterIsUpperCase(word.substring(1)))
type = _HighlightType.constant;
if (type != null) {
_spans.add(_HighlightSpan(
- type,
- _scanner.lastMatch.start,
- _scanner.lastMatch.end
- ));
+ type, _scanner.lastMatch.start, _scanner.lastMatch.end));
}
}
@@ -296,12 +307,10 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
void _simplify() {
for (int i = _spans.length - 2; i >= 0; i -= 1) {
- if (_spans[i].type == _spans[i + 1].type && _spans[i].end == _spans[i + 1].start) {
- _spans[i] = _HighlightSpan(
- _spans[i].type,
- _spans[i].start,
- _spans[i + 1].end
- );
+ if (_spans[i].type == _spans[i + 1].type &&
+ _spans[i].end == _spans[i + 1].start) {
+ _spans[i] =
+ _HighlightSpan(_spans[i].type, _spans[i].start, _spans[i + 1].end);
_spans.removeAt(i + 1);
}
}
diff --git a/lib/views/collection_page/collection_full_page.dart b/lib/views/collection_page/collection_full_page.dart
index ada616eb..29be26e3 100644
--- a/lib/views/collection_page/collection_full_page.dart
+++ b/lib/views/collection_page/collection_full_page.dart
@@ -58,7 +58,6 @@ class _CollectionFullPageState extends State {
}
Widget _renderList(context, index) {
-
if (index == 0) {
return Container(
height: 40.0,
@@ -115,9 +114,8 @@ class _CollectionFullPageState extends State {
trailing:
Icon(Icons.keyboard_arrow_right, color: Colors.grey, size: 30.0),
onTap: () {
- Application.router.navigateTo(
- context, targetRouter.toLowerCase(),
- transition: TransitionType.inFromRight);
+ Application.router.navigateTo(context, targetRouter.toLowerCase(),
+ transition: TransitionType.native);
},
),
);
diff --git a/lib/views/collection_page/collection_page.dart b/lib/views/collection_page/collection_page.dart
index 75d6e309..9dd69de3 100644
--- a/lib/views/collection_page/collection_page.dart
+++ b/lib/views/collection_page/collection_page.dart
@@ -1,3 +1,5 @@
+import 'package:fluro/fluro.dart';
+
/// @Author: 一凨
/// @Date: 2019-01-08 17:12:58
/// @Last Modified by: 一凨
@@ -11,6 +13,7 @@ import 'package:flutter_go/routers/application.dart';
import 'package:flutter_go/routers/routers.dart';
import 'package:flutter_go/event/event_bus.dart';
import 'package:flutter_go/event/event_model.dart';
+
/// import 'package:flutter_go/utils/data_utils.dart';
class CollectionPage extends StatefulWidget {
@@ -26,6 +29,7 @@ class _CollectionPageState extends State {
final eventBus = new EventBus();
ApplicationEvent.event = eventBus;
}
+
/// CollectionControlModel _collectionControl = new CollectionControlModel();
List _collectionList = [];
ScrollController _scrollController = new ScrollController();
@@ -116,11 +120,17 @@ class _CollectionPageState extends State {
onTap: () {
if (_collectionList[index - 1].router.contains('http')) {
// 注意这里title已经转义过了
- Application.router.navigateTo(context,
- '${Routes.webViewPage}?title=${_collectionList[index - 1].name}&url=${Uri.encodeComponent(_collectionList[index - 1].router)}');
+ Application.router.navigateTo(
+ context,
+ '${Routes.webViewPage}?title=${_collectionList[index - 1].name}&url=${Uri.encodeComponent(_collectionList[index - 1].router)}',
+ transition: TransitionType.nativeModal,
+ );
} else {
- Application.router
- .navigateTo(context, "${_collectionList[index - 1].router}");
+ Application.router.navigateTo(
+ context,
+ "${_collectionList[index - 1].router}",
+ transition: TransitionType.nativeModal,
+ );
}
},
),
diff --git a/lib/views/first_page/drawer_page.dart b/lib/views/first_page/drawer_page.dart
index f0fc1be0..d456598c 100644
--- a/lib/views/first_page/drawer_page.dart
+++ b/lib/views/first_page/drawer_page.dart
@@ -172,9 +172,11 @@ class _DrawerPageState extends State {
style: textStyle,
),
onTap: () {
- Application.router.navigateTo(context,
- '${Routes.collectionFullPage}?hasLogin=${hasLogin.toString()}',
- transition: TransitionType.fadeIn);
+ Application.router.navigateTo(
+ context,
+ '${Routes.collectionFullPage}?hasLogin=${hasLogin.toString()}',
+ transition: TransitionType.nativeModal,
+ );
},
),
// new Divider(),
@@ -205,11 +207,18 @@ class _DrawerPageState extends State {
onTap: () {
if (hasLogin) {
//issue 未登陆状态 返回登陆页面
- Application.router.navigateTo(context, '${Routes.issuesMessage}');
+ Application.router.navigateTo(
+ context,
+ '${Routes.issuesMessage}',
+ transition: TransitionType.nativeModal,
+ );
} else {
//No description provided.
- Application.router.navigateTo(context, '${Routes.loginPage}');
-
+ Application.router.navigateTo(
+ context,
+ '${Routes.loginPage}',
+ transition: TransitionType.nativeModal,
+ );
}
},
),
diff --git a/lib/views/first_page/first_page.dart b/lib/views/first_page/first_page.dart
index 38840ba1..e1d01544 100644
--- a/lib/views/first_page/first_page.dart
+++ b/lib/views/first_page/first_page.dart
@@ -17,7 +17,8 @@ class FirstPage extends StatefulWidget {
FirstPageState createState() => new FirstPageState();
}
-class FirstPageState extends State with AutomaticKeepAliveClientMixin{
+class FirstPageState extends State
+ with AutomaticKeepAliveClientMixin {
Future _prefs = SharedPreferences.getInstance();
Future _unKnow;
GlobalKey key;
@@ -25,7 +26,6 @@ class FirstPageState extends State with AutomaticKeepAliveClientMixin
@override
bool get wantKeepAlive => true;
-
@override
void initState() {
super.initState();
@@ -39,8 +39,10 @@ class FirstPageState extends State with AutomaticKeepAliveClientMixin
/// 判断是否需要弹出免责声明,已经勾选过不在显示,就不会主动弹
_unKnow.then((bool value) {
- new Future.delayed(const Duration(seconds: 1),(){
- if (!value && key.currentState is DisclaimerMsgState && key.currentState.showAlertDialog is Function) {
+ new Future.delayed(const Duration(seconds: 1), () {
+ if (!value &&
+ key.currentState is DisclaimerMsgState &&
+ key.currentState.showAlertDialog is Function) {
key.currentState.showAlertDialog(context);
}
});
@@ -48,26 +50,24 @@ class FirstPageState extends State with AutomaticKeepAliveClientMixin
}
}
-
Future getIndexListData([Map params]) async {
/// const juejin_flutter = 'https://timeline-merger-ms.juejin.im/v1/get_tag_entry?src=web&tagId=5a96291f6fb9a0535b535438';
- const juejin_flutter = 'https://fluttergo.pub:9527/juejin.im/v1/get_tag_entry?src=web&tagId=5a96291f6fb9a0535b535438';
+ const juejin_flutter =
+ 'https://fluttergo.pub:9527/juejin.im/v1/get_tag_entry?src=web&tagId=5a96291f6fb9a0535b535438';
var pageIndex = (params is Map) ? params['pageIndex'] : 0;
- final _param = {'page':pageIndex,'pageSize':20,'sort':'rankIndex'};
+ final _param = {'page': pageIndex, 'pageSize': 20, 'sort': 'rankIndex'};
var responseList = [];
- var pageTotal = 0;
+ var pageTotal = 0;
- try{
+ try {
var response = await NetUtils.get(juejin_flutter, _param);
responseList = response['d']['entrylist'];
pageTotal = response['d']['total'];
if (!(pageTotal is int) || pageTotal <= 0) {
pageTotal = 0;
}
- }catch(e){
-
- }
+ } catch (e) {}
pageIndex += 1;
List resultList = new List();
for (int i = 0; i < responseList.length; i++) {
@@ -78,44 +78,50 @@ class FirstPageState extends State with AutomaticKeepAliveClientMixin
// No specified type, handles all
}
}
- Map result = {"list":resultList, 'total':pageTotal, 'pageIndex':pageIndex};
+ Map result = {
+ "list": resultList,
+ 'total': pageTotal,
+ 'pageIndex': pageIndex
+ };
return result;
}
/// 每个item的样式
- Widget makeCard(index,item){
+ Widget makeCard(index, item) {
var myTitle = '${item.title}';
var myUsername = '${'👲'}: ${item.username} ';
var codeUrl = '${item.detailUrl}';
- return new ListViewItem(itemUrl:codeUrl,itemTitle: myTitle,data: myUsername,);
+ return new ListViewItem(
+ itemUrl: codeUrl,
+ itemTitle: myTitle,
+ data: myUsername,
+ );
}
- headerView(){
- return
- Column(
- children: [
- Stack(
+ headerView() {
+ return Column(
+ children: [
+ 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: 1, child:Container(color: Theme.of(context).primaryColor)),
- SizedBox(height: 10),
- ],
- );
-
+ children: [
+ Pagination(),
+ Positioned(
+ //方法二
+ top: 10.0,
+ left: 0.0,
+ child: DisclaimerMsg(key: key, pWidget: this)),
+ ]),
+ 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: [
+ return new Column(children: [
// new Stack(
// //alignment: const FractionalOffset(0.9, 0.1),//方法一
// children: [
@@ -127,14 +133,9 @@ class FirstPageState extends State with AutomaticKeepAliveClientMixin
// ),
// ]),
// SizedBox(height: 2, child:Container(color: Theme.of(context).primaryColor)),
- new Expanded(
- //child: new List(),
- child: listComp.ListRefresh(getIndexListData,makeCard,headerView)
- )
- ]
-
- );
+ new Expanded(
+ //child: new List(),
+ child: listComp.ListRefresh(getIndexListData, makeCard, headerView))
+ ]);
}
}
-
-
diff --git a/lib/views/first_page/first_page_item.dart b/lib/views/first_page/first_page_item.dart
index bef10315..bdd5da10 100644
--- a/lib/views/first_page/first_page_item.dart
+++ b/lib/views/first_page/first_page_item.dart
@@ -20,18 +20,18 @@ class FirstPageItem {
FirstPageItem(
{this.hot,
- this.tag,
- this.username,
- this.collectionCount,
- this.createdTime,
- this.commentCount,
- this.title,
- this.detailUrl,
- this.isCollection});
+ this.tag,
+ this.username,
+ this.collectionCount,
+ this.createdTime,
+ this.commentCount,
+ this.title,
+ this.detailUrl,
+ this.isCollection});
factory FirstPageItem.fromJson(Map json) {
String _tag = '';
- if(json['tags'].length>0){
+ if (json['tags'].length > 0) {
_tag = '${json['tags'][0]['title']}/';
}
return FirstPageItem(
@@ -43,7 +43,7 @@ class FirstPageItem {
createdTime: Util.getTimeDuration(json['createdAt']),
title: json['title'],
detailUrl: json['originalUrl'],
- isCollection: json['type'] ,
+ isCollection: json['type'],
);
}
-}
\ No newline at end of file
+}
diff --git a/lib/views/first_page/main_page.dart b/lib/views/first_page/main_page.dart
index c48fbe0d..d2f7850b 100644
--- a/lib/views/first_page/main_page.dart
+++ b/lib/views/first_page/main_page.dart
@@ -1,7 +1,9 @@
+import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_go/views/first_page/drawer_page.dart';
import './first_page.dart';
+
/// import './sub_page.dart';
import './main_app_bar.dart';
import './search_page.dart';
@@ -16,13 +18,14 @@ class _Page {
final String labelId;
final int labelIndex;
- _Page(this.labelId,this.labelIndex);
+ _Page(this.labelId, this.labelIndex);
}
final List<_Page> _allPages = <_Page>[
_Page('热门资讯', 1),
_Page('FG-官网', 2),
_Page('FG-web版', 3),
+
///_Page('项目4'),
];
@@ -36,11 +39,13 @@ class MainPage extends StatelessWidget {
_tabController = DefaultTabController(
length: _allPages.length,
child: Scaffold(
- appBar: MyAppBar(
+ appBar: MyAppBar(
leading: Container(
- child: ClipOval(
+ child: ClipOval(
child: Image.network(
- userInfo.id == 0?'https://hbimg.huabanimg.com/9bfa0fad3b1284d652d370fa0a8155e1222c62c0bf9d-YjG0Vt_fw658':userInfo.avatarPic,
+ userInfo.id == 0
+ ? 'https://hbimg.huabanimg.com/9bfa0fad3b1284d652d370fa0a8155e1222c62c0bf9d-YjG0Vt_fw658'
+ : userInfo.avatarPic,
scale: 15.0,
),
)),
@@ -48,16 +53,14 @@ class MainPage extends StatelessWidget {
title: TabLayout(),
actions: [
IconButton(
- icon: Icon(Icons.search),
+ icon: Icon(Icons.search),
onPressed: () {
pushPage(context, SearchPage(), pageName: "SearchPage");
})
],
),
drawer: Drawer(
- child: DrawerPage(
- userInfo: userInfo
- ),
+ child: DrawerPage(userInfo: userInfo),
),
body: TabBarViewLayout(),
));
@@ -74,26 +77,32 @@ class TabLayout extends StatelessWidget {
@override
Widget build(BuildContext context) {
_tabBar = TabBar(
- isScrollable: true,
- //labelPadding: EdgeInsets.all(12.0),
- labelPadding: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0),
- indicatorSize: TabBarIndicatorSize.label,
- tabs: _allPages.map((_Page page) => Tab(text: page.labelId)).toList(),
- onTap: (index) {
- if (index == 1) {
- DefaultTabController.of(context).animateTo(0);
- Application.router.navigateTo(context, '${Routes.webViewPage}?title=${Uri.encodeComponent('Flutter Go 官方网站')}&url=${Uri.encodeComponent('https://flutter-go.pub')}');
- } else if (index == 2) {
-
+ isScrollable: true,
+ //labelPadding: EdgeInsets.all(12.0),
+ labelPadding: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0),
+ indicatorSize: TabBarIndicatorSize.label,
+ tabs: _allPages.map((_Page page) => Tab(text: page.labelId)).toList(),
+ onTap: (index) {
+ if (index == 1) {
+ DefaultTabController.of(context).animateTo(0);
+ Application.router.navigateTo(
+ context,
+ '${Routes.webViewPage}?title=${Uri.encodeComponent('Flutter Go 官方网站')}&url=${Uri.encodeComponent('https://flutter-go.pub')}',
+ transition: TransitionType.nativeModal,
+ );
+ } else if (index == 2) {
// new Future.delayed(const Duration(seconds: 1),(){
// showAlertDialog(Application.globalContext);
// });
- DefaultTabController.of(context).animateTo(0);
- Application.router.navigateTo(context, '${Routes.webViewPage}?title=${Uri.encodeComponent('Flutter Go web版(H5)')}&url=${Uri.encodeComponent('https://flutter-go.pub/flutter_go_web')}');
- }
- }
- );
+ DefaultTabController.of(context).animateTo(0);
+ Application.router.navigateTo(
+ context,
+ '${Routes.webViewPage}?title=${Uri.encodeComponent('Flutter Go web版(H5)')}&url=${Uri.encodeComponent('https://flutter-go.pub/flutter_go_web')}',
+ transition: TransitionType.nativeModal,
+ );
+ }
+ });
return _tabBar;
}
}
@@ -116,7 +125,7 @@ class TabBarViewLayout extends StatelessWidget {
print("TabBarViewLayout build.......");
return TabBarView(
children: _allPages.map((_Page page) {
- return buildTabView(context, page);
- }).toList());
+ return buildTabView(context, page);
+ }).toList());
}
}
diff --git a/lib/views/first_page/search_page.dart b/lib/views/first_page/search_page.dart
index 042bae8a..f1ee1cba 100644
--- a/lib/views/first_page/search_page.dart
+++ b/lib/views/first_page/search_page.dart
@@ -1,3 +1,4 @@
+import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/cupertino.dart';
@@ -8,7 +9,7 @@ import 'package:flutter_go/blocs/industry_event.dart';
import 'package:flutter_go/routers/application.dart';
import 'package:flutter_go/routers/routers.dart';
-final _industryPage = Industry.IndustryPage(itemTitle: (state){
+final _industryPage = Industry.IndustryPage(itemTitle: (state) {
return ListView.builder(
itemBuilder: (BuildContext context, int index) {
return ListTile(
@@ -27,7 +28,11 @@ final _industryPage = Industry.IndustryPage(itemTitle: (state){
print(state.res[index].source);
final itemTitle = state.res[index].title;
final itemUrl = state.res[index].source;
- Application.router.navigateTo(context, '${Routes.webViewPage}?title=${Uri.encodeComponent(itemTitle)}&url=${Uri.encodeComponent(itemUrl)}');
+ Application.router.navigateTo(
+ context,
+ '${Routes.webViewPage}?title=${Uri.encodeComponent(itemTitle)}&url=${Uri.encodeComponent(itemUrl)}',
+ transition: TransitionType.nativeModal,
+ );
},
);
},
@@ -44,9 +49,8 @@ class SearchPage extends StatelessWidget {
/// print('suggestion::${Industry.suggestion}');
return Scaffold(
appBar: PreferredSize(
- preferredSize: Size(double.infinity, 52), // is the height
- child: AppBar(title: searchBarPage)
- ),
+ preferredSize: Size(double.infinity, 52), // is the height
+ child: AppBar(title: searchBarPage)),
//body: ProgressView(),
body: _industryPage,
floatingActionButton: FloatingActionButton(
@@ -54,7 +58,9 @@ class SearchPage extends StatelessWidget {
onPressed: () {
//print('searchBarPage=====>${controller.text}');
//print('searchBarPage=====>${that.getResultsDebounced}');
- if(that is _SearchBarPageState && that.getResultsDebounced is Function && controller.text is String ) {
+ if (that is _SearchBarPageState &&
+ that.getResultsDebounced is Function &&
+ controller.text is String) {
that.getResultsDebounced(controller.text);
}
},
@@ -67,11 +73,11 @@ class SearchPage extends StatelessWidget {
class ProgressView extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return Center(
- child: SizedBox(
+ return Center(
+ child: SizedBox(
width: 24.0,
height: 24.0,
- child: CircularProgressIndicator(
+ child: CircularProgressIndicator(
strokeWidth: 2.0,
),
),
@@ -79,15 +85,15 @@ class ProgressView extends StatelessWidget {
}
}
-class SearchBarPage extends StatefulWidget{
+class SearchBarPage extends StatefulWidget {
@override
- State createState() => _SearchBarPageState();
+ State createState() => _SearchBarPageState();
}
-
final TextEditingController controller = TextEditingController();
var that;
var loading;
+
class _SearchBarPageState extends State {
@override
void initState() {
@@ -99,9 +105,10 @@ class _SearchBarPageState extends State {
Timer _resultsTimer;
String oldKey;
+
/// 防抖函数
Future getResultsDebounced(String text) async {
- if(oldKey == text){
+ if (oldKey == text) {
print('请求内容重复');
return;
}
@@ -114,15 +121,14 @@ class _SearchBarPageState extends State {
}
_resultsTimer = new Timer(new Duration(milliseconds: 400), () async {
loading = true;
- if(mounted){
+ if (mounted) {
suggestion.dispatch(SuggestionFetch(query: text));
}
oldKey = text;
});
}
-
- void onSearchTextChanged(String text){
+ void onSearchTextChanged(String text) {
print('onSearchTextChanged:$text');
//suggestion.dispatch(SuggestionFetch(query: text));
getResultsDebounced(text);
@@ -136,56 +142,58 @@ class _SearchBarPageState extends State {
super.dispose();
}
-
Widget build(BuildContext context) {
return Container(
- color: Theme.of(context).primaryColor,
- //color: Colors.amber,
- child: Padding(
- //padding: EdgeInsets.only(top: MediaQueryData.fromWindow(window).padding.top,),
- padding: EdgeInsets.all(0.0),
- child: Container(
- //height: 162.0,
- child: Padding(
- padding: const EdgeInsets.all(6.0),
- child: Card(
- child: Container(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- SizedBox(width: 5.0,),
- Icon(Icons.search, color: Colors.grey,size: 18.0,),
- Expanded(
- child: Container(
- alignment: Alignment.center,
- child: TextField(
- controller: controller,
- decoration: InputDecoration(
- contentPadding: EdgeInsets.only(top: 0.0),
- hintText: '全网搜索 Flutter 相关知识库',
- hintStyle:TextStyle(fontSize: 12.0),
- border: InputBorder.none
- ),
- onChanged: onSearchTextChanged,
- ),
- ),
- ),
- IconButton(
- icon: Icon(Icons.cancel),
- color: Colors.grey,
- iconSize: 18.0,
- onPressed: () {
- controller.clear();
- // onSearchTextChanged('');
- },
- ),
- ],
+ color: Theme.of(context).primaryColor,
+ //color: Colors.amber,
+ child: Padding(
+ //padding: EdgeInsets.only(top: MediaQueryData.fromWindow(window).padding.top,),
+ padding: EdgeInsets.all(0.0),
+ child: Container(
+ //height: 162.0,
+ child: Padding(
+ padding: const EdgeInsets.all(6.0),
+ child: Card(
+ child: Container(
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ SizedBox(
+ width: 5.0,
+ ),
+ Icon(
+ Icons.search,
+ color: Colors.grey,
+ size: 18.0,
+ ),
+ Expanded(
+ child: Container(
+ alignment: Alignment.center,
+ child: TextField(
+ controller: controller,
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.only(top: 0.0),
+ hintText: '全网搜索 Flutter 相关知识库',
+ hintStyle: TextStyle(fontSize: 12.0),
+ border: InputBorder.none),
+ onChanged: onSearchTextChanged,
+ ),
),
- )
- )
- ),
- ),
+ ),
+ IconButton(
+ icon: Icon(Icons.cancel),
+ color: Colors.grey,
+ iconSize: 18.0,
+ onPressed: () {
+ controller.clear();
+ // onSearchTextChanged('');
+ },
+ ),
+ ],
+ ),
+ ))),
),
- );
+ ),
+ );
}
-}
\ No newline at end of file
+}
diff --git a/lib/views/first_page/sub_page.dart b/lib/views/first_page/sub_page.dart
index 22325f97..45b7de72 100644
--- a/lib/views/first_page/sub_page.dart
+++ b/lib/views/first_page/sub_page.dart
@@ -17,7 +17,7 @@ class SubPage extends StatefulWidget {
SubPageState createState() => SubPageState();
}
-class SubPageState extends State with AutomaticKeepAliveClientMixin{
+class SubPageState extends State with AutomaticKeepAliveClientMixin {
Future _prefs = SharedPreferences.getInstance();
Future _unKnow;
GlobalKey key;
@@ -25,47 +25,46 @@ class SubPageState extends State