├── .github └── workflows │ ├── flutter.yml │ └── tag.yml ├── .metadata ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .project ├── .settings │ └── org.eclipse.buildship.core.prefs ├── android.iml ├── app │ ├── .classpath │ ├── .project │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── app.iml │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── jiangkang │ │ │ │ └── flutter_system │ │ │ │ ├── DemoNativeView.kt │ │ │ │ ├── LottieSplashScreen.kt │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ ├── ic_launcher.png │ │ │ ├── launch_background.xml │ │ │ └── splash_screen.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 │ │ │ ├── raw │ │ │ ├── lottie1.json │ │ │ ├── lottie2.json │ │ │ ├── lottie3.json │ │ │ ├── lottie4.json │ │ │ ├── lottie5.json │ │ │ ├── lottie6.json │ │ │ ├── lottie7.json │ │ │ └── lottie8.json │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── flutter_system.iml ├── flutter_system_android.iml ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── emojis │ ├── angry_face.png │ ├── circle_face.png │ └── smile_face.png ├── fonts │ └── FangZhengFangSongJianTi.ttf ├── json │ ├── articles.json │ ├── basic.json │ ├── components.json │ ├── demos.json │ ├── month_traditional.json │ ├── pages.json │ └── youqi.json └── video │ └── butterfly.mp4 ├── best_toast ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── lib │ └── best_toast.dart ├── pubspec.lock └── pubspec.yaml ├── build.yaml ├── captures ├── demos │ ├── gridview_count_3.png │ ├── gridview_count_aspect_ratio.png │ ├── gridview_count_axis.png │ └── gridview_count_basic.png ├── home_demo.png ├── home_demo_dark.png ├── packages │ └── IconFont.png ├── page │ ├── calendar.png │ ├── custompaint.png │ └── guide.gif └── products │ ├── xiyou.png │ └── youqi.png ├── dartdoc_options.yaml ├── doc ├── component.md ├── demo.md ├── index.md └── page.md ├── flutter_system.iml ├── images ├── banner.jpg ├── github.png ├── home_bar_scan.png ├── landscape0.jpeg ├── landscape1.jpeg ├── landscape2.jpeg └── loading.gif ├── ios ├── Flutter │ ├── .last_build_id │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── flutter_export_environment.sh ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.swift │ ├── 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 │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── kicons ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── fonts │ ├── aliyun.ttf │ └── emoji.ttf ├── lib │ ├── kicons.dart │ └── src │ │ ├── aliyun.dart │ │ └── emoji.dart ├── pubspec.lock ├── pubspec.yaml └── test │ └── kicons_test.dart ├── lib ├── api │ ├── api_demo.dart │ └── api_placeholder_demo.dart ├── common │ ├── global_model.dart │ ├── model_binding.dart │ └── res_constants.dart ├── component │ ├── animations │ │ └── slide_down_to_close_page.dart │ ├── calendar.dart │ ├── case0.dart │ ├── component_appbar.dart │ ├── component_pickers.dart │ ├── component_share.dart │ ├── componet_topbanner.dart │ ├── dialogs.dart │ ├── dynamic_ui_page.dart │ ├── iconfont.dart │ ├── listview_item.dart │ ├── my_tab_indicator.dart │ ├── password.dart │ └── toast_demo.dart ├── constants │ └── const_key_value.dart ├── date │ ├── lunar.dart │ ├── lunar_solar_converter.dart │ └── solar.dart ├── demos │ ├── animation │ │ ├── anim_animated_container.dart │ │ ├── demo_native_view.dart │ │ └── demo_transform.dart │ ├── demo_animation.dart │ ├── demo_assets.dart │ ├── demo_bottom_sheet.dart │ ├── demo_button.dart │ ├── demo_camera.dart │ ├── demo_chip.dart │ ├── demo_container.dart │ ├── demo_custom_paint.dart │ ├── demo_custom_scrollview.dart │ ├── demo_dismissible.dart │ ├── demo_drawer.dart │ ├── demo_fitted_box.dart │ ├── demo_forms.dart │ ├── demo_gridview.dart │ ├── demo_http.dart │ ├── demo_image.dart │ ├── demo_key.dart │ ├── demo_list_wheel_scrollview.dart │ ├── demo_listview.dart │ ├── demo_navigator.dart │ ├── demo_pageview.dart │ ├── demo_platform.dart │ ├── demo_progress_indicator.dart │ ├── demo_read_write_files.dart │ ├── demo_real_list.dart │ ├── demo_rendering.dart │ ├── demo_safearea.dart │ ├── demo_scrollable.dart │ ├── demo_slider.dart │ ├── demo_sqlite.dart │ ├── demo_tabs.dart │ ├── demo_text.dart │ ├── demo_textfield.dart │ ├── demo_time.dart │ ├── demo_video.dart │ ├── demo_websocket.dart │ ├── demos.dart │ ├── editable │ │ └── rich_editable_text.dart │ └── image │ │ └── demo_gif_image.dart ├── entries.dart ├── frouter │ ├── router.dart │ ├── router_builder.dart │ └── router_generator.dart ├── home.dart ├── main.dart ├── model │ └── model_entry.dart ├── page │ ├── guide.dart │ ├── page_calendar.dart │ ├── page_entry.dart │ ├── page_markdown.dart │ ├── page_password.dart │ ├── page_settings.dart │ ├── page_show0.dart │ └── web_page.dart ├── page_routers.dart ├── platform │ └── toast.dart ├── products │ ├── clocks │ │ ├── clock_list_page.dart │ │ └── particles │ │ │ └── clock_face_painter.dart │ ├── todo │ │ ├── todo_api.dart │ │ ├── todo_list.dart │ │ └── todo_model.dart │ ├── xiyou │ │ ├── xiyou_home.dart │ │ └── xiyou_my.dart │ └── youqi │ │ ├── api_youqi.dart │ │ ├── widgets │ │ ├── date_box_painter.dart │ │ ├── youqi_content_page.dart │ │ └── youqi_top_header.dart │ │ ├── youqi_home_page.dart │ │ └── youqi_model.dart ├── senior │ ├── edit_text_page.dart │ └── rich_text_page.dart ├── storage │ └── storage_assets.dart ├── theme │ └── custom_themes.dart ├── try │ ├── README.md │ └── animation │ │ ├── anim_basic.dart │ │ ├── anim_builder.dart │ │ ├── anim_container.dart │ │ ├── anim_hero_std.dart │ │ ├── anim_physics.dart │ │ ├── anim_two.dart │ │ ├── anim_widget.dart │ │ └── demo_fade_in.dart ├── utils │ ├── app_utils.dart │ ├── asset_utils.dart │ ├── color_utils.dart │ ├── db_utils.dart │ ├── nav_utils.dart │ ├── pickers_utils.dart │ ├── share_utils.dart │ ├── sp_utils.dart │ ├── time_utils.dart │ └── ui_utils.dart └── widgets │ ├── gif_image.dart │ ├── keyboard_detector.dart │ └── route_builder.dart ├── pubspec.lock ├── pubspec.yaml ├── res └── values │ ├── strings_en.arb │ └── strings_zh.arb ├── test.sh ├── travis_script.sh ├── web └── index.html └── webapp ├── .gitignore ├── .metadata ├── README.md ├── android ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── webapp │ │ │ │ └── MainActivity.kt │ │ └── 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 │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.swift │ ├── 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 │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib └── main.dart ├── pubspec.lock ├── pubspec.yaml └── web └── index.html /.github/workflows/flutter.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: Setup Java JDK 11 | uses: actions/setup-java@v1.3.0 12 | with: 13 | java-version: '12.x' 14 | - uses: subosito/flutter-action@v1 15 | with: 16 | channel: 'stable' # or: 'dev' or 'beta' 17 | - run: flutter doctor 18 | - run: flutter pub get 19 | - run: flutter build apk --debug 20 | 21 | -------------------------------------------------------------------------------- /.github/workflows/tag.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | push: 5 | tags: 6 | - v* 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - name: Setup Java JDK 14 | uses: actions/setup-java@v1.3.0 15 | with: 16 | java-version: '12.x' 17 | - uses: subosito/flutter-action@v1 18 | with: 19 | channel: 'stable' # or: 'dev' or 'beta' 20 | - run: flutter doctor 21 | - run: flutter pub get 22 | - run: flutter build apk --debug 23 | - name: Release apk 24 | uses: ncipollo/release-action@v1.5.0 25 | with: 26 | artifacts: "build/app/outputs/apk/debug/*.apk" 27 | token: ${{ secrets.FLUTTER_CI }} -------------------------------------------------------------------------------- /.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: 8661d8aecd626f7f57ccbcb735553edc05a2e713 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 姜康 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter-system 2 | 3 | Flutter相关Demo -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | #所有规则: https://dart-lang.github.io/linter/lints/index.html 2 | 3 | include: package:flutter_lints/flutter.yaml 4 | 5 | analyzer: 6 | exclude: [build/**] 7 | language: 8 | strict-raw-types: true 9 | 10 | linter: 11 | rules: 12 | cancel_subscriptions: true 13 | constant_identifier_names: false 14 | prefer_const_constructors: false 15 | non_constant_identifier_names: false 16 | library_private_types_in_public_api: false 17 | depend_on_referenced_packages: false 18 | implementation_imports: false -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir= 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /android/android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /android/app/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir=.. 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | ndkVersion "21.3.6528147" 30 | compileSdkVersion 32 31 | buildToolsVersion '30.0.3' 32 | 33 | lintOptions { 34 | disable 'InvalidPackage' 35 | checkReleaseBuilds false 36 | } 37 | 38 | sourceSets { 39 | main.java.srcDirs += 'src/main/kotlin' 40 | } 41 | 42 | defaultConfig { 43 | applicationId "com.jiangkang.flutter_system" 44 | minSdkVersion 21 45 | targetSdkVersion 30 46 | versionCode flutterVersionCode.toInteger() 47 | versionName flutterVersionName 48 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 49 | } 50 | 51 | buildTypes { 52 | release { 53 | // TODO: Add your own signing config for the release build. 54 | // Signing with the debug keys for now, so `flutter run --release` works. 55 | signingConfig signingConfigs.debug 56 | } 57 | } 58 | } 59 | 60 | flutter { 61 | source '../..' 62 | } 63 | 64 | dependencies { 65 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 66 | implementation "com.airbnb.android:lottie:$lottieVersion" 67 | testImplementation 'junit:junit:4.13' 68 | androidTestImplementation 'androidx.test:runner:1.2.0' 69 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 70 | } 71 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 18 | 19 | 20 | 24 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/jiangkang/flutter_system/DemoNativeView.kt: -------------------------------------------------------------------------------- 1 | package com.jiangkang.flutter_system 2 | 3 | import android.content.Context 4 | import android.graphics.Color 5 | import android.view.View 6 | import android.widget.TextView 7 | import io.flutter.plugin.common.StandardMessageCodec 8 | import io.flutter.plugin.platform.PlatformView 9 | import io.flutter.plugin.platform.PlatformViewFactory 10 | 11 | internal class DemoNativeView(context: Context, id: Int, creationParams: Map?) : PlatformView { 12 | 13 | private val textView: TextView = TextView(context) 14 | 15 | override fun getView(): View { 16 | return textView 17 | } 18 | 19 | override fun dispose() {} 20 | 21 | init { 22 | textView.textSize = 32f 23 | textView.setBackgroundColor(Color.rgb(255, 255, 255)) 24 | textView.text = "Rendered on a native Android view (id: $id)" 25 | } 26 | } 27 | 28 | internal class DemoNativeViewFactory : PlatformViewFactory(StandardMessageCodec.INSTANCE) { 29 | override fun create(context: Context, id: Int, args: Any?): PlatformView { 30 | val creationParams = args as Map? 31 | return DemoNativeView(context, id, creationParams) 32 | } 33 | } -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/jiangkang/flutter_system/LottieSplashScreen.kt: -------------------------------------------------------------------------------- 1 | package com.jiangkang.flutter_system 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import android.graphics.Color 6 | import android.graphics.drawable.ColorDrawable 7 | import android.os.Bundle 8 | import android.os.Handler 9 | import android.os.Looper 10 | import android.view.Gravity 11 | import android.view.View 12 | import android.view.ViewGroup 13 | import android.widget.FrameLayout 14 | import com.airbnb.lottie.LottieAnimationView 15 | import com.airbnb.lottie.LottieDrawable 16 | import io.flutter.embedding.android.SplashScreen 17 | import kotlin.random.Random 18 | 19 | /** 20 | * A Splash Screen based lottie animation 21 | * it will pause 1s,then enter the main page 22 | */ 23 | class LottieSplashScreen : SplashScreen{ 24 | 25 | private val lottieRawIds = arrayOf( 26 | R.raw.lottie1, 27 | R.raw.lottie2, 28 | R.raw.lottie3, 29 | R.raw.lottie4, 30 | R.raw.lottie5, 31 | R.raw.lottie6, 32 | R.raw.lottie7, 33 | R.raw.lottie8 34 | ) 35 | 36 | override fun createSplashView(context: Context, savedInstanceState: Bundle?): View? { 37 | val lottieView = LottieAnimationView(context) 38 | lottieView.apply { 39 | repeatMode = LottieDrawable.RESTART 40 | repeatCount = LottieDrawable.INFINITE 41 | setAnimation(lottieRawIds[Random(System.currentTimeMillis()).nextInt(0,lottieRawIds.size)]) 42 | }.playAnimation() 43 | (context as Activity).window.setBackgroundDrawable(ColorDrawable(Color.WHITE)) 44 | 45 | val layoutParamsLottie = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT) 46 | .apply { 47 | gravity = Gravity.CENTER 48 | } 49 | val rootView = FrameLayout(context) 50 | rootView.apply { 51 | layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT) 52 | setBackgroundColor(Color.WHITE) 53 | addView(lottieView,layoutParamsLottie) 54 | } 55 | return rootView 56 | } 57 | 58 | override fun transitionToFlutter(onTransitionComplete: Runnable) { 59 | Handler(Looper.getMainLooper()).postDelayed(onTransitionComplete,1000) 60 | } 61 | } -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/jiangkang/flutter_system/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.jiangkang.flutter_system 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | import io.flutter.embedding.android.SplashScreen 5 | import io.flutter.embedding.engine.FlutterEngine 6 | 7 | class MainActivity : FlutterActivity() { 8 | 9 | override fun provideSplashScreen(): SplashScreen? { 10 | return LottieSplashScreen() 11 | } 12 | 13 | override fun configureFlutterEngine(flutterEngine: FlutterEngine) { 14 | super.configureFlutterEngine(flutterEngine) 15 | flutterEngine 16 | .platformViewsController 17 | .registry 18 | .registerViewFactory("demo_native_view", 19 | DemoNativeViewFactory() 20 | ) 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/android/app/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.0' 3 | ext.lottieVersion = "3.4.1" 4 | repositories { 5 | google() 6 | jcenter() 7 | } 8 | 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:7.0.3' 11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | tasks.register("clean", Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /android/flutter_system.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/flutter_system_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableJetifier=true 3 | android.useAndroidX=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /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/emojis/angry_face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/assets/emojis/angry_face.png -------------------------------------------------------------------------------- /assets/emojis/circle_face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/assets/emojis/circle_face.png -------------------------------------------------------------------------------- /assets/emojis/smile_face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/assets/emojis/smile_face.png -------------------------------------------------------------------------------- /assets/fonts/FangZhengFangSongJianTi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/assets/fonts/FangZhengFangSongJianTi.ttf -------------------------------------------------------------------------------- /assets/json/articles.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "title": "Text的使用", 4 | "url": "https://jiangkang.tech/?p=151" 5 | }, 6 | { 7 | "title": "GridView.count的使用", 8 | "url": "https://jiangkang.tech/?p=174" 9 | }, 10 | { 11 | "title": "GridView.extent的使用", 12 | "url": "https://jiangkang.tech/?p=168" 13 | }, 14 | { 15 | "title": "GridView的使用总结", 16 | "url": "https://jiangkang.tech/?p=149" 17 | }, 18 | { 19 | "title": "图片圆角的几种实现方式", 20 | "url": "https://jiangkang.tech/?p=141" 21 | }, 22 | { 23 | "title": "Dart基础语法", 24 | "url": "https://jiangkang.tech/?p=145" 25 | }, 26 | { 27 | "title": "Flutter 1.9 Web开发体验", 28 | "url": "https://jiangkang.tech/?p=181" 29 | }, 30 | { 31 | "title": "Flutter-Tabs的使用", 32 | "url": "https://jiangkang.tech/?p=192" 33 | }, 34 | { 35 | "title": "Flutter-时间的处理", 36 | "url": "https://jiangkang.tech/?p=132" 37 | }, 38 | { 39 | "title": "Flutter-Timeline View的使用", 40 | "url": "https://jiangkang.tech/?p=184" 41 | }, 42 | { 43 | "title": "Flutter-深色模式的实现", 44 | "url": "https://jiangkang.tech/?p=138" 45 | }, 46 | { 47 | "title": "Flutter-使用http请求数据并展示", 48 | "url": "https://jiangkang.tech/?p=159" 49 | } 50 | ] -------------------------------------------------------------------------------- /assets/json/components.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/assets/json/components.json -------------------------------------------------------------------------------- /assets/json/demos.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | 4 | } 5 | ] -------------------------------------------------------------------------------- /assets/json/month_traditional.json: -------------------------------------------------------------------------------- 1 | { 2 | "1": ["孟春","初春","上春","端月","初阳","端春","孟陬","春阳","首阳","肇春"], 3 | "2": ["仲春","仲阳","仲钟"], 4 | "3": ["季春","暮春","契月","花月","晚春","嘉月","蚕月"], 5 | "4": ["孟夏","初夏","首夏","维夏","槐月","余月","清和月"], 6 | "5": ["仲夏","超夏","榴月","蒲月"], 7 | "6": ["季夏","晚夏","暑夏","荷月","极暑","且月","杪夏"], 8 | "7": ["孟秋","初秋","少秋","新秋","肇秋","初商","兰月","凉月","相月"], 9 | "8": ["仲秋","仲商","桂月","壮月"], 10 | "9": ["季秋","暮秋","晚秋","杪秋","杪商","季商","季白","菊月","咏月","玄月","穷秋"], 11 | "10": ["孟冬","初冬","上冬","阳月","坤月","吉月","良月"], 12 | "11": ["仲冬","子月","葭月","畅月"], 13 | "12": ["季冬","暮冬","杪冬","穷冬","严冬","严月","嘉平月","腊月","除月"] 14 | } -------------------------------------------------------------------------------- /assets/json/pages.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "title": "Guide Page", 4 | "router": "/page/guide" 5 | }, 6 | { 7 | "title": "MarkDown Editor", 8 | "router": "/page/markdown" 9 | }, 10 | { 11 | "title": "", 12 | "router": "" 13 | }, 14 | { 15 | "title": "", 16 | "router": "" 17 | }, 18 | { 19 | "title": "", 20 | "router": "" 21 | }, 22 | { 23 | "title": "", 24 | "router": "" 25 | }, 26 | { 27 | "title": "", 28 | "router": "" 29 | }, 30 | { 31 | "title": "", 32 | "router": "" 33 | } 34 | ] -------------------------------------------------------------------------------- /assets/json/youqi.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": "0", 3 | "msg": "success", 4 | "data": [ 5 | { 6 | "date": "2019-10-25", 7 | "bgImgUrl": "", 8 | "bgColor": "#FFFDD835", 9 | "content": "为天地立心,为生民立命\n为往圣继绝学,为万世开太平", 10 | "source": "张载 横渠四句 《横渠语录》", 11 | "contentDetail": "", 12 | "detailUrl": "https://baike.baidu.com/item/%E6%A8%AA%E6%B8%A0%E5%9B%9B%E5%8F%A5" 13 | }, 14 | { 15 | "date": "2019-10-24", 16 | "bgImgUrl": "", 17 | "bgColor": "#FFFFAB91", 18 | "content": "知之为知之,不知为不知,是知也", 19 | "source": "《论语》", 20 | "contentDetail": "", 21 | "detailUrl": "" 22 | }, 23 | { 24 | "date": "2019-10-23", 25 | "bgImgUrl": "", 26 | "bgColor": "#FF64B5F6", 27 | "content": "读书,行路,阅人", 28 | "source": "姜康-座右铭", 29 | "contentDetail": "", 30 | "detailUrl": "" 31 | }, 32 | { 33 | "date": "2019-10-22", 34 | "bgImgUrl": "", 35 | "bgColor": "#FFB39DDB", 36 | "content": "时间是最宝贵的东西", 37 | "source": "姜康", 38 | "contentDetail": "", 39 | "detailUrl": "" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /assets/video/butterfly.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/assets/video/butterfly.mp4 -------------------------------------------------------------------------------- /best_toast/.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 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 76 | -------------------------------------------------------------------------------- /best_toast/.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: bbfbf1770cca2da7c82e887e4e4af910034800b6 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /best_toast/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.2 2 | 3 | - init plugin 4 | -------------------------------------------------------------------------------- /best_toast/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 JiangKang. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /best_toast/README.md: -------------------------------------------------------------------------------- 1 | # ktoast 2 | 3 | A new Flutter package project. 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 | -------------------------------------------------------------------------------- /best_toast/lib/best_toast.dart: -------------------------------------------------------------------------------- 1 | library best_toast; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Toast { 6 | Toast._(); 7 | 8 | static void showMessage(BuildContext context, String message, 9 | {int duration = 3, 10 | Color bgColor = Colors.white, 11 | Color fontColor = Colors.black}) { 12 | final entry = OverlayEntry( 13 | builder: (context) => Positioned( 14 | top: MediaQuery.of(context).size.height * 0.8, 15 | child: Container( 16 | alignment: Alignment.center, 17 | width: MediaQuery.of(context).size.width, 18 | child: Center( 19 | child: Card( 20 | shape: RoundedRectangleBorder( 21 | borderRadius: BorderRadius.circular(6)), 22 | elevation: 10, 23 | shadowColor: Colors.transparent, 24 | color: bgColor, 25 | child: Padding( 26 | padding: const EdgeInsets.symmetric( 27 | horizontal: 10, vertical: 6), 28 | child: Text( 29 | message, 30 | style: TextStyle(color: fontColor, fontSize: 18), 31 | ), 32 | ), 33 | ), 34 | ), 35 | ), 36 | )); 37 | Overlay.of(context).insert(entry); 38 | Future.delayed(Duration(seconds: duration)) 39 | .then((value) => entry.remove()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /best_toast/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: best_toast 2 | description: A pure dart toast plugin 3 | version: 0.0.3 4 | homepage: https://www.jiangkang.tech 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | flutter_lints: 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | # For information on the generic Dart part of this file, see the 20 | # following page: https://dart.dev/tools/pub/pubspec 21 | 22 | # The following section is specific to Flutter. 23 | flutter: 24 | 25 | # To add assets to your package, add an assets section, like this: 26 | # assets: 27 | # - images/a_dot_burr.jpeg 28 | # - images/a_dot_ham.jpeg 29 | # 30 | # For details regarding assets in packages, see 31 | # https://flutter.dev/assets-and-images/#from-packages 32 | # 33 | # An image asset can refer to one or more resolution-specific "variants", see 34 | # https://flutter.dev/assets-and-images/#resolution-aware. 35 | 36 | # To add custom fonts to your package, add a fonts section here, 37 | # in this "flutter" section. Each entry in this list should have a 38 | # "family" key with the font family name, and a "fonts" key with a 39 | # list giving the asset and other descriptors for the font. For 40 | # example: 41 | # fonts: 42 | # - family: Schyler 43 | # fonts: 44 | # - asset: fonts/Schyler-Regular.ttf 45 | # - asset: fonts/Schyler-Italic.ttf 46 | # style: italic 47 | # - family: Trajan Pro 48 | # fonts: 49 | # - asset: fonts/TrajanPro.ttf 50 | # - asset: fonts/TrajanPro_Bold.ttf 51 | # weight: 700 52 | # 53 | # For details regarding fonts in packages, see 54 | # https://flutter.dev/custom-fonts/#from-packages 55 | -------------------------------------------------------------------------------- /build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | build_web_compilers|entrypoint: 5 | options: 6 | compiler: dart2js 7 | generate_for: 8 | - test/multiplatform/**_test.dart 9 | - test/web/**_test.dart 10 | - web/**.dart 11 | build_vm_compilers|entrypoint: 12 | generate_for: 13 | - test/multiplatform/**_test.dart 14 | - test/vm/**_test.dart 15 | - bin/**.dart 16 | flutter_system|router_builder: 17 | enabled: true 18 | 19 | 20 | builders: 21 | router_builder: 22 | import: 'package:flutter_system/frouter/router_builder.dart' 23 | builder_factories: ['routerBuilder'] 24 | build_extensions: {'.dart': ['.router.dart']} 25 | auto_apply: root_package 26 | build_to: source 27 | -------------------------------------------------------------------------------- /captures/demos/gridview_count_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/demos/gridview_count_3.png -------------------------------------------------------------------------------- /captures/demos/gridview_count_aspect_ratio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/demos/gridview_count_aspect_ratio.png -------------------------------------------------------------------------------- /captures/demos/gridview_count_axis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/demos/gridview_count_axis.png -------------------------------------------------------------------------------- /captures/demos/gridview_count_basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/demos/gridview_count_basic.png -------------------------------------------------------------------------------- /captures/home_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/home_demo.png -------------------------------------------------------------------------------- /captures/home_demo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/home_demo_dark.png -------------------------------------------------------------------------------- /captures/packages/IconFont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/packages/IconFont.png -------------------------------------------------------------------------------- /captures/page/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/page/calendar.png -------------------------------------------------------------------------------- /captures/page/custompaint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/page/custompaint.png -------------------------------------------------------------------------------- /captures/page/guide.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/page/guide.gif -------------------------------------------------------------------------------- /captures/products/xiyou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/products/xiyou.png -------------------------------------------------------------------------------- /captures/products/youqi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/captures/products/youqi.png -------------------------------------------------------------------------------- /dartdoc_options.yaml: -------------------------------------------------------------------------------- 1 | dartdoc: 2 | categories: 3 | "Flutter-System": 4 | documentationMarkdown: doc/index.md 5 | "Flutter Page": 6 | documentationMarkdown: doc/page.md 7 | "Flutter Component": 8 | documentationMarkdown: doc/component.md 9 | "Flutter Demo": 10 | documentationMarkdown: doc/demo.md 11 | categoryOrder: ["Flutter-System", "Flutter Page","Flutter Component","Flutter Demo"] -------------------------------------------------------------------------------- /doc/component.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/doc/component.md -------------------------------------------------------------------------------- /doc/demo.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/doc/demo.md -------------------------------------------------------------------------------- /doc/index.md: -------------------------------------------------------------------------------- 1 | # Flutter System 2 | 3 | - [Page](page.md) 4 | - [Component](component.md) 5 | - [Demo](demo.md) 6 | -------------------------------------------------------------------------------- /doc/page.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/doc/page.md -------------------------------------------------------------------------------- /images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/images/banner.jpg -------------------------------------------------------------------------------- /images/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/images/github.png -------------------------------------------------------------------------------- /images/home_bar_scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/images/home_bar_scan.png -------------------------------------------------------------------------------- /images/landscape0.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/images/landscape0.jpeg -------------------------------------------------------------------------------- /images/landscape1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/images/landscape1.jpeg -------------------------------------------------------------------------------- /images/landscape2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/images/landscape2.jpeg -------------------------------------------------------------------------------- /images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/images/loading.gif -------------------------------------------------------------------------------- /ios/Flutter/.last_build_id: -------------------------------------------------------------------------------- 1 | 6b96431848928268c35aa1df2900c9aa -------------------------------------------------------------------------------- /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 | 9.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/jiangkang/Env/google/flutter" 4 | export "FLUTTER_APPLICATION_PATH=/Users/jiangkang/MyProjects/flutter-system" 5 | export "COCOAPODS_PARALLEL_CODE_SIGN=true" 6 | export "FLUTTER_TARGET=lib/main.dart" 7 | export "FLUTTER_BUILD_DIR=build" 8 | export "FLUTTER_BUILD_NAME=0.0.1" 9 | export "FLUTTER_BUILD_NUMBER=0.0.1" 10 | export "DART_OBFUSCATION=false" 11 | export "TRACK_WIDGET_CREATION=true" 12 | export "TREE_SHAKE_ICONS=false" 13 | export "PACKAGE_CONFIG=.dart_tool/package_config.json" 14 | -------------------------------------------------------------------------------- /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 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - FMDB (2.7.5): 4 | - FMDB/standard (= 2.7.5) 5 | - FMDB/standard (2.7.5) 6 | - image_picker_ios (0.0.1): 7 | - Flutter 8 | - path_provider_ios (0.0.1): 9 | - Flutter 10 | - share (0.0.1): 11 | - Flutter 12 | - shared_preferences_ios (0.0.1): 13 | - Flutter 14 | - sqflite (0.0.2): 15 | - Flutter 16 | - FMDB (>= 2.7.5) 17 | - url_launcher_ios (0.0.1): 18 | - Flutter 19 | - video_player_avfoundation (0.0.1): 20 | - Flutter 21 | - webview_flutter_wkwebview (0.0.1): 22 | - Flutter 23 | 24 | DEPENDENCIES: 25 | - Flutter (from `Flutter`) 26 | - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) 27 | - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) 28 | - share (from `.symlinks/plugins/share/ios`) 29 | - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`) 30 | - sqflite (from `.symlinks/plugins/sqflite/ios`) 31 | - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) 32 | - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) 33 | - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) 34 | 35 | SPEC REPOS: 36 | trunk: 37 | - FMDB 38 | 39 | EXTERNAL SOURCES: 40 | Flutter: 41 | :path: Flutter 42 | image_picker_ios: 43 | :path: ".symlinks/plugins/image_picker_ios/ios" 44 | path_provider_ios: 45 | :path: ".symlinks/plugins/path_provider_ios/ios" 46 | share: 47 | :path: ".symlinks/plugins/share/ios" 48 | shared_preferences_ios: 49 | :path: ".symlinks/plugins/shared_preferences_ios/ios" 50 | sqflite: 51 | :path: ".symlinks/plugins/sqflite/ios" 52 | url_launcher_ios: 53 | :path: ".symlinks/plugins/url_launcher_ios/ios" 54 | video_player_avfoundation: 55 | :path: ".symlinks/plugins/video_player_avfoundation/ios" 56 | webview_flutter_wkwebview: 57 | :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" 58 | 59 | SPEC CHECKSUMS: 60 | Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 61 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 62 | image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb 63 | path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 64 | share: 0b2c3e82132f5888bccca3351c504d0003b3b410 65 | shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad 66 | sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 67 | url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de 68 | video_player_avfoundation: e489aac24ef5cf7af82702979ed16f2a5ef84cff 69 | webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f 70 | 71 | PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 72 | 73 | COCOAPODS: 1.11.3 74 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@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/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/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 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_system 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | io.flutter.embedded_views_preview 43 | yes 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | NSAppTransportSecurity 47 | 48 | NSAllowsArbitraryLoads 49 | 50 | 51 | CADisableMinimumFrameDurationOnPhone 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /kicons/.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 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | build/ 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Generated.xcconfig 61 | **/ios/Flutter/app.flx 62 | **/ios/Flutter/app.zip 63 | **/ios/Flutter/flutter_assets/ 64 | **/ios/Flutter/flutter_export_environment.sh 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 | -------------------------------------------------------------------------------- /kicons/.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: 1aedbb1835bd6eb44550293d57d4d124f19901f0 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /kicons/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## v1.0.2 - 2020/09/01 2 | 3 | * emoj and aliyun icons 4 | -------------------------------------------------------------------------------- /kicons/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 JiangKang. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /kicons/README.md: -------------------------------------------------------------------------------- 1 | # kicons 2 | 3 | 一个自定义的图标库 4 | 5 | ![效果图](https://github.com/jiangkang/flutter-system/blob/master/captures/packages/IconFont.png) 6 | 7 | 8 | -------------------------------------------------------------------------------- /kicons/fonts/aliyun.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/kicons/fonts/aliyun.ttf -------------------------------------------------------------------------------- /kicons/fonts/emoji.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/kicons/fonts/emoji.ttf -------------------------------------------------------------------------------- /kicons/lib/kicons.dart: -------------------------------------------------------------------------------- 1 | library kicons; 2 | 3 | export 'package:kicons/src/aliyun.dart'; 4 | export 'package:kicons/src/emoji.dart'; 5 | 6 | const package = "kicons"; 7 | -------------------------------------------------------------------------------- /kicons/lib/src/emoji.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:kicons/kicons.dart'; 3 | 4 | /// 表情Icon 5 | class EmojiIcon { 6 | static const String _family = "Emoji"; 7 | 8 | EmojiIcon._(); 9 | 10 | static const IconData angry = 11 | IconData(0xeaf4, fontFamily: _family, fontPackage: package); 12 | static const IconData astonished = 13 | IconData(0xeaf5, fontFamily: _family, fontPackage: package); 14 | static const IconData confounded = 15 | IconData(0xeaf6, fontFamily: _family, fontPackage: package); 16 | static const IconData confused = 17 | IconData(0xeaf7, fontFamily: _family, fontPackage: package); 18 | static const IconData crying = 19 | IconData(0xeaf8, fontFamily: _family, fontPackage: package); 20 | static const IconData dizzy = 21 | IconData(0xeaf9, fontFamily: _family, fontPackage: package); 22 | static const IconData expressionless = 23 | IconData(0xeafa, fontFamily: _family, fontPackage: package); 24 | static const IconData heart_eyes = 25 | IconData(0xeafb, fontFamily: _family, fontPackage: package); 26 | static const IconData laughing = 27 | IconData(0xeafc, fontFamily: _family, fontPackage: package); 28 | static const IconData nerd_smile = 29 | IconData(0xeafd, fontFamily: _family, fontPackage: package); 30 | static const IconData open_mouth = 31 | IconData(0xeafe, fontFamily: _family, fontPackage: package); 32 | static const IconData rage = 33 | IconData(0xeaff, fontFamily: _family, fontPackage: package); 34 | static const IconData rolling_eyes = 35 | IconData(0xeb00, fontFamily: _family, fontPackage: package); 36 | static const IconData sad = 37 | IconData(0xeb01, fontFamily: _family, fontPackage: package); 38 | static const IconData simple_smile = 39 | IconData(0xeb02, fontFamily: _family, fontPackage: package); 40 | static const IconData slightly_smile = 41 | IconData(0xeb03, fontFamily: _family, fontPackage: package); 42 | static const IconData smirk = 43 | IconData(0xeb04, fontFamily: _family, fontPackage: package); 44 | static const IconData stuck_out_tongue = 45 | IconData(0xeb05, fontFamily: _family, fontPackage: package); 46 | static const IconData wink_smile = 47 | IconData(0xeb06, fontFamily: _family, fontPackage: package); 48 | static const IconData worried = 49 | IconData(0xeb07, fontFamily: _family, fontPackage: package); 50 | 51 | /// 返回IconData列表 52 | static List toList() { 53 | final result = []; 54 | for (int i = 0xeaf4; i <= 0xeb07; i++) { 55 | result.add(IconData(i, fontFamily: _family, fontPackage: package)); 56 | } 57 | return result; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /kicons/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: kicons 2 | description: An Icon package project,you can use many icons which you like.Then,you can list all of the icons quickly! 3 | version: 1.0.3 4 | homepage: https://www.jiangkang.tech 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | flutter_lints: 18 | 19 | flutter: 20 | fonts: 21 | - family: Emoji 22 | fonts: 23 | - asset: fonts/emoji.ttf 24 | - family: Aliyun 25 | fonts: 26 | - asset: fonts/aliyun.ttf 27 | -------------------------------------------------------------------------------- /kicons/test/kicons_test.dart: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/api/api_demo.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | import 'package:http/http.dart'; 5 | 6 | const String HOST_DEMO = "https://api.apiopen.top"; 7 | 8 | const String defaultPage = "0"; 9 | 10 | const String defaultCount = "30"; 11 | 12 | /// 获取图片列表 13 | Future fetchImages() async { 14 | return getImages().then((response) { 15 | return ImageResponse.fromJson(json.decode(response.body)); 16 | }).catchError((error) { 17 | throw HttpException("statusCode: ${error.toString()}"); 18 | }); 19 | } 20 | 21 | Future getImages() => get(Uri.parse("$HOST_DEMO/getImages"), 22 | headers: {"page": defaultPage, "count": defaultCount}); 23 | 24 | /// 获取新闻列表 25 | Future getNews() => get(Uri.parse("$HOST_DEMO/getWangYiNews") , 26 | headers: {"page": defaultPage, "count": defaultCount}); 27 | 28 | /// 获取城市列表 29 | Future getWeather(String city) => 30 | get(Uri.parse("$HOST_DEMO/weatherApi"), headers: {"city": city}); 31 | 32 | /// 获取唐诗列表 33 | Future getTangPoets() => get(Uri.parse("$HOST_DEMO/getTangPoetry"), 34 | headers: {"page": defaultPage, "count": defaultCount}); 35 | 36 | /// 获取宋诗列表 37 | Future getSongPoets() => get(Uri.parse("$HOST_DEMO/getSongPoetry"), 38 | headers: {"page": defaultPage, "count": defaultCount}); 39 | 40 | /// 获取一首随机的诗词 41 | Future getRecPoet() => get(Uri.parse("$HOST_DEMO/recommendPoetry")); 42 | 43 | /// Model:图片列表响应 44 | class ImageResponse { 45 | final int? code; 46 | final String? message; 47 | final List> result; 48 | 49 | ImageResponse(this.code, this.message, this.result); 50 | 51 | factory ImageResponse.fromJson(Map json) => ImageResponse( 52 | json["code"] as int?, 53 | json["message"] as String?, 54 | List>.from(json["result"])); 55 | } 56 | 57 | /// Model:图片数据 58 | class ImageBean { 59 | final String? img; 60 | final String? publishedAt; 61 | 62 | ImageBean({this.img, this.publishedAt}); 63 | 64 | factory ImageBean.fromJson(Map json) { 65 | return ImageBean(img: json["img"], publishedAt: json["publishedAt"]); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/api/api_placeholder_demo.dart: -------------------------------------------------------------------------------- 1 | import 'package:http/http.dart'; 2 | 3 | const API_PLACEHOLDER = "https://jsonplaceholder.typicode.com"; 4 | 5 | Future deleteAlbum(String id) async { 6 | final response = await delete( 7 | Uri.parse("$API_PLACEHOLDER/albums/$id"), 8 | headers: { 9 | "Content-Type": "application/json; charset=UTF-8", 10 | }, 11 | ); 12 | return response; 13 | } 14 | -------------------------------------------------------------------------------- /lib/common/global_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class GlobalModel { 5 | bool? isDarkMode; 6 | } 7 | 8 | class DarkMode with ChangeNotifier { 9 | bool? _isDarkMode; 10 | 11 | bool? get value => _isDarkMode; 12 | 13 | void setDarkMode(bool darkMode) { 14 | _isDarkMode = darkMode; 15 | notifyListeners(); 16 | } 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /lib/common/model_binding.dart: -------------------------------------------------------------------------------- 1 | import "package:flutter/material.dart"; 2 | 3 | class ModelBinding extends StatefulWidget { 4 | final AppSettings initialSettings; 5 | final Widget? child; 6 | 7 | const ModelBinding({ 8 | Key? key, 9 | this.initialSettings = const AppSettings(), 10 | this.child, 11 | }) : super(key: key); 12 | 13 | @override 14 | ModelBindingState createState() => ModelBindingState(); 15 | } 16 | 17 | class ModelBindingState extends State { 18 | AppSettings? currentSettings; 19 | 20 | @override 21 | void initState() { 22 | super.initState(); 23 | currentSettings = widget.initialSettings; 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return _ModelBindingScope( 29 | modelBindingState: this, 30 | child: widget.child!, 31 | ); 32 | } 33 | 34 | void updateModel(AppSettings newSettings) { 35 | if (newSettings != currentSettings) { 36 | setState(() { 37 | currentSettings = newSettings; 38 | }); 39 | } 40 | } 41 | } 42 | 43 | class _ModelBindingScope extends InheritedWidget { 44 | final ModelBindingState modelBindingState; 45 | 46 | const _ModelBindingScope({Key? key, required this.modelBindingState, required Widget child}) 47 | : super(key: key, child: child); 48 | 49 | @override 50 | bool updateShouldNotify(_ModelBindingScope oldWidget) { 51 | return true; 52 | } 53 | } 54 | 55 | class AppSettings { 56 | const AppSettings({ 57 | this.themeData, 58 | this.locale, 59 | }); 60 | 61 | final ThemeData? themeData; 62 | final Locale? locale; 63 | 64 | static AppSettings? of(BuildContext context) { 65 | final scope = 66 | context.dependOnInheritedWidgetOfExactType<_ModelBindingScope>()!; 67 | return scope.modelBindingState.currentSettings; 68 | } 69 | 70 | static void update(BuildContext context, AppSettings newSettings) { 71 | final scope = 72 | context.dependOnInheritedWidgetOfExactType<_ModelBindingScope>()!; 73 | scope.modelBindingState.updateModel(newSettings); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/common/res_constants.dart: -------------------------------------------------------------------------------- 1 | const IMG_URL0 = 2 | "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562091615926&di=dc8a96e9a11cbc5441111ad0733cd4cd&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201707%2F27%2F20170727200329_4iHtV.thumb.700_0.jpeg"; 3 | const IMG_URL1 = 4 | "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562091615927&di=87270e4500df2b75293283bb2d1c8621&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201808%2F29%2F20180829165902_z4zSy.thumb.700_0.jpeg"; 5 | const IMG_URL2 = 6 | "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562091615926&di=4ec60190605df5e374d29a14a672780a&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201808%2F04%2F20180804223630_eomiz.jpg"; 7 | const IMG_URL3 = 8 | "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562428791752&di=5a128e387c649e8c5ef13abbf07322d8&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201807%2F14%2F20180714231750_ivpuu.jpeg"; 9 | const IMG_URL4 = 10 | "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562092377107&di=ef49842960b2a82cceb42caa66d0eba1&imgtype=0&src=http%3A%2F%2Fc4.haibao.cn%2Fimg%2F0_0_100_0%2F1540787377.4582%2F36f6b8a6e33bbebac771fc463cdc0e5f.jpg"; 11 | const IMG_URL5 = 12 | "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562428791751&di=30f544808fff345f8a35e2290079064f&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201706%2F18%2F20170618231226_KZVUd.jpeg"; 13 | const IMG_URL6 = 14 | "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562428791751&di=20fa287c373eca888bfac4868acae8ad&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201806%2F15%2F20180615223714_zpyjc.jpg"; 15 | const IMG_URL7 = 16 | "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562428791749&di=c960fbc9d86996f605a21a387a426522&imgtype=0&src=http%3A%2F%2Fimg3.doubanio.com%2Fview%2Fgroup_topic%2Fl%2Fpublic%2Fp144589803.jpg"; 17 | const IMG_URL8 = 18 | "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562428895236&di=03322d03df7ec21f408a88bb3fcbe244&imgtype=0&src=http%3A%2F%2Fpics1.baidu.com%2Ffeed%2F7dd98d1001e93901bbbae7d68d93d9e337d19626.jpeg%3Ftoken%3Db82c7de1748aeacba09eefa3483dcf44%26s%3DFD2631774DC342511E5429DA0100C0B2"; 19 | const IMG_URL9 = ""; 20 | const IMG_URL10 = ""; 21 | 22 | const List IMGS = [ 23 | IMG_URL0, 24 | IMG_URL1, 25 | IMG_URL2, 26 | IMG_URL3, 27 | IMG_URL4, 28 | IMG_URL5, 29 | IMG_URL6, 30 | IMG_URL7, 31 | IMG_URL8, 32 | ]; 33 | -------------------------------------------------------------------------------- /lib/component/animations/slide_down_to_close_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | 4 | class SlideDownToClosePage extends StatefulWidget { 5 | const SlideDownToClosePage({Key? key}) : super(key: key); 6 | 7 | @override 8 | State createState() => _SlideDownToClosePageState(); 9 | } 10 | 11 | class _SlideDownToClosePageState extends State { 12 | 13 | double _scrollPos = 0.0; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); 18 | SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( 19 | statusBarColor: Colors.red, 20 | statusBarBrightness: Brightness.light 21 | )); 22 | return Scaffold( 23 | backgroundColor: Colors.white, 24 | appBar: PreferredSize( 25 | preferredSize: Size.fromHeight(kToolbarHeight + _scrollPos + 64), 26 | child: GestureDetector( 27 | onVerticalDragDown: (details) { 28 | 29 | }, 30 | onVerticalDragUpdate: (details) { 31 | final dy = details.delta.dy; 32 | debugPrint("dy:$dy"); 33 | setState(() { 34 | _scrollPos +=dy; 35 | }); 36 | }, 37 | onVerticalDragEnd: (details) {}, 38 | child: Container( 39 | width: double.infinity, 40 | color: Colors.cyan, 41 | child: Align( 42 | alignment: Alignment.topLeft, 43 | child: IconButton( 44 | icon: Icon(Icons.keyboard_arrow_down), 45 | onPressed: () {}, 46 | ), 47 | ), 48 | ), 49 | ), 50 | ), 51 | body: SafeArea( 52 | child: Container( 53 | color: Colors.red, 54 | ), 55 | ), 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/component/case0.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// 一个封面图 + 1个标题 + 一个头像 + 用户名 + 点赞数 4 | /// TODO: 瀑布流 5 | class ShowCase0 extends StatelessWidget { 6 | const ShowCase0( 7 | {Key? key, 8 | this.radius, 9 | this.imgUrl, 10 | this.title, 11 | this.avatarUrl, 12 | this.username, 13 | this.likeNum}) 14 | : super(key: key); 15 | 16 | /// card半径 17 | final double? radius; 18 | 19 | /// 图片url 20 | final String? imgUrl; 21 | 22 | /// 标题文本 23 | final String? title; 24 | 25 | /// 图像url 26 | final String? avatarUrl; 27 | 28 | /// 用户名 29 | final String? username; 30 | 31 | /// 点赞数 32 | final int? likeNum; 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return Card( 37 | shape: RoundedRectangleBorder( 38 | borderRadius: BorderRadiusDirectional.circular(radius!)), 39 | child: Column( 40 | mainAxisAlignment: MainAxisAlignment.start, 41 | mainAxisSize: MainAxisSize.min, 42 | crossAxisAlignment: CrossAxisAlignment.start, 43 | children: [ 44 | Expanded( 45 | child: Center( 46 | child: ClipRRect( 47 | borderRadius: BorderRadius.circular(radius!), 48 | child: Image.network( 49 | imgUrl!, 50 | fit: BoxFit.cover, 51 | width: double.maxFinite, 52 | ), 53 | ), 54 | ), 55 | ), 56 | Padding( 57 | padding: const EdgeInsets.only(left: 10, top: 6), 58 | child: Text(title!), 59 | ), 60 | Row( 61 | mainAxisSize: MainAxisSize.max, 62 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 63 | children: [ 64 | Padding( 65 | padding: const EdgeInsets.only(left: 10), 66 | child: Row( 67 | children: [ 68 | CircleAvatar( 69 | maxRadius: 8, 70 | child: Image.network(avatarUrl!), 71 | ), 72 | Text(username!), 73 | ], 74 | ), 75 | ), 76 | TextButton.icon( 77 | onPressed: null, 78 | icon: Icon(Icons.favorite_border), 79 | label: Text(likeNum.toString())) 80 | ], 81 | ) 82 | ], 83 | ), 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /lib/component/component_appbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppBarPage extends StatefulWidget { 4 | const AppBarPage({Key? key}) : super(key: key); 5 | 6 | @override 7 | State createState() => _AppBarPageState(); 8 | } 9 | 10 | class _AppBarPageState extends State { 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | appBar: buildAppBarWithMiddleSearch(), 15 | ); 16 | } 17 | 18 | AppBar buildAppBarWithMiddleSearch() { 19 | return AppBar( 20 | title: Chip( 21 | backgroundColor: Colors.white, 22 | label: Row( 23 | mainAxisSize: MainAxisSize.max, 24 | children: const [ 25 | Icon( 26 | Icons.search, 27 | color: Colors.grey, 28 | ), 29 | SizedBox( 30 | width: 6, 31 | ), 32 | Text( 33 | "点击这里搜索内容", 34 | style: TextStyle(color: Colors.grey), 35 | ) 36 | ], 37 | ), 38 | ), 39 | leading: InkWell( 40 | onTap: () { 41 | Navigator.pop(context); 42 | }, 43 | child: Center(child: Text("首页"))), 44 | actions: [ 45 | Padding( 46 | padding: const EdgeInsets.all(8.0), 47 | child: Image.asset( 48 | "images/home_bar_scan.png", 49 | color: Colors.white, 50 | width: 28, 51 | height: 28, 52 | ), 53 | ) 54 | ], 55 | ); 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /lib/component/component_share.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/component/listview_item.dart'; 3 | import 'package:flutter_system/utils/pickers_utils.dart'; 4 | import 'package:share/share.dart'; 5 | 6 | class ShareDemoPage extends StatefulWidget { 7 | const ShareDemoPage({Key? key}) : super(key: key); 8 | 9 | @override 10 | ShareDemoPageState createState() => ShareDemoPageState(); 11 | } 12 | 13 | class ShareDemoPageState extends State { 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | appBar: AppBar( 18 | title: Text("Share"), 19 | ), 20 | body: ListView( 21 | children: [ 22 | ListTileCard( 23 | title: Text("Share Text"), 24 | onTap: () { 25 | Share.share("这是一段分享文本"); 26 | }, 27 | ), 28 | ListTileCard( 29 | title: Text("Share Text With Subject"), 30 | onTap: () { 31 | Share.share("这是一段分享文本", subject: "主题"); 32 | }, 33 | ), 34 | ListTileCard( 35 | title: Text("Share Files"), 36 | onTap: () async { 37 | final pickedFile = await Pickers.pickImageFromGallery(); 38 | await Share.shareFiles([(pickedFile.path)], text: "美图"); 39 | }, 40 | ), 41 | ], 42 | ), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/component/my_tab_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// A tab Indicator 4 | /// round corner at bottom of the tab 5 | class RoundCornerTabIndicator extends Decoration { 6 | final BorderSide borderSide; 7 | 8 | final EdgeInsetsGeometry insets; 9 | 10 | const RoundCornerTabIndicator({ 11 | this.borderSide = const BorderSide(width: 4.0, color: Colors.white), 12 | this.insets = EdgeInsets.zero, 13 | }); 14 | 15 | 16 | @override 17 | BoxPainter createBoxPainter([VoidCallback? onChanged]) { 18 | return _RoundCornerTabPainter(this, onChanged); 19 | } 20 | } 21 | 22 | class _RoundCornerTabPainter extends BoxPainter { 23 | _RoundCornerTabPainter(this.decoration, onChanged); 24 | 25 | final RoundCornerTabIndicator decoration; 26 | 27 | BorderSide get borderSide => decoration.borderSide; 28 | 29 | EdgeInsetsGeometry get insets => decoration.insets; 30 | 31 | @override 32 | void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) { 33 | final Rect rect = offset & configuration.size!; 34 | final TextDirection textDirection = configuration.textDirection!; 35 | final Rect indicator = 36 | _indicatorRectFor(rect, textDirection).deflate(borderSide.width / 2.0); 37 | final Paint paint = borderSide.toPaint()..strokeCap = StrokeCap.round; 38 | canvas.drawLine(indicator.bottomLeft, indicator.bottomRight, paint); 39 | canvas.drawRRect( 40 | RRect.fromLTRBAndCorners( 41 | indicator.left, indicator.top, indicator.right, indicator.bottom, 42 | topLeft: Radius.circular(6), 43 | topRight: Radius.circular(6), 44 | bottomLeft: Radius.circular(6), 45 | bottomRight: Radius.circular(6)), 46 | paint); 47 | } 48 | 49 | Rect _indicatorRectFor(Rect rect, TextDirection textDirection) { 50 | final Rect indicator = insets.resolve(textDirection).deflateRect(rect); 51 | return Rect.fromLTWH( 52 | indicator.left, 53 | indicator.bottom - borderSide.width, 54 | indicator.width, 55 | borderSide.width, 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/component/toast_demo.dart: -------------------------------------------------------------------------------- 1 | import 'package:best_toast/best_toast.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class ToastDemo extends StatefulWidget { 5 | const ToastDemo({Key? key}) : super(key: key); 6 | 7 | @override 8 | _ToastDemoState createState() => _ToastDemoState(); 9 | } 10 | 11 | class _ToastDemoState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | appBar: AppBar( 16 | title: Text("Toast"), 17 | ), 18 | body: ListView( 19 | children: [ 20 | ListTile( 21 | title: Text("显示文本Toast"), 22 | onTap: () { 23 | Toast.showMessage(context, "简单的文本"); 24 | }, 25 | ), 26 | ListTile( 27 | title: Text("显示带样式的Toast"), 28 | ), 29 | ListTile( 30 | title: Text("显示图片的Toast"), 31 | ), 32 | ], 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/constants/const_key_value.dart: -------------------------------------------------------------------------------- 1 | const keyIsDarkMode = "key_is_dark_mode"; 2 | -------------------------------------------------------------------------------- /lib/date/solar.dart: -------------------------------------------------------------------------------- 1 | part of lunar_solar_converter; 2 | 3 | /// 阳历,即公历 4 | class Solar { 5 | int? solarYear = -1; 6 | int? solarMonth; 7 | int? solarDay; 8 | 9 | 10 | Solar({this.solarYear, this.solarMonth, this.solarDay}); 11 | 12 | 13 | get dateTime => DateTime(solarYear!, solarMonth!, solarDay!); 14 | 15 | @override 16 | toString() { 17 | String result = ""; 18 | if (solarYear != null) { 19 | int? absYear = solarYear?.abs(); 20 | String prefix = ((solarYear ?? -1) < 0 ? "公元前" : "公元"); 21 | result += "$prefix$absYear年"; 22 | } 23 | if (solarMonth != null) { 24 | if (solarMonth! < 1 || solarMonth! > 12) { 25 | return "非法日期"; 26 | } 27 | result += "$solarMonth月"; 28 | 29 | if (solarDay != null) { 30 | if (solarDay! < 1 || solarDay! > 31) { 31 | return "非法日期"; 32 | } 33 | result += "$solarDay日"; 34 | } 35 | } 36 | return result.isEmpty ? "非法日期" : result; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/demos/animation/anim_animated_container.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | /// AnimatedContainer Demo 6 | class AnimatedContainerDemo extends StatefulWidget { 7 | const AnimatedContainerDemo({Key? key}) : super(key: key); 8 | 9 | @override 10 | _AnimatedContainerDemoState createState() { 11 | return _AnimatedContainerDemoState(); 12 | } 13 | } 14 | 15 | class _AnimatedContainerDemoState extends State { 16 | double _width = 50.0; 17 | double _height = 50.0; 18 | 19 | Color _color = Colors.blue; 20 | 21 | BorderRadiusGeometry _borderRadius = BorderRadius.circular(8); 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | appBar: AppBar( 27 | title: Text("AnimatedContainer Demo"), 28 | centerTitle: true, 29 | ), 30 | body: InkWell( 31 | onTap: () { 32 | _change(); 33 | }, 34 | child: Center( 35 | child: AnimatedContainer( 36 | duration: Duration(seconds: 1), 37 | width: _width, 38 | height: _height, 39 | decoration: 40 | BoxDecoration(color: _color, borderRadius: _borderRadius), 41 | curve: Curves.fastOutSlowIn, 42 | ), 43 | ), 44 | ), 45 | floatingActionButton: FloatingActionButton( 46 | child: Icon(Icons.swap_horiz), 47 | onPressed: () { 48 | _change(); 49 | }), 50 | ); 51 | } 52 | 53 | void _change() { 54 | setState(() { 55 | final random = Random(); 56 | _width = random.nextInt(360).toDouble(); 57 | _height = random.nextInt(360).toDouble(); 58 | 59 | _color = Color.fromRGBO( 60 | random.nextInt(256), random.nextInt(256), random.nextInt(256), 1.0); 61 | _borderRadius = BorderRadius.circular(random.nextInt(360).toDouble()); 62 | }); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/demos/animation/demo_native_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/gestures.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/rendering.dart'; 5 | import 'package:flutter/services.dart'; 6 | 7 | class NativeViewDemo extends StatefulWidget { 8 | const NativeViewDemo({Key? key}) : super(key: key); 9 | 10 | @override 11 | _NativeViewDemoState createState() => _NativeViewDemoState(); 12 | } 13 | 14 | class _NativeViewDemoState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | // This is used in the platform side to register the view. 18 | const String viewType = 'demo_native_view'; 19 | // Pass parameters to the platform side. 20 | final Map creationParams = {}; 21 | 22 | return Scaffold( 23 | appBar: AppBar( 24 | title: Text("Native View"), 25 | ), 26 | body: SafeArea( 27 | child: ListView( 28 | children: [ 29 | SizedBox( 30 | width: double.maxFinite, 31 | height: 120, 32 | child: PlatformViewLink( 33 | viewType: viewType, 34 | surfaceFactory: 35 | (BuildContext context, PlatformViewController controller) { 36 | return AndroidViewSurface( 37 | controller: controller as AndroidViewController, 38 | gestureRecognizers: const < 39 | Factory>{}, 40 | hitTestBehavior: PlatformViewHitTestBehavior.opaque, 41 | ); 42 | }, 43 | onCreatePlatformView: (PlatformViewCreationParams params) { 44 | return PlatformViewsService.initSurfaceAndroidView( 45 | id: params.id, 46 | viewType: viewType, 47 | layoutDirection: TextDirection.ltr, 48 | creationParams: creationParams, 49 | creationParamsCodec: StandardMessageCodec(), 50 | ) 51 | ..addOnPlatformViewCreatedListener( 52 | params.onPlatformViewCreated) 53 | ..create(); 54 | }, 55 | ), 56 | ), 57 | ], 58 | ), 59 | ), 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/demos/demo_assets.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/component/listview_item.dart'; 3 | import 'package:flutter_system/model/model_entry.dart'; 4 | import 'package:flutter_system/storage/storage_assets.dart'; 5 | import 'package:flutter_system/utils/nav_utils.dart'; 6 | 7 | /// Assets Demo 8 | /// 1. 读取字符串 9 | /// 2. 读取结构性数据 10 | class AssetsDemo extends StatefulWidget { 11 | const AssetsDemo({Key? key}) : super(key: key); 12 | 13 | @override 14 | _AssetsDemoState createState() { 15 | return _AssetsDemoState(); 16 | } 17 | } 18 | 19 | class _AssetsDemoState extends State { 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | appBar: AppBar( 24 | title: Text("Assets Demo"), 25 | centerTitle: true, 26 | ), 27 | body: SafeArea( 28 | child: FutureBuilder>( 29 | future: AssetStorage.getArticleList(context), 30 | builder: (context, snapshot) { 31 | if (snapshot.hasData) { 32 | final articles = snapshot.data!; 33 | return ListView.builder( 34 | itemCount: articles.length, 35 | itemBuilder: (context, index) { 36 | return ListTileCard( 37 | borderRadius: 4, 38 | title: Text("${articles[index].title}"), 39 | onTap: () { 40 | NavUtils.openWebView(context, articles[index].url, 41 | title: articles[index].title); 42 | }, 43 | ); 44 | }); 45 | } else { 46 | return CircularProgressIndicator(); 47 | } 48 | })), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/demos/demo_chip.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ChipDemo extends StatelessWidget { 4 | const ChipDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text("Chip"), 11 | centerTitle: true, 12 | ), 13 | body: ListView( 14 | padding: EdgeInsets.all(8), 15 | children: const [ 16 | Chip(label: Text("Default")), 17 | Chip( 18 | label: Text("Default"), 19 | backgroundColor: Colors.redAccent, 20 | ), 21 | Chip( 22 | label: Text("Default"), 23 | avatar: Icon(Icons.check), 24 | ), 25 | FilterChip(label: Text("Fliter Chip"), onSelected: null), 26 | InputChip( 27 | label: Text("Input Chip"), 28 | deleteIcon: Icon(Icons.close), 29 | ), 30 | Chip( 31 | label: Text("Default"), 32 | avatar: CircleAvatar( 33 | backgroundColor: Colors.deepOrange, 34 | ), 35 | ) 36 | ], 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/demos/demo_container.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ContainerDemo extends StatelessWidget { 4 | const ContainerDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return ListView( 9 | children: const [ 10 | SizedBox( 11 | width: 100, 12 | height: 100, 13 | child: 14 | DecoratedBox(decoration: BoxDecoration(color: Colors.pinkAccent)), 15 | ), 16 | ], 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/demos/demo_custom_scrollview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/component/listview_item.dart'; 3 | 4 | class CustomScrollViewDemo extends StatefulWidget { 5 | const CustomScrollViewDemo({Key? key}) : super(key: key); 6 | 7 | @override 8 | _CustomScrollViewDemoState createState() { 9 | return _CustomScrollViewDemoState(); 10 | } 11 | } 12 | 13 | class _CustomScrollViewDemoState extends State 14 | with SingleTickerProviderStateMixin { 15 | TabController? _tabController; 16 | 17 | @override 18 | void initState() { 19 | _tabController = TabController(length: 3, vsync: this); 20 | super.initState(); 21 | } 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | body: CustomScrollView( 27 | slivers: [ 28 | SliverAppBar( 29 | title: Text("Floating App bar"), 30 | centerTitle: true, 31 | floating: true, 32 | expandedHeight: 200, 33 | flexibleSpace: Image.asset( 34 | "images/landscape0.jpeg", 35 | width: double.infinity, 36 | fit: BoxFit.fitWidth, 37 | ), 38 | pinned: true, 39 | snap: true, 40 | bottom: TabBar(controller: _tabController, tabs: const [ 41 | Tab( 42 | text: "Tab1", 43 | ), 44 | Tab( 45 | text: "Tab2", 46 | ), 47 | Tab( 48 | text: "Tab3", 49 | ) 50 | ]), 51 | ), 52 | SliverList( 53 | delegate: SliverChildListDelegate( 54 | _buildListChildren(), 55 | )), 56 | ], 57 | ), 58 | ); 59 | } 60 | 61 | List _buildListChildren() { 62 | return List.generate( 63 | 100, 64 | (index) => ListTileCard( 65 | title: Text("Item $index"), 66 | borderRadius: 4, 67 | )); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/demos/demo_dismissible.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/component/listview_item.dart'; 3 | 4 | class SwipeDismissDemo extends StatefulWidget { 5 | const SwipeDismissDemo({Key? key}) : super(key: key); 6 | 7 | @override 8 | _SwipeDismissDemoState createState() { 9 | return _SwipeDismissDemoState(); 10 | } 11 | } 12 | 13 | class _SwipeDismissDemoState extends State { 14 | final _items = List.generate(100, (index) => "Item $index"); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return Scaffold( 19 | appBar: AppBar( 20 | title: Text("Swipe to Dismiss"), 21 | centerTitle: true, 22 | ), 23 | body: SafeArea( 24 | child: ListView.builder( 25 | itemCount: _items.length, 26 | itemBuilder: (context, index) { 27 | return Dismissible( 28 | background: Container( 29 | color: Theme.of(context).colorScheme.secondary, 30 | child: Align( 31 | alignment: AlignmentDirectional.centerEnd, 32 | child: Padding( 33 | padding: const EdgeInsets.only(right: 20), 34 | child: Text( 35 | "Are you sure?", 36 | style: TextStyle(color: Colors.white), 37 | ), 38 | ), 39 | ), 40 | ), 41 | key: Key(_items[index]), 42 | onDismissed: (DismissDirection direction) { 43 | setState(() { 44 | _items.removeAt(index); 45 | }); 46 | ScaffoldMessenger.of(context).showSnackBar( 47 | SnackBar(content: Text("${_items[index]}已删除!"))); 48 | }, 49 | child: ListTileCard( 50 | borderRadius: 6, 51 | title: Text(_items[index]), 52 | ), 53 | ); 54 | })), 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/demos/demo_fitted_box.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class FittedBoxDemo extends StatefulWidget { 4 | const FittedBoxDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | _FittedBoxDemoState createState() => _FittedBoxDemoState(); 8 | } 9 | 10 | class _FittedBoxDemoState extends State { 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | appBar: AppBar( 15 | title: Text("FittedBox"), 16 | centerTitle: true, 17 | ), 18 | body: SafeArea( 19 | child: Column( 20 | mainAxisAlignment: MainAxisAlignment.center, 21 | children: [ 22 | FittedBox( 23 | child: Card( 24 | color: Colors.white, 25 | child: Row( 26 | children: [ 27 | Text( 28 | "Understand With FittedBox", 29 | style: TextStyle(fontSize: 20, color: Colors.black), 30 | ), 31 | SizedBox( 32 | height: 200, 33 | child: Image.asset("images/landscape2.jpeg"), 34 | ), 35 | ], 36 | ), 37 | ), 38 | ), 39 | ], 40 | ), 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/demos/demo_http.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/api/api_demo.dart'; 3 | import 'package:flutter_system/common/res_constants.dart'; 4 | import 'package:flutter_system/utils/nav_utils.dart'; 5 | 6 | class HttpDemo extends StatefulWidget { 7 | const HttpDemo({Key? key}) : super(key: key); 8 | 9 | @override 10 | _HttpDemoState createState() { 11 | return _HttpDemoState(); 12 | } 13 | } 14 | 15 | class _HttpDemoState extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | return Scaffold( 19 | appBar: AppBar( 20 | centerTitle: true, 21 | title: Text("Http Demo"), 22 | ), 23 | body: SafeArea( 24 | child: FutureBuilder( 25 | future: fetchImages(), 26 | builder: (context, snapshot) { 27 | if (snapshot.hasData) { 28 | return RefreshIndicator( 29 | onRefresh: () { 30 | setState(() { 31 | return; 32 | }); 33 | return null; 34 | } as Future Function(), 35 | child: ListView.builder( 36 | physics: const AlwaysScrollableScrollPhysics(), 37 | padding: EdgeInsets.only(left: 10, right: 10, top: 6), 38 | itemCount: snapshot.data!.result.length, 39 | itemBuilder: (context, index) { 40 | final Map bean = 41 | (snapshot.data!.result)[index]; 42 | return Card( 43 | shape: RoundedRectangleBorder( 44 | borderRadius: BorderRadius.circular(4)), 45 | child: InkWell( 46 | child: FadeInImage.assetNetwork( 47 | image: bean["img"] ?? IMG_URL0, 48 | placeholder: "images/loading.gif", 49 | ), 50 | onTap: () { 51 | NavUtils.openWebView(context, 52 | "https://github.com/jiangkang/flutter-system", 53 | title: "Flutter System"); 54 | }, 55 | ), 56 | ); 57 | }), 58 | ); 59 | } else if (snapshot.hasError) { 60 | return Center(child: Text("Error occurs! ${snapshot.error}")); 61 | } 62 | return Center(child: CircularProgressIndicator()); 63 | }, 64 | )), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/demos/demo_key.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class KeyDemo extends StatefulWidget { 6 | const KeyDemo({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _KeyDemoState(); 10 | } 11 | 12 | class _KeyDemoState extends State { 13 | List widgets = [ 14 | RandomColorBlock(key: UniqueKey()), 15 | RandomColorBlock(key: UniqueKey()), 16 | ]; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | body: SizedBox( 22 | width: double.maxFinite, 23 | height: double.maxFinite, 24 | child: Center( 25 | child: Row( 26 | mainAxisAlignment: MainAxisAlignment.center, 27 | crossAxisAlignment: CrossAxisAlignment.center, 28 | children: widgets), 29 | ), 30 | ), 31 | floatingActionButton: FloatingActionButton( 32 | onPressed: () { 33 | widgets.insert(0, widgets.removeAt(1)); 34 | setState(() {}); 35 | }, 36 | child: Icon(Icons.swap_horiz), 37 | ), 38 | ); 39 | } 40 | } 41 | 42 | class RandomColorBlock extends StatefulWidget { 43 | @override 44 | State createState() => _RandomColorBlockState(); 45 | 46 | const RandomColorBlock({Key? key}) : super(key: key); 47 | } 48 | 49 | class _RandomColorBlockState extends State { 50 | final Color randomColor = Color.fromARGB(Random().nextInt(256), 51 | Random().nextInt(256), Random().nextInt(256), Random().nextInt(256)); 52 | 53 | @override 54 | Widget build(BuildContext context) { 55 | return Container( 56 | width: 100, 57 | height: 100, 58 | color: randomColor, 59 | ); 60 | } 61 | } 62 | 63 | void main() => runApp(MaterialApp(home: KeyDemo())); 64 | -------------------------------------------------------------------------------- /lib/demos/demo_list_wheel_scrollview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ListWheelScrollViewDemo extends StatefulWidget { 4 | const ListWheelScrollViewDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | _ListWheelScrollViewDemoState createState() => 8 | _ListWheelScrollViewDemoState(); 9 | } 10 | 11 | class _ListWheelScrollViewDemoState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | appBar: AppBar( 16 | title: Text("ListWheelScrollView"), 17 | centerTitle: true, 18 | ), 19 | body: ListWheelScrollView( 20 | itemExtent: 60, 21 | controller: FixedExtentScrollController(), 22 | physics: FixedExtentScrollPhysics(), 23 | children: List.generate( 24 | 100, 25 | (index) => Card( 26 | shape: RoundedRectangleBorder( 27 | borderRadius: BorderRadius.circular(6)), 28 | child: ListTile( 29 | title: Text("$index"), 30 | ), 31 | )), 32 | ), 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/demos/demo_platform.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/component/listview_item.dart'; 3 | import 'package:flutter_system/platform/toast.dart'; 4 | 5 | class PlatformDemo extends StatefulWidget { 6 | const PlatformDemo({Key? key}) : super(key: key); 7 | 8 | @override 9 | _PlatformDemoState createState() { 10 | return _PlatformDemoState(); 11 | } 12 | } 13 | 14 | class _PlatformDemoState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: AppBar( 19 | title: Text("Platform Special"), 20 | centerTitle: true, 21 | ), 22 | body: SafeArea( 23 | child: ListView( 24 | children: [ 25 | ListTileCard( 26 | borderRadius: 4, 27 | title: Text("Show a Toast"), 28 | onTap: () { 29 | showToast("Are you familar with me?"); 30 | }, 31 | ), 32 | ], 33 | )), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/demos/demo_progress_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ProgressIndicatorDemo extends StatelessWidget { 4 | const ProgressIndicatorDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text("Progress Indicator"), 11 | centerTitle: true, 12 | ), 13 | body: SafeArea( 14 | child: GridView.count( 15 | crossAxisCount: 2, 16 | padding: EdgeInsets.all(10), 17 | children: const [ 18 | Card(child: Center(child: LinearProgressIndicator())), 19 | Card( 20 | child: Center( 21 | child: LinearProgressIndicator( 22 | valueColor: AlwaysStoppedAnimation(Colors.yellow), 23 | ))), 24 | Card( 25 | child: Center( 26 | child: LinearProgressIndicator( 27 | value: 0.5, 28 | ))), 29 | Card( 30 | child: Center( 31 | child: LinearProgressIndicator( 32 | value: 0.1, 33 | ))), 34 | Card( 35 | child: Center( 36 | child: LinearProgressIndicator( 37 | value: 1, 38 | ))), 39 | Card(child: Center(child: CircularProgressIndicator())), 40 | Card(child: Center(child: RefreshProgressIndicator())), 41 | Card( 42 | child: Center( 43 | child: RefreshProgressIndicator( 44 | backgroundColor: Colors.pinkAccent, 45 | ))), 46 | ], 47 | ), 48 | ), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/demos/demo_rendering.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/rendering.dart'; 3 | 4 | void main() { 5 | // We use RenderingFlutterBinding to attach the render tree to the window. 6 | RenderingFlutterBinding( 7 | // The root of our render tree is a RenderPositionedBox, which centers its 8 | // child both vertically and horizontally. 9 | root: RenderPositionedBox( 10 | // We use a RenderParagraph to display the text 'Hello, world.' without 11 | // any explicit styling. 12 | child: RenderParagraph( 13 | const TextSpan(text: 'Hello, world.'), 14 | // The text is in English so we specify the text direction as 15 | // left-to-right. If the text had been in Hebrew or Arabic, we would 16 | // have specified right-to-left. The Flutter framework does not assume a 17 | // particular text direction. 18 | textDirection: TextDirection.ltr, 19 | ), 20 | ), 21 | ).scheduleFrame(); 22 | } 23 | -------------------------------------------------------------------------------- /lib/demos/demo_safearea.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// SafeArea Demo 4 | class SafeAreaDemo extends StatelessWidget { 5 | const SafeAreaDemo({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return SafeArea( 10 | child: ListView( 11 | children: List.generate( 12 | 500, 13 | (index) => ListTile( 14 | title: Text("$index"), 15 | )), 16 | ), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/demos/demo_scrollable.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/demos/demo_navigator.dart'; 3 | import 'package:flutter_system/demos/demos.dart'; 4 | 5 | void main() { 6 | runDemo(ScrollableDemo(), title: "Scrollable Demo"); 7 | } 8 | 9 | class ScrollableDemo extends StatefulWidget { 10 | const ScrollableDemo({Key? key}) : super(key: key); 11 | 12 | @override 13 | _ScrollableDemoState createState() => _ScrollableDemoState(); 14 | } 15 | 16 | class _ScrollableDemoState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: AppBar( 21 | title: InkWell( 22 | child: Text("跳转到navigator demo"), 23 | onTap: (){ 24 | Navigator.of(context).push(MaterialPageRoute(builder: (context) => NavigatorDemo())); 25 | }, 26 | ), 27 | ), 28 | body: Scrollable( 29 | axisDirection: AxisDirection.right, 30 | controller: ScrollController(), 31 | viewportBuilder: (context, offset) { 32 | return Viewport( 33 | axisDirection: AxisDirection.right, 34 | offset: offset, 35 | slivers: [ 36 | SliverFillViewport( 37 | viewportFraction: 1, 38 | delegate: SliverChildBuilderDelegate( 39 | (context, index) { 40 | return Center( 41 | child: Container( 42 | color: index.isEven ? Colors.redAccent : Colors.amber, 43 | width: 360, 44 | height: 360, 45 | alignment: Alignment.center, 46 | child: Text("Item $index"), 47 | ), 48 | ); 49 | }, 50 | childCount: 24, 51 | )), 52 | ], 53 | ); 54 | }), 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/demos/demo_tabs.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/page/page_entry.dart'; 3 | 4 | /// Tab Demo 5 | /// important concept: [TabBar.indicator],[TabController],[TabBar],[TabBarView] 6 | class TabsDemo extends StatefulWidget { 7 | const TabsDemo({Key? key}) : super(key: key); 8 | 9 | @override 10 | _TabsDemoState createState() { 11 | return _TabsDemoState(); 12 | } 13 | } 14 | 15 | class _TabsDemoState extends State 16 | with SingleTickerProviderStateMixin { 17 | final TABS = [ 18 | Tab(icon: Icon(Icons.book)), 19 | Tab(icon: Icon(Icons.videocam)), 20 | Tab(icon: Icon(Icons.games)), 21 | ]; 22 | 23 | final PAGES = [ 24 | ArticleEntry(), 25 | PageEntry(), 26 | DemoEntry(), 27 | ]; 28 | 29 | TabController? _tabController; 30 | 31 | @override 32 | void initState() { 33 | _tabController = 34 | TabController(initialIndex: 0, length: TABS.length, vsync: this); 35 | super.initState(); 36 | } 37 | 38 | @override 39 | Widget build(BuildContext context) { 40 | return DefaultTabController( 41 | length: TABS.length, 42 | child: Scaffold( 43 | appBar: AppBar( 44 | title: Text("Tabs Demo"), 45 | centerTitle: true, 46 | bottom: _buildTabBar(), 47 | ), 48 | body: _buildTabBarView(), 49 | floatingActionButton: Builder( 50 | builder: (BuildContext context) => FloatingActionButton( 51 | child: Icon(Icons.info), 52 | onPressed: () { 53 | _showSnackBar(context); 54 | }), 55 | ))); 56 | } 57 | 58 | TabBarView _buildTabBarView() { 59 | return TabBarView( 60 | controller: _tabController, 61 | children: PAGES, 62 | ); 63 | } 64 | 65 | TabBar _buildTabBar() { 66 | return TabBar( 67 | controller: _tabController, 68 | tabs: TABS, 69 | indicatorColor: Colors.white, 70 | indicatorPadding: EdgeInsets.symmetric(horizontal: 20), 71 | indicatorWeight: 2, 72 | indicatorSize: TabBarIndicatorSize.label, 73 | isScrollable: true, 74 | ); 75 | } 76 | 77 | void _showSnackBar(BuildContext context) { 78 | ScaffoldMessenger.of(context).showSnackBar( 79 | SnackBar(content: Text("当前选中index为${_tabController!.index}"))); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lib/demos/demo_textfield.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class TextFieldDemo extends StatefulWidget { 4 | const TextFieldDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | _TextFieldDemoState createState() => _TextFieldDemoState(); 8 | } 9 | 10 | class _TextFieldDemoState extends State { 11 | String _value = ""; 12 | 13 | TextEditingController? _controller; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | _controller = TextEditingController(); 19 | _controller!.addListener(() {}); 20 | } 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | appBar: AppBar( 26 | title: Text("TextField"), 27 | centerTitle: true, 28 | ), 29 | body: Column( 30 | children: [ 31 | Text(_value), 32 | Row( 33 | children: [ 34 | Text("Default:"), 35 | Expanded( 36 | child: TextField( 37 | controller: _controller, 38 | onChanged: (value) { 39 | _value = value; 40 | }, 41 | ), 42 | ), 43 | ], 44 | ), 45 | ], 46 | ), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/demos/demo_websocket.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:web_socket_channel/io.dart'; 3 | 4 | class WebSocketDemo extends StatefulWidget { 5 | const WebSocketDemo({Key? key}) : super(key: key); 6 | 7 | @override 8 | _WebSocketDemoState createState() { 9 | return _WebSocketDemoState(); 10 | } 11 | } 12 | 13 | class _WebSocketDemoState extends State { 14 | final _channel = IOWebSocketChannel.connect('ws://echo.websocket.org'); 15 | 16 | final _controller = TextEditingController(); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | appBar: AppBar( 22 | title: Text("WebSocket"), 23 | centerTitle: true, 24 | ), 25 | body: SafeArea( 26 | child: Column( 27 | children: [ 28 | Form( 29 | child: TextFormField( 30 | controller: _controller, 31 | decoration: InputDecoration(labelText: "Send a message"), 32 | )), 33 | StreamBuilder( 34 | stream: _channel.stream, 35 | builder: (context, snapshot) { 36 | if (snapshot.hasError) { 37 | showDialog( 38 | context: context, 39 | builder: (context) => AlertDialog( 40 | title: Text( 41 | "Tips", 42 | ), 43 | content: Text( 44 | "You should science online if you are in china"), 45 | )); 46 | } 47 | return Padding( 48 | padding: EdgeInsets.symmetric(vertical: 20), 49 | child: Text(snapshot.hasData 50 | ? "${snapshot.data}" 51 | : "waiting response..."), 52 | ); 53 | }) 54 | ], 55 | )), 56 | floatingActionButton: FloatingActionButton( 57 | onPressed: _sendMessage, 58 | tooltip: "Send Message", 59 | child: Icon(Icons.send), 60 | ), 61 | ); 62 | } 63 | 64 | @override 65 | void dispose() { 66 | _channel.sink.close(); 67 | super.dispose(); 68 | } 69 | 70 | void _sendMessage() { 71 | if (_controller.text.isNotEmpty) { 72 | _channel.sink.add(_controller.text); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/demos/demos.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | RouteObserver> demoRouteObserver = RouteObserver(); 4 | 5 | /// Run demo page 6 | void runDemo(Widget widget, {String title = ""}) { 7 | runApp( 8 | MaterialApp( 9 | navigatorObservers: [ 10 | demoRouteObserver, 11 | ], 12 | home: Scaffold( 13 | appBar: AppBar( 14 | title: Text(title), 15 | centerTitle: true, 16 | ), 17 | body: widget, 18 | ), 19 | ), 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /lib/demos/editable/rich_editable_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/demos/demos.dart'; 3 | 4 | void main() { 5 | runDemo(RichEditableTextDemo()); 6 | } 7 | 8 | class RichTextEditingController extends TextEditingController { 9 | @override 10 | TextSpan buildTextSpan({required BuildContext context, TextStyle? style, required bool withComposing}) { 11 | String originText = value.text; 12 | if (originText.isEmpty) { 13 | return super.buildTextSpan(context: context, style: style, withComposing: withComposing); 14 | } 15 | return _handleRichTextSpan(originText, style, withComposing); 16 | } 17 | 18 | TextSpan _handleRichTextSpan(String content, TextStyle? style, bool withComposing) { 19 | final List inlineSpanList = []; 20 | RegExp regExp = RegExp(r'^{\[}[a-zA-Z]+(\])$'); 21 | regExp.allMatches(content).forEach((match) { 22 | int start = match.start; 23 | int end = match.end; 24 | String matchedText = content.substring(start,end); 25 | debugPrint(">>> $matchedText"); 26 | }); 27 | if (content.startsWith("@") && content.endsWith(" ")) { 28 | InlineSpan span = WidgetSpan( 29 | child: Text( 30 | content, 31 | style: style?.copyWith(color: Colors.redAccent) ?? TextStyle(color: Colors.red), 32 | )); 33 | inlineSpanList.add(span); 34 | } else { 35 | inlineSpanList.add(TextSpan(text: content,style: TextStyle(color: Colors.black))); 36 | } 37 | debugPrint("$inlineSpanList"); 38 | selection = TextSelection.collapsed(offset: content.length); 39 | return TextSpan(children: inlineSpanList, style: style ?? TextStyle(color: Colors.black)); 40 | } 41 | } 42 | 43 | class RichEditableTextDemo extends StatefulWidget { 44 | const RichEditableTextDemo({Key? key}) : super(key: key); 45 | 46 | @override 47 | _RichEditableTextDemoState createState() => _RichEditableTextDemoState(); 48 | } 49 | 50 | class _RichEditableTextDemoState extends State { 51 | late RichTextEditingController _richTextEditingController; 52 | 53 | @override 54 | void initState() { 55 | _richTextEditingController = RichTextEditingController(); 56 | super.initState(); 57 | } 58 | 59 | @override 60 | Widget build(BuildContext context) { 61 | return Padding( 62 | padding: const EdgeInsets.all(8.0), 63 | child: TextField( 64 | maxLines: null, 65 | expands: true, 66 | decoration: InputDecoration(border: OutlineInputBorder()), 67 | controller: _richTextEditingController, 68 | onChanged: (content) { 69 | debugPrint("onChanged"); 70 | }, 71 | ), 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/demos/image/demo_gif_image.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class GifDemo extends StatefulWidget { 4 | const GifDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | _GifDemoState createState() => _GifDemoState(); 8 | } 9 | 10 | class _GifDemoState extends State { 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | appBar: AppBar( 15 | title: Text("Gif Demo"), 16 | centerTitle: true, 17 | ), 18 | body: SafeArea( 19 | child: ListView( 20 | children: const [], 21 | ), 22 | ), 23 | ); 24 | } 25 | } 26 | 27 | class GifImage extends StatefulWidget { 28 | final bool showOnlyFirstFrame; 29 | 30 | const GifImage({Key? key, this.showOnlyFirstFrame = false}) : super(key: key); 31 | 32 | @override 33 | _GifImageState createState() => _GifImageState(); 34 | } 35 | 36 | class _GifImageState extends State { 37 | @override 38 | void initState() { 39 | super.initState(); 40 | } 41 | 42 | @override 43 | Widget build(BuildContext context) { 44 | return FutureBuilder(builder: (context, snapshot) { 45 | if (snapshot.hasData) { 46 | return Image(image: NetworkImage("")); 47 | } else { 48 | return CircularProgressIndicator(); 49 | } 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/frouter/router.dart: -------------------------------------------------------------------------------- 1 | /// Router注解 2 | class Router { 3 | final String name; 4 | final Map? args; 5 | 6 | const Router(this.name, {this.args}); 7 | @override 8 | String toString() => "Router"; 9 | } 10 | -------------------------------------------------------------------------------- /lib/frouter/router_builder.dart: -------------------------------------------------------------------------------- 1 | import 'package:build/build.dart'; 2 | import 'package:flutter_system/frouter/router_generator.dart'; 3 | import 'package:source_gen/source_gen.dart'; 4 | 5 | Builder routerBuilder(BuilderOptions options) => 6 | LibraryBuilder(RouterGenerator(), generatedExtension: '.router.dart'); 7 | -------------------------------------------------------------------------------- /lib/frouter/router_generator.dart: -------------------------------------------------------------------------------- 1 | import 'package:analyzer/dart/element/element.dart'; 2 | import 'package:build/src/builder/build_step.dart'; 3 | import 'package:flutter_system/frouter/router.dart'; 4 | import 'package:source_gen/source_gen.dart'; 5 | 6 | /// 基于注解的生成器 7 | class RouterGenerator extends GeneratorForAnnotation { 8 | @override 9 | generateForAnnotatedElement( 10 | Element element, ConstantReader annotation, BuildStep buildStep) { 11 | String routerName = annotation.peek("name")!.stringValue; 12 | return "final maps = {'$routerName':${element.name}()}"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | import 'package:flutter_localizations/flutter_localizations.dart'; 4 | import 'package:flutter_system/common/model_binding.dart'; 5 | import 'package:flutter_system/constants/const_key_value.dart'; 6 | import 'package:flutter_system/page_routers.dart'; 7 | import 'package:flutter_system/theme/custom_themes.dart'; 8 | import 'package:flutter_system/utils/sp_utils.dart'; 9 | 10 | /// App Entry 11 | void main() { 12 | /// 错误处理 13 | handleError(); 14 | runApp(MyApp()); 15 | SystemUiOverlayStyle style = 16 | SystemUiOverlayStyle(systemNavigationBarColor: Colors.transparent, statusBarColor: Colors.transparent); 17 | SystemChrome.setSystemUIOverlayStyle(style); 18 | } 19 | 20 | void handleError() { 21 | ErrorWidget.builder = (FlutterErrorDetails details) { 22 | return Container( 23 | alignment: Alignment.center, 24 | color: Colors.white, 25 | child: Center( 26 | child: Text( 27 | "好像发生了什么错误!", 28 | textDirection: TextDirection.ltr, 29 | style: TextStyle(color: Colors.blueAccent, fontSize: 32), 30 | ), 31 | ), 32 | ); 33 | }; 34 | } 35 | 36 | /// App Entry 37 | class MyApp extends StatefulWidget { 38 | const MyApp({Key? key}) : super(key: key); 39 | 40 | @override 41 | _MyAppState createState() => _MyAppState(); 42 | } 43 | 44 | class _MyAppState extends State { 45 | @override 46 | void initState() { 47 | super.initState(); 48 | } 49 | 50 | @override 51 | Widget build(BuildContext context) { 52 | return ModelBinding( 53 | initialSettings: AppSettings(themeData: ThemeData.light()), 54 | child: Builder( 55 | builder: (context) { 56 | SpUtils.getBool(keyIsDarkMode, false).then((value) { 57 | AppSettings.update(context, AppSettings(themeData: value ? dartTheme : lightTheme)); 58 | }); 59 | return MaterialApp( 60 | title: 'Flutter System', 61 | theme: AppSettings.of(context)!.themeData, 62 | debugShowCheckedModeBanner: false, 63 | initialRoute: '/', 64 | routes: appRouters, 65 | localizationsDelegates: const [ 66 | GlobalMaterialLocalizations.delegate, 67 | GlobalWidgetsLocalizations.delegate, 68 | ], 69 | ); 70 | }, 71 | ), 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/model/model_entry.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | @immutable 4 | class Article { 5 | final String? title; 6 | final String? url; 7 | 8 | const Article(this.title, this.url); 9 | 10 | factory Article.fromJson(Map json) { 11 | return Article(json["title"] as String?, json["url"] as String?); 12 | } 13 | 14 | Map toJson(Article article) { 15 | return {"title": article.title, "url": article.url}; 16 | } 17 | } 18 | 19 | @immutable 20 | class EntryItem { 21 | final String title; 22 | final String routerName; 23 | final IconData? icon; 24 | 25 | const EntryItem(this.title, this.routerName, {this.icon}); 26 | } 27 | -------------------------------------------------------------------------------- /lib/page/page_calendar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/component/calendar.dart'; 3 | 4 | class CalendarPage extends StatefulWidget { 5 | const CalendarPage({Key? key}) : super(key: key); 6 | 7 | @override 8 | _CalendarPageState createState() => _CalendarPageState(); 9 | } 10 | 11 | class _CalendarPageState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | appBar: AppBar( 16 | title: Text("Calendar"), 17 | centerTitle: true, 18 | ), 19 | body: SafeArea( 20 | child: Column( 21 | children: const [ 22 | Calendar( 23 | startDayOfWeek: StartDayOfWeek.sunday, 24 | calendarLanguage: CalendarLanguage.english, 25 | weekTextStyle: TextStyle( 26 | fontSize: 20, 27 | ), 28 | ), 29 | ], 30 | ), 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/page/page_markdown.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_markdown/flutter_markdown.dart'; 3 | import 'package:flutter_system/common/res_constants.dart'; 4 | 5 | class MarkDownEditorPage extends StatefulWidget { 6 | 7 | const MarkDownEditorPage({Key? key}) : super(key: key); 8 | 9 | @override 10 | _MarkDownEditorPageState createState() { 11 | return _MarkDownEditorPageState(); 12 | } 13 | } 14 | 15 | class _MarkDownEditorPageState extends State { 16 | 17 | @override 18 | void didChangeDependencies() { 19 | super.didChangeDependencies(); 20 | } 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | appBar: AppBar( 26 | title: Text("Markdown Editor"), 27 | centerTitle: true, 28 | ), 29 | body: SafeArea( 30 | child: Markdown( 31 | data: "# Title\n [我的博客](https://jiangkang.tech)\n![]($IMG_URL1)", 32 | )), 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/page/page_password.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/component/password.dart'; 3 | 4 | class PasswordPage extends StatefulWidget { 5 | const PasswordPage({Key? key}) : super(key: key); 6 | 7 | @override 8 | _PasswordPageState createState() { 9 | return _PasswordPageState(); 10 | } 11 | } 12 | 13 | class _PasswordPageState extends State { 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | appBar: AppBar( 18 | title: Text("Password Page"), 19 | centerTitle: true, 20 | ), 21 | body: SizedBox( 22 | width: double.infinity, 23 | height: double.infinity, 24 | child: PasswordBox( 25 | enableActionButton: false, 26 | ), 27 | )); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/page/page_settings.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/common/model_binding.dart'; 3 | import 'package:flutter_system/constants/const_key_value.dart'; 4 | import 'package:flutter_system/theme/custom_themes.dart'; 5 | import 'package:flutter_system/utils/sp_utils.dart'; 6 | 7 | /// 设置页 8 | class SettingsPage extends StatefulWidget { 9 | const SettingsPage({Key? key}) : super(key: key); 10 | 11 | @override 12 | _SettingsPageState createState() => _SettingsPageState(); 13 | } 14 | 15 | class _SettingsPageState extends State { 16 | bool _isDarkMode = false; 17 | 18 | @override 19 | void initState() { 20 | SpUtils.getBool(keyIsDarkMode, false).then((value) { 21 | setState(() { 22 | _isDarkMode = value; 23 | }); 24 | }); 25 | super.initState(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Scaffold( 31 | appBar: AppBar( 32 | title: Text("设置页"), 33 | centerTitle: true, 34 | ), 35 | body: SafeArea( 36 | child: ListView( 37 | children: [ 38 | SwitchListTile( 39 | title: Text("深色模式"), 40 | value: _isDarkMode, 41 | onChanged: (newValue) { 42 | setState(() { 43 | SpUtils.saveBool(keyIsDarkMode, newValue); 44 | _isDarkMode = newValue; 45 | AppSettings.update( 46 | context, 47 | AppSettings( 48 | themeData: _isDarkMode ? dartTheme : lightTheme)); 49 | }); 50 | }, 51 | activeColor: Theme.of(context).colorScheme.secondary, 52 | ), 53 | ], 54 | )), 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/page/page_show0.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/common/res_constants.dart'; 3 | import 'package:flutter_system/component/case0.dart'; 4 | 5 | @immutable 6 | class ShowCaseOModel { 7 | final String imgUrl; 8 | final String avatarUrl; 9 | final String title; 10 | final String username; 11 | final double radius; 12 | final int likeNum; 13 | 14 | const ShowCaseOModel(this.imgUrl, this.avatarUrl, this.title, this.username, 15 | this.radius, this.likeNum); 16 | } 17 | 18 | final List _dataList = [ 19 | ShowCaseOModel(IMGS[0], IMGS[0], "大江东去浪淘尽", "小白", 6, 10), 20 | ShowCaseOModel(IMGS[1], IMGS[1], "高处不胜寒", "小苏", 6, 12), 21 | ShowCaseOModel(IMGS[2], IMGS[2], "为伊消得人憔悴", "小李", 6, 14), 22 | ShowCaseOModel(IMGS[3], IMGS[3], "滚滚长江东逝水", "匿名", 6, 15), 23 | ShowCaseOModel(IMGS[4], IMGS[4], "恰同学少年", "老毛", 6, 19), 24 | ShowCaseOModel(IMGS[5], IMGS[5], "大漠孤烟直", "小愤", 6, 14), 25 | ]; 26 | 27 | /// 信息流 28 | class Show0Page extends StatefulWidget { 29 | 30 | 31 | 32 | const Show0Page({Key? key}) : super(key: key); 33 | 34 | @override 35 | State createState() => _Show0PageState(); 36 | } 37 | 38 | class _Show0PageState extends State { 39 | @override 40 | Widget build(BuildContext context) { 41 | return Scaffold( 42 | appBar: AppBar( 43 | title: Text("信息流"), 44 | centerTitle: true, 45 | ), 46 | body: SafeArea( 47 | child: Container( 48 | width: double.maxFinite, 49 | height: double.maxFinite, 50 | decoration: BoxDecoration(color: Colors.white), 51 | child: GridView.count( 52 | crossAxisCount: 2, 53 | children: List.generate(1000, gen), 54 | ), 55 | ), 56 | ), 57 | ); 58 | } 59 | 60 | Widget gen(int index) { 61 | final ShowCaseOModel model = 62 | _dataList[index % _dataList.length]; 63 | return ShowCase0( 64 | imgUrl: model.imgUrl, 65 | avatarUrl: model.avatarUrl, 66 | title: model.title, 67 | username: model.username, 68 | radius: model.radius, 69 | likeNum: model.likeNum, 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/page/web_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:webview_flutter/webview_flutter.dart'; 3 | 4 | class WebPage extends StatefulWidget { 5 | final String? title; 6 | 7 | final String? webUrl; 8 | 9 | @override 10 | _WebPageState createState() { 11 | return _WebPageState(); 12 | } 13 | 14 | const WebPage(this.title, this.webUrl, {Key? key}) : super(key: key); 15 | } 16 | 17 | class _WebPageState extends State { 18 | late bool _loadFinished; 19 | 20 | @override 21 | void initState() { 22 | _loadFinished = false; 23 | super.initState(); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Scaffold( 29 | appBar: AppBar( 30 | title: Text(widget.title!), 31 | centerTitle: true, 32 | leading: Builder(builder: (BuildContext context) { 33 | return IconButton( 34 | icon: Icon(Icons.arrow_back), 35 | onPressed: () { 36 | Navigator.of(context).pop(); 37 | }); 38 | }), 39 | ), 40 | body: Stack( 41 | alignment: AlignmentDirectional.center, 42 | children: [ 43 | WebView( 44 | initialUrl: widget.webUrl, 45 | javascriptMode: JavascriptMode.unrestricted, 46 | onPageFinished: (url) { 47 | setState(() { 48 | _loadFinished = true; 49 | }); 50 | }, 51 | onWebViewCreated: (controller) {}, 52 | navigationDelegate: (NavigationRequest request) { 53 | return NavigationDecision.navigate; 54 | }, 55 | ), 56 | Visibility( 57 | visible: !_loadFinished, 58 | child: CircularProgressIndicator(), 59 | ) 60 | ], 61 | ), 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/platform/toast.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | 3 | const platform = MethodChannel("com.jiangkang.flutter_system/toast"); 4 | 5 | /// show a toast 6 | Future showToast(String message) async { 7 | await platform.invokeMethod("showToast", message); 8 | } 9 | -------------------------------------------------------------------------------- /lib/products/clocks/clock_list_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/component/listview_item.dart'; 3 | 4 | class ClockListPage extends StatefulWidget { 5 | const ClockListPage({Key? key}) : super(key: key); 6 | 7 | @override 8 | _ClockListPageState createState() => _ClockListPageState(); 9 | } 10 | 11 | class _ClockListPageState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return SafeArea( 15 | child: ListView( 16 | children: [ 17 | ListTileCard( 18 | title: Text("Particle Clock"), 19 | onTap: () {}, 20 | ) 21 | ], 22 | )); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/products/clocks/particles/clock_face_painter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | const int MIN_OF_HOUR = 60; 6 | 7 | /// 时钟盘面 8 | class ClockFacePainter extends CustomPainter { 9 | final Color? color; 10 | 11 | ClockFacePainter({this.color}); 12 | 13 | @override 14 | void paint(Canvas canvas, Size size) { 15 | var cx = size.width / 2; 16 | var cy = size.height / 2; 17 | var radius = min(size.width / 2, size.height / 2); 18 | var dotRadius = radius * 0.012; 19 | 20 | var paint = Paint() 21 | ..color = color! 22 | ..strokeWidth = dotRadius * 0.5; 23 | 24 | for (var i = 0; i < MIN_OF_HOUR; i++) { 25 | var angle = i * 60 * 2 * pi / 360.0; 26 | var point = Offset(cx + radius * sin(angle), cy - radius * cos(angle)); 27 | if (i % 5 == 0) { 28 | paint.style = PaintingStyle.fill; 29 | canvas.drawCircle(point, dotRadius * 2, paint); 30 | } else { 31 | paint.style = PaintingStyle.stroke; 32 | canvas.drawCircle(point, dotRadius, paint); 33 | } 34 | } 35 | } 36 | 37 | @override 38 | bool shouldRepaint(CustomPainter oldDelegate) { 39 | return false; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/products/todo/todo_api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | 3 | import 'package:flutter_system/utils/db_utils.dart'; 4 | import 'package:sqflite/sqflite.dart'; 5 | 6 | import 'todo_model.dart'; 7 | 8 | final List list = [ 9 | Task("掌握一门编程语言"), 10 | Task("减肥20斤"), 11 | Task("考托福"), 12 | Task("考雅思"), 13 | ]; 14 | 15 | Future todoListDb = DbUtils.openDb( 16 | "todo.db", 17 | version: 1, 18 | createCallback: (db, version) { 19 | return db.execute( 20 | "CREATE TABLE todo(taskName TEXT PRIMARY KEY,taskDetail TEXT,startDate TEXT,endDate TEXT,deadline TEXT,taskStatus INTEGER,needRemind BOOL,remindDate TEXT,repeatType INTEGER)"); 21 | }, 22 | ); 23 | 24 | Future> requestTaskList() async { 25 | final Database db = await todoListDb; 26 | final List> maps = await db.query("todo"); 27 | return List.generate(maps.length, (index) => Task.fromMap(maps[index])); 28 | } 29 | 30 | Future updateTask(int index, Task newTask) async { 31 | final Database db = await todoListDb; 32 | await db.update("todo", newTask.toMap(), 33 | where: "taskName= ?", whereArgs: [newTask.taskName]); 34 | } 35 | 36 | Future addTask(Task task) async { 37 | final Database db = await todoListDb; 38 | await db.insert("todo", task.toMap()); 39 | } 40 | 41 | Future deleteTask(Task task) async { 42 | final Database db = await todoListDb; 43 | await db.delete("todo", where: "taskName = ?", whereArgs: [task.taskName]); 44 | } 45 | -------------------------------------------------------------------------------- /lib/products/youqi/api_youqi.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | import 'dart:io'; 4 | 5 | import 'package:flutter/foundation.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter/services.dart'; 8 | import 'package:flutter_system/products/youqi/youqi_model.dart'; 9 | import 'package:http/http.dart'; 10 | 11 | Future requestYouQiResponseFromApi(String url) async { 12 | final uri = Uri.parse(url); 13 | return get(uri).then((value) { 14 | return YouQiResponse.fromJson(jsonDecode(value.body)); 15 | }).catchError((err) { 16 | throw HttpException(err.toString()); 17 | }); 18 | } 19 | 20 | Future requestYouQiResponseFromAssets( 21 | BuildContext context) async { 22 | String json = await rootBundle.loadString("assets/json/youqi.json"); 23 | return YouQiResponse.fromJson(jsonDecode(json)); 24 | } 25 | 26 | Future>> requestMonthAliasResponseFromAssets( 27 | BuildContext context) async { 28 | parser(jsonData) { 29 | Map map = json.decode(jsonData); 30 | Map> result = map.map((key, value) { 31 | return MapEntry(key, List.from(value)); 32 | }); 33 | return SynchronousFuture(result); 34 | } 35 | return DefaultAssetBundle.of(context) 36 | .loadStructuredData>>( 37 | "assets/json/month_traditional.json", parser); 38 | } 39 | -------------------------------------------------------------------------------- /lib/products/youqi/widgets/date_box_painter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DateBoxPainter extends CustomPainter { 4 | final Paint _painter = Paint() 5 | ..color = Colors.white 6 | ..strokeWidth = 2; 7 | 8 | @override 9 | void paint(Canvas canvas, Size size) { 10 | canvas.drawLine( 11 | Offset(6, size.height - 6), Offset(size.height - 6, 6), _painter); 12 | } 13 | 14 | @override 15 | bool shouldRepaint(CustomPainter oldDelegate) { 16 | return false; 17 | } 18 | } -------------------------------------------------------------------------------- /lib/products/youqi/youqi_home_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_system/products/youqi/api_youqi.dart'; 5 | import 'package:flutter_system/products/youqi/youqi_model.dart'; 6 | import 'package:flutter_system/utils/nav_utils.dart'; 7 | import 'package:flutter_system/utils/time_utils.dart'; 8 | import 'package:kicons/kicons.dart'; 9 | 10 | import 'widgets/youqi_content_page.dart'; 11 | 12 | class YouQiHomePage extends StatefulWidget { 13 | const YouQiHomePage({Key? key}) : super(key: key); 14 | 15 | @override 16 | _YouQiHomePageState createState() => _YouQiHomePageState(); 17 | } 18 | 19 | class _YouQiHomePageState extends State { 20 | late Future _youQiResponseFuture; 21 | 22 | @override 23 | void initState() { 24 | _youQiResponseFuture = requestYouQiResponseFromAssets(context); 25 | super.initState(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Scaffold( 31 | body: FutureBuilder( 32 | future: _youQiResponseFuture, 33 | builder: (context, snapshot) { 34 | if (snapshot.hasData && 35 | snapshot.connectionState == ConnectionState.done) { 36 | YouQiResponse response = snapshot.data as YouQiResponse; 37 | final modelList = response.data ?? []; 38 | return PageView.builder( 39 | itemBuilder: (context, index) { 40 | return YouQiContentPage(modelList[index]); 41 | }, 42 | itemCount: modelList.length, 43 | pageSnapping: true, 44 | reverse: true, 45 | ); 46 | } 47 | return Center(child: CircularProgressIndicator()); 48 | }), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/senior/rich_text_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// 富文本基本需求: 4 | /// 1. Emoji 5 | /// 2. 链接 6 | /// 3. 单选/多选 7 | /// 4. item list 8 | /// 5. color/textStyle 9 | /// 6. quote 10 | /// 7. image 11 | /// 8. audio 12 | /// 9. video 13 | /// 10.link Card 14 | /// 11.table 15 | /// 12.其他自定义形式 16 | /// 设计要求: 17 | /// 1. 输入普通文本,内部进行匹配,分发,渲染; 18 | /// 2. 既然是普通文本,这就涉及协议的设计,用来识别不同的类型; 19 | /// 3. 两种方式,一个是默认的协议设计,一个支持自定义协议的设计; 20 | /// 4. 灵活匹配各种builder,支持外部传入 21 | void main() { 22 | runApp(MaterialApp( 23 | home: RichTextPage(), 24 | )); 25 | } 26 | 27 | class RichTextPage extends StatefulWidget { 28 | const RichTextPage({Key? key}) : super(key: key); 29 | 30 | @override 31 | _RichTextPageState createState() => _RichTextPageState(); 32 | } 33 | 34 | class _RichTextPageState extends State { 35 | @override 36 | Widget build(BuildContext context) { 37 | return Scaffold( 38 | appBar: AppBar( 39 | title: Text("Rich Text"), 40 | centerTitle: true, 41 | ), 42 | body: SafeArea( 43 | child: ListView( 44 | children: [ 45 | ListTile( 46 | title: Text.rich(TextSpan( 47 | children: [ 48 | TextSpan(text: "普通文本", style: TextStyle(color: Colors.black)), 49 | WidgetSpan( 50 | child: Icon( 51 | Icons.all_inclusive_rounded, 52 | color: Colors.red, 53 | ), 54 | ), 55 | WidgetSpan( 56 | child: Checkbox(value: false, onChanged: (value) {})), 57 | ], 58 | )), 59 | ), 60 | 61 | /// [圆嘴],[生气],[笑眯眼] 62 | ListTile( 63 | title: Text("Emoji"), 64 | subtitle: RichText( 65 | text: TextSpan(children: [ 66 | WidgetSpan( 67 | child: Image.asset( 68 | "assets/emojis/angry_face.png", 69 | width: 20, 70 | height: 20, 71 | )), 72 | WidgetSpan( 73 | child: Image.asset( 74 | "assets/emojis/circle_face.png", 75 | width: 20, 76 | height: 20, 77 | )), 78 | WidgetSpan( 79 | child: Image.asset( 80 | "assets/emojis/smile_face.png", 81 | width: 20, 82 | height: 20, 83 | )), 84 | ]), 85 | ), 86 | ), 87 | ], 88 | ), 89 | ), 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/storage/storage_assets.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_system/model/model_entry.dart'; 6 | 7 | class AssetStorage { 8 | /// 从assets中获取字符串 9 | static Future getStringFromAsset( 10 | BuildContext context, String path) async { 11 | return DefaultAssetBundle.of(context).loadString(path); 12 | } 13 | 14 | /// 从assets中读取Article列表数据 15 | static Future> getArticleList(BuildContext context) async { 16 | articleListParser(jsonData) { 17 | final List list = json.decode(jsonData); 18 | final mapList = list.cast>(); 19 | return SynchronousFuture(mapList 20 | .map((Map map) => Article.fromJson(map)) 21 | .toList()); 22 | } 23 | return DefaultAssetBundle.of(context).loadStructuredData>( 24 | "assets/json/articles.json", articleListParser); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/theme/custom_themes.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | final lightTheme = ThemeData.light(); 4 | 5 | final dartTheme = ThemeData.dark(); 6 | 7 | final yellowLightTheme = ThemeData( 8 | brightness: Brightness.light, 9 | primaryColor: Colors.yellow, colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.yellowAccent)); 10 | 11 | class ThemesNotifier with ChangeNotifier { 12 | static ThemeData _currentTheme = lightTheme; 13 | 14 | void setCurrentTheme(ThemeData themeData) { 15 | _currentTheme = themeData; 16 | notifyListeners(); 17 | } 18 | 19 | get currentTheme => _currentTheme; 20 | } 21 | -------------------------------------------------------------------------------- /lib/try/README.md: -------------------------------------------------------------------------------- 1 | ## 可以直接运行的例子 2 | -------------------------------------------------------------------------------- /lib/try/animation/anim_basic.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AnimBasic extends StatefulWidget { 4 | const AnimBasic({Key? key}) : super(key: key); 5 | 6 | @override 7 | _AnimBasicState createState() => _AnimBasicState(); 8 | } 9 | 10 | class _AnimBasicState extends State 11 | with SingleTickerProviderStateMixin { 12 | late Animation _animation; 13 | late AnimationController _animationController; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | _animationController = AnimationController( 19 | vsync: this, 20 | duration: Duration(seconds: 10), 21 | ); 22 | _animation = Tween(begin: 100.0, end: 360.0).animate(_animationController) 23 | ..addListener(() { 24 | setState(() {}); 25 | }) 26 | ..addStatusListener((status) { 27 | setState(() { 28 | if (_animation.isDismissed) { 29 | // stop at beginning 30 | _animationController.forward(); 31 | } else if (_animation.isCompleted) { 32 | //stop at end 33 | _animationController.reverse(); 34 | } 35 | }); 36 | }); 37 | _animationController.forward(); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Scaffold( 43 | appBar: AppBar( 44 | title: Text("Animation Basic"), 45 | ), 46 | body: SafeArea( 47 | child: Center( 48 | child: Image.asset( 49 | "images/landscape2.jpeg", 50 | width: _animation.value, 51 | height: _animation.value, 52 | ), 53 | ), 54 | ), 55 | ); 56 | } 57 | 58 | @override 59 | void dispose() { 60 | super.dispose(); 61 | _animationController.dispose(); 62 | } 63 | } 64 | 65 | void main() { 66 | runApp(MaterialApp( 67 | home: AnimBasic(), 68 | )); 69 | } 70 | -------------------------------------------------------------------------------- /lib/try/animation/anim_builder.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AnimBuilderDemo extends StatefulWidget { 4 | const AnimBuilderDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | _AnimBuilderDemoState createState() => _AnimBuilderDemoState(); 8 | } 9 | 10 | class _AnimBuilderDemoState extends State 11 | with SingleTickerProviderStateMixin { 12 | Animation? _animation; 13 | late AnimationController _controller; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | _controller = AnimationController( 19 | vsync: this, 20 | duration: Duration(seconds: 3), 21 | ); 22 | _animation = Tween(begin: 100.0, end: 360.0).animate(_controller) 23 | ..addStatusListener((status) { 24 | setState(() { 25 | if (_animation!.isCompleted) { 26 | _controller.reverse(); 27 | } else if (_animation!.isDismissed) { 28 | _controller.forward(); 29 | } 30 | }); 31 | }); 32 | _controller.forward(); 33 | } 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | return Scaffold( 38 | appBar: AppBar( 39 | title: Text("AnimatedBuilder"), 40 | ), 41 | body: InkWell( 42 | child: GrowTransition( 43 | animation: _animation, 44 | child: LogoWidget(), 45 | ), 46 | ), 47 | ); 48 | } 49 | 50 | @override 51 | void dispose() { 52 | _controller.dispose(); 53 | super.dispose(); 54 | } 55 | } 56 | 57 | class GrowTransition extends StatelessWidget { 58 | final Widget? child; 59 | final Animation? animation; 60 | 61 | @override 62 | Widget build(BuildContext context) { 63 | return Center( 64 | child: AnimatedBuilder( 65 | animation: animation!, 66 | builder: (context, w) => SizedBox( 67 | width: animation!.value, 68 | height: animation!.value, 69 | child: w, 70 | ), 71 | child: child, 72 | ), 73 | ); 74 | } 75 | 76 | const GrowTransition({Key? key, this.child, this.animation}) : super(key: key); 77 | } 78 | 79 | class LogoWidget extends StatelessWidget { 80 | const LogoWidget({Key? key}) : super(key: key); 81 | 82 | @override 83 | Widget build(BuildContext context) { 84 | return Container( 85 | margin: EdgeInsets.symmetric(vertical: 10), 86 | child: FlutterLogo(), 87 | ); 88 | } 89 | } 90 | 91 | void main() => runApp(MaterialApp( 92 | home: AnimBuilderDemo(), 93 | )); 94 | -------------------------------------------------------------------------------- /lib/try/animation/anim_container.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class AnimContainerDemo extends StatefulWidget { 6 | const AnimContainerDemo({Key? key}) : super(key: key); 7 | 8 | @override 9 | _AnimContainerDemoState createState() => _AnimContainerDemoState(); 10 | } 11 | 12 | class _AnimContainerDemoState extends State { 13 | double _width = 50.0; 14 | double _height = 50.0; 15 | Color _color = Colors.green; 16 | BorderRadiusGeometry _borderRadius = BorderRadius.circular(8); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | appBar: AppBar( 22 | title: Text("AnimatedContainer"), 23 | ), 24 | body: Container( 25 | decoration: BoxDecoration( 26 | color: Colors.white, 27 | ), 28 | child: Center( 29 | child: AnimatedContainer( 30 | duration: Duration(seconds: 3), 31 | width: _width, 32 | height: _height, 33 | decoration: 34 | BoxDecoration(color: _color, borderRadius: _borderRadius), 35 | curve: Curves.fastOutSlowIn, 36 | ), 37 | ), 38 | ), 39 | floatingActionButton: FloatingActionButton( 40 | onPressed: () { 41 | setState(() { 42 | final random = Random(); 43 | _width = random.nextInt(360).toDouble(); 44 | _height = random.nextInt(360).toDouble(); 45 | _color = Color.fromRGBO(random.nextInt(256), random.nextInt(256), 46 | random.nextInt(256), 1); 47 | _borderRadius = 48 | BorderRadius.circular(random.nextInt(100).toDouble()); 49 | }); 50 | }, 51 | child: Icon(Icons.track_changes), 52 | ), 53 | ); 54 | } 55 | } 56 | 57 | void main() => runApp(MaterialApp( 58 | home: AnimContainerDemo(), 59 | )); 60 | -------------------------------------------------------------------------------- /lib/try/animation/anim_hero_std.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class HeroStdDemo extends StatefulWidget { 4 | const HeroStdDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | _HeroStdDemoState createState() => _HeroStdDemoState(); 8 | } 9 | 10 | class _HeroStdDemoState extends State { 11 | @override 12 | Widget build(BuildContext context) { 13 | return Container(); 14 | } 15 | } 16 | 17 | void main() => runApp(MaterialApp( 18 | home: HeroStdDemo(), 19 | )); 20 | -------------------------------------------------------------------------------- /lib/try/animation/anim_two.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AnimTwoDemo extends StatefulWidget { 4 | const AnimTwoDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | _AnimTwoDemoState createState() => _AnimTwoDemoState(); 8 | } 9 | 10 | class _AnimTwoDemoState extends State 11 | with SingleTickerProviderStateMixin { 12 | late AnimationController _controller; 13 | late Animation _animation; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | _controller = AnimationController( 19 | vsync: this, 20 | duration: Duration(seconds: 3), 21 | ); 22 | _animation = CurvedAnimation(parent: _controller, curve: Curves.easeIn) 23 | ..addStatusListener((status) { 24 | setState(() { 25 | if (status == AnimationStatus.completed) { 26 | _controller.reverse(); 27 | } else if (status == AnimationStatus.dismissed) { 28 | _controller.forward(); 29 | } 30 | }); 31 | }); 32 | _controller.forward(); 33 | } 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | return Scaffold( 38 | appBar: AppBar( 39 | title: Text("两个Animation同时运行"), 40 | ), 41 | body: AnimatedLogo( 42 | animation: _animation, 43 | ), 44 | ); 45 | } 46 | } 47 | 48 | class AnimatedLogo extends AnimatedWidget { 49 | static final _tweenOpacity = Tween(begin: 0.0, end: 1.0); 50 | static final _tweenSize = Tween(begin: 100.0, end: 360.0); 51 | 52 | const AnimatedLogo({Key? key, required Animation animation}) 53 | : super(key: key, listenable: animation); 54 | 55 | @override 56 | Widget build(BuildContext context) { 57 | final animation = listenable as Animation; 58 | return Center( 59 | child: Opacity( 60 | opacity: _tweenOpacity.evaluate(animation), 61 | child: SizedBox( 62 | width: _tweenSize.evaluate(animation), 63 | height: _tweenSize.evaluate(animation), 64 | child: FlutterLogo(), 65 | ), 66 | ), 67 | ); 68 | } 69 | } 70 | 71 | void main() => runApp(MaterialApp( 72 | home: AnimTwoDemo(), 73 | )); 74 | -------------------------------------------------------------------------------- /lib/try/animation/anim_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AnimatedLogo extends AnimatedWidget { 4 | const AnimatedLogo({Key? key, required Animation animation}) 5 | : super(key: key, listenable: animation); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | final animation = listenable as Animation; 10 | return Center( 11 | child: Container( 12 | margin: EdgeInsets.symmetric(vertical: 10), 13 | width: animation.value, 14 | height: animation.value, 15 | child: FlutterLogo(), 16 | ), 17 | ); 18 | } 19 | } 20 | 21 | class AnimatedDemo extends StatefulWidget { 22 | const AnimatedDemo({Key? key}) : super(key: key); 23 | 24 | @override 25 | _AnimatedDemoState createState() => _AnimatedDemoState(); 26 | } 27 | 28 | class _AnimatedDemoState extends State 29 | with SingleTickerProviderStateMixin { 30 | late Animation _animation; 31 | late AnimationController _controller; 32 | 33 | @override 34 | void initState() { 35 | super.initState(); 36 | _controller = AnimationController( 37 | vsync: this, 38 | duration: Duration(seconds: 3), 39 | ); 40 | _animation = Tween(begin: 100.0, end: 360.0).animate(_controller) 41 | ..addStatusListener((status) { 42 | setState(() { 43 | if (_animation.isDismissed) { 44 | // stop at beginning 45 | _controller.forward(); 46 | } else if (_animation.isCompleted) { 47 | //stop at end 48 | _controller.reverse(); 49 | } 50 | }); 51 | }); 52 | _controller.forward(); 53 | } 54 | 55 | @override 56 | Widget build(BuildContext context) { 57 | return Scaffold( 58 | appBar: AppBar( 59 | title: Text("AnimatedWidget"), 60 | ), 61 | body: AnimatedLogo( 62 | animation: _animation, 63 | ), 64 | ); 65 | } 66 | 67 | @override 68 | void dispose() { 69 | super.dispose(); 70 | _controller.dispose(); 71 | } 72 | } 73 | 74 | void main() { 75 | runApp(MaterialApp( 76 | home: AnimatedDemo(), 77 | )); 78 | } 79 | -------------------------------------------------------------------------------- /lib/try/animation/demo_fade_in.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class FadeInDemo extends StatefulWidget { 4 | const FadeInDemo({Key? key}) : super(key: key); 5 | 6 | @override 7 | _FadeInDemoState createState() => _FadeInDemoState(); 8 | } 9 | 10 | class _FadeInDemoState extends State { 11 | double _opacity = 0.0; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Scaffold( 16 | appBar: AppBar( 17 | title: Text("FadeIn"), 18 | ), 19 | body: Center( 20 | child: Column( 21 | children: [ 22 | Image.asset( 23 | "images/banner.jpg", 24 | height: 100, 25 | ), 26 | MaterialButton( 27 | onPressed: () { 28 | setState(() { 29 | _opacity = 1.0; 30 | }); 31 | }, 32 | child: Text( 33 | "Show Details", 34 | style: TextStyle(color: Colors.blueAccent), 35 | ), 36 | ), 37 | AnimatedOpacity( 38 | duration: Duration(seconds: 3), 39 | opacity: _opacity, 40 | child: Column( 41 | children: const [ 42 | Text('Type: Owl'), 43 | Text('Age: 39'), 44 | Text('Employment: None'), 45 | ], 46 | ), 47 | ), 48 | ], 49 | ), 50 | ), 51 | ); 52 | } 53 | } 54 | 55 | void main() => runApp(MaterialApp( 56 | home: FadeInDemo(), 57 | )); 58 | -------------------------------------------------------------------------------- /lib/utils/app_utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | 3 | /// 是否为Release模式 4 | const bool isReleaseMode = bool.fromEnvironment("dart.vm.product"); 5 | 6 | /// 判断是否为Debug模式 7 | bool isDebug() { 8 | return kDebugMode; 9 | } 10 | 11 | /// 判断编译模式 12 | String getCompileMode() { 13 | if (kDebugMode) { 14 | return "debug"; 15 | } else if (kProfileMode) { 16 | return "profile"; 17 | } else if (kReleaseMode) { 18 | return "release"; 19 | } else { 20 | return "Unknown type"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/utils/asset_utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/services.dart'; 6 | import 'package:flutter_system/model/model_entry.dart'; 7 | 8 | class AssetUtils { 9 | AssetUtils._(); 10 | 11 | /// 从assets中读取Article列表数据 12 | static Future> getArticleList(BuildContext context) async { 13 | articleListParser(jsonData) { 14 | final List list = json.decode(jsonData); 15 | final mapList = list.cast>(); 16 | return SynchronousFuture(mapList 17 | .map((Map map) => Article.fromJson(map)) 18 | .toList()); 19 | } 20 | return DefaultAssetBundle.of(context).loadStructuredData>( 21 | "assets/json/articles.json", articleListParser); 22 | } 23 | 24 | static Future getString(String filename, bool cache) async { 25 | return rootBundle.loadString(filename, cache: cache); 26 | } 27 | 28 | static Future getByteData(String filename) async { 29 | return rootBundle.load(filename); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/utils/color_utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ColorUtils { 4 | ColorUtils._(); 5 | 6 | /// 解析颜色字符串 7 | /// * `colorString` 颜色格式为"#123456" 8 | static Color? parseColor(String colorString) { 9 | if (colorString.isEmpty) { 10 | return null; 11 | } else { 12 | int colorInt = int.parse(colorString.substring(1), radix: 16); 13 | return Color(colorInt); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/utils/db_utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:path/path.dart'; 2 | import 'package:sqflite/sqflite.dart'; 3 | 4 | /// 数据库工具类 5 | class DbUtils { 6 | DbUtils._(); 7 | 8 | /// 打开数据库 9 | /// [dbName] 是数据库名,如test.db 10 | /// [createCallback] 这里可以创建数据表 11 | static Future openDb(String dbName, 12 | {OnDatabaseCreateFn? createCallback, int version = 1}) async { 13 | return openDatabase( 14 | join(await getDatabasesPath(), dbName), 15 | onCreate: createCallback, 16 | version: version, 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/utils/nav_utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_system/page/web_page.dart'; 3 | 4 | class NavUtils { 5 | /// 打开WebView 6 | static Future openWebView(BuildContext context, String? webUrl, 7 | {String? title = ""}) async { 8 | await Navigator.of(context).push(MaterialPageRoute(builder: (context) { 9 | return WebPage(title, webUrl); 10 | })); 11 | } 12 | 13 | /// 通过路由名字跳转 14 | static navByRouterName(BuildContext context, String routerName) { 15 | Navigator.of(context).pushNamed(routerName); 16 | Navigator.of(context).pop(); 17 | } 18 | 19 | /// 跳转指定页面 20 | static navToPage(BuildContext context, Widget page) { 21 | Navigator.of(context).push(MaterialPageRoute(builder: (context) { 22 | return page; 23 | })); 24 | } 25 | 26 | /// 动画跳转 27 | static animToPage(BuildContext context, Widget page) { 28 | final router = PageRouteBuilder( 29 | pageBuilder: (BuildContext context, Animation animation, 30 | Animation secondaryAnimation) { 31 | return page; 32 | }, 33 | transitionsBuilder: (BuildContext context, Animation animation, 34 | Animation secondaryAnimation, Widget child) { 35 | // child是pageBuilder中返回的,一般在这里处理转场动画 36 | return child; 37 | }, 38 | ); 39 | Navigator.of(context).push(router); 40 | } 41 | 42 | static navToPageWithData(BuildContext context, Widget page, Object data) { 43 | Navigator.of(context).pushNamed("/demo", arguments: data); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/utils/pickers_utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | import 'package:image_picker/image_picker.dart'; 5 | 6 | class Pickers { 7 | static Future pickImageFromGallery() async { 8 | final pickedFile = await (ImagePicker().pickImage(source: ImageSource.gallery) as FutureOr); 9 | return File(pickedFile.path); 10 | } 11 | 12 | static Future pickImageFromCamera() async { 13 | final pickedFile = await (ImagePicker().pickImage(source: ImageSource.camera) as FutureOr); 14 | return File(pickedFile.path); 15 | } 16 | 17 | static Future pickVideoFromGallery() async { 18 | final pickedFile = await (ImagePicker().pickVideo(source: ImageSource.gallery) as FutureOr); 19 | return File(pickedFile.path); 20 | } 21 | 22 | static Future pickVideoFromCamera() async { 23 | final pickedFile = await (ImagePicker().pickVideo(source: ImageSource.camera) as FutureOr); 24 | return File(pickedFile.path); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/utils/share_utils.dart: -------------------------------------------------------------------------------- 1 | class ShareUtils {} 2 | -------------------------------------------------------------------------------- /lib/utils/sp_utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | /// Key-Value 存储工具类 4 | class SpUtils { 5 | SpUtils._(); 6 | 7 | static Future get _prefs async { 8 | return await SharedPreferences.getInstance(); 9 | } 10 | 11 | static Future saveString(String key, String value) async { 12 | final prefs = await _prefs; 13 | return prefs.setString(key, value); 14 | } 15 | 16 | static Future saveInt(String key, int value) async { 17 | final prefs = await _prefs; 18 | return prefs.setInt(key, value); 19 | } 20 | 21 | static Future saveDouble(String key, double value) async { 22 | final prefs = await _prefs; 23 | return prefs.setDouble(key, value); 24 | } 25 | 26 | static Future saveBool(String key, bool value) async { 27 | final prefs = await _prefs; 28 | return prefs.setBool(key, value); 29 | } 30 | 31 | static Future getBool(String key, bool defaultValue) async { 32 | final prefs = await _prefs; 33 | return prefs.getBool(key) ?? defaultValue; 34 | } 35 | 36 | static Future saveStringList(String key, List value) async { 37 | final prefs = await _prefs; 38 | return prefs.setStringList(key, value); 39 | } 40 | 41 | static String getString(String key, String defaultValue) { 42 | _prefs.then((value) { 43 | return value.getString(key); 44 | }).catchError((err) { 45 | return defaultValue; 46 | }); 47 | return defaultValue; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/utils/time_utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_system/date/lunar_solar_converter.dart'; 2 | 3 | class TimeUtils { 4 | /// 2019年10月 5 | static String getTodayYearAndMonthString() { 6 | final today = DateTime.now(); 7 | return "${today.year}年${today.month}月"; 8 | } 9 | 10 | /// 获取农历年份 11 | static int? getLunarYear(DateTime time) => 12 | _getLunarFromSolarTime(time).lunarYear; 13 | 14 | /// 获取农历月份 15 | static String getLunarMonth(DateTime time) => 16 | _getLunarFromSolarTime(time).lunarMonthString; 17 | 18 | /// 获取农历天数 19 | static String getLunarDay(DateTime time) => 20 | _getLunarFromSolarTime(time).lunarDayString; 21 | 22 | static Lunar _getLunarFromSolarTime(DateTime time) { 23 | final solar = 24 | Solar(solarYear: time.year, solarMonth: time.month, solarDay: time.day); 25 | return LunarSolarConverter.solarToLunar(solar); 26 | } 27 | 28 | /// 转换为时间字符串 yyyy-mm-dd 29 | static String toTimeString(DateTime? time) { 30 | if (time == null) return ""; 31 | return "${time.year}-${time.month}-${time.day}"; 32 | } 33 | 34 | static DateTime? toDateTime(String? time) { 35 | if (time == null || time.isEmpty || time.split("-").length != 3) { 36 | return null; 37 | } 38 | final t = time.split("-"); 39 | return DateTime(int.parse(t[0]), int.parse(t[1]), int.parse(t[2])); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/utils/ui_utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// 圆角矩形Border 4 | ShapeBorder roundedRectBorder(double radius) => RoundedRectangleBorder( 5 | borderRadius: BorderRadius.all(Radius.circular(radius)), 6 | ); 7 | 8 | /// 显示SnackBar 9 | void showSnackBar(BuildContext context, String content) { 10 | ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(content))); 11 | } 12 | -------------------------------------------------------------------------------- /lib/widgets/keyboard_detector.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | mixin KeyboardDetectorMixin on State implements WidgetsBindingObserver { 6 | 7 | bool keyboardShowing = false; 8 | 9 | double realKeyboardHeight = 0.0; 10 | 11 | @override 12 | void initState() { 13 | WidgetsBinding.instance.addObserver(this); 14 | super.initState(); 15 | } 16 | 17 | @override 18 | void dispose() { 19 | WidgetsBinding.instance.removeObserver(this); 20 | super.dispose(); 21 | } 22 | 23 | @override 24 | void didChangeMetrics() { 25 | WidgetsBinding.instance.addPostFrameCallback((_) { 26 | double bottom = MediaQuery.maybeOf(context)?.viewInsets.bottom ?? 0.0; 27 | if (bottom > 0) { 28 | keyboardShowing = true; 29 | } else { 30 | keyboardShowing = false; 31 | } 32 | realKeyboardHeight = max(realKeyboardHeight, bottom); 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/widgets/route_builder.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class KRoute extends MaterialPageRoute { 4 | 5 | @override 6 | dynamic get currentResult => getCurrentResult(); 7 | 8 | KRoute({builder, settings, maintainState = true, fullscreenDialog = false}) 9 | : super(builder: builder, settings: settings, maintainState: maintainState, fullscreenDialog: fullscreenDialog); 10 | 11 | dynamic getCurrentResult() { 12 | return "DefaultValue"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_system 2 | description: Learn Flutter System 3 | 4 | version: 0.0.1 5 | 6 | publish_to: none 7 | 8 | environment: 9 | sdk: '>=2.17.0 <3.0.0' 10 | flutter: ">=3.0.0" 11 | 12 | # ^0.1.1 则版本应该为0.1.x , x >=1 13 | # '0.1.1' 指定版本 14 | dependencies: 15 | flutter: 16 | sdk: flutter 17 | kicons: 18 | path: kicons 19 | best_toast: 20 | path: best_toast 21 | flutter_localizations: 22 | sdk: flutter 23 | provider: 24 | cupertino_icons: 25 | webview_flutter: 26 | url_launcher: 27 | http: 28 | video_player: 29 | shared_preferences: 30 | share: 31 | # sensors: 32 | # quick_actions: 33 | path_provider: 34 | image_picker: 35 | # google_sign_in: 36 | # package_info: 37 | # local_auth: 38 | # in_app_purchase: 39 | # google_maps_flutter: 40 | # device_info: 41 | # connectivity: 42 | # camera: ^0.5.8+11 43 | # battery: 44 | flutter_markdown: 45 | web_socket_channel: 46 | sqflite: 47 | path: 48 | source_gen: 49 | # flutter_dynamic_ui: ^0.3.0 50 | 51 | 52 | dev_dependencies: 53 | build_runner: ^2.1.5 54 | flutter_lints: ^2.0.1 55 | 56 | flutter: 57 | uses-material-design: true 58 | assets: 59 | - images/ 60 | - assets/video/ 61 | - assets/json/ 62 | - assets/emojis/ 63 | fonts: 64 | - family: FangZhengFangSongJianTi 65 | fonts: 66 | - asset: assets/fonts/FangZhengFangSongJianTi.ttf 67 | 68 | -------------------------------------------------------------------------------- /res/values/strings_en.arb: -------------------------------------------------------------------------------- 1 | { 2 | "page": "Page", 3 | "component": "Component", 4 | "demo": "Demo", 5 | "article": "Article" 6 | } -------------------------------------------------------------------------------- /res/values/strings_zh.arb: -------------------------------------------------------------------------------- 1 | { 2 | "page": "页面", 3 | "component": "组件", 4 | "demo": "实例", 5 | "article": "文章" 6 | } -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if test "$1"="driver"; then 4 | flutter drive --target=test_driver/app.dart 5 | fi 6 | 7 | -------------------------------------------------------------------------------- /travis_script.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | #../flutter/bin/flutter analyze 5 | 6 | #../flutter/bin/flutter format -n --set-exit-if-changed . 7 | 8 | echo "-- Success --" -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | flutter_system 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /webapp/.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 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | /build/ 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Generated.xcconfig 61 | **/ios/Flutter/app.flx 62 | **/ios/Flutter/app.zip 63 | **/ios/Flutter/flutter_assets/ 64 | **/ios/Flutter/flutter_export_environment.sh 65 | **/ios/ServiceDefinitions.json 66 | **/ios/Runner/GeneratedPluginRegistrant.* 67 | 68 | # Web related 69 | lib/generated_plugin_registrant.dart 70 | 71 | # Exceptions to above rules. 72 | !**/ios/**/default.mode1v3 73 | !**/ios/**/default.mode2v3 74 | !**/ios/**/default.pbxuser 75 | !**/ios/**/default.perspectivev3 76 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 77 | -------------------------------------------------------------------------------- /webapp/.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: a7cfdbd3f309d930b5f3236faf7ec74618f5878b 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /webapp/README.md: -------------------------------------------------------------------------------- 1 | # webapp 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /webapp/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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.webapp" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 67 | } 68 | -------------------------------------------------------------------------------- /webapp/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /webapp/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /webapp/android/app/src/main/kotlin/com/example/webapp/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.webapp 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /webapp/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /webapp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /webapp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /webapp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /webapp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /webapp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /webapp/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /webapp/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /webapp/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.4.10' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /webapp/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | -------------------------------------------------------------------------------- /webapp/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-6.5.1-all.zip 7 | -------------------------------------------------------------------------------- /webapp/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 | -------------------------------------------------------------------------------- /webapp/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 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /webapp/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /webapp/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /webapp/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /webapp/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /webapp/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /webapp/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 | -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /webapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiangkang/flutter-system/0ce0388b692c94521dcb518e809899d4752e5962/webapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /webapp/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. -------------------------------------------------------------------------------- /webapp/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 | -------------------------------------------------------------------------------- /webapp/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 | -------------------------------------------------------------------------------- /webapp/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | webapp 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /webapp/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /webapp/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | webapp 6 | 7 | 8 | 9 | 10 | 11 | --------------------------------------------------------------------------------