├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── android
├── app
│ ├── build.gradle
│ ├── proguard-rules.pro
│ ├── release
│ │ ├── app-release.apk
│ │ └── output.json
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── flutter
│ │ │ │ └── flutter_eyepetizer
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── layout
│ │ │ └── launch_screen.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── launch_screen.jpg
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── eye
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── settings.gradle
└── speech_plugin
│ ├── .gitignore
│ ├── build.gradle
│ ├── consumer-rules.pro
│ ├── libs
│ ├── Msc.jar
│ ├── arm64-v8a
│ │ └── libmsc.so
│ └── armeabi-v7a
│ │ └── libmsc.so
│ ├── proguard-rules.pro
│ └── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── flutter
│ │ └── eyepetizer
│ │ └── speech
│ │ └── plugin
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── iflytek
│ │ │ ├── recognize.xml
│ │ │ ├── voice_bg.9.png
│ │ │ ├── voice_empty.png
│ │ │ ├── voice_full.png
│ │ │ ├── waiting.png
│ │ │ └── warning.png
│ ├── java
│ │ └── com
│ │ │ └── flutter
│ │ │ └── eyepetizer
│ │ │ └── speech
│ │ │ └── plugin
│ │ │ ├── JsonParser.java
│ │ │ ├── ResultStateful.java
│ │ │ ├── SpeechManager.java
│ │ │ └── SpeechPlugin.java
│ └── res
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── flutter
│ └── eyepetizer
│ └── speech
│ └── plugin
│ └── ExampleUnitTest.java
├── component
├── lib_cache
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ │ ├── cache_manager.dart
│ │ └── lib_cache.dart
│ ├── pubspec.lock
│ └── pubspec.yaml
├── lib_core
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ │ ├── lib_core.dart
│ │ ├── model
│ │ │ └── paging_model.dart
│ │ ├── state
│ │ │ ├── base_list_state.dart
│ │ │ └── base_state.dart
│ │ ├── viewmodel
│ │ │ ├── base_change_notifier_model.dart
│ │ │ └── paging_list_model.dart
│ │ └── widget
│ │ │ └── provider_widget.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── lib_core_test.dart
├── lib_image
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ │ └── lib_image.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── lib_image_test.dart
├── lib_navigator
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ │ └── lib_navigator.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── lib_navigator_test.dart
├── lib_net
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ │ ├── http_manager.dart
│ │ └── lib_net.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── lib_net_test.dart
├── lib_ui
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── images
│ │ └── ic_error.png
│ ├── lib
│ │ ├── config
│ │ │ ├── color.dart
│ │ │ └── string.dart
│ │ ├── lib_ui.dart
│ │ └── widget
│ │ │ ├── appbar_widget.dart
│ │ │ ├── blur_widget.dart
│ │ │ ├── load_more_widget.dart
│ │ │ ├── loading_container.dart
│ │ │ ├── remod_more_text_widget.dart
│ │ │ └── tab_bar_widget.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── lib_ui_test.dart
├── lib_utils
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ │ ├── commom_uitl.dart
│ │ ├── date_util.dart
│ │ ├── event_bus.dart
│ │ ├── lib_utils.dart
│ │ ├── share_util.dart
│ │ ├── toast_util.dart
│ │ └── view_util.dart
│ ├── pubspec.lock
│ └── pubspec.yaml
└── lib_video
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ ├── customer_video_controls.dart
│ ├── lib_video.dart
│ └── video_widget.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ └── lib_video_test.dart
├── images
├── 1567913521.png
├── 1621567911767_.pic.jpg
├── 1891576051893_.pic.jpg
├── 1901576051894_.pic.jpg
├── 1911576051895_.pic.jpg
├── 1941576565879_.pic.jpg
├── 1961576565881_.pic.jpg
├── 1981576565883_.pic.jpg
├── 2021576568582_.pic.jpg
├── 2031576568583_.pic.jpg
├── 2041576568584_.pic.jpg
├── 2051576568585_.pic.jpg
├── 2061576568586_.pic.jpg
├── 2071576569018_.pic.jpg
├── 2081576569019_.pic.jpg
├── 2141576721487_.pic.jpg
├── 2521583645458_.pic.jpg
├── 2531583645460_.pic.jpg
├── 2541583645461_.pic.jpg
├── 2601584689731_.pic.jpg
├── 2611584689732_.pic.jpg
├── 2621584689733_.pic.jpg
├── function.png
├── ic_discovery_normal.png
├── ic_discovery_selected.png
├── ic_home_normal.png
├── ic_home_selected.png
├── ic_hot_normal.png
├── ic_hot_selected.png
├── ic_mine_normal.png
├── ic_mine_selected.png
└── technology.png
├── ios
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── flutter_export_environment.sh
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ ├── Contents.json
│ ├── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── landing_background.imageset
│ │ ├── Contents.json
│ │ └── landing_background.jpg
│ ├── launch_screen.imageset
│ │ ├── Contents.json
│ │ └── launch_screen.jpg
│ └── launch_screen_bg.imageset
│ │ ├── Contents.json
│ │ └── launch_screen.jpeg
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── main.m
├── lib
├── app_initialize.dart
├── config
│ └── string.dart
├── main.dart
├── navigation
│ └── tab_navigation.dart
└── viewmodel
│ └── tab_navigation_model.dart
├── module
├── module_author
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── images
│ │ └── ic_default_header_bg.png
│ ├── lib
│ │ ├── constant
│ │ │ ├── api_service.dart
│ │ │ └── string.dart
│ │ ├── delegate
│ │ │ └── sticky_tabbar_delegate.dart
│ │ ├── module_author.dart
│ │ ├── page
│ │ │ ├── all_tab_page.dart
│ │ │ ├── author_page.dart
│ │ │ ├── home_tab_page.dart
│ │ │ └── special_tab_page.dart
│ │ ├── viewmodel
│ │ │ └── author_tab_page_model.dart
│ │ └── widget
│ │ │ ├── all_widget_item.dart
│ │ │ ├── author_common_horizontal_widget_item.dart
│ │ │ ├── special_horizontal_widget_item.dart
│ │ │ └── special_widget_item.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── module_author_test.dart
├── module_common
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ │ ├── constant
│ │ │ ├── color.dart
│ │ │ └── http_constant.dart
│ │ ├── event
│ │ │ └── watch_video_event.dart
│ │ ├── model
│ │ │ ├── common_item_model.dart
│ │ │ └── tab_info_model.dart
│ │ ├── module_common.dart
│ │ ├── repository
│ │ │ └── history_repository.dart
│ │ └── widget
│ │ │ ├── rank_widget_item.dart
│ │ │ └── video_relate_widget_item.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── module_common_test.dart
├── module_detail
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── images
│ │ ├── ic_like.png
│ │ ├── ic_share_white.png
│ │ └── icon_comment.png
│ ├── lib
│ │ ├── constant
│ │ │ ├── api_service.dart
│ │ │ └── string.dart
│ │ ├── module_detail.dart
│ │ ├── page
│ │ │ └── video_detail_page.dart
│ │ ├── viewmodel
│ │ │ └── video_detail_page_model.dart
│ │ └── widget
│ │ │ └── appbar_widget.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── module_detail_test.dart
├── module_discover
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ │ ├── constant
│ │ │ ├── api_service.dart
│ │ │ ├── color.dart
│ │ │ └── string.dart
│ │ ├── model
│ │ │ ├── category_model.dart
│ │ │ ├── news_model.dart
│ │ │ ├── recommend_model.dart
│ │ │ ├── topic_detail_model.dart
│ │ │ └── topic_model.dart
│ │ ├── module_discover.dart
│ │ ├── page
│ │ │ ├── category_detail_page.dart
│ │ │ ├── category_page.dart
│ │ │ ├── discovery_page.dart
│ │ │ ├── follow_page.dart
│ │ │ ├── news_list_page.dart
│ │ │ ├── recommend_page.dart
│ │ │ ├── recommend_photo_gallery_page.dart
│ │ │ ├── recommend_video_play_page.dart
│ │ │ ├── topics_detail_page.dart
│ │ │ ├── topics_page.dart
│ │ │ └── web_page.dart
│ │ ├── repository
│ │ │ └── recommend_repository.dart
│ │ ├── viewmodel
│ │ │ ├── category_detail_model.dart
│ │ │ ├── category_page_model.dart
│ │ │ ├── follow_page_model.dart
│ │ │ ├── news_page_model.dart
│ │ │ ├── photo_gallery_model.dart
│ │ │ ├── topic_detail_page_model.dart
│ │ │ ├── topic_page_model.dart
│ │ │ └── video_detail_page_model.dart
│ │ └── widget
│ │ │ ├── category_widget_item.dart
│ │ │ ├── follow_page_item.dart
│ │ │ ├── follow_widget_item.dart
│ │ │ ├── news_widget_item.dart
│ │ │ ├── recommend_widget_item.dart
│ │ │ ├── topic_detail_widget_item.dart
│ │ │ └── topic_widget_item.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── module_discover_test.dart
├── module_home
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ │ ├── const
│ │ │ ├── api_service.dart
│ │ │ └── string.dart
│ │ ├── model
│ │ │ └── issue_model.dart
│ │ ├── module_home.dart
│ │ ├── page
│ │ │ ├── home_page.dart
│ │ │ ├── home_tab_page.dart
│ │ │ └── video_search_page.dart
│ │ ├── plugin
│ │ │ └── speech_plugin.dart
│ │ ├── viewmodel
│ │ │ ├── home_page_model.dart
│ │ │ └── video_search_model.dart
│ │ └── widget
│ │ │ ├── banner_widget.dart
│ │ │ └── search_video_widget_item.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── module_home_test.dart
├── module_hot
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ │ ├── constant
│ │ │ ├── api_service.dart
│ │ │ └── string.dart
│ │ ├── module_hot.dart
│ │ ├── page
│ │ │ ├── rank_list_page.dart
│ │ │ └── rank_page.dart
│ │ └── viewmodel
│ │ │ └── rank_list_page_model.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── module_hot_test.dart
└── module_person
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── images
│ ├── ic_img_avatar.png
│ ├── ic_no_data.png
│ ├── icon_comment_grey.png
│ └── icon_like_grey.png
│ ├── lib
│ ├── constant
│ │ └── string.dart
│ ├── module_person.dart
│ ├── page
│ │ ├── mine_page.dart
│ │ └── watch_history_page.dart
│ ├── repository
│ │ └── mine_repository.dart
│ └── viewmodel
│ │ └── watch_history_page_model.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ └── module_person_test.dart
├── note
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Generated.xcconfig
62 | **/ios/Flutter/app.flx
63 | **/ios/Flutter/app.zip
64 | **/ios/Flutter/flutter_assets/
65 | **/ios/ServiceDefinitions.json
66 | **/ios/Runner/GeneratedPluginRegistrant.*
67 |
68 | # Exceptions to above rules.
69 | !**/ios/**/default.mode1v3
70 | !**/ios/**/default.mode2v3
71 | !**/ios/**/default.pbxuser
72 | !**/ios/**/default.perspectivev3
73 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
74 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 20e59316b8b8474554b38493b8ca888794b0234a
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 fmtjava
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 | -keep class com.iflytek.**{*;}
23 | -keepattributes Signature
--------------------------------------------------------------------------------
/android/app/release/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/release/app-release.apk
--------------------------------------------------------------------------------
/android/app/release/output.json:
--------------------------------------------------------------------------------
1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
14 |
18 |
21 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/layout/launch_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/launch_screen.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-xxhdpi/launch_screen.jpg
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #000000
4 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | //google()
4 | //jcenter()
5 | maven { url 'https://maven.aliyun.com/repository/google' }
6 | maven { url 'https://maven.aliyun.com/repository/jcenter' }
7 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
8 | }
9 |
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:4.0.1'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | //google()
19 | //jcenter()
20 | maven { url 'https://maven.aliyun.com/repository/google' }
21 | maven { url 'https://maven.aliyun.com/repository/jcenter' }
22 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
23 |
24 | maven {
25 | url 'http://download.flutter.io'
26 | }
27 | }
28 | }
29 |
30 | rootProject.buildDir = '../build'
31 | subprojects {
32 | project.buildDir = "${rootProject.buildDir}/${project.name}"
33 | }
34 | subprojects {
35 | project.evaluationDependsOn(':app')
36 | }
37 |
38 | task clean(type: Delete) {
39 | delete rootProject.buildDir
40 | }
41 |
--------------------------------------------------------------------------------
/android/eye:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/eye
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 | android.enableR8=true
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Dec 15 19:41:54 CST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':speech_plugin'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/android/speech_plugin/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/android/speech_plugin/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 | def flutterRoot = localProperties.getProperty('flutter.sdk')
9 | if (flutterRoot == null) {
10 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
11 | }
12 |
13 | apply plugin: 'com.android.library'
14 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
15 |
16 | android {
17 | compileSdkVersion 29
18 | buildToolsVersion "29.0.2"
19 | ndkVersion "21.1.6352462"
20 |
21 | defaultConfig {
22 | minSdkVersion 16
23 | targetSdkVersion 29
24 | versionCode 1
25 | versionName "1.0"
26 |
27 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
28 | consumerProguardFiles 'consumer-rules.pro'
29 | }
30 |
31 | buildTypes {
32 | release {
33 | minifyEnabled false
34 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
35 | }
36 | }
37 |
38 | sourceSets {
39 | main {
40 | jniLibs.srcDirs = ['libs']
41 | }
42 | }
43 | }
44 |
45 | flutter {
46 | source '../..'
47 | }
48 |
49 | dependencies {
50 | implementation fileTree(dir: 'libs', include: ['*.jar'])
51 |
52 | implementation 'androidx.appcompat:appcompat:1.1.0'
53 | testImplementation 'junit:junit:4.12'
54 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
55 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
56 | }
57 |
--------------------------------------------------------------------------------
/android/speech_plugin/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/speech_plugin/consumer-rules.pro
--------------------------------------------------------------------------------
/android/speech_plugin/libs/Msc.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/speech_plugin/libs/Msc.jar
--------------------------------------------------------------------------------
/android/speech_plugin/libs/arm64-v8a/libmsc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/speech_plugin/libs/arm64-v8a/libmsc.so
--------------------------------------------------------------------------------
/android/speech_plugin/libs/armeabi-v7a/libmsc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/speech_plugin/libs/armeabi-v7a/libmsc.so
--------------------------------------------------------------------------------
/android/speech_plugin/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/android/speech_plugin/src/androidTest/java/com/flutter/eyepetizer/speech/plugin/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.flutter.eyepetizer.speech.plugin;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("com.flutter.eyepetizer.speech.plugin.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/android/speech_plugin/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/android/speech_plugin/src/main/assets/iflytek/recognize.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/speech_plugin/src/main/assets/iflytek/recognize.xml
--------------------------------------------------------------------------------
/android/speech_plugin/src/main/assets/iflytek/voice_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/speech_plugin/src/main/assets/iflytek/voice_bg.9.png
--------------------------------------------------------------------------------
/android/speech_plugin/src/main/assets/iflytek/voice_empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/speech_plugin/src/main/assets/iflytek/voice_empty.png
--------------------------------------------------------------------------------
/android/speech_plugin/src/main/assets/iflytek/voice_full.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/speech_plugin/src/main/assets/iflytek/voice_full.png
--------------------------------------------------------------------------------
/android/speech_plugin/src/main/assets/iflytek/waiting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/speech_plugin/src/main/assets/iflytek/waiting.png
--------------------------------------------------------------------------------
/android/speech_plugin/src/main/assets/iflytek/warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/android/speech_plugin/src/main/assets/iflytek/warning.png
--------------------------------------------------------------------------------
/android/speech_plugin/src/main/java/com/flutter/eyepetizer/speech/plugin/ResultStateful.java:
--------------------------------------------------------------------------------
1 | package com.flutter.eyepetizer.speech.plugin;
2 |
3 | import androidx.annotation.Nullable;
4 |
5 | import io.flutter.plugin.common.MethodChannel;
6 |
7 | /**
8 | * 采用装饰者模式优化回掉方法
9 | */
10 | public class ResultStateful implements MethodChannel.Result {
11 |
12 | private MethodChannel.Result result;
13 | private boolean called;//防止语音识别回调多次(由于MethodChannel的通讯是一次性的,即调用和回调是一次性的)
14 |
15 | public static ResultStateful of(MethodChannel.Result result) {
16 | return new ResultStateful(result);
17 | }
18 |
19 | private ResultStateful(MethodChannel.Result result) {
20 | this.result = result;
21 | }
22 |
23 | @Override
24 | public void success(@Nullable Object o) {
25 | if (called) {
26 | return;
27 | }
28 | called = true;
29 | result.success(o);
30 | }
31 |
32 | @Override
33 | public void error(String s, @Nullable String s1, @Nullable Object o) {
34 | if (called) {
35 | return;
36 | }
37 | called = true;
38 | result.error(s, s1, o);
39 | }
40 |
41 | @Override
42 | public void notImplemented() {
43 | if (called) {
44 | return;
45 | }
46 | called = true;
47 | result.notImplemented();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/android/speech_plugin/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | speech_plugin
3 | 警告!
4 | 请前往设置->应用->开眼->权限中打开相关权限,否则功能无法正常运行!
5 | 确定
6 | 取消
7 |
8 |
--------------------------------------------------------------------------------
/android/speech_plugin/src/test/java/com/flutter/eyepetizer/speech/plugin/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.flutter.eyepetizer.speech.plugin;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/component/lib_cache/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/component/lib_cache/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/component/lib_cache/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/component/lib_cache/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/component/lib_cache/README.md:
--------------------------------------------------------------------------------
1 | # lib_cache
2 |
3 | 本地缓存组件
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/component/lib_cache/lib/cache_manager.dart:
--------------------------------------------------------------------------------
1 | import 'package:shared_preferences/shared_preferences.dart';
2 |
3 | ///本地缓存管理类
4 | class CacheManager {
5 | SharedPreferences _preferences;
6 |
7 | CacheManager._();
8 |
9 | CacheManager._pre(SharedPreferences preferences) {
10 | this._preferences = preferences;
11 | }
12 |
13 | static CacheManager _instance;
14 |
15 | static CacheManager getInstance() {
16 | if (_instance == null) {
17 | _instance = CacheManager._();
18 | }
19 | return _instance;
20 | }
21 |
22 | //预初始化,防止get时,SharedPreferences还未初始化完毕
23 | static Future preInit() async {
24 | if (_instance == null) {
25 | var preferences = await SharedPreferences.getInstance();
26 | _instance = CacheManager._pre(preferences);
27 | }
28 | return _instance;
29 | }
30 |
31 | set(String key, Object value) {
32 | if (value is int) {
33 | _preferences.setInt(key, value);
34 | } else if (value is String) {
35 | _preferences.setString(key, value);
36 | } else if (value is double) {
37 | _preferences.setDouble(key, value);
38 | } else if (value is bool) {
39 | _preferences.setBool(key, value);
40 | } else if (value is List) {
41 | _preferences.setStringList(key, value);
42 | } else {
43 | throw Exception("only Support int、String、double、bool、List");
44 | }
45 | }
46 |
47 | T get(String key) {
48 | return _preferences.get(key);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/component/lib_cache/lib/lib_cache.dart:
--------------------------------------------------------------------------------
1 | library lib_cache;
2 |
3 | export 'package:lib_cache/cache_manager.dart';
--------------------------------------------------------------------------------
/component/lib_cache/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: lib_cache
2 | description: 本地缓存组件
3 | version: 0.0.1
4 | homepage:
5 |
6 | publish_to: 'none'
7 |
8 | environment:
9 | sdk: ">=2.7.0 <3.0.0"
10 | flutter: ">=1.17.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | shared_preferences: ^2.0.4
17 |
18 | dev_dependencies:
19 | flutter_test:
20 | sdk: flutter
21 |
22 | # For information on the generic Dart part of this file, see the
23 | # following page: https://dart.dev/tools/pub/pubspec
24 |
25 | # The following section is specific to Flutter.
26 | flutter:
27 |
28 | # To add assets to your package, add an assets section, like this:
29 | # assets:
30 | # - images/a_dot_burr.jpeg
31 | # - images/a_dot_ham.jpeg
32 | #
33 | # For details regarding assets in packages, see
34 | # https://flutter.dev/assets-and-images/#from-packages
35 | #
36 | # An image asset can refer to one or more resolution-specific "variants", see
37 | # https://flutter.dev/assets-and-images/#resolution-aware.
38 |
39 | # To add custom fonts to your package, add a fonts section here,
40 | # in this "flutter" section. Each entry in this list should have a
41 | # "family" key with the font family name, and a "fonts" key with a
42 | # list giving the asset and other descriptors for the font. For
43 | # example:
44 | # fonts:
45 | # - family: Schyler
46 | # fonts:
47 | # - asset: fonts/Schyler-Regular.ttf
48 | # - asset: fonts/Schyler-Italic.ttf
49 | # style: italic
50 | # - family: Trajan Pro
51 | # fonts:
52 | # - asset: fonts/TrajanPro.ttf
53 | # - asset: fonts/TrajanPro_Bold.ttf
54 | # weight: 700
55 | #
56 | # For details regarding fonts in packages, see
57 | # https://flutter.dev/custom-fonts/#from-packages
58 |
--------------------------------------------------------------------------------
/component/lib_core/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/component/lib_core/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/component/lib_core/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/component/lib_core/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/component/lib_core/README.md:
--------------------------------------------------------------------------------
1 | # lib_core
2 |
3 | 基础组件库
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/component/lib_core/lib/lib_core.dart:
--------------------------------------------------------------------------------
1 | library lib_core;
2 |
3 | export 'package:lib_core/widget/provider_widget.dart';
4 | export 'package:lib_core/viewmodel/base_change_notifier_model.dart';
5 | export 'package:lib_core/viewmodel/paging_list_model.dart';
6 | export 'package:lib_core/state/base_list_state.dart';
7 | export 'package:lib_core/state/base_state.dart';
8 | export 'package:lib_core/model/paging_model.dart';
--------------------------------------------------------------------------------
/component/lib_core/lib/model/paging_model.dart:
--------------------------------------------------------------------------------
1 |
2 | //通用分页Model
3 | class PagingModel {
4 | String nextPageUrl;
5 | List itemList;
6 | }
7 |
--------------------------------------------------------------------------------
/component/lib_core/lib/state/base_list_state.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_core/model/paging_model.dart';
3 | import 'package:lib_core/viewmodel/paging_list_model.dart';
4 | import 'package:lib_core/widget/provider_widget.dart';
5 | import 'package:lib_ui/widget/loading_container.dart';
6 | import 'package:pull_to_refresh/pull_to_refresh.dart';
7 |
8 | //通用分页State封装
9 | abstract class BaseListState>,
10 | T extends StatefulWidget> extends State
11 | with AutomaticKeepAliveClientMixin {
12 | M get viewModel; //真实获取数据的仓库
13 |
14 | Widget getContentChild(M model); //真实的分页控件
15 |
16 | bool get enablePullDown => true;
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | super.build(context);
21 | return ProviderWidget(
22 | model: viewModel,
23 | onModelInit: (model) {
24 | model.refresh();
25 | },
26 | builder: (context, model, child) {
27 | return LoadingContainer(
28 | viewState: model.viewState,
29 | retry: model.retry,
30 | child: Container(
31 | color: Colors.white,
32 | child: SmartRefresher(
33 | controller: model.refreshController,
34 | onRefresh: model.refresh,
35 | onLoading: model.loadMore,
36 | enablePullUp: true,
37 | enablePullDown: enablePullDown,
38 | child: getContentChild(model))));
39 | });
40 | }
41 |
42 | @override
43 | bool get wantKeepAlive => true;
44 | }
45 |
--------------------------------------------------------------------------------
/component/lib_core/lib/state/base_state.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | abstract class BaseState extends State {
4 | @override
5 | void setState(fn) {
6 | //判断是否渲染完成,防止数据还没有获取到,此时setState触发的控件渲染就会报错
7 | if (mounted) {
8 | super.setState(fn);
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/component/lib_core/lib/viewmodel/base_change_notifier_model.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:flutter/material.dart';
3 | import 'package:lib_ui/widget/loading_container.dart';
4 |
5 | class BaseChangeNotifierModel with ChangeNotifier{
6 |
7 | bool _dispose = false;
8 | ViewState viewState = ViewState.loading;
9 |
10 | @override
11 | void dispose() {
12 | super.dispose();
13 | _dispose = true;
14 | }
15 |
16 | @override
17 | void notifyListeners() {
18 | //防止页面销毁后,网络数据请求回来后调用notifyListeners方法,_debugAssertNotDisposed()报错问题
19 | //另一种方案在页面销毁时取消网络请求
20 | if(!_dispose){
21 | super.notifyListeners();
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/component/lib_core/lib/widget/provider_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:provider/provider.dart';
3 |
4 | //状态管理组件封装(MVVM),核心组件(基于provider封装)
5 | //provider状态管理,可以比喻成电台与听众的关系,电台 --》ChangeNotifierProvider 听众 --》Consumer model -->维护了一系列状态数据
6 | class ProviderWidget extends StatefulWidget {
7 | final T model;//控件对应的数据
8 | final Widget child;
9 | final Widget Function(BuildContext context, T value, Widget child) builder;//绑定数据的控件
10 | final Function(T) onModelInit; //数据初始化方法
11 |
12 | const ProviderWidget(
13 | {Key key,
14 | @required this.model,
15 | @required this.builder,
16 | this.onModelInit,
17 | this.child})
18 | : super(key: key);
19 |
20 | @override
21 | _ProviderWidgetState createState() => _ProviderWidgetState();
22 | }
23 |
24 | class _ProviderWidgetState
25 | extends State> {
26 | T model;
27 |
28 | @override
29 | void initState() {
30 | super.initState();
31 | model = widget.model;
32 | if (widget.onModelInit != null && model != null) {
33 | widget.onModelInit(model);
34 | }
35 | }
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return ChangeNotifierProvider(
40 | create: (_) => model,
41 | child: Consumer(
42 | builder: widget.builder,
43 | child: widget.child)); //可以控制刷新性能优化,当数据数据发生改变,不会重新build
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/component/lib_core/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: lib_core
2 | description: 基础组件库
3 | version: 0.0.1
4 | homepage:
5 |
6 | publish_to: 'none'
7 |
8 | environment:
9 | sdk: ">=2.7.0 <3.0.0"
10 | flutter: ">=1.17.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | lib_ui:
17 | path: ../lib_ui
18 | lib_utils:
19 | path: ../lib_utils
20 | lib_net:
21 | path: ../lib_net
22 |
23 | provider: ^5.0.0
24 | pull_to_refresh: ^2.0.0
25 |
26 | dev_dependencies:
27 | flutter_test:
28 | sdk: flutter
29 |
30 | # For information on the generic Dart part of this file, see the
31 | # following page: https://dart.dev/tools/pub/pubspec
32 |
33 | # The following section is specific to Flutter.
34 | flutter:
35 |
36 | # To add assets to your package, add an assets section, like this:
37 | # assets:
38 | # - images/a_dot_burr.jpeg
39 | # - images/a_dot_ham.jpeg
40 | #
41 | # For details regarding assets in packages, see
42 | # https://flutter.dev/assets-and-images/#from-packages
43 | #
44 | # An image asset can refer to one or more resolution-specific "variants", see
45 | # https://flutter.dev/assets-and-images/#resolution-aware.
46 |
47 | # To add custom fonts to your package, add a fonts section here,
48 | # in this "flutter" section. Each entry in this list should have a
49 | # "family" key with the font family name, and a "fonts" key with a
50 | # list giving the asset and other descriptors for the font. For
51 | # example:
52 | # fonts:
53 | # - family: Schyler
54 | # fonts:
55 | # - asset: fonts/Schyler-Regular.ttf
56 | # - asset: fonts/Schyler-Italic.ttf
57 | # style: italic
58 | # - family: Trajan Pro
59 | # fonts:
60 | # - asset: fonts/TrajanPro.ttf
61 | # - asset: fonts/TrajanPro_Bold.ttf
62 | # weight: 700
63 | #
64 | # For details regarding fonts in packages, see
65 | # https://flutter.dev/custom-fonts/#from-packages
66 |
--------------------------------------------------------------------------------
/component/lib_core/test/lib_core_test.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | void main() {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/component/lib_image/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/component/lib_image/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/component/lib_image/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/component/lib_image/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/component/lib_image/README.md:
--------------------------------------------------------------------------------
1 | # lib_image
2 |
3 | 图片加载组件
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/component/lib_image/lib/lib_image.dart:
--------------------------------------------------------------------------------
1 | library lib_image;
2 |
3 | import 'package:extended_image/extended_image.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | //封装带缓存的Image
7 | Widget cacheImage(String url,
8 | {double width,
9 | double height,
10 | BoxFit fit = BoxFit.cover,
11 | BorderRadius borderRadius,
12 | BoxShape shape = BoxShape.rectangle,
13 | bool clearMemoryCacheWhenDispose = false}) {
14 | return ExtendedImage.network(
15 | url,
16 | shape: shape,
17 | height: height,
18 | width: width,
19 | fit: fit,
20 | borderRadius: borderRadius,
21 | clearMemoryCacheWhenDispose:
22 | clearMemoryCacheWhenDispose, //图片从 tree 中移除,清掉内存缓存,以减少内存压力
23 | );
24 | }
25 |
26 | ImageProvider cachedNetworkImageProvider(String url) {
27 | return ExtendedNetworkImageProvider(url);
28 | }
--------------------------------------------------------------------------------
/component/lib_image/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: lib_image
2 | description: 图片加载组件
3 | version: 0.0.1
4 | homepage:
5 |
6 | environment:
7 | sdk: ">=2.7.0 <3.0.0"
8 | flutter: ">=1.17.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 |
14 | extended_image: ^3.0.0
15 |
16 | dev_dependencies:
17 | flutter_test:
18 | sdk: flutter
19 |
20 | # For information on the generic Dart part of this file, see the
21 | # following page: https://dart.dev/tools/pub/pubspec
22 |
23 | # The following section is specific to Flutter.
24 | flutter:
25 |
26 | # To add assets to your package, add an assets section, like this:
27 | # assets:
28 | # - images/a_dot_burr.jpeg
29 | # - images/a_dot_ham.jpeg
30 | #
31 | # For details regarding assets in packages, see
32 | # https://flutter.dev/assets-and-images/#from-packages
33 | #
34 | # An image asset can refer to one or more resolution-specific "variants", see
35 | # https://flutter.dev/assets-and-images/#resolution-aware.
36 |
37 | # To add custom fonts to your package, add a fonts section here,
38 | # in this "flutter" section. Each entry in this list should have a
39 | # "family" key with the font family name, and a "fonts" key with a
40 | # list giving the asset and other descriptors for the font. For
41 | # example:
42 | # fonts:
43 | # - family: Schyler
44 | # fonts:
45 | # - asset: fonts/Schyler-Regular.ttf
46 | # - asset: fonts/Schyler-Italic.ttf
47 | # style: italic
48 | # - family: Trajan Pro
49 | # fonts:
50 | # - asset: fonts/TrajanPro.ttf
51 | # - asset: fonts/TrajanPro_Bold.ttf
52 | # weight: 700
53 | #
54 | # For details regarding fonts in packages, see
55 | # https://flutter.dev/custom-fonts/#from-packages
56 |
--------------------------------------------------------------------------------
/component/lib_image/test/lib_image_test.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | void main() {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/component/lib_navigator/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/component/lib_navigator/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/component/lib_navigator/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/component/lib_navigator/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/component/lib_navigator/README.md:
--------------------------------------------------------------------------------
1 | # lib_navigator
2 |
3 | 路由组件
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/component/lib_navigator/lib/lib_navigator.dart:
--------------------------------------------------------------------------------
1 | library lib_navigator;
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:get/get.dart';
5 | export 'package:get/get.dart';
6 |
7 | //页面路由常用方法封装
8 |
9 | void toPage(Widget page, {bool opaque = false, preventDuplicates: true}) {
10 | Get.to(() => page, opaque: opaque, preventDuplicates: preventDuplicates);
11 | }
12 |
13 | void offPage(Widget page, {bool opaque = false}) {
14 | Get.off(() => page, opaque: opaque);
15 | }
16 |
17 | void toNamed(String page, dynamic arguments, {preventDuplicates: false}) {
18 | Get.toNamed(page, preventDuplicates: preventDuplicates, arguments: arguments);
19 | }
20 |
21 | void offNamed(String page, dynamic arguments, {preventDuplicates: false}) {
22 | Get.offNamed(page,
23 | preventDuplicates: preventDuplicates, arguments: arguments);
24 | }
25 |
26 | void offAndToNamed(String page, dynamic arguments) {
27 | Get.offAndToNamed(page, arguments: arguments);
28 | }
29 |
30 | void back() {
31 | Get.back();
32 | }
33 |
34 | //获取页面传递的参数
35 | dynamic arguments() {
36 | return Get.arguments;
37 | }
38 |
--------------------------------------------------------------------------------
/component/lib_navigator/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: lib_navigator
2 | description: 路由组件
3 | version: 0.0.1
4 | homepage:
5 |
6 | environment:
7 | sdk: ">=2.7.0 <3.0.0"
8 | flutter: ">=1.17.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 |
14 | get: ^3.26.0
15 |
16 | dev_dependencies:
17 | flutter_test:
18 | sdk: flutter
19 |
20 | # For information on the generic Dart part of this file, see the
21 | # following page: https://dart.dev/tools/pub/pubspec
22 |
23 | # The following section is specific to Flutter.
24 | flutter:
25 |
26 | # To add assets to your package, add an assets section, like this:
27 | # assets:
28 | # - images/a_dot_burr.jpeg
29 | # - images/a_dot_ham.jpeg
30 | #
31 | # For details regarding assets in packages, see
32 | # https://flutter.dev/assets-and-images/#from-packages
33 | #
34 | # An image asset can refer to one or more resolution-specific "variants", see
35 | # https://flutter.dev/assets-and-images/#resolution-aware.
36 |
37 | # To add custom fonts to your package, add a fonts section here,
38 | # in this "flutter" section. Each entry in this list should have a
39 | # "family" key with the font family name, and a "fonts" key with a
40 | # list giving the asset and other descriptors for the font. For
41 | # example:
42 | # fonts:
43 | # - family: Schyler
44 | # fonts:
45 | # - asset: fonts/Schyler-Regular.ttf
46 | # - asset: fonts/Schyler-Italic.ttf
47 | # style: italic
48 | # - family: Trajan Pro
49 | # fonts:
50 | # - asset: fonts/TrajanPro.ttf
51 | # - asset: fonts/TrajanPro_Bold.ttf
52 | # weight: 700
53 | #
54 | # For details regarding fonts in packages, see
55 | # https://flutter.dev/custom-fonts/#from-packages
56 |
--------------------------------------------------------------------------------
/component/lib_navigator/test/lib_navigator_test.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | void main() {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/component/lib_net/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/component/lib_net/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/component/lib_net/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/component/lib_net/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/component/lib_net/README.md:
--------------------------------------------------------------------------------
1 | # lib_net
2 |
3 | 网络请求组件
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/component/lib_net/lib/http_manager.dart:
--------------------------------------------------------------------------------
1 | import 'package:http/http.dart' as http;
2 | import 'dart:convert';
3 |
4 | class HttpManager {
5 | static Utf8Decoder utf8decoder = Utf8Decoder();
6 |
7 | //网络请求封装,通过方法回调执行的结果(成功或失败)
8 | //网络请求封装方式一:采用回调函数处理请求结果,类似Android开发
9 | static getData(String url,
10 | {Map headers,
11 | Function success,
12 | Function fail,
13 | Function complete}) async {
14 | try {
15 | var response = await http.get(Uri.parse(url), headers: headers);
16 | if (response.statusCode == 200) {
17 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
18 | success(result);
19 | } else {
20 | throw Exception('"Request failed with status: ${response.statusCode}"');
21 | }
22 | } catch (e) {
23 | fail(e);
24 | } finally {
25 | if (complete != null) {
26 | complete();
27 | }
28 | }
29 | }
30 |
31 | //网络请求封装方式二:返回Future,结合 then ==> catchError ==>whenComplete,类似JS
32 | static Future requestData(String url, {Map headers}) async {
33 | try {
34 | var response = await http.get(Uri.parse(url), headers: headers);
35 | if (response.statusCode == 200) {
36 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
37 | return result;
38 | } else {
39 | throw Exception('"Request failed with status: ${response.statusCode}"');
40 | }
41 | } catch (e) {
42 | Future.error(e);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/component/lib_net/lib/lib_net.dart:
--------------------------------------------------------------------------------
1 | library lib_net;
2 |
3 | export 'package:lib_net/http_manager.dart';
4 |
--------------------------------------------------------------------------------
/component/lib_net/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: lib_net
2 | description: 网络请求组件
3 | version: 0.0.1
4 | homepage:
5 |
6 | environment:
7 | sdk: ">=2.7.0 <3.0.0"
8 | flutter: ">=1.17.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 |
14 | http: ^0.13.0
15 |
16 | dev_dependencies:
17 | flutter_test:
18 | sdk: flutter
19 |
20 | # For information on the generic Dart part of this file, see the
21 | # following page: https://dart.dev/tools/pub/pubspec
22 |
23 | # The following section is specific to Flutter.
24 | flutter:
25 |
26 | # To add assets to your package, add an assets section, like this:
27 | # assets:
28 | # - images/a_dot_burr.jpeg
29 | # - images/a_dot_ham.jpeg
30 | #
31 | # For details regarding assets in packages, see
32 | # https://flutter.dev/assets-and-images/#from-packages
33 | #
34 | # An image asset can refer to one or more resolution-specific "variants", see
35 | # https://flutter.dev/assets-and-images/#resolution-aware.
36 |
37 | # To add custom fonts to your package, add a fonts section here,
38 | # in this "flutter" section. Each entry in this list should have a
39 | # "family" key with the font family name, and a "fonts" key with a
40 | # list giving the asset and other descriptors for the font. For
41 | # example:
42 | # fonts:
43 | # - family: Schyler
44 | # fonts:
45 | # - asset: fonts/Schyler-Regular.ttf
46 | # - asset: fonts/Schyler-Italic.ttf
47 | # style: italic
48 | # - family: Trajan Pro
49 | # fonts:
50 | # - asset: fonts/TrajanPro.ttf
51 | # - asset: fonts/TrajanPro_Bold.ttf
52 | # weight: 700
53 | #
54 | # For details regarding fonts in packages, see
55 | # https://flutter.dev/custom-fonts/#from-packages
56 |
--------------------------------------------------------------------------------
/component/lib_net/test/lib_net_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 |
3 | import 'package:lib_net/lib_net.dart';
4 |
5 | void main() {
6 | test('adds one to input values', () {
7 |
8 | });
9 | }
10 |
--------------------------------------------------------------------------------
/component/lib_ui/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/component/lib_ui/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/component/lib_ui/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/component/lib_ui/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/component/lib_ui/README.md:
--------------------------------------------------------------------------------
1 | # lib_ui
2 |
3 | 通用UI组件库
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/component/lib_ui/images/ic_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/component/lib_ui/images/ic_error.png
--------------------------------------------------------------------------------
/component/lib_ui/lib/config/color.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const Color hitTextColor = Color(0xff9a9a9a);
--------------------------------------------------------------------------------
/component/lib_ui/lib/config/string.dart:
--------------------------------------------------------------------------------
1 | const String loading_text = '加载中...';
2 | const String load_more_text = '上拉加载更多';
3 | const String net_error_tip = '网络请求失败';
4 | const String reload_again = '重新加载';
5 | const String more_text = '更多';
6 | const String less_text = '收起';
--------------------------------------------------------------------------------
/component/lib_ui/lib/lib_ui.dart:
--------------------------------------------------------------------------------
1 | library lib_ui;
2 |
3 | export 'package:lib_ui/config/color.dart';
4 | export 'package:lib_ui/config/string.dart';
5 | export 'package:lib_ui/widget/appbar_widget.dart';
6 | export 'package:lib_ui/widget/blur_widget.dart';
7 | export 'package:lib_ui/widget/load_more_widget.dart';
8 | export 'package:lib_ui/widget/loading_container.dart';
9 | export 'package:lib_ui/widget/remod_more_text_widget.dart';
10 | export 'package:lib_ui/widget/tab_bar_widget.dart';
--------------------------------------------------------------------------------
/component/lib_ui/lib/widget/appbar_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 |
4 | appBar(String title, {bool showBack = true, List actions}) {
5 | return AppBar(
6 | title: Text(title,
7 | style: TextStyle(
8 | fontSize: 18, color: Colors.black, fontWeight: FontWeight.bold)),
9 | systemOverlayStyle: SystemUiOverlayStyle(),
10 | centerTitle: true,
11 | elevation: 0,
12 | backgroundColor: Colors.white,
13 | leading: showBack
14 | ? BackButton(
15 | color: Colors.black,
16 | )
17 | : null,
18 | actions: actions,
19 | );
20 | }
21 |
--------------------------------------------------------------------------------
/component/lib_ui/lib/widget/blur_widget.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | //高斯模糊组件封装
6 | class BlurWidget extends StatelessWidget {
7 | final Widget child;
8 | final Color color;
9 | final double sigma;
10 |
11 | const BlurWidget({Key key, this.sigma = 10, this.child, this.color})
12 | : super(key: key);
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return BackdropFilter(
17 | filter: ImageFilter.blur(sigmaX: sigma, sigmaY: sigma),
18 | child: Container(
19 | color: color,
20 | child: child,
21 | ),
22 | );
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/component/lib_ui/lib/widget/load_more_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_ui/config/string.dart';
3 |
4 | //封装加载更多控件
5 | class LoadMoreWidget extends StatefulWidget {
6 | final bool isLoadMore;
7 | final String loadingText;
8 | final String loadMoreText;
9 |
10 | const LoadMoreWidget(
11 | {Key key,
12 | this.isLoadMore,
13 | this.loadingText = loading_text,
14 | this.loadMoreText = load_more_text})
15 | : super(key: key);
16 |
17 | @override
18 | _LoadMoreWidgetState createState() => _LoadMoreWidgetState();
19 | }
20 |
21 | class _LoadMoreWidgetState extends State {
22 | @override
23 | Widget build(BuildContext context) {
24 | if (widget.isLoadMore) {
25 | return Row(
26 | mainAxisAlignment: MainAxisAlignment.center,
27 | children: [
28 | Text(widget.loadingText, style: TextStyle(fontSize: 16)),
29 | Padding(
30 | padding: EdgeInsets.only(left: 5),
31 | child: CircularProgressIndicator())
32 | ],
33 | );
34 | } else {
35 | return Container(
36 | alignment: Alignment.center,
37 | padding: EdgeInsets.only(top: 10),
38 | child: Text(widget.loadMoreText, style: TextStyle(fontSize: 16)),
39 | );
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/component/lib_ui/lib/widget/loading_container.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_ui/config/color.dart';
3 | import 'package:lib_ui/config/string.dart';
4 |
5 | //页面加载的状态
6 | enum ViewState { loading, content, error }
7 |
8 | //多状态视图封装
9 | class LoadingContainer extends StatelessWidget {
10 | final Widget child;
11 | final ViewState viewState;
12 | final VoidCallback retry;
13 |
14 | const LoadingContainer(
15 | {Key key,
16 | @required this.child,
17 | @required this.retry,
18 | this.viewState = ViewState.loading})
19 | : super(key: key);
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | if (viewState == ViewState.loading) {
24 | return _loadView;
25 | } else if (viewState == ViewState.error) {
26 | return _errorView;
27 | } else {
28 | return child;
29 | }
30 | }
31 |
32 | Widget get _errorView {
33 | return Center(
34 | child: Column(
35 | mainAxisAlignment: MainAxisAlignment.center,
36 | children: [
37 | Image.asset(
38 | 'images/ic_error.png',
39 | width: 100,
40 | height: 100,
41 | package: 'lib_ui',
42 | ),
43 | Padding(
44 | padding: const EdgeInsets.only(top: 8),
45 | child: Text(
46 | net_error_tip,
47 | style: TextStyle(color:hitTextColor, fontSize: 18),
48 | ),
49 | ),
50 | Padding(
51 | padding: const EdgeInsets.only(top: 8),
52 | child: OutlinedButton(
53 | onPressed: () => retry.call(),
54 | child: Text(
55 | reload_again,
56 | style: TextStyle(color: Colors.black87),
57 | ),
58 | style: ButtonStyle(
59 | backgroundColor: MaterialStateProperty.all(Colors.white),
60 | overlayColor: MaterialStateProperty.all(Colors.black12)),
61 | ),
62 | )
63 | ],
64 | ),
65 | );
66 | }
67 |
68 | Widget get _loadView {
69 | return Center(
70 | child: CircularProgressIndicator(),
71 | );
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/component/lib_ui/lib/widget/remod_more_text_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_ui/config/string.dart';
3 | import 'package:readmore/readmore.dart';
4 |
5 | enum TrimTypeMode {
6 | Length,
7 | Line,
8 | }
9 |
10 | class ReadMoreTextWidget extends StatelessWidget {
11 | final String text;
12 | final String trimCollapsedText;
13 | final String trimExpandedText;
14 | final TextStyle style;
15 | final TextStyle moreStyle;
16 | final TextStyle lessStyle;
17 | final int trimLines;
18 | final TrimTypeMode trimMode;
19 |
20 | const ReadMoreTextWidget(this.text,
21 | {Key key,
22 | this.trimCollapsedText = more_text,
23 | this.trimExpandedText = less_text,
24 | this.style,
25 | this.moreStyle,
26 | this.lessStyle,
27 | this.trimLines = 2,
28 | this.trimMode = TrimTypeMode.Line})
29 | : super(key: key);
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | return ReadMoreText(
34 | text,
35 | trimLines: trimLines,
36 | trimMode: trimMode == TrimTypeMode.Line ? TrimMode.Line : TrimMode.Length,
37 | trimCollapsedText: trimCollapsedText,
38 | trimExpandedText: trimExpandedText,
39 | style: style,
40 | moreStyle: moreStyle,
41 | lessStyle: lessStyle,
42 | );
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/component/lib_ui/lib/widget/tab_bar_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_ui/config/color.dart';
3 |
4 | //通用的TabBar封装
5 | class TabBarWidget extends StatelessWidget {
6 | final List tabs;
7 | final TabController tabController;
8 | final Color labelColor;
9 | final Color unselectedLabelColor;
10 | final Color indicatorColor;
11 | final double fontSize;
12 | final TabBarIndicatorSize indicatorSize;
13 | final ValueChanged onTap;
14 |
15 | const TabBarWidget(
16 | {Key key,
17 | this.tabs,
18 | this.tabController,
19 | this.labelColor = Colors.black,
20 | this.unselectedLabelColor = hitTextColor,
21 | this.indicatorColor = Colors.black,
22 | this.fontSize = 14,
23 | this.indicatorSize = TabBarIndicatorSize.label,
24 | this.onTap})
25 | : super(key: key);
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | return TabBar(
30 | controller: tabController,
31 | labelColor: labelColor,
32 | unselectedLabelColor: unselectedLabelColor,
33 | labelStyle: TextStyle(fontSize: fontSize),
34 | unselectedLabelStyle: TextStyle(fontSize: fontSize),
35 | indicatorColor: indicatorColor,
36 | indicatorSize: indicatorSize,
37 | tabs: tabs,
38 | onTap: (index) => onTap(index));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/component/lib_ui/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: lib_ui
2 | description: 通用UI组件库
3 | version: 0.0.1
4 | homepage:
5 |
6 | environment:
7 | sdk: ">=2.7.0 <3.0.0"
8 | flutter: ">=1.17.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 |
14 | readmore: ^2.0.0
15 |
16 | dev_dependencies:
17 | flutter_test:
18 | sdk: flutter
19 |
20 | # For information on the generic Dart part of this file, see the
21 | # following page: https://dart.dev/tools/pub/pubspec
22 |
23 | # The following section is specific to Flutter.
24 | flutter:
25 |
26 | # To add assets to your package, add an assets section, like this:
27 | assets:
28 | - images/
29 | # - images/a_dot_ham.jpeg
30 | #
31 | # For details regarding assets in packages, see
32 | # https://flutter.dev/assets-and-images/#from-packages
33 | #
34 | # An image asset can refer to one or more resolution-specific "variants", see
35 | # https://flutter.dev/assets-and-images/#resolution-aware.
36 |
37 | # To add custom fonts to your package, add a fonts section here,
38 | # in this "flutter" section. Each entry in this list should have a
39 | # "family" key with the font family name, and a "fonts" key with a
40 | # list giving the asset and other descriptors for the font. For
41 | # example:
42 | # fonts:
43 | # - family: Schyler
44 | # fonts:
45 | # - asset: fonts/Schyler-Regular.ttf
46 | # - asset: fonts/Schyler-Italic.ttf
47 | # style: italic
48 | # - family: Trajan Pro
49 | # fonts:
50 | # - asset: fonts/TrajanPro.ttf
51 | # - asset: fonts/TrajanPro_Bold.ttf
52 | # weight: 700
53 | #
54 | # For details regarding fonts in packages, see
55 | # https://flutter.dev/custom-fonts/#from-packages
56 |
--------------------------------------------------------------------------------
/component/lib_ui/test/lib_ui_test.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | void main() {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/component/lib_utils/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/component/lib_utils/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/component/lib_utils/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/component/lib_utils/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/component/lib_utils/README.md:
--------------------------------------------------------------------------------
1 | # lib_utils
2 |
3 | 通用工具类组件
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/component/lib_utils/lib/commom_uitl.dart:
--------------------------------------------------------------------------------
1 | import 'package:flustars/flustars.dart';
2 |
3 | bool isEmpty(String text) {
4 | return TextUtil.isEmpty(text);
5 | }
6 |
--------------------------------------------------------------------------------
/component/lib_utils/lib/date_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:flustars/flustars.dart';
2 |
3 | String formatDateMsByMS(int milliseconds) {
4 | return DateUtil.formatDateMs(milliseconds, format: 'mm:ss');
5 | }
6 |
7 | String formatDateMsByYMD(int milliseconds) {
8 | return DateUtil.formatDateMs(milliseconds, format: 'yyyy/MM/dd');
9 | }
10 |
11 | String formatDateMsByYMDHM(int milliseconds) {
12 | return DateUtil.formatDateMs(milliseconds, format: 'yyyy/MM/dd HH:mm');
13 | }
14 |
--------------------------------------------------------------------------------
/component/lib_utils/lib/event_bus.dart:
--------------------------------------------------------------------------------
1 | import 'package:event_bus/event_bus.dart';
2 |
3 | class Bus {
4 | Bus._();
5 |
6 | static Bus _bus;
7 | static EventBus _eventBus;
8 |
9 | static Bus getInstance() {
10 | if (_bus == null) {
11 | _bus = Bus._();
12 | _eventBus = EventBus();
13 | }
14 | return _bus;
15 | }
16 |
17 | void send(event) {
18 | _eventBus.fire(event);
19 | }
20 |
21 | Stream register() {
22 | return _eventBus.on();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/component/lib_utils/lib/lib_utils.dart:
--------------------------------------------------------------------------------
1 | library lib_utils;
2 |
3 | export 'package:lib_utils/event_bus.dart';
4 | export 'package:lib_utils/commom_uitl.dart';
5 | export 'package:lib_utils/date_util.dart';
6 | export 'package:lib_utils/share_util.dart';
7 | export 'package:lib_utils/toast_util.dart';
8 | export 'package:lib_utils/view_util.dart';
--------------------------------------------------------------------------------
/component/lib_utils/lib/share_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:share/share.dart';
2 |
3 | void share(String title, String content) {
4 | Share.share('$title\n$content');
5 | }
6 |
--------------------------------------------------------------------------------
/component/lib_utils/lib/toast_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:fluttertoast/fluttertoast.dart';
3 |
4 | void showTip(String tipMessage) {
5 | Fluttertoast.showToast(
6 | msg: tipMessage,
7 | toastLength: Toast.LENGTH_SHORT,
8 | gravity: ToastGravity.CENTER);
9 | }
10 |
11 | void showError(String errorMessage) {
12 | Fluttertoast.showToast(
13 | msg: errorMessage,
14 | toastLength: Toast.LENGTH_SHORT,
15 | gravity: ToastGravity.CENTER,
16 | backgroundColor: Colors.red,
17 | textColor: Colors.white);
18 | }
19 |
--------------------------------------------------------------------------------
/component/lib_utils/lib/view_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | //底部线性渐变
4 | blackLinearGradient({bool fromTop = false}) {
5 | return LinearGradient(
6 | begin: fromTop ? Alignment.topCenter : Alignment.bottomCenter,
7 | end: fromTop ? Alignment.bottomCenter : Alignment.topCenter,
8 | colors: [
9 | Colors.black54,
10 | Colors.black45,
11 | Colors.black38,
12 | Colors.black26,
13 | Colors.black12,
14 | Colors.transparent
15 | ]);
16 | }
17 |
--------------------------------------------------------------------------------
/component/lib_utils/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: lib_utils
2 | description: 通用工具类组件
3 | version: 0.0.1
4 | homepage:
5 |
6 | environment:
7 | sdk: ">=2.7.0 <3.0.0"
8 | flutter: ">=1.17.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 |
14 | fluttertoast: ^8.2.2
15 | flustars: ^2.0.1
16 | share: ^0.6.4+3
17 | event_bus: ^2.0.0
18 |
19 | dev_dependencies:
20 | flutter_test:
21 | sdk: flutter
22 |
23 | # For information on the generic Dart part of this file, see the
24 | # following page: https://dart.dev/tools/pub/pubspec
25 |
26 | # The following section is specific to Flutter.
27 | flutter:
28 |
29 | # To add assets to your package, add an assets section, like this:
30 | # assets:
31 | # - images/a_dot_burr.jpeg
32 | # - images/a_dot_ham.jpeg
33 | #
34 | # For details regarding assets in packages, see
35 | # https://flutter.dev/assets-and-images/#from-packages
36 | #
37 | # An image asset can refer to one or more resolution-specific "variants", see
38 | # https://flutter.dev/assets-and-images/#resolution-aware.
39 |
40 | # To add custom fonts to your package, add a fonts section here,
41 | # in this "flutter" section. Each entry in this list should have a
42 | # "family" key with the font family name, and a "fonts" key with a
43 | # list giving the asset and other descriptors for the font. For
44 | # example:
45 | # fonts:
46 | # - family: Schyler
47 | # fonts:
48 | # - asset: fonts/Schyler-Regular.ttf
49 | # - asset: fonts/Schyler-Italic.ttf
50 | # style: italic
51 | # - family: Trajan Pro
52 | # fonts:
53 | # - asset: fonts/TrajanPro.ttf
54 | # - asset: fonts/TrajanPro_Bold.ttf
55 | # weight: 700
56 | #
57 | # For details regarding fonts in packages, see
58 | # https://flutter.dev/custom-fonts/#from-packages
59 |
--------------------------------------------------------------------------------
/component/lib_video/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/component/lib_video/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/component/lib_video/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/component/lib_video/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/component/lib_video/README.md:
--------------------------------------------------------------------------------
1 | # lib_video
2 |
3 | 视频播放组件
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/component/lib_video/lib/lib_video.dart:
--------------------------------------------------------------------------------
1 | library lib_video;
2 |
3 | export 'package:lib_video/video_widget.dart';
--------------------------------------------------------------------------------
/component/lib_video/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: lib_video
2 | description: 视频播放组件
3 | version: 0.0.1
4 | homepage:
5 |
6 | publish_to: 'none'#如果你想发布到pub.dev,请删除这一行
7 |
8 | environment:
9 | sdk: ">=2.7.0 <3.0.0"
10 | flutter: ">=1.17.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | lib_utils:
17 | path: ../lib_utils
18 |
19 | chewie: ^1.2.2
20 | video_player: ^2.2.3
21 | screen: ^0.0.5
22 | orientation: ^1.3.0
23 |
24 | dev_dependencies:
25 | flutter_test:
26 | sdk: flutter
27 |
28 | # For information on the generic Dart part of this file, see the
29 | # following page: https://dart.dev/tools/pub/pubspec
30 |
31 | # The following section is specific to Flutter.
32 | flutter:
33 |
34 | # To add assets to your package, add an assets section, like this:
35 | # assets:
36 | # - images/a_dot_burr.jpeg
37 | # - images/a_dot_ham.jpeg
38 | #
39 | # For details regarding assets in packages, see
40 | # https://flutter.dev/assets-and-images/#from-packages
41 | #
42 | # An image asset can refer to one or more resolution-specific "variants", see
43 | # https://flutter.dev/assets-and-images/#resolution-aware.
44 |
45 | # To add custom fonts to your package, add a fonts section here,
46 | # in this "flutter" section. Each entry in this list should have a
47 | # "family" key with the font family name, and a "fonts" key with a
48 | # list giving the asset and other descriptors for the font. For
49 | # example:
50 | # fonts:
51 | # - family: Schyler
52 | # fonts:
53 | # - asset: fonts/Schyler-Regular.ttf
54 | # - asset: fonts/Schyler-Italic.ttf
55 | # style: italic
56 | # - family: Trajan Pro
57 | # fonts:
58 | # - asset: fonts/TrajanPro.ttf
59 | # - asset: fonts/TrajanPro_Bold.ttf
60 | # weight: 700
61 | #
62 | # For details regarding fonts in packages, see
63 | # https://flutter.dev/custom-fonts/#from-packages
64 |
--------------------------------------------------------------------------------
/component/lib_video/test/lib_video_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 | void main() {
3 | test('adds one to input values', () {
4 |
5 | });
6 | }
7 |
--------------------------------------------------------------------------------
/images/1567913521.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/1567913521.png
--------------------------------------------------------------------------------
/images/1621567911767_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/1621567911767_.pic.jpg
--------------------------------------------------------------------------------
/images/1891576051893_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/1891576051893_.pic.jpg
--------------------------------------------------------------------------------
/images/1901576051894_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/1901576051894_.pic.jpg
--------------------------------------------------------------------------------
/images/1911576051895_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/1911576051895_.pic.jpg
--------------------------------------------------------------------------------
/images/1941576565879_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/1941576565879_.pic.jpg
--------------------------------------------------------------------------------
/images/1961576565881_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/1961576565881_.pic.jpg
--------------------------------------------------------------------------------
/images/1981576565883_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/1981576565883_.pic.jpg
--------------------------------------------------------------------------------
/images/2021576568582_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2021576568582_.pic.jpg
--------------------------------------------------------------------------------
/images/2031576568583_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2031576568583_.pic.jpg
--------------------------------------------------------------------------------
/images/2041576568584_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2041576568584_.pic.jpg
--------------------------------------------------------------------------------
/images/2051576568585_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2051576568585_.pic.jpg
--------------------------------------------------------------------------------
/images/2061576568586_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2061576568586_.pic.jpg
--------------------------------------------------------------------------------
/images/2071576569018_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2071576569018_.pic.jpg
--------------------------------------------------------------------------------
/images/2081576569019_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2081576569019_.pic.jpg
--------------------------------------------------------------------------------
/images/2141576721487_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2141576721487_.pic.jpg
--------------------------------------------------------------------------------
/images/2521583645458_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2521583645458_.pic.jpg
--------------------------------------------------------------------------------
/images/2531583645460_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2531583645460_.pic.jpg
--------------------------------------------------------------------------------
/images/2541583645461_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2541583645461_.pic.jpg
--------------------------------------------------------------------------------
/images/2601584689731_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2601584689731_.pic.jpg
--------------------------------------------------------------------------------
/images/2611584689732_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2611584689732_.pic.jpg
--------------------------------------------------------------------------------
/images/2621584689733_.pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/2621584689733_.pic.jpg
--------------------------------------------------------------------------------
/images/function.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/function.png
--------------------------------------------------------------------------------
/images/ic_discovery_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/ic_discovery_normal.png
--------------------------------------------------------------------------------
/images/ic_discovery_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/ic_discovery_selected.png
--------------------------------------------------------------------------------
/images/ic_home_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/ic_home_normal.png
--------------------------------------------------------------------------------
/images/ic_home_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/ic_home_selected.png
--------------------------------------------------------------------------------
/images/ic_hot_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/ic_hot_normal.png
--------------------------------------------------------------------------------
/images/ic_hot_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/ic_hot_selected.png
--------------------------------------------------------------------------------
/images/ic_mine_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/ic_mine_normal.png
--------------------------------------------------------------------------------
/images/ic_mine_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/ic_mine_selected.png
--------------------------------------------------------------------------------
/images/technology.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/images/technology.png
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 11.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/flutter_export_environment.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # This is a generated file; do not edit or check into version control.
3 | export "FLUTTER_ROOT=/Users/heytea/flutter"
4 | export "FLUTTER_APPLICATION_PATH=/Users/heytea/FlutterProject/Flutter_Eyepetizer"
5 | export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6 | export "FLUTTER_TARGET=/Users/heytea/FlutterProject/Flutter_Eyepetizer/lib/main.dart"
7 | export "FLUTTER_BUILD_DIR=build"
8 | export "FLUTTER_BUILD_NAME=2.0.3"
9 | export "FLUTTER_BUILD_NUMBER=1"
10 | export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
11 | export "DART_OBFUSCATION=false"
12 | export "TRACK_WIDGET_CREATION=true"
13 | export "TREE_SHAKE_ICONS=false"
14 | export "PACKAGE_CONFIG=/Users/heytea/FlutterProject/Flutter_Eyepetizer/.dart_tool/package_config.json"
15 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | platform :ios, '11.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
32 | end
33 |
34 | post_install do |installer|
35 | installer.pods_project.targets.each do |target|
36 | flutter_additional_ios_build_settings(target)
37 | end
38 | end
39 |
40 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/landing_background.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "landing_background.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/landing_background.imageset/landing_background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/landing_background.imageset/landing_background.jpg
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/launch_screen.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "launch_screen.jpg",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/launch_screen.imageset/launch_screen.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/launch_screen.imageset/launch_screen.jpg
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/launch_screen_bg.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "launch_screen.jpeg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/launch_screen_bg.imageset/launch_screen.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/ios/Runner/Assets.xcassets/launch_screen_bg.imageset/launch_screen.jpeg
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/app_initialize.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_splash_screen/flutter_splash_screen.dart';
2 | import 'package:lib_cache/cache_manager.dart';
3 | import 'package:module_common/constant/http_constant.dart';
4 |
5 | class AppInitialize {
6 | AppInitialize._();
7 |
8 | //App初始化工作
9 | static Future init() async {
10 | await CacheManager.preInit();
11 | HttpConstant.baseUrl = 'http://baobab.kaiyanapp.com/api/';
12 | Future.delayed(
13 | Duration(milliseconds: 2000), () => FlutterSplashScreen.hide());
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lib/config/string.dart:
--------------------------------------------------------------------------------
1 | class DString {
2 | DString._();
3 |
4 | static const String exit_tip = '再按一次退出';
5 | static const String daily_paper = '日报';
6 | static const String discover = '发现';
7 | static const String hot = '热门';
8 | static const String mime = '我的';
9 | }
10 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter/services.dart';
4 | import 'package:flutter_eyepetizer/navigation/tab_navigation.dart';
5 | import 'package:flutter_eyepetizer/app_initialize.dart';
6 | import 'package:lib_navigator/lib_navigator.dart';
7 | import 'package:module_detail/page/video_detail_page.dart';
8 | import 'package:module_author/page/author_page.dart';
9 |
10 | void main() {
11 | //Flutter沉浸式状态栏
12 | if (Platform.isAndroid) {
13 | SystemChrome.setSystemUIOverlayStyle(
14 | SystemUiOverlayStyle.dark.copyWith(statusBarColor: Colors.transparent));
15 | }
16 | runApp(App());
17 | }
18 |
19 | class App extends StatelessWidget {
20 | @override
21 | Widget build(BuildContext context) {
22 | return FutureBuilder(
23 | future: AppInitialize.init(),
24 | builder: (BuildContext context, AsyncSnapshot snapshot) {
25 | var widget = snapshot.connectionState == ConnectionState.done
26 | ? TabNavigation()
27 | : Scaffold(
28 | body: Center(
29 | child: CircularProgressIndicator(),
30 | ),
31 | );
32 | return GetMaterialAppWidget(
33 | child: widget,
34 | );
35 | },
36 | );
37 | }
38 | }
39 |
40 | class GetMaterialAppWidget extends StatefulWidget {
41 | final Widget child;
42 |
43 | const GetMaterialAppWidget({Key key, this.child}) : super(key: key);
44 |
45 | @override
46 | _GetMaterialAppWidgetState createState() => _GetMaterialAppWidgetState();
47 | }
48 |
49 | class _GetMaterialAppWidgetState extends State {
50 | @override
51 | Widget build(BuildContext context) {
52 | return GetMaterialApp(
53 | title: 'Eyepetizer',
54 | initialRoute: '/',
55 | getPages: [
56 | GetPage(name: '/', page: () => widget.child),
57 | GetPage(name: '/detail', page: () => VideoDetailPage()),
58 | GetPage(name: '/author', page: () => AuthorPage()),
59 | ],
60 | );
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/lib/viewmodel/tab_navigation_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:lib_core/viewmodel/base_change_notifier_model.dart';
2 |
3 | class TabNavigationModel extends BaseChangeNotifierModel {
4 | int currentIndex = 0;
5 |
6 | changeBottomTabIndex(int index) {
7 | currentIndex = index;
8 | notifyListeners();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/module/module_author/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | .idea/
8 | .vagrant/
9 | .sconsign.dblite
10 | .svn/
11 |
12 | *.swp
13 | profile
14 |
15 | DerivedData/
16 |
17 | .generated/
18 |
19 | *.pbxuser
20 | *.mode1v3
21 | *.mode2v3
22 | *.perspectivev3
23 |
24 | !default.pbxuser
25 | !default.mode1v3
26 | !default.mode2v3
27 | !default.perspectivev3
28 |
29 | xcuserdata
30 |
31 | *.moved-aside
32 |
33 | *.pyc
34 | *sync/
35 | Icon?
36 | .tags*
37 |
38 | build/
39 | .android/
40 | .ios/
41 | .flutter-plugins
42 | .flutter-plugins-dependencies
43 |
44 | # Symbolication related
45 | app.*.symbols
46 |
47 | # Obfuscation related
48 | app.*.map.json
49 |
--------------------------------------------------------------------------------
/module/module_author/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: module
11 |
--------------------------------------------------------------------------------
/module/module_author/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/module/module_author/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/module/module_author/README.md:
--------------------------------------------------------------------------------
1 | # module_author
2 |
3 | 作者信息模块
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/module/module_author/images/ic_default_header_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/module/module_author/images/ic_default_header_bg.png
--------------------------------------------------------------------------------
/module/module_author/lib/constant/api_service.dart:
--------------------------------------------------------------------------------
1 | import 'package:module_common/constant/http_constant.dart';
2 |
3 | class URLs {
4 | static String tabUrl = '${HttpConstant.baseUrl}v4/pgcs/detail/tab?id=';
5 | }
6 |
--------------------------------------------------------------------------------
/module/module_author/lib/constant/string.dart:
--------------------------------------------------------------------------------
1 | const String author_works = '作品';
2 | const String author_flows = '关注';
3 | const String author_share = '分享';
--------------------------------------------------------------------------------
/module/module_author/lib/delegate/sticky_tabbar_delegate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | //自定义SliverPersistentHeaderDelegate保证child滑动顶部时吸顶
3 | class StickyTabBarDelegate extends SliverPersistentHeaderDelegate {
4 | final TabBar child;
5 |
6 | StickyTabBarDelegate({@required this.child});
7 |
8 | @override
9 | Widget build(
10 | BuildContext context, double shrinkOffset, bool overlapsContent) {
11 | return Container(
12 | color: Colors.white,
13 | child: this.child,
14 | );
15 | }
16 |
17 | //吸顶的关键:maxExtent = minExtent = child.preferredSize.height
18 | @override
19 | double get maxExtent => this.child.preferredSize.height;
20 |
21 | @override
22 | double get minExtent => this.child.preferredSize.height;
23 |
24 | @override
25 | bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) {
26 | return true;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/module_author/lib/module_author.dart:
--------------------------------------------------------------------------------
1 | library module_author;
2 |
3 |
--------------------------------------------------------------------------------
/module/module_author/lib/page/all_tab_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:module_author/widget/all_widget_item.dart';
3 | import 'package:lib_core/state/base_list_state.dart';
4 | import 'package:module_author/viewmodel/author_tab_page_model.dart';
5 | import 'package:module_common/model/common_item_model.dart';
6 |
7 | class AllTabPage extends StatefulWidget {
8 | final apiUrl;
9 |
10 | const AllTabPage({Key key, this.apiUrl}) : super(key: key);
11 |
12 | @override
13 | _AllTabPageState createState() => _AllTabPageState();
14 | }
15 |
16 | class _AllTabPageState
17 | extends BaseListState- {
18 | @override
19 | Widget getContentChild(AuthorTabPageModel model) => ListView.separated(
20 | itemBuilder: (context, index) {
21 | return AllWidgetItem(
22 | item: model.itemList[index],
23 | );
24 | },
25 | separatorBuilder: (context, index) {
26 | return Padding(
27 | padding: EdgeInsets.symmetric(horizontal: 15),
28 | child: Divider(
29 | height: 0.5,
30 | ),
31 | );
32 | },
33 | itemCount: model.itemList.length);
34 |
35 | @override
36 | AuthorTabPageModel get viewModel => AuthorTabPageModel(widget.apiUrl);
37 |
38 | @override
39 | bool get enablePullDown => false;
40 | }
41 |
--------------------------------------------------------------------------------
/module/module_author/lib/page/special_tab_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_core/state/base_list_state.dart';
3 | import 'package:module_author/viewmodel/author_tab_page_model.dart';
4 | import 'package:module_author/widget/special_widget_item.dart';
5 | import 'package:module_common/model/common_item_model.dart';
6 |
7 | class SpecialTabPage extends StatefulWidget {
8 | final apiUrl;
9 |
10 | const SpecialTabPage({Key key, this.apiUrl}) : super(key: key);
11 |
12 | @override
13 | _SpecialTabPageState createState() => _SpecialTabPageState();
14 | }
15 |
16 | class _SpecialTabPageState
17 | extends BaseListState
- {
18 | @override
19 | Widget getContentChild(AuthorTabPageModel model) => ListView.separated(
20 | itemBuilder: (context, index) {
21 | return SpecialWidgetItem(
22 | item: model.itemList[index],
23 | );
24 | },
25 | separatorBuilder: (context, index) {
26 | return Divider(height: 0.5);
27 | },
28 | itemCount: model.itemList.length);
29 |
30 | @override
31 | AuthorTabPageModel get viewModel => AuthorTabPageModel(widget.apiUrl);
32 |
33 | @override
34 | bool get enablePullDown => false;
35 | }
36 |
--------------------------------------------------------------------------------
/module/module_author/lib/viewmodel/author_tab_page_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:module_common/model/common_item_model.dart';
2 | import 'package:lib_core/viewmodel/paging_list_model.dart';
3 |
4 | class AuthorTabPageModel extends PagingListModel
- {
5 | String apiUrl;
6 |
7 | AuthorTabPageModel(this.apiUrl);
8 |
9 | @override
10 | String getUrl() {
11 | return apiUrl;
12 | }
13 |
14 | @override
15 | Issue getModel(Map json) {
16 | return Issue.fromJson(json);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/module/module_author/lib/widget/author_common_horizontal_widget_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:module_author/widget/special_horizontal_widget_item.dart';
3 | import 'package:module_common/model/common_item_model.dart';
4 |
5 | class AuthorCommonHorizontalWidgetItem extends StatelessWidget {
6 | final Item item;
7 |
8 | const AuthorCommonHorizontalWidgetItem({Key key, this.item})
9 | : super(key: key);
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Container(
14 | height: 240,
15 | child: ListView.builder(
16 | itemBuilder: (context, index) {
17 | return SpecialHorizontalWidgetItem(
18 | item: item.data.itemList[index],
19 | isLast: index == item.data.itemList.length - 1,
20 | );
21 | },
22 | scrollDirection: Axis.horizontal,
23 | itemCount: item.data.itemList.length,
24 | ),
25 | );
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/module/module_author/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: module_author
2 | description: 作者信息模块
3 | version: 0.0.1
4 | homepage:
5 |
6 | publish_to: 'none'#如果你想发布到pub.dev,请删除这一行
7 |
8 | environment:
9 | sdk: ">=2.7.0 <3.0.0"
10 | flutter: ">=1.17.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | module_common:
17 | path: ../module_common
18 | lib_core:
19 | path: ../../component/lib_core
20 | lib_ui:
21 | path: ../../component/lib_ui
22 | lib_navigator:
23 | path: ../../component/lib_navigator
24 |
25 |
26 | dev_dependencies:
27 | flutter_test:
28 | sdk: flutter
29 |
30 | # For information on the generic Dart part of this file, see the
31 | # following page: https://dart.dev/tools/pub/pubspec
32 |
33 | # The following section is specific to Flutter.
34 | flutter:
35 |
36 | # To add assets to your package, add an assets section, like this:
37 | assets:
38 | - images/
39 | # - images/a_dot_ham.jpeg
40 | #
41 | # For details regarding assets in packages, see
42 | # https://flutter.dev/assets-and-images/#from-packages
43 | #
44 | # An image asset can refer to one or more resolution-specific "variants", see
45 | # https://flutter.dev/assets-and-images/#resolution-aware.
46 |
47 | # To add custom fonts to your package, add a fonts section here,
48 | # in this "flutter" section. Each entry in this list should have a
49 | # "family" key with the font family name, and a "fonts" key with a
50 | # list giving the asset and other descriptors for the font. For
51 | # example:
52 | # fonts:
53 | # - family: Schyler
54 | # fonts:
55 | # - asset: fonts/Schyler-Regular.ttf
56 | # - asset: fonts/Schyler-Italic.ttf
57 | # style: italic
58 | # - family: Trajan Pro
59 | # fonts:
60 | # - asset: fonts/TrajanPro.ttf
61 | # - asset: fonts/TrajanPro_Bold.ttf
62 | # weight: 700
63 | #
64 | # For details regarding fonts in packages, see
65 | # https://flutter.dev/custom-fonts/#from-packages
66 |
--------------------------------------------------------------------------------
/module/module_author/test/module_author_test.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | void main() {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/module/module_common/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/module/module_common/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/module/module_common/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/module/module_common/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/module/module_common/README.md:
--------------------------------------------------------------------------------
1 | # module_common
2 |
3 | 公共业务模块
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/module/module_common/lib/constant/color.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | Color tabBgColor = Color(0x3389b1e9);
4 | Color hitTextColor = Color(0xff9a9a9a);
--------------------------------------------------------------------------------
/module/module_common/lib/constant/http_constant.dart:
--------------------------------------------------------------------------------
1 | class HttpConstant {
2 | static String baseUrl = "";
3 |
4 | static Map httpHeader = {
5 | 'Accept': 'application/json, text/plain, */*',
6 | 'Accept-Encoding': 'gzip, deflate, br',
7 | 'Accept-Language': 'zh-CN,zh;q=0.9',
8 | 'Connection': 'keep-alive',
9 | 'Content-Type': 'application/json',
10 | 'User-Agent':
11 | 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1',
12 | };
13 | }
14 |
--------------------------------------------------------------------------------
/module/module_common/lib/event/watch_video_event.dart:
--------------------------------------------------------------------------------
1 |
2 | class WatchVideoEvent{
3 |
4 | }
--------------------------------------------------------------------------------
/module/module_common/lib/module_common.dart:
--------------------------------------------------------------------------------
1 | library module_common;
2 |
--------------------------------------------------------------------------------
/module/module_common/lib/repository/history_repository.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:lib_cache/cache_manager.dart';
4 | import 'package:module_common/model/common_item_model.dart';
5 |
6 | class HistoryRepository {
7 | static const String watch_history_list_key = "watch_history_list";
8 |
9 | static saveWatchHistory(Data data) async {
10 | List watchList = loadHistoryData();
11 |
12 | var jsonParam = data.toJson();
13 | var jsonStr = json.encode(jsonParam);
14 | if (!watchList.contains(jsonStr)) {
15 | watchList.add(json.encode(jsonParam));
16 | CacheManager.getInstance().set(watch_history_list_key, watchList);
17 | }
18 | }
19 |
20 | static List loadHistoryData() {
21 | List originList =
22 | CacheManager.getInstance().get
>(watch_history_list_key);
23 |
24 | List watchList;
25 |
26 | if (originList == null) {
27 | watchList = [];
28 | } else {
29 | watchList = originList.map((e) => e.toString()).toList();
30 | }
31 | return watchList;
32 | }
33 |
34 | static saveHistoryData(List watchHistoryList) {
35 | CacheManager.getInstance().set(watch_history_list_key, watchHistoryList);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/module/module_common/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: module_common
2 | description: 公共业务模块
3 | version: 0.0.1
4 | homepage:
5 |
6 | publish_to: 'none'
7 |
8 | environment:
9 | sdk: ">=2.7.0 <3.0.0"
10 | flutter: ">=1.17.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | lib_net:
17 | path: ../../component/lib_net
18 | lib_core:
19 | path: ../../component/lib_core
20 | lib_cache:
21 | path: ../../component/lib_cache
22 | lib_utils:
23 | path: ../../component/lib_utils
24 | lib_image:
25 | path: ../../component/lib_image
26 | lib_navigator:
27 | path: ../../component/lib_navigator
28 |
29 | dev_dependencies:
30 | flutter_test:
31 | sdk: flutter
32 |
33 | # For information on the generic Dart part of this file, see the
34 | # following page: https://dart.dev/tools/pub/pubspec
35 |
36 | # The following section is specific to Flutter.
37 | flutter:
38 |
39 | # To add assets to your package, add an assets section, like this:
40 | # assets:
41 | # - images/a_dot_burr.jpeg
42 | # - images/a_dot_ham.jpeg
43 | #
44 | # For details regarding assets in packages, see
45 | # https://flutter.dev/assets-and-images/#from-packages
46 | #
47 | # An image asset can refer to one or more resolution-specific "variants", see
48 | # https://flutter.dev/assets-and-images/#resolution-aware.
49 |
50 | # To add custom fonts to your package, add a fonts section here,
51 | # in this "flutter" section. Each entry in this list should have a
52 | # "family" key with the font family name, and a "fonts" key with a
53 | # list giving the asset and other descriptors for the font. For
54 | # example:
55 | # fonts:
56 | # - family: Schyler
57 | # fonts:
58 | # - asset: fonts/Schyler-Regular.ttf
59 | # - asset: fonts/Schyler-Italic.ttf
60 | # style: italic
61 | # - family: Trajan Pro
62 | # fonts:
63 | # - asset: fonts/TrajanPro.ttf
64 | # - asset: fonts/TrajanPro_Bold.ttf
65 | # weight: 700
66 | #
67 | # For details regarding fonts in packages, see
68 | # https://flutter.dev/custom-fonts/#from-packages
69 |
--------------------------------------------------------------------------------
/module/module_common/test/module_common_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 |
3 | void main() {
4 | test('adds one to input values', () {});
5 | }
6 |
--------------------------------------------------------------------------------
/module/module_detail/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/module/module_detail/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/module/module_detail/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/module/module_detail/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/module/module_detail/README.md:
--------------------------------------------------------------------------------
1 | # module_detail
2 |
3 | 视频详情页面
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/module/module_detail/images/ic_like.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/module/module_detail/images/ic_like.png
--------------------------------------------------------------------------------
/module/module_detail/images/ic_share_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/module/module_detail/images/ic_share_white.png
--------------------------------------------------------------------------------
/module/module_detail/images/icon_comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/module/module_detail/images/icon_comment.png
--------------------------------------------------------------------------------
/module/module_detail/lib/constant/api_service.dart:
--------------------------------------------------------------------------------
1 | import 'package:module_common/constant/http_constant.dart';
2 |
3 | class URLs {
4 | static String videoRelatedUrl = '${HttpConstant.baseUrl}v4/video/related?id=';
5 | }
6 |
--------------------------------------------------------------------------------
/module/module_detail/lib/constant/string.dart:
--------------------------------------------------------------------------------
1 | const String add_follow = '+ 关注';
--------------------------------------------------------------------------------
/module/module_detail/lib/module_detail.dart:
--------------------------------------------------------------------------------
1 | library module_detail;
2 |
3 |
--------------------------------------------------------------------------------
/module/module_detail/lib/viewmodel/video_detail_page_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:lib_net/http_manager.dart';
2 | import 'package:lib_utils/toast_util.dart';
3 | import 'package:lib_core/viewmodel/base_change_notifier_model.dart';
4 | import 'package:lib_ui/widget/loading_container.dart';
5 | import 'package:module_common/model/common_item_model.dart';
6 | import 'package:module_detail/constant/api_service.dart';
7 |
8 | class VideoDetailPageModel extends BaseChangeNotifierModel {
9 | List- itemList = [];
10 | int _videoId;
11 |
12 | void loadVideoRelateData(int id) {
13 | _videoId = id;
14 | HttpManager.requestData('${URLs.videoRelatedUrl}$id').then((res) {
15 | Issue issue = Issue.fromJson(res);
16 | itemList = issue.itemList;
17 | viewState = ViewState.content;
18 | }).catchError((e) {
19 | showError(e.toString());
20 | viewState = ViewState.error;
21 | }).whenComplete(() => notifyListeners());
22 | }
23 |
24 | void retry() {
25 | viewState = ViewState.loading;
26 | notifyListeners();
27 | loadVideoRelateData(_videoId);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/module/module_detail/lib/widget/appbar_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_utils/view_util.dart';
3 |
4 | ///视频详情页appBar
5 | videoAppBar() {
6 | return Container(
7 | padding: EdgeInsets.only(right: 8),
8 | decoration: BoxDecoration(gradient: blackLinearGradient(fromTop: true)),
9 | child: Row(
10 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
11 | children: [
12 | Material(
13 | color: Colors.transparent,
14 | child: BackButton(
15 | color: Colors.white,
16 | ),
17 | ),
18 | Row(
19 | children: [
20 | Icon(Icons.more_vert_rounded, color: Colors.white, size: 20),
21 | ],
22 | )
23 | ],
24 | ),
25 | );
26 | }
27 |
--------------------------------------------------------------------------------
/module/module_detail/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: module_detail
2 | description: 视频详情页面
3 | version: 0.0.1
4 | homepage:
5 |
6 | publish_to: 'none'
7 |
8 | environment:
9 | sdk: ">=2.7.0 <3.0.0"
10 | flutter: ">=1.17.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | lib_ui:
17 | path: ../../component/lib_ui
18 | lib_utils:
19 | path: ../../component/lib_utils
20 | lib_video:
21 | path: ../../component/lib_video
22 | lib_core:
23 | path: ../../component/lib_core
24 | lib_net:
25 | path: ../../component/lib_net
26 | lib_navigator:
27 | path: ../../component/lib_navigator
28 | module_common:
29 | path: ../module_common
30 |
31 | dev_dependencies:
32 | flutter_test:
33 | sdk: flutter
34 |
35 | # For information on the generic Dart part of this file, see the
36 | # following page: https://dart.dev/tools/pub/pubspec
37 |
38 | # The following section is specific to Flutter.
39 | flutter:
40 |
41 | # To add assets to your package, add an assets section, like this:
42 | assets:
43 | - images/
44 | # - images/a_dot_ham.jpeg
45 | #
46 | # For details regarding assets in packages, see
47 | # https://flutter.dev/assets-and-images/#from-packages
48 | #
49 | # An image asset can refer to one or more resolution-specific "variants", see
50 | # https://flutter.dev/assets-and-images/#resolution-aware.
51 |
52 | # To add custom fonts to your package, add a fonts section here,
53 | # in this "flutter" section. Each entry in this list should have a
54 | # "family" key with the font family name, and a "fonts" key with a
55 | # list giving the asset and other descriptors for the font. For
56 | # example:
57 | # fonts:
58 | # - family: Schyler
59 | # fonts:
60 | # - asset: fonts/Schyler-Regular.ttf
61 | # - asset: fonts/Schyler-Italic.ttf
62 | # style: italic
63 | # - family: Trajan Pro
64 | # fonts:
65 | # - asset: fonts/TrajanPro.ttf
66 | # - asset: fonts/TrajanPro_Bold.ttf
67 | # weight: 700
68 | #
69 | # For details regarding fonts in packages, see
70 | # https://flutter.dev/custom-fonts/#from-packages
71 |
--------------------------------------------------------------------------------
/module/module_detail/test/module_detail_test.dart:
--------------------------------------------------------------------------------
1 |
2 | void main() {
3 |
4 | }
5 |
--------------------------------------------------------------------------------
/module/module_discover/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/module/module_discover/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/module/module_discover/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/module/module_discover/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/module/module_discover/README.md:
--------------------------------------------------------------------------------
1 | # module_discover
2 |
3 | 发现模块组件
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/module/module_discover/lib/constant/api_service.dart:
--------------------------------------------------------------------------------
1 | import 'package:module_common/constant/http_constant.dart';
2 |
3 | class URLs {
4 | static String communityUrl = '${HttpConstant.baseUrl}v7/community/tab/rec';
5 |
6 | static String categoryUrl = '${HttpConstant.baseUrl}v4/categories';
7 |
8 | static String followUrl = '${HttpConstant.baseUrl}v4/tabs/follow';
9 |
10 | static String categoryVideoUrl =
11 | '${HttpConstant.baseUrl}v4/categories/videoList?';
12 |
13 | static String newsUrl =
14 | '${HttpConstant.baseUrl}v7/information/list?vc=6030000&deviceModel=';
15 |
16 | static String topicsDetailUrl =
17 | '${HttpConstant.baseUrl}v3/lightTopics/internal/';
18 |
19 | static String topicsUrl = '${HttpConstant.baseUrl}v3/specialTopics';
20 |
21 | static String videoRelatedUrl = '${HttpConstant.baseUrl}v4/video/related?id=';
22 | }
23 |
--------------------------------------------------------------------------------
/module/module_discover/lib/constant/color.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | Color desTextColor = Color(0xff333333);
--------------------------------------------------------------------------------
/module/module_discover/lib/constant/string.dart:
--------------------------------------------------------------------------------
1 | const String news_title = '新鲜资讯';
2 | const String add_follow = '+ 关注';
3 | const String collect_text = '收藏';
4 | const String discover_text = '发现';
5 |
--------------------------------------------------------------------------------
/module/module_discover/lib/model/category_model.dart:
--------------------------------------------------------------------------------
1 | class CategoryModel {
2 | int id;
3 | String name;
4 | Null alias;
5 | String description;
6 | String bgPicture;
7 | String bgColor;
8 | String headerImage;
9 | int defaultAuthorId;
10 | int tagId;
11 |
12 | CategoryModel(
13 | {this.id,
14 | this.name,
15 | this.alias,
16 | this.description,
17 | this.bgPicture,
18 | this.bgColor,
19 | this.headerImage,
20 | this.defaultAuthorId,
21 | this.tagId});
22 |
23 | CategoryModel.fromJson(Map json) {
24 | id = json['id'];
25 | name = json['name'];
26 | alias = json['alias'];
27 | description = json['description'];
28 | bgPicture = json['bgPicture'];
29 | bgColor = json['bgColor'];
30 | headerImage = json['headerImage'];
31 | defaultAuthorId = json['defaultAuthorId'];
32 | tagId = json['tagId'];
33 | }
34 |
35 | Map toJson() {
36 | final Map data = new Map();
37 | data['id'] = this.id;
38 | data['name'] = this.name;
39 | data['alias'] = this.alias;
40 | data['description'] = this.description;
41 | data['bgPicture'] = this.bgPicture;
42 | data['bgColor'] = this.bgColor;
43 | data['headerImage'] = this.headerImage;
44 | data['defaultAuthorId'] = this.defaultAuthorId;
45 | data['tagId'] = this.tagId;
46 | return data;
47 | }
48 | }
--------------------------------------------------------------------------------
/module/module_discover/lib/module_discover.dart:
--------------------------------------------------------------------------------
1 | library module_discover;
2 |
3 | /// A Calculator.
4 | class Calculator {
5 | /// Returns [value] plus 1.
6 | int addOne(int value) => value + 1;
7 | }
8 |
--------------------------------------------------------------------------------
/module/module_discover/lib/page/category_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:animations/animations.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:lib_core/widget/provider_widget.dart';
4 | import 'package:lib_ui/widget/loading_container.dart';
5 | import 'package:module_discover/viewmodel/category_page_model.dart';
6 | import 'package:module_discover/widget/category_widget_item.dart';
7 |
8 | import 'category_detail_page.dart';
9 |
10 | class CategoryPage extends StatefulWidget {
11 | @override
12 | _CategoryPageState createState() => _CategoryPageState();
13 | }
14 |
15 | class _CategoryPageState extends State
16 | with AutomaticKeepAliveClientMixin {
17 | @override
18 | Widget build(BuildContext context) {
19 | super.build(context);
20 | return ProviderWidget(
21 | model: CategoryPageModel(),
22 | onModelInit: (model) {
23 | model.loadData();
24 | },
25 | builder: (context, model, child) {
26 | return LoadingContainer(
27 | viewState: model.viewState,
28 | retry: model.retry,
29 | child: Container(
30 | padding: EdgeInsets.all(5),
31 | decoration: BoxDecoration(color: Color(0xfff2f2f2)),
32 | child: GridView.builder(
33 | itemCount: model.list.length,
34 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
35 | crossAxisCount: 2,
36 | mainAxisSpacing: 5,
37 | crossAxisSpacing: 5),
38 | itemBuilder: (context, index) {
39 | return OpenContainer(closedBuilder: (context, action) {
40 | return CategoryWidgetItem(
41 | categoryModel: model.list[index]);
42 | }, openBuilder: (context, action) {
43 | return CategoryDetailPage(
44 | categoryModel: model.list[index]);
45 | });
46 | })),
47 | );
48 | },
49 | );
50 | }
51 |
52 | @override
53 | bool get wantKeepAlive => true;
54 | }
55 |
--------------------------------------------------------------------------------
/module/module_discover/lib/page/follow_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_core/state/base_list_state.dart';
3 | import 'package:module_common/model/common_item_model.dart';
4 | import 'package:module_discover/viewmodel/follow_page_model.dart';
5 | import 'package:module_discover/widget/follow_page_item.dart';
6 |
7 | class FollowPage extends StatefulWidget {
8 | @override
9 | _FollowPageState createState() => _FollowPageState();
10 | }
11 | class _FollowPageState extends BaseListState
- {
12 | @override
13 | Widget getContentChild(FollowPageModel model) => ListView.separated(
14 | itemBuilder: (context, index) {
15 | return FollowPageItem(item: model.itemList[index]);
16 | },
17 | separatorBuilder: (context, index) {
18 | return Divider(height: 0.5);
19 | },
20 | itemCount: model.itemList.length);
21 |
22 | @override
23 | FollowPageModel get viewModel => FollowPageModel();
24 | }
--------------------------------------------------------------------------------
/module/module_discover/lib/page/news_list_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_core/state/base_list_state.dart';
3 | import 'package:module_discover/model/news_model.dart';
4 | import 'package:module_discover/viewmodel/news_page_model.dart';
5 | import 'package:module_discover/widget/news_widget_item.dart';
6 |
7 | const TEXT_CARD_TYPE = "textCard";
8 | const INFORMATION_CARD_TYPE = "informationCard";
9 |
10 | class NewsListPage extends StatefulWidget {
11 | @override
12 | _NewsListPageState createState() => _NewsListPageState();
13 | }
14 |
15 | class _NewsListPageState
16 | extends BaseListState {
17 | @override
18 | NewsPageModel get viewModel => NewsPageModel();
19 |
20 | @override
21 | Widget getContentChild(NewsPageModel model) => ListView.builder(
22 | itemBuilder: (context, index) {
23 | if (model.itemList[index].type == TEXT_CARD_TYPE) {
24 | return NewsTitleWidgetItem(newsItemModel: model.itemList[index]);
25 | } else {
26 | return NewsContentWidgetItem(newsItemModel: model.itemList[index]);
27 | }
28 | },
29 | itemCount: model.itemList.length);
30 | }
31 |
--------------------------------------------------------------------------------
/module/module_discover/lib/page/topics_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:animations/animations.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:lib_core/state/base_list_state.dart';
4 | import 'package:module_discover/model/topic_model.dart';
5 | import 'package:module_discover/page/topics_detail_page.dart';
6 | import 'package:module_discover/viewmodel/topic_page_model.dart';
7 | import 'package:module_discover/widget/topic_widget_item.dart';
8 |
9 | class TopicsPage extends StatefulWidget {
10 | @override
11 | _TopicsPageState createState() => _TopicsPageState();
12 | }
13 |
14 | class _TopicsPageState
15 | extends BaseListState {
16 | @override
17 | Widget getContentChild(TopicPageModel model) => ListView.builder(
18 | itemBuilder: (context, index) {
19 | return OpenContainer(closedBuilder: (context, action) {
20 | return TopicWidgetItem(itemModel: model.itemList[index]);
21 | }, openBuilder: (context, action) {
22 | return TopicDetailPage(detailId: model.itemList[index].data.id);
23 | });
24 | },
25 | itemCount: model.itemList.length);
26 |
27 | @override
28 | TopicPageModel get viewModel => TopicPageModel();
29 | }
30 |
--------------------------------------------------------------------------------
/module/module_discover/lib/repository/recommend_repository.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:http/http.dart' as http;
4 | import 'package:lib_utils/toast_util.dart';
5 | import 'package:loading_more_list/loading_more_list.dart';
6 | import 'package:module_common/constant/http_constant.dart';
7 | import 'package:module_discover/constant/api_service.dart';
8 | import 'package:module_discover/model/recommend_model.dart';
9 |
10 | class RecommendRepository extends LoadingMoreBase {
11 | String nextPageUrl;
12 | bool _hasMore = true;
13 | bool forceRefresh = false;
14 | Utf8Decoder utf8decoder = Utf8Decoder();
15 |
16 | @override
17 | bool get hasMore => _hasMore || forceRefresh;
18 |
19 | @override
20 | Future refresh([bool notifyStateChanged = false]) async {
21 | _hasMore = true;
22 | forceRefresh = !notifyStateChanged;
23 | final bool result = await super.refresh(notifyStateChanged);
24 | forceRefresh = false;
25 | return result;
26 | }
27 |
28 | @override
29 | Future loadData([bool isloadMoreAction = false]) async {
30 | String url = '';
31 | if (isloadMoreAction) {
32 | url = nextPageUrl;
33 | } else {
34 | url = URLs.communityUrl;
35 | }
36 | bool isSuccess = true;
37 |
38 | try {
39 | var response =
40 | await http.get(Uri.parse(url), headers: HttpConstant.httpHeader);
41 | if (response.statusCode == 200) {
42 | var result = json.decode(utf8decoder.convert(response.bodyBytes));
43 | RecommendModel model = RecommendModel.fromJson(result);
44 | model.itemList.removeWhere((item) {
45 | return item.type == 'horizontalScrollCard';
46 | });
47 | if (!isloadMoreAction) {
48 | clear();
49 | }
50 | addAll(model.itemList);
51 | nextPageUrl = model.nextPageUrl;
52 | _hasMore = nextPageUrl != null;
53 | isSuccess = true;
54 | } else {
55 | throw Exception('"Request failed with status: ${response.statusCode}"');
56 | }
57 | } catch (e) {
58 | isSuccess = false;
59 | showError(e.toString());
60 | }
61 |
62 | return isSuccess;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/module/module_discover/lib/viewmodel/category_page_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:lib_core/viewmodel/base_change_notifier_model.dart';
2 | import 'package:lib_net/http_manager.dart';
3 | import 'package:lib_ui/widget/loading_container.dart';
4 | import 'package:lib_utils/toast_util.dart';
5 | import 'package:module_discover/constant/api_service.dart';
6 | import 'package:module_discover/model/category_model.dart';
7 |
8 | class CategoryPageModel extends BaseChangeNotifierModel {
9 | List list = [];
10 |
11 | void loadData() async {
12 | HttpManager.getData(URLs.categoryUrl,
13 | success: (result) {
14 | List responseList = result as List;
15 | List categoryList = responseList
16 | .map((model) => CategoryModel.fromJson(model))
17 | .toList();
18 | this.list = categoryList;
19 | viewState = ViewState.content;
20 | },
21 | fail: (e) {
22 | showError(e.toString());
23 | viewState = ViewState.error;
24 | },
25 | complete: () => notifyListeners());
26 | }
27 |
28 | retry() {
29 | viewState = ViewState.content;
30 | notifyListeners();
31 | loadData();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/module/module_discover/lib/viewmodel/follow_page_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:lib_core/viewmodel/paging_list_model.dart';
2 | import 'package:module_common/model/common_item_model.dart';
3 | import 'package:module_discover/constant/api_service.dart';
4 |
5 | class FollowPageModel extends PagingListModel
- {
6 |
7 | @override
8 | String getUrl() {
9 | return URLs.followUrl;
10 | }
11 |
12 | @override
13 | Issue getModel(Map json) {
14 | return Issue.fromJson(json);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/module/module_discover/lib/viewmodel/news_page_model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'package:lib_core/viewmodel/paging_list_model.dart';
3 | import 'package:module_discover/constant/api_service.dart';
4 | import 'package:module_discover/model/news_model.dart';
5 |
6 | class NewsPageModel extends PagingListModel {
7 |
8 | @override
9 | String getUrl() {
10 | String deviceModel = Platform.isAndroid ? "Android" : "IOS";
11 | return URLs.newsUrl + deviceModel;
12 | }
13 |
14 | @override
15 | String getNextUrl(NewsModel model) {
16 | String deviceModel = Platform.isAndroid ? "Android" : "IOS";
17 | return "${model.nextPageUrl}&vc=6030000&deviceModel=$deviceModel";
18 | }
19 |
20 | @override
21 | NewsModel getModel(Map json) {
22 | return NewsModel.fromJson(json);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/module/module_discover/lib/viewmodel/photo_gallery_model.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | import 'package:lib_core/viewmodel/base_change_notifier_model.dart';
4 |
5 | class PhotoGalleryModel extends BaseChangeNotifierModel {
6 | int currentIndex = 1;
7 |
8 | changeIndex(int index) {
9 | this.currentIndex = index + 1;
10 | notifyListeners();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/module/module_discover/lib/viewmodel/topic_detail_page_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:lib_core/viewmodel/base_change_notifier_model.dart';
2 | import 'package:lib_net/http_manager.dart';
3 | import 'package:lib_ui/widget/loading_container.dart';
4 | import 'package:lib_utils/toast_util.dart';
5 | import 'package:module_discover/constant/api_service.dart';
6 | import 'package:module_discover/model/topic_detail_model.dart';
7 |
8 | class TopicDetailPageModel extends BaseChangeNotifierModel {
9 | TopicDetailModel topicDetailModel = TopicDetailModel();
10 | List itemList = [];
11 |
12 | int _id;
13 |
14 | void loadTopicDetailData(int id) {
15 | _id = id;
16 | HttpManager.requestData('${URLs.topicsDetailUrl}$id').then((res) {
17 | topicDetailModel = TopicDetailModel.fromJson(res);
18 | itemList = topicDetailModel.itemList;
19 | viewState = ViewState.content;
20 | }).catchError((e) {
21 | showError(e.toString());
22 | viewState = ViewState.error;
23 | }).whenComplete(() => notifyListeners());
24 | }
25 |
26 | retry() {
27 | viewState = ViewState.loading;
28 | notifyListeners();
29 | loadTopicDetailData(_id);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/module/module_discover/lib/viewmodel/topic_page_model.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:lib_core/viewmodel/paging_list_model.dart';
3 | import 'package:module_discover/constant/api_service.dart';
4 | import 'package:module_discover/model/topic_model.dart';
5 |
6 | class TopicPageModel extends PagingListModel{
7 |
8 | @override
9 | String getUrl() {
10 | return URLs.topicsUrl;
11 | }
12 |
13 | @override
14 | TopicModel getModel(Map json) {
15 | return TopicModel.fromJson(json);
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/module/module_discover/lib/viewmodel/video_detail_page_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:lib_core/viewmodel/base_change_notifier_model.dart';
2 | import 'package:lib_net/http_manager.dart';
3 | import 'package:lib_ui/widget/loading_container.dart';
4 | import 'package:lib_utils/toast_util.dart';
5 | import 'package:module_common/model/common_item_model.dart';
6 | import 'package:module_discover/constant/api_service.dart';
7 |
8 | class VideoDetailPageModel extends BaseChangeNotifierModel {
9 | List
- itemList = [];
10 | int _videoId;
11 |
12 | void loadVideoRelateData(int id) {
13 | _videoId = id;
14 | HttpManager.requestData('${URLs.videoRelatedUrl}$id').then((res) {
15 | Issue issue = Issue.fromJson(res);
16 | itemList = issue.itemList;
17 | viewState = ViewState.content;
18 | }).catchError((e) {
19 | showError(e.toString());
20 | viewState = ViewState.error;
21 | }).whenComplete(() => notifyListeners());
22 | }
23 |
24 | void retry() {
25 | viewState = ViewState.loading;
26 | notifyListeners();
27 | loadVideoRelateData(_videoId);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/module/module_discover/lib/widget/category_widget_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_image/lib_image.dart';
3 | import 'package:module_discover/model/category_model.dart';
4 |
5 | class CategoryWidgetItem extends StatelessWidget {
6 | final CategoryModel categoryModel;
7 |
8 | const CategoryWidgetItem({Key key, this.categoryModel}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Stack(children: [
13 | ClipRRect(
14 | borderRadius: BorderRadius.circular(4),
15 | child: cacheImage(categoryModel.bgPicture)),
16 | Center(
17 | child: Text('#${categoryModel.name}',
18 | style: TextStyle(
19 | color: Colors.white,
20 | fontSize: 22,
21 | fontWeight: FontWeight.bold)))
22 | ]);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/module/module_discover/lib/widget/topic_widget_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_image/lib_image.dart';
3 | import 'package:module_discover/model/topic_model.dart';
4 |
5 | class TopicWidgetItem extends StatelessWidget {
6 | final TopicItemModel itemModel;
7 |
8 | const TopicWidgetItem({Key key, this.itemModel}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Column(
13 | children: [
14 | Padding(
15 | padding: EdgeInsets.all(10),
16 | child: ClipRRect(
17 | child: cacheImage(
18 | itemModel.data.image,
19 | width: MediaQuery.of(context).size.width,
20 | height: 200,
21 | ), //充满容器,可能会被截断
22 | borderRadius: BorderRadius.circular(4))),
23 | Padding(
24 | padding: EdgeInsets.only(left: 10, right: 10, bottom: 5),
25 | child: Divider(height: 0.5))
26 | ],
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/module/module_discover/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: module_discover
2 | description: 发现模块组件
3 | version: 0.0.1
4 | homepage:
5 |
6 | publish_to: 'none'
7 |
8 | environment:
9 | sdk: ">=2.7.0 <3.0.0"
10 | flutter: ">=1.17.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | lib_ui:
17 | path: ../../component/lib_ui
18 | lib_video:
19 | path: ../../component/lib_video
20 | lib_core:
21 | path: ../../component/lib_core
22 | lib_navigator:
23 | path: ../../component/lib_navigator
24 | module_common:
25 | path: ../module_common
26 |
27 | flutter_webview_plugin: ^0.4.0
28 | photo_view: ^0.9.2
29 | loading_more_list: ^3.0.0
30 | animations: ^1.1.1
31 |
32 | dev_dependencies:
33 | flutter_test:
34 | sdk: flutter
35 |
36 | # For information on the generic Dart part of this file, see the
37 | # following page: https://dart.dev/tools/pub/pubspec
38 |
39 | # The following section is specific to Flutter.
40 | flutter:
41 |
42 | # To add assets to your package, add an assets section, like this:
43 | # assets:
44 | # - images/a_dot_burr.jpeg
45 | # - images/a_dot_ham.jpeg
46 | #
47 | # For details regarding assets in packages, see
48 | # https://flutter.dev/assets-and-images/#from-packages
49 | #
50 | # An image asset can refer to one or more resolution-specific "variants", see
51 | # https://flutter.dev/assets-and-images/#resolution-aware.
52 |
53 | # To add custom fonts to your package, add a fonts section here,
54 | # in this "flutter" section. Each entry in this list should have a
55 | # "family" key with the font family name, and a "fonts" key with a
56 | # list giving the asset and other descriptors for the font. For
57 | # example:
58 | # fonts:
59 | # - family: Schyler
60 | # fonts:
61 | # - asset: fonts/Schyler-Regular.ttf
62 | # - asset: fonts/Schyler-Italic.ttf
63 | # style: italic
64 | # - family: Trajan Pro
65 | # fonts:
66 | # - asset: fonts/TrajanPro.ttf
67 | # - asset: fonts/TrajanPro_Bold.ttf
68 | # weight: 700
69 | #
70 | # For details regarding fonts in packages, see
71 | # https://flutter.dev/custom-fonts/#from-packages
72 |
--------------------------------------------------------------------------------
/module/module_discover/test/module_discover_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 |
3 | import 'package:module_discover/module_discover.dart';
4 |
5 | void main() {
6 | test('adds one to input values', () {
7 | final calculator = Calculator();
8 | expect(calculator.addOne(2), 3);
9 | expect(calculator.addOne(-7), -6);
10 | expect(calculator.addOne(0), 1);
11 | });
12 | }
13 |
--------------------------------------------------------------------------------
/module/module_home/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/module/module_home/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/module/module_home/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/module/module_home/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/module/module_home/README.md:
--------------------------------------------------------------------------------
1 | # module_home
2 |
3 | 首页模块组件
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/module/module_home/lib/const/api_service.dart:
--------------------------------------------------------------------------------
1 | import 'package:module_common/constant/http_constant.dart';
2 |
3 | class URLs {
4 | static String feedUrl = '${HttpConstant.baseUrl}v2/feed?num=1';
5 |
6 | static String keywordUrl = '${HttpConstant.baseUrl}v3/queries/hot';
7 |
8 | static String searchUrl = "${HttpConstant.baseUrl}v1/search?query=";
9 | }
10 |
--------------------------------------------------------------------------------
/module/module_home/lib/const/string.dart:
--------------------------------------------------------------------------------
1 | const String daily_paper = '日报';
2 | const String hot_key_word = '- 热搜关键字 -';
3 | const String no_data = '暂无数据';
4 | const String interest_video = '帮你找到感兴趣的视频';
5 |
--------------------------------------------------------------------------------
/module/module_home/lib/model/issue_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:lib_core/model/paging_model.dart';
2 | import 'package:module_common/model/common_item_model.dart';
3 |
4 | class IssueEntity extends PagingModel
- {
5 | int nextPublishTime;
6 | String newestIssueType;
7 | List issueList;
8 |
9 | IssueEntity({this.nextPublishTime, this.newestIssueType});
10 |
11 | IssueEntity.fromJson(Map json) {
12 | nextPublishTime = json['nextPublishTime'];
13 | newestIssueType = json['newestIssueType'];
14 | nextPageUrl = json['nextPageUrl'];
15 | if (json['issueList'] != null) {
16 | issueList = [];
17 | itemList = [];
18 | (json['issueList'] as List).forEach((v) {
19 | issueList.add(new Issue.fromJson(v));
20 | });
21 | itemList = issueList[0].itemList;
22 | }
23 | }
24 |
25 | Map toJson() {
26 | final Map data = new Map();
27 | data['nextPublishTime'] = this.nextPublishTime;
28 | data['newestIssueType'] = this.newestIssueType;
29 | data['nextPageUrl'] = this.nextPageUrl;
30 | if (this.issueList != null) {
31 | data['issueList'] = this.issueList.map((v) => v.toJson()).toList();
32 | }
33 | return data;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/module/module_home/lib/module_home.dart:
--------------------------------------------------------------------------------
1 | library module_home;
2 |
--------------------------------------------------------------------------------
/module/module_home/lib/page/home_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:animations/animations.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:lib_ui/widget/appbar_widget.dart';
4 | import 'package:module_home/const/string.dart';
5 | import 'package:module_home/page/video_search_page.dart';
6 |
7 | import 'home_tab_page.dart';
8 |
9 | class HomePage extends StatefulWidget {
10 | @override
11 | _HomePageState createState() => _HomePageState();
12 | }
13 |
14 | class _HomePageState extends State
15 | with AutomaticKeepAliveClientMixin {
16 | @override
17 | Widget build(BuildContext context) {
18 | super.build(context);
19 | return Scaffold(
20 | backgroundColor: Colors.white,
21 | appBar: appBar(
22 | daily_paper,
23 | showBack: false,
24 | actions: [
25 | Padding(
26 | padding: EdgeInsets.only(right: 15),
27 | child: OpenContainer(
28 | closedElevation: 0.0,
29 | closedBuilder: (context, action) {
30 | return Icon(
31 | Icons.search,
32 | color: Colors.black87,
33 | );
34 | },
35 | openBuilder: (context, action) {
36 | return VideoSearchPage();
37 | }),
38 | )
39 | ],
40 | ),
41 | body: HomeTabPage());
42 | }
43 |
44 | @override
45 | bool get wantKeepAlive => true;
46 | }
47 |
--------------------------------------------------------------------------------
/module/module_home/lib/plugin/speech_plugin.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/services.dart';
2 |
3 | class SpeechPlugin {
4 | //定义与Native进行交互的MethodChannel,Android与Ios通用
5 | static const MethodChannel _methodChannel = MethodChannel('speech_plugin');
6 |
7 | static Future start() async {
8 | return await _methodChannel.invokeMethod('start');
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/module/module_home/lib/viewmodel/home_page_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:lib_core/viewmodel/paging_list_model.dart';
2 | import 'package:module_common/model/common_item_model.dart';
3 | import 'package:module_home/const/api_service.dart';
4 | import 'package:module_home/model/issue_model.dart';
5 |
6 | class HomePageModel extends PagingListModel
- {
7 | List
- bannerList = [];
8 |
9 | @override
10 | IssueEntity getModel(Map json) => IssueEntity.fromJson(json);
11 |
12 | @override
13 | String getUrl() => URLs.feedUrl;
14 |
15 | @override
16 | void doRefreshDataProcess(List
- list) {
17 | doLoadMoreDataProcess(list);
18 | itemList.clear();
19 | itemList.add(Item()); //为Banner占位
20 | bannerList = list;
21 | }
22 |
23 | @override
24 | void doLoadMoreDataProcess(List
- list) {
25 | list.removeWhere((item) {
26 | return item.type == 'banner2';
27 | });
28 | }
29 |
30 | @override
31 | void doExtraAfterRefresh() async {
32 | await loadMore();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/module/module_home/lib/widget/banner_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_swiper/flutter_swiper.dart';
3 | import 'package:lib_image/lib_image.dart';
4 | import 'package:lib_navigator/lib_navigator.dart';
5 | import 'package:module_home/viewmodel/home_page_model.dart';
6 |
7 | class BannerWidget extends StatelessWidget {
8 | final HomePageModel model;
9 |
10 | const BannerWidget({Key key, this.model}) : super(key: key);
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | return Swiper(
15 | autoplay: true,
16 | itemBuilder: (BuildContext context, int index) {
17 | return Stack(
18 | children: [
19 | Container(
20 | decoration: BoxDecoration(
21 | image: DecorationImage(
22 | image: cachedNetworkImageProvider(
23 | model.bannerList[index].data.cover.feed),
24 | fit: BoxFit.cover)),
25 | ),
26 | Positioned(
27 | width: MediaQuery.of(context).size.width - 30,
28 | bottom: 0,
29 | child: Container(
30 | padding: EdgeInsets.fromLTRB(15, 10, 0, 10),
31 | decoration: BoxDecoration(color: Colors.black12),
32 | child: Text(model.bannerList[index].data.title,
33 | style: TextStyle(color: Colors.white, fontSize: 12))))
34 | ],
35 | );
36 | },
37 | onTap: (index) {
38 | toNamed("/detail", model.bannerList[index].data);
39 | },
40 | itemCount: model.bannerList?.length ?? 0,
41 | pagination: new SwiperPagination(
42 | alignment: Alignment.bottomRight,
43 | builder: DotSwiperPaginationBuilder(
44 | size: 8,
45 | activeSize: 8,
46 | activeColor: Colors.white,
47 | color: Colors.white24)));
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/module/module_home/lib/widget/search_video_widget_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_image/lib_image.dart';
3 | import 'package:lib_navigator/lib_navigator.dart';
4 | import 'package:lib_utils/date_util.dart';
5 | import 'package:module_common/model/common_item_model.dart';
6 |
7 | class SearchVideoWidgetItem extends StatelessWidget {
8 | final Item item;
9 |
10 | const SearchVideoWidgetItem({Key key, this.item}) : super(key: key);
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | return GestureDetector(
15 | onTap: () {
16 | toNamed('/detail', item.data);
17 | },
18 | child: Container(
19 | child: Stack(alignment: Alignment.center, children: [
20 | Hero(
21 | tag: '${item.data.id}${item.data.time}',
22 | child: cacheImage(
23 | item.data.cover.feed,
24 | width: double.infinity, //撑满整个屏幕
25 | height: 220,
26 | )),
27 | Positioned(
28 | child: Column(children: [
29 | Text(
30 | item.data.title,
31 | maxLines: 1,
32 | style: TextStyle(
33 | fontSize: 14,
34 | color: Colors.white,
35 | fontWeight: FontWeight.bold),
36 | ),
37 | Container(
38 | margin: EdgeInsets.only(top: 10),
39 | child: ClipRRect(
40 | borderRadius: BorderRadius.circular(5),
41 | child: Container(
42 | decoration: BoxDecoration(color: Colors.black54),
43 | padding: EdgeInsets.all(5),
44 | child: Text(
45 | formatDateMsByMS(item.data.duration * 1000),
46 | style: TextStyle(
47 | color: Colors.white,
48 | fontSize: 12,
49 | fontWeight: FontWeight.bold),
50 | ))),
51 | )
52 | ]))
53 | ])));
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/module/module_home/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: module_home
2 | description: 首页模块组件
3 | version: 0.0.1
4 | homepage:
5 |
6 | publish_to: 'none'
7 |
8 | environment:
9 | sdk: ">=2.7.0 <3.0.0"
10 | flutter: ">=1.17.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | lib_ui:
17 | path: ../../component/lib_ui
18 | lib_core:
19 | path: ../../component/lib_core
20 | lib_navigator:
21 | path: ../../component/lib_navigator
22 | module_common:
23 | path: ../module_common
24 |
25 | flutter_swiper: ^1.1.6
26 | animations: ^1.1.1
27 |
28 | dev_dependencies:
29 | flutter_test:
30 | sdk: flutter
31 |
32 | # For information on the generic Dart part of this file, see the
33 | # following page: https://dart.dev/tools/pub/pubspec
34 |
35 | # The following section is specific to Flutter.
36 | flutter:
37 |
38 | # To add assets to your package, add an assets section, like this:
39 | # assets:
40 | # - images/a_dot_burr.jpeg
41 | # - images/a_dot_ham.jpeg
42 | #
43 | # For details regarding assets in packages, see
44 | # https://flutter.dev/assets-and-images/#from-packages
45 | #
46 | # An image asset can refer to one or more resolution-specific "variants", see
47 | # https://flutter.dev/assets-and-images/#resolution-aware.
48 |
49 | # To add custom fonts to your package, add a fonts section here,
50 | # in this "flutter" section. Each entry in this list should have a
51 | # "family" key with the font family name, and a "fonts" key with a
52 | # list giving the asset and other descriptors for the font. For
53 | # example:
54 | # fonts:
55 | # - family: Schyler
56 | # fonts:
57 | # - asset: fonts/Schyler-Regular.ttf
58 | # - asset: fonts/Schyler-Italic.ttf
59 | # style: italic
60 | # - family: Trajan Pro
61 | # fonts:
62 | # - asset: fonts/TrajanPro.ttf
63 | # - asset: fonts/TrajanPro_Bold.ttf
64 | # weight: 700
65 | #
66 | # For details regarding fonts in packages, see
67 | # https://flutter.dev/custom-fonts/#from-packages
68 |
--------------------------------------------------------------------------------
/module/module_home/test/module_home_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 |
3 | void main() {
4 | test('adds one to input values', () {});
5 | }
6 |
--------------------------------------------------------------------------------
/module/module_hot/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/module/module_hot/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/module/module_hot/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/module/module_hot/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/module/module_hot/README.md:
--------------------------------------------------------------------------------
1 | # module_hot
2 |
3 | 热门模块组件
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/module/module_hot/lib/constant/api_service.dart:
--------------------------------------------------------------------------------
1 | import 'package:module_common/constant/http_constant.dart';
2 |
3 | class URLs {
4 | static String rankUrl = '${HttpConstant.baseUrl}v4/rankList';
5 | }
6 |
--------------------------------------------------------------------------------
/module/module_hot/lib/constant/string.dart:
--------------------------------------------------------------------------------
1 | const String popularity_list = '人气榜';
2 |
--------------------------------------------------------------------------------
/module/module_hot/lib/module_hot.dart:
--------------------------------------------------------------------------------
1 | library module_hot;
2 |
3 | /// A Calculator.
4 | class Calculator {
5 | /// Returns [value] plus 1.
6 | int addOne(int value) => value + 1;
7 | }
8 |
--------------------------------------------------------------------------------
/module/module_hot/lib/page/rank_list_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:lib_core/widget/provider_widget.dart';
3 | import 'package:lib_ui/widget/loading_container.dart';
4 | import 'package:module_common/widget/rank_widget_item.dart';
5 | import 'package:module_hot/viewmodel/rank_list_page_model.dart';
6 | import 'package:pull_to_refresh/pull_to_refresh.dart';
7 |
8 | class RankListPage extends StatefulWidget {
9 | final String apiUrl;
10 |
11 | const RankListPage({Key key, this.apiUrl}) : super(key: key);
12 |
13 | @override
14 | _RankListPageState createState() => _RankListPageState();
15 | }
16 |
17 | class _RankListPageState extends State
18 | with AutomaticKeepAliveClientMixin {
19 | @override
20 | Widget build(BuildContext context) {
21 | super.build(context);
22 | return ProviderWidget(
23 | model: RankListPageModel(),
24 | onModelInit: (model) {
25 | model.init(widget.apiUrl);
26 | model.loadData();
27 | },
28 | builder: (context, model, child) {
29 | return LoadingContainer(
30 | viewState: model.viewState,
31 | retry: model.retry,
32 | child: SmartRefresher(
33 | controller: model.refreshController,
34 | enablePullDown: true,
35 | onRefresh: model.loadData,
36 | child: ListView.separated(
37 | itemCount: model.itemList.length,
38 | itemBuilder: (context, index) {
39 | return RankWidgetItem(item: model.itemList[index]);
40 | },
41 | separatorBuilder: (context, index) {
42 | return Padding(
43 | padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
44 | child: Divider(height: 0.5));
45 | },
46 | )),
47 | );
48 | });
49 | }
50 |
51 | @override
52 | bool get wantKeepAlive => true; //设置页面缓存
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/module/module_hot/lib/viewmodel/rank_list_page_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:lib_core/viewmodel/base_change_notifier_model.dart';
2 | import 'package:lib_net/http_manager.dart';
3 | import 'package:lib_ui/widget/loading_container.dart';
4 | import 'package:lib_utils/toast_util.dart';
5 | import 'package:module_common/model/common_item_model.dart';
6 | import 'package:pull_to_refresh/pull_to_refresh.dart';
7 |
8 | class RankListPageModel extends BaseChangeNotifierModel {
9 | List
- itemList = [];
10 | String apiUrl;
11 | RefreshController refreshController =
12 | RefreshController(initialRefresh: false);
13 |
14 | void init(String apiUrl) {
15 | this.apiUrl = apiUrl;
16 | }
17 |
18 | void loadData() {
19 | HttpManager.getData(apiUrl,
20 | success: (result) {
21 | Issue issueModel = Issue.fromJson(result);
22 | itemList = issueModel.itemList;
23 | viewState = ViewState.content;
24 | refreshController.refreshCompleted();
25 | },
26 | fail: (e) {
27 | showError(e.toString());
28 | refreshController.refreshFailed();
29 | viewState = ViewState.error;
30 | },
31 | complete: () => notifyListeners());
32 | }
33 |
34 | retry() {
35 | viewState = ViewState.loading;
36 | notifyListeners();
37 | loadData();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/module/module_hot/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: module_hot
2 | description: 热门模块组件
3 | version: 0.0.1
4 | homepage:
5 |
6 | publish_to: 'none'
7 |
8 | environment:
9 | sdk: ">=2.7.0 <3.0.0"
10 | flutter: ">=1.17.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | lib_ui:
17 | path: ../../component/lib_ui
18 | lib_net:
19 | path: ../../component/lib_net
20 | lib_core:
21 | path: ../../component/lib_core
22 | lib_utils:
23 | path: ../../component/lib_utils
24 | module_common:
25 | path: ../module_common
26 |
27 | dev_dependencies:
28 | flutter_test:
29 | sdk: flutter
30 |
31 | # For information on the generic Dart part of this file, see the
32 | # following page: https://dart.dev/tools/pub/pubspec
33 |
34 | # The following section is specific to Flutter.
35 | flutter:
36 |
37 | # To add assets to your package, add an assets section, like this:
38 | # assets:
39 | # - images/a_dot_burr.jpeg
40 | # - images/a_dot_ham.jpeg
41 | #
42 | # For details regarding assets in packages, see
43 | # https://flutter.dev/assets-and-images/#from-packages
44 | #
45 | # An image asset can refer to one or more resolution-specific "variants", see
46 | # https://flutter.dev/assets-and-images/#resolution-aware.
47 |
48 | # To add custom fonts to your package, add a fonts section here,
49 | # in this "flutter" section. Each entry in this list should have a
50 | # "family" key with the font family name, and a "fonts" key with a
51 | # list giving the asset and other descriptors for the font. For
52 | # example:
53 | # fonts:
54 | # - family: Schyler
55 | # fonts:
56 | # - asset: fonts/Schyler-Regular.ttf
57 | # - asset: fonts/Schyler-Italic.ttf
58 | # style: italic
59 | # - family: Trajan Pro
60 | # fonts:
61 | # - asset: fonts/TrajanPro.ttf
62 | # - asset: fonts/TrajanPro_Bold.ttf
63 | # weight: 700
64 | #
65 | # For details regarding fonts in packages, see
66 | # https://flutter.dev/custom-fonts/#from-packages
67 |
--------------------------------------------------------------------------------
/module/module_hot/test/module_hot_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 |
3 | import 'package:module_hot/module_hot.dart';
4 |
5 | void main() {
6 | test('adds one to input values', () {
7 | final calculator = Calculator();
8 | expect(calculator.addOne(2), 3);
9 | expect(calculator.addOne(-7), -6);
10 | expect(calculator.addOne(0), 1);
11 | });
12 | }
13 |
--------------------------------------------------------------------------------
/module/module_person/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/module/module_person/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/module/module_person/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/module/module_person/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/module/module_person/README.md:
--------------------------------------------------------------------------------
1 | # module_person
2 |
3 | 个人模块组件
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/module/module_person/images/ic_img_avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/module/module_person/images/ic_img_avatar.png
--------------------------------------------------------------------------------
/module/module_person/images/ic_no_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/module/module_person/images/ic_no_data.png
--------------------------------------------------------------------------------
/module/module_person/images/icon_comment_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/module/module_person/images/icon_comment_grey.png
--------------------------------------------------------------------------------
/module/module_person/images/icon_like_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fmtjava/Flutter_Eyepetizer/aca086f70a1707ff7c4020ac723f0d7dc00bd897/module/module_person/images/icon_like_grey.png
--------------------------------------------------------------------------------
/module/module_person/lib/constant/string.dart:
--------------------------------------------------------------------------------
1 | const String watch_history = '观看记录';
2 |
--------------------------------------------------------------------------------
/module/module_person/lib/module_person.dart:
--------------------------------------------------------------------------------
1 | library module_person;
2 |
3 | /// A Calculator.
4 | class Calculator {
5 | /// Returns [value] plus 1.
6 | int addOne(int value) => value + 1;
7 | }
8 |
--------------------------------------------------------------------------------
/module/module_person/lib/repository/mine_repository.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:lib_cache/cache_manager.dart';
4 |
5 | class MineRepository {
6 | static const String user_avatar_path = "user_avatar_path";
7 |
8 | static String getAvatarPath() {
9 | return CacheManager.getInstance().get(user_avatar_path);
10 | }
11 |
12 | static saveAvatarPath(File file) async {
13 | CacheManager.getInstance().set(user_avatar_path, file.path);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/module/module_person/lib/viewmodel/watch_history_page_model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:lib_core/viewmodel/base_change_notifier_model.dart';
4 | import 'package:module_common/model/common_item_model.dart';
5 | import 'package:module_common/repository/history_repository.dart';
6 |
7 | class WatchHistoryPageModel extends BaseChangeNotifierModel {
8 | List itemList = [];
9 | List watchList = [];
10 |
11 | void loadData() {
12 | watchList = HistoryRepository.loadHistoryData();
13 | if (watchList != null) {
14 | var list = watchList.map((value) {
15 | return Data.fromJson(json.decode(value));
16 | }).toList();
17 | itemList = list;
18 | notifyListeners();
19 | }
20 | }
21 |
22 | void remove(int index) {
23 | watchList.removeAt(index);
24 | HistoryRepository.saveHistoryData(watchList);
25 | loadData();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/module/module_person/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: module_person
2 | description: 个人模块组件
3 | version: 0.0.1
4 | homepage:
5 |
6 | publish_to: 'none'
7 |
8 | environment:
9 | sdk: ">=2.7.0 <3.0.0"
10 | flutter: ">=1.17.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 |
16 | lib_ui:
17 | path: ../../component/lib_ui
18 | lib_utils:
19 | path: ../../component/lib_utils
20 | lib_cache:
21 | path: ../../component/lib_cache
22 | lib_navigator:
23 | path: ../../component/lib_navigator
24 | module_common:
25 | path: ../module_common
26 |
27 | image_picker: ^0.7.2+1
28 | flutter_slidable: ^0.5.4
29 | provider: ^5.0.0
30 |
31 |
32 | dev_dependencies:
33 | flutter_test:
34 | sdk: flutter
35 |
36 | # For information on the generic Dart part of this file, see the
37 | # following page: https://dart.dev/tools/pub/pubspec
38 |
39 | # The following section is specific to Flutter.
40 | flutter:
41 |
42 | # To add assets to your package, add an assets section, like this:
43 | assets:
44 | - images/
45 | # - images/a_dot_ham.jpeg
46 | #
47 | # For details regarding assets in packages, see
48 | # https://flutter.dev/assets-and-images/#from-packages
49 | #
50 | # An image asset can refer to one or more resolution-specific "variants", see
51 | # https://flutter.dev/assets-and-images/#resolution-aware.
52 |
53 | # To add custom fonts to your package, add a fonts section here,
54 | # in this "flutter" section. Each entry in this list should have a
55 | # "family" key with the font family name, and a "fonts" key with a
56 | # list giving the asset and other descriptors for the font. For
57 | # example:
58 | # fonts:
59 | # - family: Schyler
60 | # fonts:
61 | # - asset: fonts/Schyler-Regular.ttf
62 | # - asset: fonts/Schyler-Italic.ttf
63 | # style: italic
64 | # - family: Trajan Pro
65 | # fonts:
66 | # - asset: fonts/TrajanPro.ttf
67 | # - asset: fonts/TrajanPro_Bold.ttf
68 | # weight: 700
69 | #
70 | # For details regarding fonts in packages, see
71 | # https://flutter.dev/custom-fonts/#from-packages
72 |
--------------------------------------------------------------------------------
/module/module_person/test/module_person_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 |
3 | import 'package:module_person/module_person.dart';
4 |
5 | void main() {
6 | test('adds one to input values', () {
7 | final calculator = Calculator();
8 | expect(calculator.addOne(2), 3);
9 | expect(calculator.addOne(-7), -6);
10 | expect(calculator.addOne(0), 1);
11 | });
12 | }
13 |
--------------------------------------------------------------------------------
/note:
--------------------------------------------------------------------------------
1 | flutter build apk --target-platform=android-arm64 --no-shrink
2 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:flutter_eyepetizer/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(App());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------