├── .gitignore
├── .metadata
├── README.md
├── android
├── app
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── judou
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── drawable
│ │ └── launch_background.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
├── author_sub.jpg
├── avatar_placeholder.png
├── descovery.png
├── detail_page.jpg
├── discovery_dis.jpg
├── discovery_recommand.jpg
├── discovery_subscribe.jpg
├── home.png
├── index_page.jpg
├── judou.png
├── topics.jpg
├── user_collections.jpg
└── user_sentences.jpg
├── fonts
├── Apple-LiSung-Light.ttf
└── PingFang-SC-Regular.ttf
├── ios
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-60.png
│ │ ├── Icon-60@2x.png
│ │ ├── Icon-60@3x.png
│ │ ├── Icon-76.png
│ │ ├── Icon-76@2x.png
│ │ ├── Icon-Small-1.png
│ │ ├── Icon-Small.png
│ │ ├── Icon-Small@2x-1.png
│ │ ├── Icon-Small@2x.png
│ │ ├── Icon-Small@3x.png
│ │ ├── Icon-Spotlight-40.png
│ │ ├── Icon-Spotlight-40@2x-1.png
│ │ ├── Icon-Spotlight-40@2x.png
│ │ ├── Icon-Spotlight-40@3x.png
│ │ ├── Icon-Spotlight-41.png
│ │ ├── Icon-Spotlight-42.png
│ │ ├── Icon-Spotlight-43.png
│ │ └── Icon-iPadPro@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── JudouTestPlugin.h
│ ├── JudouTestPlugin.m
│ └── main.m
├── json
└── daily.json
├── lib
├── bloc_provider.dart
├── discovery
│ ├── BLoc
│ │ ├── discovery_bloc.dart
│ │ ├── recommand_bloc.dart
│ │ └── subscribe_bloc.dart
│ ├── models
│ │ ├── carousel_model.dart
│ │ ├── jotting_model.dart
│ │ ├── post_model.dart
│ │ ├── subject_model.dart
│ │ ├── tabs_model.dart
│ │ ├── topic_model.dart
│ │ └── video_model.dart
│ ├── pages
│ │ ├── discovery_page.dart
│ │ └── include_page.dart
│ └── widget
│ │ ├── discovery_card.dart
│ │ ├── discovery_widget.dart
│ │ ├── recommand_cell.dart
│ │ ├── recommand_widget.dart
│ │ ├── subscribe_widget.dart
│ │ └── topic_header.dart
├── index
│ ├── BLoc
│ │ ├── detail_bloc.dart
│ │ └── index_bloc.dart
│ ├── models
│ │ ├── author_model.dart
│ │ ├── comment_model.dart
│ │ ├── image_model.dart
│ │ ├── judou_model.dart
│ │ ├── tag_model.dart
│ │ └── user_model.dart
│ ├── pages
│ │ ├── detail_page.dart
│ │ └── index_page.dart
│ └── widgets
│ │ ├── detail_label.dart
│ │ ├── index_item.dart
│ │ └── vertical_text.dart
├── main.dart
├── main_page.dart
├── network
│ ├── network.dart
│ ├── path.dart
│ └── request.dart
├── profile
│ ├── Bloc
│ │ └── profile_detail_bloc.dart
│ ├── models
│ │ └── collections_model.dart
│ ├── pages
│ │ ├── message_page.dart
│ │ ├── profile_detail.dart
│ │ ├── profile_page.dart
│ │ └── subscribes_page.dart
│ └── widgets
│ │ ├── list_cell.dart
│ │ ├── normal_header.dart
│ │ ├── subscribes_cell.dart
│ │ └── verify_header.dart
├── utils
│ ├── color_util.dart
│ ├── date_util.dart
│ └── ui_util.dart
└── widgets
│ ├── SliverAppBarDelegate.dart
│ ├── blank.dart
│ ├── button_subscript.dart
│ ├── collection_cell.dart
│ ├── comment_cell.dart
│ ├── end_cell.dart
│ ├── image_preview.dart
│ ├── jottings_cell.dart
│ ├── judou_cell.dart
│ ├── label.dart
│ ├── loading.dart
│ ├── radius_image.dart
│ └── user_info_tile.dart
├── pubspec.yaml
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.lock
4 | *.log
5 | *.pyc
6 | *.swp
7 | .DS_Store
8 | .atom/
9 | .buildlog/
10 | .history
11 | .svn/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # Visual Studio Code related
20 | .vscode/
21 |
22 | # Flutter/Dart/Pub related
23 | **/doc/api/
24 | .dart_tool/
25 | .flutter-plugins
26 | .packages
27 | .pub-cache/
28 | .pub/
29 | build/
30 |
31 | # Android related
32 | **/android/**/gradle-wrapper.jar
33 | **/android/.gradle
34 | **/android/captures/
35 | **/android/gradlew
36 | **/android/gradlew.bat
37 | **/android/local.properties
38 | **/android/**/GeneratedPluginRegistrant.java
39 |
40 | # iOS/XCode related
41 | **/ios/**/*.mode1v3
42 | **/ios/**/*.mode2v3
43 | **/ios/**/*.moved-aside
44 | **/ios/**/*.pbxuser
45 | **/ios/**/*.perspectivev3
46 | **/ios/**/*sync/
47 | **/ios/**/.sconsign.dblite
48 | **/ios/**/.tags*
49 | **/ios/**/.vagrant/
50 | **/ios/**/DerivedData/
51 | **/ios/**/Icon?
52 | **/ios/**/Pods/
53 | **/ios/**/.symlinks/
54 | **/ios/**/profile
55 | **/ios/**/xcuserdata
56 | **/ios/.generated/
57 | **/ios/Flutter/App.framework
58 | **/ios/Flutter/Flutter.framework
59 | **/ios/Flutter/Generated.xcconfig
60 | **/ios/Flutter/app.flx
61 | **/ios/Flutter/app.zip
62 | **/ios/Flutter/flutter_assets/
63 | **/ios/ServiceDefinitions.json
64 | **/ios/Runner/GeneratedPluginRegistrant.*
65 |
66 | # Exceptions to above rules.
67 | !**/ios/**/default.mode1v3
68 | !**/ios/**/default.mode2v3
69 | !**/ios/**/default.pbxuser
70 | !**/ios/**/default.perspectivev3
71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
72 |
--------------------------------------------------------------------------------
/.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: 5391447fae6209bb21a89e6a5a6583cac1af9b4b
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | ## JuDou
13 |
14 | Judou is my favorite app,so I implemented it in flutter
15 |
16 | ## UI
17 |
18 | |  |  |  |  |
19 | | :--: | :--: | :--: | :--: |
20 | | 首页 | 详情 | 订阅 | 发现 |
21 |
22 | |  |  |  |  |
23 | | :--: | :--: | :--: | :--: |
24 | | 订阅作者 | 用户句子 | 用户收藏 | 话题 |
25 |
26 | ## Getting Started
27 |
28 | This project is a starting point for a Flutter application.
29 |
30 | A few resources to get you started if this is your first Flutter project:
31 |
32 | - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab)
33 | - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook)
34 |
35 | For help getting started with Flutter, view our
36 | [online documentation](https://flutter.io/docs), which offers tutorials,
37 | samples, guidance on mobile development, and a full API reference.
38 |
39 | ## BLoc Architecture
40 |
41 | Fully implemented using the BLoc architecture,
42 | If you are not familiar with BLoc, the following resources can help you.
43 |
44 | - [Architect your Flutter project using BLOC pattern](https://medium.com/flutterpub/architecting-your-flutter-project-bd04e144a8f1)
45 | - [Reactive Programming - Streams - BLoC](https://www.didierboelens.com/2018/08/reactive-programming---streams---bloc/)
46 | - [Technical Debt and Streams/BLoC](https://www.youtube.com/watch?v=fahC3ky_zW0)🎬
47 | - [Flutter / AngularDart – Code sharing, better together](https://www.youtube.com/watch?v=PLHln7wHgPE)🎬
48 |
49 | ## Desktop
50 |
51 | Currently only supports macOS
52 |
53 | Open FeatherApp.xcodeproj file with Xcode, then cmd + R
54 |
55 | ## Thanks
56 |
57 | - [RxDart](https://github.com/ReactiveX/rxdart)
58 | - [RxCommand](https://github.com/fluttercommunity/rx_command)
59 | - [Dio](https://github.com/flutterchina/dio)
60 | - [flutter_page_transition](https://github.com/kalismeras61/flutter_page_transition)
61 |
62 | ## License
63 |
64 | MIT License
65 |
66 | Copyright (c) 2018 CrazyCoderShi
67 |
68 | Permission is hereby granted, free of charge, to any person obtaining a copy
69 | of this software and associated documentation files (the "Software"), to deal
70 | in the Software without restriction, including without limitation the rights
71 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
72 | copies of the Software, and to permit persons to whom the Software is
73 | furnished to do so, subject to the following conditions:
74 |
75 | The above copyright notice and this permission notice shall be included in all
76 | copies or substantial portions of the Software.
77 |
78 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
79 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
80 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
81 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
82 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
83 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
84 | SOFTWARE.
85 |
--------------------------------------------------------------------------------
/android/app/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 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 27
29 |
30 | lintOptions {
31 | disable 'InvalidPackage'
32 | }
33 |
34 | defaultConfig {
35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36 | applicationId "com.example.judou"
37 | minSdkVersion 16
38 | targetSdkVersion 27
39 | versionCode flutterVersionCode.toInteger()
40 | versionName flutterVersionName
41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
42 | }
43 |
44 | buildTypes {
45 | release {
46 | // TODO: Add your own signing config for the release build.
47 | // Signing with the debug keys for now, so `flutter run --release` works.
48 | signingConfig signingConfigs.debug
49 | }
50 | }
51 | }
52 |
53 | flutter {
54 | source '../..'
55 | }
56 |
57 | dependencies {
58 | testImplementation 'junit:junit:4.12'
59 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
61 | }
62 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
19 |
26 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/example/judou/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.judou;
2 |
3 | import android.os.Bundle;
4 | import io.flutter.app.FlutterActivity;
5 | import io.flutter.plugins.GeneratedPluginRegistrant;
6 |
7 | public class MainActivity extends FlutterActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | GeneratedPluginRegistrant.registerWith(this);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.2.1'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
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-4.6-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
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 |
--------------------------------------------------------------------------------
/assets/author_sub.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/author_sub.jpg
--------------------------------------------------------------------------------
/assets/avatar_placeholder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/avatar_placeholder.png
--------------------------------------------------------------------------------
/assets/descovery.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/descovery.png
--------------------------------------------------------------------------------
/assets/detail_page.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/detail_page.jpg
--------------------------------------------------------------------------------
/assets/discovery_dis.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/discovery_dis.jpg
--------------------------------------------------------------------------------
/assets/discovery_recommand.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/discovery_recommand.jpg
--------------------------------------------------------------------------------
/assets/discovery_subscribe.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/discovery_subscribe.jpg
--------------------------------------------------------------------------------
/assets/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/home.png
--------------------------------------------------------------------------------
/assets/index_page.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/index_page.jpg
--------------------------------------------------------------------------------
/assets/judou.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/judou.png
--------------------------------------------------------------------------------
/assets/topics.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/topics.jpg
--------------------------------------------------------------------------------
/assets/user_collections.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/user_collections.jpg
--------------------------------------------------------------------------------
/assets/user_sentences.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/assets/user_sentences.jpg
--------------------------------------------------------------------------------
/fonts/Apple-LiSung-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/fonts/Apple-LiSung-Light.ttf
--------------------------------------------------------------------------------
/fonts/PingFang-SC-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/fonts/PingFang-SC-Regular.ttf
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
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 | 8.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/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.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 parse_KV_file(file, separator='=')
14 | file_abs_path = File.expand_path(file)
15 | if !File.exists? file_abs_path
16 | return [];
17 | end
18 | pods_ary = []
19 | skip_line_start_symbols = ["#", "/"]
20 | File.foreach(file_abs_path) { |line|
21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22 | plugin = line.split(pattern=separator)
23 | if plugin.length == 2
24 | podname = plugin[0].strip()
25 | path = plugin[1].strip()
26 | podpath = File.expand_path("#{path}", file_abs_path)
27 | pods_ary.push({:name => podname, :path => podpath});
28 | else
29 | puts "Invalid plugin specification: #{line}"
30 | end
31 | }
32 | return pods_ary
33 | end
34 |
35 | target 'Runner' do
36 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
37 | # referring to absolute paths on developers' machines.
38 | system('rm -rf .symlinks')
39 | system('mkdir -p .symlinks/plugins')
40 |
41 | # Flutter Pods
42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
43 | if generated_xcode_build_settings.empty?
44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
45 | end
46 | generated_xcode_build_settings.map { |p|
47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
48 | symlink = File.join('.symlinks', 'flutter')
49 | File.symlink(File.dirname(p[:path]), symlink)
50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
51 | end
52 | }
53 |
54 | # Plugin Pods
55 | plugin_pods = parse_KV_file('../.flutter-plugins')
56 | plugin_pods.map { |p|
57 | symlink = File.join('.symlinks', 'plugins', p[:name])
58 | File.symlink(p[:path], symlink)
59 | pod p[:name], :path => File.join(symlink, 'ios')
60 | }
61 | end
62 |
63 | post_install do |installer|
64 | installer.pods_project.targets.each do |target|
65 | target.build_configurations.each do |config|
66 | config.build_settings['ENABLE_BITCODE'] = 'NO'
67 | end
68 | end
69 | end
70 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/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.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildSystemType
6 | Original
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 | #include
4 |
5 | @implementation AppDelegate
6 |
7 | - (BOOL)application:(UIApplication *)application
8 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
9 | [GeneratedPluginRegistrant registerWithRegistry:self];
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-Spotlight-40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-Small-1.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-Small@2x-1.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-Small@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-Spotlight-40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-Spotlight-40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-Spotlight-43.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-Spotlight-42.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-Small.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-Small@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-Spotlight-41.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-Spotlight-40@2x-1.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-76.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-iPadPro@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "idiom" : "ios-marketing",
113 | "size" : "1024x1024",
114 | "scale" : "1x"
115 | }
116 | ],
117 | "info" : {
118 | "version" : 1,
119 | "author" : "xcode"
120 | }
121 | }
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small-1.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x-1.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-41.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-42.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-43.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png
--------------------------------------------------------------------------------
/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/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyCoderShi/judou/7a00e1e30c3cb3f87f8c7fd6cc4b545b6c902742/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/Base.lproj/LaunchScreen.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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/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 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | 句读
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | judou
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/JudouTestPlugin.h:
--------------------------------------------------------------------------------
1 | //
2 | // JudouTestPlugin.h
3 | // Runner
4 | //
5 | // Created by 天南 on 2019/2/18.
6 | // Copyright © 2019 The Chromium Authors. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface JudouTestPlugin : NSObject
15 |
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 |
--------------------------------------------------------------------------------
/ios/Runner/JudouTestPlugin.m:
--------------------------------------------------------------------------------
1 | //
2 | // JudouTestPlugin.m
3 | // Runner
4 | //
5 | // Created by 天南 on 2019/2/18.
6 | // Copyright © 2019 The Chromium Authors. All rights reserved.
7 | //
8 |
9 | #import "JudouTestPlugin.h"
10 |
11 | @implementation JudouTestPlugin
12 |
13 | + (void)registerWithRegistrar:(NSObject *)registrar {
14 | FlutterMethodChannel *channel = [FlutterMethodChannel methodChannelWithName:@"judou.test" binaryMessenger:registrar.messenger];
15 | [channel setMethodCallHandler:^(FlutterMethodCall * _Nonnull call, FlutterResult _Nonnull result) {
16 | if ([call.method isEqualToString:@"getString"]) {
17 | result([self getString]);
18 | } else {
19 | result(FlutterMethodNotImplemented);
20 | }
21 | }];
22 | }
23 |
24 | + (NSString *)getString {
25 | NSLog(@"调用回来之前...");
26 | return @"我回来了...";
27 | }
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/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/bloc_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 |
3 | abstract class BlocBase {
4 | void dispose();
5 | }
6 |
7 | // Generic BLoC provider
8 | class BlocProvider extends StatefulWidget {
9 | BlocProvider({
10 | Key key,
11 | @required this.child,
12 | @required this.bloc,
13 | }) : super(key: key);
14 |
15 | final T bloc;
16 | final Widget child;
17 |
18 | @override
19 | _BlocProviderState createState() => _BlocProviderState();
20 |
21 | static T of(BuildContext context) {
22 | final type = _typeOf>();
23 | BlocProvider provider = context.ancestorWidgetOfExactType(type);
24 | return provider.bloc;
25 | }
26 |
27 | static Type _typeOf() => T;
28 | }
29 |
30 | class _BlocProviderState extends State> {
31 | @override
32 | void dispose() {
33 | widget.bloc.dispose();
34 | super.dispose();
35 | }
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return widget.child;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/discovery/BLoc/discovery_bloc.dart:
--------------------------------------------------------------------------------
1 | import '../models/topic_model.dart';
2 | import '../../network/network.dart';
3 | import '../../index/models/tag_model.dart';
4 | import '../../index/models/judou_model.dart';
5 | import 'dart:async';
6 |
7 | class DiscoveryBloc implements BlocBase {
8 | final _discoverySubject = PublishSubject