├── .gitignore
├── .metadata
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── studyyoun
│ │ │ │ └── flutterbook
│ │ │ │ └── flutter_test_app
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
└── settings.gradle
├── assets
├── animation
│ └── button-animation.flr
├── fonts
│ ├── AfternooninStereo.ttf
│ ├── CircularAir-Light.ttf
│ ├── CircularStd-Bold.ttf
│ ├── CircularStd-Medium.ttf
│ ├── OpenSans-Bold.ttf
│ ├── OpenSans-ExtraBold.ttf
│ ├── OpenSans-Light.ttf
│ ├── OpenSans-Regular.ttf
│ ├── OpenSans.ttf
│ ├── TikTokIcons.ttf
│ └── cm_sans_serif_2012.ttf
├── images
│ ├── Bitmap.png
│ ├── Item_1.png
│ ├── Item_2.png
│ ├── Item_3.png
│ ├── app_icon.png
│ ├── audio_waveform.png
│ ├── back.svg
│ ├── banner1.webp
│ ├── banner2.webp
│ ├── banner3.webp
│ ├── banner4.webp
│ ├── banner5.jpeg
│ ├── banner6.jpeg
│ ├── bg.png
│ ├── bg_kyzg_login2.png
│ ├── bg_snow.png
│ ├── book-1.png
│ ├── book-2.png
│ ├── book-3.png
│ ├── cart_with_item.svg
│ ├── chat.svg
│ ├── main_page_bg.png
│ ├── man.png
│ ├── maomi1.jpg
│ ├── maomi2.jpg
│ ├── maomi3.jpg
│ ├── mastercardlogo.png
│ ├── notification.svg
│ ├── one.png
│ ├── password.png
│ ├── qq.png
│ ├── search.svg
│ ├── shopping-bag.svg
│ ├── tianyi.png
│ ├── welcome_bg.jpeg
│ ├── woman.png
│ ├── wx.png
│ └── xingkong.png
└── logos
│ ├── facebook.jpg
│ └── google.jpg
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-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
│ └── main.m
├── lib
├── animation
│ ├── example_clip_path_wave_login.dart
│ ├── example_number_PageTransitionSwitcher.dart
│ ├── example_number_PageTransitionSwitcher2.dart
│ ├── example_pie2_animagtion_page.dart
│ ├── example_pie_animagtion_page.dart
│ ├── flash
│ │ ├── child
│ │ │ └── list_placeholder.dart
│ │ ├── flash_animation_controller.dart
│ │ ├── flash_animation_widget.dart
│ │ └── gradient
│ │ │ └── default_linear_gradient.dart
│ ├── test.dart
│ ├── test2.dart
│ ├── test__animation.dart
│ └── test_rect_path_animation.dart
├── async
│ ├── main_async.dart
│ ├── test_AB_page.dart
│ ├── test_f_page.dart
│ ├── test_progress_time_and_flash_page.dart
│ ├── test_progress_time_page.dart
│ ├── test_sing_stream_page.dart
│ ├── test_stream_builder2_page.dart
│ ├── test_stream_builder_page.dart
│ ├── test_stream_page.dart
│ ├── test_user_notifier_page.dart
│ ├── test_value_notifier_page.dart
│ └── test_widget.dart
├── bloc
│ ├── demo1
│ │ ├── bloc_time.dart
│ │ ├── main_bloc.dart
│ │ └── test_bloc_time_page.dart
│ └── demo2
│ │ ├── bloc_number.dart
│ │ ├── main_mul_bloc.dart
│ │ └── test_mul_bloc_time_page.dart
├── canvas
│ ├── Spinner.dart
│ ├── art.dart
│ ├── cpi_audio_waveform.dart
│ ├── examle_snow_page.dart
│ ├── flutter_bnb_v2
│ │ └── lib
│ │ │ └── main.dart
│ ├── image
│ │ ├── main.dart
│ │ ├── my-canvas.dart
│ │ └── my-painter.dart
│ ├── percentage_indicator_sm.dart
│ ├── rain
│ │ ├── main.dart
│ │ ├── my_rain_canvas.dart
│ │ ├── my_weather_canvas.dart
│ │ ├── particle.dart
│ │ ├── rain_widget.dart
│ │ └── weather_widget.dart
│ ├── test.dart
│ ├── testWidget2.dart
│ ├── test_BluePainter.dart
│ ├── test_bubble_login_page.dart
│ ├── test_page.dart
│ └── tiltable_stack.dart
├── clip
│ ├── clip_main.dart
│ ├── test_clip_oval_page.dart
│ └── test_clip_react_page.dart
├── customDrawer
│ ├── CustomDrawer.dart
│ ├── FirstLayer.dart
│ ├── HomePage.dart
│ ├── SecondLayer.dart
│ ├── ThirdLayer.dart
│ └── main.dart
├── custom_tabbar.dart
├── hero
│ ├── test_hero_page.dart
│ ├── test_hero_show_imgpage.dart
│ └── test_widget.dart
├── icon
│ ├── round_corner_icon.dart
│ └── test_round_icon_page.dart
├── key
│ └── test_key.dart
├── listview
│ └── test_list_part_page.dart
├── logindemo
│ ├── login_demo1.dart
│ ├── main.dart
│ ├── screens
│ │ └── login_screen.dart
│ └── utilities
│ │ └── constants.dart
├── main.dart
├── net
│ └── http
│ │ ├── DioUtils.dart
│ │ └── test_http_page.dart
├── path
│ └── demo1
│ │ └── dash_board_page.dart
├── progress
│ ├── test_CircularProgressIndicator_page.dart
│ ├── test_CupertinoActivityIndicator_page.dart
│ ├── test_CupertinoSliverIndicator_page.dart
│ ├── test_LinearProgressIndicator_page.dart
│ ├── test_RefreshIndicator_page.dart
│ └── test_SmartRefresher1_page.dart
├── provider
│ ├── demo1
│ │ ├── main_provider.dart
│ │ ├── test_provider_consumer_time_page.dart
│ │ ├── test_provider_time_page.dart
│ │ └── time_model.dart
│ └── demo2
│ │ ├── number_model.dart
│ │ └── test_provider_abc_page.dart
├── scroll
│ ├── customscroll_demo2_page.dart
│ ├── customscroll_demo_page.dart
│ ├── customscroll_home_page.dart
│ ├── example_507_NestScrollView.dart
│ ├── main_scroll.dart
│ ├── netscroll_home_page.dart
│ └── scroll_home_page.dart
├── shake
│ ├── test_shak_bottom_middle_button_page.dart
│ └── test_shak_right_float_button_page.dart
├── slid_banner_page.dart
├── test_A_B_page.dart
├── test_OpenContainer_GridView_page.dart
├── test_OpenContainer_page.dart
├── test_bottom_nvigationbar.dart
├── test_button_page.dart
├── test_clock_app.dart
├── test_common_login_page.dart
├── test_comon_login_page.dart
├── test_custom_button.dart
├── test_custom_camera_widget.dart
├── test_drag_and_drop_gridview_widget.dart
├── test_float_hero_page.dart
├── test_html2_widget.dart
├── test_html_widget.dart
├── test_login_page.dart
├── test_orientation_widget.dart
├── test_progress_home_page.dart
├── test_right_float_button_page.dart
├── test_shake_login_page.dart
├── test_slid_banner_page.dart
├── test_slider_home_page.dart
├── test_splash_widget.dart
├── test_tabbar_home_page.dart
├── test_warrp_widget.dart
├── test_webview_widget.dart
├── test_widget_live_widget.dart
├── text_animations_showModal_page.dart
├── text_bottom_dialog_page.dart
├── text_goods_details_page.dart
├── tk
│ ├── demo1
│ │ ├── constants.dart
│ │ ├── data.dart
│ │ ├── detail_page.dart
│ │ ├── home_page.dart
│ │ └── main.dart
│ ├── demo2
│ │ ├── flare_demo.dart
│ │ ├── main.dart
│ │ └── smart_flare_animation.dart
│ ├── demo3
│ │ ├── components
│ │ │ └── search_box.dart
│ │ ├── constants.dart
│ │ ├── main.dart
│ │ ├── models
│ │ │ └── product.dart
│ │ └── screens
│ │ │ ├── details
│ │ │ ├── components
│ │ │ │ ├── body.dart
│ │ │ │ ├── chat_and_add_to_cart.dart
│ │ │ │ ├── color_dots.dart
│ │ │ │ ├── list_of_colors.dart
│ │ │ │ └── product_image.dart
│ │ │ └── details_screen.dart
│ │ │ └── product
│ │ │ ├── components
│ │ │ ├── body.dart
│ │ │ ├── category_list.dart
│ │ │ └── product_card.dart
│ │ │ └── products_screen.dart
│ ├── demo4
│ │ ├── main.dart
│ │ ├── style.dart
│ │ └── widgets
│ │ │ └── iconbutton.dart
│ ├── demo5
│ │ ├── consttants.dart
│ │ ├── main.dart
│ │ ├── screens
│ │ │ ├── details_screen.dart
│ │ │ ├── home_screen.dart
│ │ │ └── notes_screen.dart
│ │ └── widgets
│ │ │ ├── book_rating.dart
│ │ │ ├── reading_card_list.dart
│ │ │ ├── rounded_button.dart
│ │ │ └── two_side_rounded_button.dart
│ ├── demo6
│ │ ├── cardwidget.dart
│ │ ├── components
│ │ │ ├── appbar.dart
│ │ │ ├── arrowbutton.dart
│ │ │ └── card.dart
│ │ ├── config
│ │ │ ├── colors.dart
│ │ │ ├── size.dart
│ │ │ └── strings.dart
│ │ ├── dashboard.dart
│ │ ├── expenseswidget.dart
│ │ ├── main.dart
│ │ └── piechart
│ │ │ ├── piechart.dart
│ │ │ └── piechartcustompainter.dart
│ └── demo7
│ │ ├── Animations
│ │ └── FadeAnimation.dart
│ │ ├── LoginPage.dart
│ │ └── main.dart
└── utils
│ └── DateUtils.dart
├── pubimages
└── flutter_inspector.gif
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Exceptions to above rules.
44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
45 |
--------------------------------------------------------------------------------
/.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: 84c84fb24914e098667649be04614f6ea19d689c
8 | channel: dev
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # flutter_test_app
2 |
3 |
4 | [Flutter CustomScrollView实现的一个经典滑动折叠头部图片的效果](https://github.com/zhaolongs/flutter_demo_app/blob/master/lib/scroll/customscroll_demo_page.dart)
5 |
6 | [Flutter NestedScrollView实现的一个经典滑动折叠头部图片的效果](https://github.com/zhaolongs/flutter_demo_app/blob/master/lib/scroll/netscroll_home_page.dart)
7 |
8 |
9 | ***
10 |
11 | * 仿今日头条底部的一个登录弹框
12 |
13 | [源码在这里](https://github.com/zhaolongs/flutter_demo_app/blob/master/lib/text_bottom_dialog_page.dart)
14 |
15 | [知乎视频在这里](https://www.zhihu.com/zvideo/1306194115948789760)
16 |
17 | [头条/西瓜视频在这里](https://www.ixigua.com/6889993164409700876/)
18 |
19 | [B站](https://www.bilibili.com/video/BV1TT4y1c7Bu/)
20 |
21 |
22 | * 向上弹出的一个动画菜单
23 |
24 | [源码在这里](https://github.com/zhaolongs/flutter_demo_app/blob/master/lib/test_right_float_button_page.dart)
25 |
26 | [知乎视频在这里](https://www.zhihu.com/zvideo/1308724791466467328)
27 |
28 | [头条/西瓜视频在这里](https://www.ixigua.com/6892581580443746823/)
29 |
30 | [B站](https://www.bilibili.com/video/BV1Dt4y1e7Va/)
31 |
32 |
33 | * Flutter 一个优美的用户体验的登录页面 抖动提示 文本提示
34 |
35 |
36 | [源码在这里](https://github.com/zhaolongs/flutter_demo_app/blob/master/lib/test_shake_login_page.dart)
37 |
38 | [知乎视频在这里](https://www.zhihu.com/zvideo/1308873518554267648)
39 |
40 | [头条/西瓜视频在这里](https://www.ixigua.com/6892732997343281675/)
41 |
42 | [B站](https://www.bilibili.com/video/BV1my4y1z75r/)
43 |
44 |
45 | * Flutter Path动画 让你的画布动起来 造就高级动画
46 |
47 | [源码在这里](https://github.com/zhaolongs/flutter_demo_app/blob/master/lib/animation/test_rect_path_animation.dart)
48 |
49 | [知乎视频在这里](https://www.zhihu.com/zvideo/1311742576261955584)
50 |
51 | [头条/西瓜视频在这里](https://www.ixigua.com/6895672096479773188/)
52 |
53 | [B站](https://www.bilibili.com/video/BV1s5411V7ge/)
54 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 28
29 |
30 | lintOptions {
31 | disable 'InvalidPackage'
32 | }
33 |
34 | defaultConfig {
35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36 | applicationId "com.studyyoun.flutterbook.flutter_test_app"
37 | minSdkVersion 16
38 | targetSdkVersion 28
39 | versionCode flutterVersionCode.toInteger()
40 | versionName flutterVersionName
41 | }
42 |
43 | buildTypes {
44 | release {
45 | // TODO: Add your own signing config for the release build.
46 | // Signing with the debug keys for now, so `flutter run --release` works.
47 | signingConfig signingConfigs.debug
48 | }
49 | }
50 | }
51 |
52 | flutter {
53 | source '../..'
54 | }
55 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
23 |
27 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/studyyoun/flutterbook/flutter_test_app/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.studyyoun.flutterbook.flutter_test_app;
2 |
3 | import android.os.Bundle;
4 | import android.os.PersistableBundle;
5 |
6 | import androidx.annotation.Nullable;
7 |
8 | import io.flutter.embedding.android.FlutterActivity;
9 |
10 | public class MainActivity extends FlutterActivity {
11 |
12 | @Override
13 | protected void onCreate(@Nullable Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.5.0'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | include ':app'
6 |
7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
8 | def properties = new Properties()
9 |
10 | assert localPropertiesFile.exists()
11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12 |
13 | def flutterSdkPath = properties.getProperty("flutter.sdk")
14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
16 |
--------------------------------------------------------------------------------
/assets/fonts/AfternooninStereo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/AfternooninStereo.ttf
--------------------------------------------------------------------------------
/assets/fonts/CircularAir-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/CircularAir-Light.ttf
--------------------------------------------------------------------------------
/assets/fonts/CircularStd-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/CircularStd-Bold.ttf
--------------------------------------------------------------------------------
/assets/fonts/CircularStd-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/CircularStd-Medium.ttf
--------------------------------------------------------------------------------
/assets/fonts/OpenSans-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/OpenSans-Bold.ttf
--------------------------------------------------------------------------------
/assets/fonts/OpenSans-ExtraBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/OpenSans-ExtraBold.ttf
--------------------------------------------------------------------------------
/assets/fonts/OpenSans-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/OpenSans-Light.ttf
--------------------------------------------------------------------------------
/assets/fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/assets/fonts/OpenSans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/OpenSans.ttf
--------------------------------------------------------------------------------
/assets/fonts/TikTokIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/TikTokIcons.ttf
--------------------------------------------------------------------------------
/assets/fonts/cm_sans_serif_2012.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/fonts/cm_sans_serif_2012.ttf
--------------------------------------------------------------------------------
/assets/images/Bitmap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/Bitmap.png
--------------------------------------------------------------------------------
/assets/images/Item_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/Item_1.png
--------------------------------------------------------------------------------
/assets/images/Item_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/Item_2.png
--------------------------------------------------------------------------------
/assets/images/Item_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/Item_3.png
--------------------------------------------------------------------------------
/assets/images/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/app_icon.png
--------------------------------------------------------------------------------
/assets/images/audio_waveform.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/audio_waveform.png
--------------------------------------------------------------------------------
/assets/images/back.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/assets/images/banner1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/banner1.webp
--------------------------------------------------------------------------------
/assets/images/banner2.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/banner2.webp
--------------------------------------------------------------------------------
/assets/images/banner3.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/banner3.webp
--------------------------------------------------------------------------------
/assets/images/banner4.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/banner4.webp
--------------------------------------------------------------------------------
/assets/images/banner5.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/banner5.jpeg
--------------------------------------------------------------------------------
/assets/images/banner6.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/banner6.jpeg
--------------------------------------------------------------------------------
/assets/images/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/bg.png
--------------------------------------------------------------------------------
/assets/images/bg_kyzg_login2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/bg_kyzg_login2.png
--------------------------------------------------------------------------------
/assets/images/bg_snow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/bg_snow.png
--------------------------------------------------------------------------------
/assets/images/book-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/book-1.png
--------------------------------------------------------------------------------
/assets/images/book-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/book-2.png
--------------------------------------------------------------------------------
/assets/images/book-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/book-3.png
--------------------------------------------------------------------------------
/assets/images/cart_with_item.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/assets/images/chat.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/assets/images/main_page_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/main_page_bg.png
--------------------------------------------------------------------------------
/assets/images/man.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/man.png
--------------------------------------------------------------------------------
/assets/images/maomi1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/maomi1.jpg
--------------------------------------------------------------------------------
/assets/images/maomi2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/maomi2.jpg
--------------------------------------------------------------------------------
/assets/images/maomi3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/maomi3.jpg
--------------------------------------------------------------------------------
/assets/images/mastercardlogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/mastercardlogo.png
--------------------------------------------------------------------------------
/assets/images/notification.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/assets/images/one.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/one.png
--------------------------------------------------------------------------------
/assets/images/password.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/password.png
--------------------------------------------------------------------------------
/assets/images/qq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/qq.png
--------------------------------------------------------------------------------
/assets/images/search.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/assets/images/shopping-bag.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/assets/images/tianyi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/tianyi.png
--------------------------------------------------------------------------------
/assets/images/welcome_bg.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/welcome_bg.jpeg
--------------------------------------------------------------------------------
/assets/images/woman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/woman.png
--------------------------------------------------------------------------------
/assets/images/wx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/wx.png
--------------------------------------------------------------------------------
/assets/images/xingkong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/images/xingkong.png
--------------------------------------------------------------------------------
/assets/logos/facebook.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/logos/facebook.jpg
--------------------------------------------------------------------------------
/assets/logos/google.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/assets/logos/google.jpg
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - flutter_custom_camera_pugin (0.0.1):
4 | - Flutter
5 | - flutter_fai_webview (0.0.1):
6 | - Flutter
7 | - flutter_html_text_plugin (0.0.1):
8 | - Flutter
9 | - FMDB (2.7.5):
10 | - FMDB/standard (= 2.7.5)
11 | - FMDB/standard (2.7.5)
12 | - path_provider (0.0.1):
13 | - Flutter
14 | - path_provider_linux (0.0.1):
15 | - Flutter
16 | - path_provider_macos (0.0.1):
17 | - Flutter
18 | - path_provider_windows (0.0.1):
19 | - Flutter
20 | - sqflite (0.0.2):
21 | - Flutter
22 | - FMDB (>= 2.7.5)
23 |
24 | DEPENDENCIES:
25 | - Flutter (from `Flutter`)
26 | - flutter_custom_camera_pugin (from `.symlinks/plugins/flutter_custom_camera_pugin/ios`)
27 | - flutter_fai_webview (from `.symlinks/plugins/flutter_fai_webview/ios`)
28 | - flutter_html_text_plugin (from `.symlinks/plugins/flutter_html_text_plugin/ios`)
29 | - path_provider (from `.symlinks/plugins/path_provider/ios`)
30 | - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
31 | - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
32 | - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
33 | - sqflite (from `.symlinks/plugins/sqflite/ios`)
34 |
35 | SPEC REPOS:
36 | trunk:
37 | - FMDB
38 |
39 | EXTERNAL SOURCES:
40 | Flutter:
41 | :path: Flutter
42 | flutter_custom_camera_pugin:
43 | :path: ".symlinks/plugins/flutter_custom_camera_pugin/ios"
44 | flutter_fai_webview:
45 | :path: ".symlinks/plugins/flutter_fai_webview/ios"
46 | flutter_html_text_plugin:
47 | :path: ".symlinks/plugins/flutter_html_text_plugin/ios"
48 | path_provider:
49 | :path: ".symlinks/plugins/path_provider/ios"
50 | path_provider_linux:
51 | :path: ".symlinks/plugins/path_provider_linux/ios"
52 | path_provider_macos:
53 | :path: ".symlinks/plugins/path_provider_macos/ios"
54 | path_provider_windows:
55 | :path: ".symlinks/plugins/path_provider_windows/ios"
56 | sqflite:
57 | :path: ".symlinks/plugins/sqflite/ios"
58 |
59 | SPEC CHECKSUMS:
60 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
61 | flutter_custom_camera_pugin: 7566d6050ecc4e2b01ef892a0b1a36ee7a2da5d7
62 | flutter_fai_webview: 7ecaa35047fd557c12e86a698e05fba18f5b25eb
63 | flutter_html_text_plugin: 17905cfddc60b031f1070418983bb3338c750304
64 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
65 | path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
66 | path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
67 | path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
68 | path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
69 | sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
70 |
71 | PODFILE CHECKSUM: 61f4c6fa41de8ddcb6ae400bc4a781688f4c5f96
72 |
73 | COCOAPODS: 1.9.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.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 | #import "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaolongs/flutter_demo_app/bef039d29f69ea520a2494fd1e7a3137ad42d447/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_test_app
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 |
--------------------------------------------------------------------------------
/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/animation/flash/child/list_placeholder.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | /// 创建人: Created by zhaolong
5 | /// 创建时间:Created by on 2020/7/14.
6 | ///
7 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
8 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
9 | /// 可关注博客:https://blog.csdn.net/zl18603543572
10 | class ListPlacholderWidget extends StatefulWidget {
11 | @override
12 | _TestPageState createState() => _TestPageState();
13 | }
14 |
15 | //lib/code/main_data.dart
16 | class _TestPageState extends State {
17 | @override
18 | Widget build(BuildContext context) {
19 | return ListView.builder(
20 | physics: NeverScrollableScrollPhysics(),
21 | itemBuilder: (BuildContext context, int index) {
22 | return buildItemWidget();
23 | },
24 | );
25 | }
26 |
27 | Widget buildItemWidget() {
28 | return Padding(
29 | padding: const EdgeInsets.only(bottom: 8.0),
30 | child: Row(
31 | crossAxisAlignment: CrossAxisAlignment.start,
32 | children: [
33 | Container(
34 | width: 48.0,
35 | height: 48.0,
36 | color: Colors.white,
37 | ),
38 | const Padding(
39 | padding: EdgeInsets.symmetric(horizontal: 8.0),
40 | ),
41 | Expanded(
42 | child: Column(
43 | crossAxisAlignment: CrossAxisAlignment.start,
44 | children: [
45 | Container(
46 | width: double.infinity,
47 | height: 8.0,
48 | color: Colors.white,
49 | ),
50 | const Padding(
51 | padding: EdgeInsets.symmetric(vertical: 2.0),
52 | ),
53 | Container(
54 | width: double.infinity,
55 | height: 8.0,
56 | color: Colors.white,
57 | ),
58 | const Padding(
59 | padding: EdgeInsets.symmetric(vertical: 2.0),
60 | ),
61 | Container(
62 | width: 40.0,
63 | height: 8.0,
64 | color: Colors.white,
65 | ),
66 | ],
67 | ),
68 | )
69 | ],
70 | ),
71 | );
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/lib/animation/flash/flash_animation_controller.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | /**
4 | * 创建人: Created by zhaolong
5 | * 创建时间:Created by on 2020/7/19.
6 | *
7 | * 可关注公众号:我的大前端生涯 获取最新技术分享
8 | * 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
9 | * 可关注博客:https://blog.csdn.net/zl18603543572
10 | */
11 |
12 | ///lib/demo/flash/flash_animation_controller.dart
13 | ///
14 | ///监听
15 | typedef FlashAnimationListener = void Function(bool value);
16 |
17 | ///控制器
18 | class FlashAnimationController {
19 | FlashAnimationListener _flashAnimationListener;
20 | ///开启动画
21 | void start() {
22 | if (_flashAnimationListener != null) {
23 | _flashAnimationListener(true);
24 | }
25 | }
26 | ///关闭动画
27 | void stop() {
28 | if (_flashAnimationListener != null) {
29 | _flashAnimationListener(false);
30 | }
31 | }
32 | ///绑定监听
33 | void setListener(FlashAnimationListener listener){
34 | _flashAnimationListener = listener;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib/animation/flash/gradient/default_linear_gradient.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | /**
5 | * 创建人: Created by zhaolong
6 | * 创建时间:Created by on 2020/7/19.
7 | *
8 | * 可关注公众号:我的大前端生涯 获取最新技术分享
9 | * 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
10 | * 可关注博客:https://blog.csdn.net/zl18603543572
11 | */
12 |
13 | ///lib/demo/flash/gradient/default_linear_gradient.dart
14 | ///默认的线性渐变
15 | class DefaultLinearGradient extends LinearGradient {
16 | DefaultLinearGradient({
17 | ///高亮颜色
18 | @required Color normalColor,
19 | ///高亮颜色
20 | @required Color highlightColor,
21 | }) : super(
22 | ///开始位置为左上角
23 | begin: Alignment.topLeft,
24 | ///结束的位置为右中间
25 | end: Alignment.centerRight,
26 | ///过渡的颜色组
27 | colors: [
28 | normalColor,
29 | normalColor,
30 | highlightColor,
31 | normalColor,
32 | normalColor
33 | ],
34 | ///取范围为0.0到1.0 数值表示梯度方向上的分割比例
35 | ///如果stops是空的,那么stops里面默认存放一组均匀分布的点,并且第一个点是0.0,最后一个点是1.0。
36 | ///stops值列表中的数据必须是升序。如果stops值列表有一个数据小于前一个数据值,那么这个数据会被默认等于前面的数据值
37 | ///如果Stops不为空,那么它必须与colors中颜色个数保持一致,否则运行异常
38 | ///如果第一个数值不为0,此时会默认一个stop位置0.0,颜色和colors中第一个颜色相同。
39 | ///如果最后一个数值不为1.0,此时会默认一个stop位置1.0,颜色和colors中最后一个颜色相同
40 | stops: const [0.0, 0.35, 0.5, 0.65, 1.0],
41 | );
42 | }
43 |
--------------------------------------------------------------------------------
/lib/animation/test__animation.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import 'package:animations/animations.dart';
4 | import 'package:flutter/cupertino.dart';
5 | import 'package:flutter/gestures.dart';
6 | import 'package:flutter/material.dart';
7 |
8 | /// 创建人: Created by zhaolong
9 | /// 创建时间:Created by on 2020/10/31.
10 | ///
11 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
12 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
13 | /// 可关注博客:https://blog.csdn.net/zl18603543572
14 | ///
15 | /// 代码清单
16 |
17 | void main() {
18 | runApp(MaterialApp(
19 | home: RootPage(),
20 | ));
21 | }
22 |
23 |
24 | class RootPage extends StatefulWidget {
25 | @override
26 | _TestingFadeThroughState createState() => _TestingFadeThroughState();
27 | }
28 |
29 | class _TestingFadeThroughState extends State {
30 | int pageIndex = 0;
31 | List pageList = [
32 | Container(key: UniqueKey(), color: Colors.red),
33 | Container(key: UniqueKey(), color: Colors.blue),
34 | Container(key: UniqueKey(), color: Colors.green)
35 | ];
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return Scaffold(
40 | appBar: AppBar(title: const Text('Testing Fade Through')),
41 | body: PageTransitionSwitcher(
42 | transitionBuilder: (Widget child, Animation animation,
43 | Animation secondaryAnimation) {
44 | return FadeThroughTransition(
45 | animation: animation,
46 | secondaryAnimation: secondaryAnimation,
47 | child: child,
48 | );
49 | },
50 | child: pageList[pageIndex],
51 | ),
52 | bottomNavigationBar: BottomNavigationBar(
53 | currentIndex: pageIndex,
54 | onTap: (int newValue) {
55 | setState(() {
56 | pageIndex = newValue;
57 | });
58 | },
59 | items: const [
60 | BottomNavigationBarItem(
61 | icon: Icon(Icons.looks_one),
62 | title: Text('First Page'),
63 | ),
64 | BottomNavigationBarItem(
65 | icon: Icon(Icons.looks_two),
66 | title: Text('Second Page'),
67 | ),
68 | BottomNavigationBarItem(
69 | icon: Icon(Icons.looks_3),
70 | title: Text('Third Page'),
71 | ),
72 | ],
73 | ),
74 | );
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/lib/async/main_async.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_test_app/async/test_progress_time_page.dart';
4 | import 'package:flutter_test_app/async/test_sing_stream_page.dart';
5 | import 'package:flutter_test_app/async/test_stream_builder2_page.dart';
6 | import 'package:flutter_test_app/async/test_stream_builder_page.dart';
7 | import 'package:flutter_test_app/async/test_stream_page.dart';
8 | import 'package:flutter_test_app/async/test_user_notifier_page.dart';
9 | import 'package:flutter_test_app/async/test_value_notifier_page.dart';
10 |
11 | ///flutter应用程序中的入口函数
12 | void main() => runApp(AsyncMainApp());
13 |
14 | ///应用的根布局
15 | class AsyncMainApp extends StatelessWidget {
16 | @override
17 | Widget build(BuildContext context) {
18 | ///构建Materia Desin 风格的应用程序
19 | return MaterialApp(
20 | ///Android应用程序中任务栏中显示应用的名称
21 | title: " 配制",
22 | theme: ThemeData(
23 | accentColor: Colors.blue,
24 |
25 | ///默认是 Brightness.light
26 | brightness: Brightness.light,
27 | ),
28 |
29 | ///默认的首页面
30 | // home: TestValueNotifierPage(),
31 | // home: TestUserNotifierPage(),
32 | // home: TestStreamBaseUsePage(),
33 | // home: TestSingStreamBaseUsePage(),
34 | // home: TestStreamBuilderPage(),
35 | // home: TestTimer2BuilderPage(),
36 | home: TestStreamBuilderPage(),
37 | // home: TestTimeProgressIndicatorPage(),
38 | );
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/lib/async/test_AB_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import 'package:flutter/cupertino.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter_test_app/test_widget_live_widget.dart';
6 |
7 | class TestABPage extends StatefulWidget {
8 | @override
9 | State createState() {
10 | return _TestABPageState();
11 | }
12 | }
13 |
14 | class _TestABPageState extends State {
15 | ///页面B返回的数据
16 | String _message = "--";
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | ///页面主体脚手架
21 | return Scaffold(
22 | appBar: AppBar(
23 | title: Text("测试"),
24 | ),
25 |
26 | /// 处理滑动
27 | body: Column(
28 | children: [
29 | SizedBox(
30 | height: 40,
31 | ),
32 |
33 | OutlineButton(
34 | child: Text("打开页面B"),
35 | onPressed: () {
36 | ///以动态路由的方式打开
37 | openPageFunction(context);
38 | },
39 | ),
40 | SizedBox(
41 | height: 40,
42 | ),
43 | //ValueListenableBuilder是简易版的Provider
44 | Text("页面B返回的数据 : $_message")
45 | ],
46 | ),
47 | );
48 | }
49 | ///代码清单 1-1
50 | void openPageFunction(BuildContext context) {
51 | ///以动态路由的方式打开
52 | Navigator.of(context).push(
53 | MaterialPageRoute(
54 | builder: (BuildContext context) {
55 | return TestBPage();
56 | },
57 | ),
58 | ///页面 TestBPage 关闭后会回调 then 函数
59 | ///其中参数 value 为回传的参数
60 | ).then((value) {
61 | if (value != null) {
62 | setState(() {
63 | _message = value;
64 | });
65 | }
66 | });
67 | }
68 | }
69 |
70 | class TestAPage extends StatefulWidget {
71 | @override
72 | State createState() {
73 | return _TestBPageState();
74 | }
75 | }
76 |
77 | class _TestBPageState extends State {
78 | @override
79 | Widget build(BuildContext context) {
80 | return Scaffold(
81 | appBar: AppBar(
82 | title: Text("测试"),
83 | ),
84 |
85 | /// 处理滑动
86 | body: Column(
87 | children: [
88 | SizedBox(
89 | height: 40,
90 | ),
91 | buildOutlineButton(context),
92 | ],
93 | ),
94 | );
95 | }
96 |
97 | ///代码 清单 1-2
98 | OutlineButton buildOutlineButton(BuildContext context) {
99 | return OutlineButton(
100 | child: Text("返回页面 A "),
101 | onPressed: () {
102 | String result = "345";
103 | Navigator.of(context).pop(result);
104 | },
105 | );
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/lib/async/test_f_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import 'package:flutter/cupertino.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | class TestValueNotifierPage extends StatefulWidget {
7 | @override
8 | State createState() {
9 | return _ScrollHomePageState();
10 | }
11 | }
12 |
13 | class _ScrollHomePageState extends State {
14 | ValueNotifier _testValueNotifier = ValueNotifier('');
15 |
16 | ValueNotifier _testUserNotifier = ValueNotifier(null);
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | ///页面主体脚手架
21 | return Scaffold(
22 | appBar: AppBar(
23 | title: Text("测试"),
24 | ),
25 |
26 | /// 处理滑动
27 | body: Column(
28 | children: [
29 | SizedBox(
30 | height: 40,
31 | ),
32 | OutlineButton(
33 | child: Text("测试数据"),
34 | onPressed: () {
35 | testFunction();
36 | },
37 | ),
38 | OutlineButton(
39 | child: Text("测试用户数据"),
40 | onPressed: () {
41 | testUserFunction();
42 | },
43 | ),
44 | SizedBox(
45 | height: 40,
46 | ),
47 | //ValueListenableBuilder是简易版的Provider
48 |
49 | ],
50 | ),
51 | );
52 | }
53 |
54 | ValueListenableBuilder buildValueListenableBuilder() {
55 | return ValueListenableBuilder(
56 | ///数据发生变化时回调
57 | builder: (context, value, child) {
58 | return Text(value);
59 | },
60 | ///监听的数据
61 | valueListenable: _testValueNotifier,
62 | child: Text(
63 | '未登录',
64 | style: TextStyle(color: Colors.red),
65 | ),
66 | );
67 | }
68 |
69 | void testFunction() {
70 | _testValueNotifier.value = '传递的测试数据';
71 | }
72 |
73 | void testUserFunction(){
74 | UserInfo userInfo = new UserInfo();
75 | userInfo.name='张三';
76 | userInfo.age = 29 ;
77 |
78 | _testUserNotifier.value = userInfo;
79 | }
80 | }
81 |
82 |
83 | class UserInfo {
84 | String name;
85 | int age ;
86 | }
--------------------------------------------------------------------------------
/lib/async/test_stream_builder2_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'dart:async';
4 | import 'package:intl/intl.dart';
5 |
6 | /// 对比使用 StreamBuilder 实现的计时性能分析 Demo
7 | class TestTimer2BuilderPage extends StatefulWidget {
8 | @override
9 | State createState() {
10 | return _TestABPageState();
11 | }
12 | }
13 |
14 | class _TestABPageState extends State {
15 | ///测试数据
16 | String _message = "--";
17 | ///计时器
18 | Timer _timer;
19 |
20 | @override
21 | void initState() {
22 | super.initState();
23 | ///间隔1秒执行时间
24 | _timer = Timer.periodic(Duration(milliseconds: 1000), (timer) {
25 | ///获取当前的时间
26 | DateTime dateTime = DateTime.now();
27 | ///格式化时间
28 | String formatTime = DateFormat("HH:mm:ss").format(dateTime);
29 | setState(() {
30 | _message = formatTime;
31 | });
32 | });
33 | }
34 |
35 | @override
36 | Widget build(BuildContext context) {
37 | ///页面主体脚手架
38 | return Scaffold(
39 | appBar: AppBar(
40 | title: Text("测试Stream $_message"),
41 | ),
42 | body: Text(
43 | '当前时间 $_message ',
44 | style: TextStyle(fontSize: 22, color: Colors.blue),
45 | ),
46 | );
47 | }
48 |
49 | @override
50 | void dispose() {
51 | super.dispose();
52 |
53 | ///取消计时器
54 | _timer.cancel();
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/lib/async/test_stream_builder_page.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | import 'package:flutter/cupertino.dart';
5 | import 'package:flutter/material.dart';
6 |
7 |
8 | import 'dart:async';
9 |
10 | import 'package:intl/intl.dart';
11 |
12 | ///多订阅流使用 Demo
13 |
14 |
15 | class TestStreamBuilderPage extends StatefulWidget {
16 | @override
17 | State createState() {
18 | return _TestABPageState();
19 | }
20 | }
21 |
22 | class _TestABPageState extends State {
23 | ///测试数据
24 | String _message = "--";
25 | ///使用单订阅流即可
26 | StreamController _streamController = StreamController();
27 | ///计时器
28 | Timer _timer;
29 |
30 | @override
31 | void initState() {
32 | super.initState();
33 |
34 |
35 | ///间隔1秒执行时间
36 | _timer= Timer.periodic(Duration(milliseconds: 1000), (timer) {
37 | ///获取当前的时间
38 | DateTime dateTime= DateTime.now();
39 | ///格式化时间
40 | String formatTime = DateFormat("HH:mm:ss").format(dateTime);
41 | _message=formatTime;
42 | ///流数据更新
43 | _streamController.add("$formatTime");
44 | });
45 |
46 |
47 | }
48 |
49 |
50 | @override
51 | void dispose() {
52 | super.dispose();
53 | ///关闭
54 | _streamController.close();
55 |
56 | ///取消计时器
57 | _timer.cancel();
58 | }
59 | @override
60 | Widget build(BuildContext context) {
61 | ///页面主体脚手架
62 | return Scaffold(
63 | appBar: AppBar(
64 | title: Text("测试Stream $_message"),
65 | ),
66 |
67 | body:buildStreamBuilder(),
68 | );
69 | }
70 |
71 | ///代码清单1-1
72 | /// 监听Stream,每次值改变的时候,更新Text中的内容
73 | StreamBuilder buildStreamBuilder() {
74 | return StreamBuilder(
75 | ///绑定stream
76 | stream: _streamController.stream,
77 | ///默认的数据
78 | initialData: "00:00:00",
79 | ///构建绑定数据的UI
80 | builder: (BuildContext context, AsyncSnapshot snapshot) {
81 | ///snapshot.data 就是传递的数据对象
82 | return Text(
83 | '当前时间 ${snapshot.data} ',
84 | style: TextStyle(fontSize: 22, color: Colors.blue),
85 | );
86 | },
87 | );
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/lib/async/test_user_notifier_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import 'package:flutter/cupertino.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | class TestUserNotifierPage extends StatefulWidget {
7 | @override
8 | State createState() {
9 | return _ScrollHomePageState();
10 | }
11 | }
12 |
13 | class _ScrollHomePageState extends State {
14 |
15 | UserNotifier _testUserNotifier = UserNotifier(UserInfo(name: "", age: 0));
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | ///页面主体脚手架
20 | return Scaffold(
21 | appBar: AppBar(
22 | title: Text("测试"),
23 | ),
24 |
25 | /// 处理滑动
26 | body: Column(
27 | children: [
28 | SizedBox(
29 | height: 40,
30 | ),
31 |
32 | OutlineButton(
33 | child: Text("测试用户数据"),
34 | onPressed: () {
35 | testUserFunction();
36 | },
37 | ),
38 | SizedBox(
39 | height: 40,
40 | ),
41 | //ValueListenableBuilder是简易版的Provider
42 | buildUserListenableBuilder(),
43 | ],
44 | ),
45 | );
46 | }
47 |
48 | ///第二步 定义
49 | Widget buildUserListenableBuilder() {
50 | return ValueListenableBuilder(
51 | ///数据发生变化时回调
52 | builder: (context, value, child) {
53 | String message = "--";
54 | if (value != null) {
55 | message = "姓名是:${value.name} 年龄是: ${value.age}";
56 | }
57 | return Text(message);
58 | },
59 |
60 | ///监听的数据
61 | valueListenable: _testUserNotifier,
62 | );
63 | }
64 |
65 | void testUserFunction() {
66 | _testUserNotifier.setName("李四");
67 | }
68 | }
69 |
70 | class UserInfo {
71 | String name;
72 | int age;
73 |
74 | UserInfo({this.name, this.age});
75 | }
76 |
77 | ///自定义 ValueNotifier
78 | /// UserInfo 为数据类型
79 | class UserNotifier extends ValueNotifier {
80 | UserNotifier(UserInfo userInfo) : super(userInfo);
81 |
82 | void setName(String name) {
83 | ///赋值
84 | value.name = name;
85 |
86 | ///通知更新
87 | notifyListeners();
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/lib/async/test_value_notifier_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import 'package:flutter/cupertino.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | class TestValueNotifierPage extends StatefulWidget {
7 | @override
8 | State createState() {
9 | return _ScrollHomePageState();
10 | }
11 | }
12 |
13 | class _ScrollHomePageState extends State {
14 |
15 | /// 第一步 定义 ValueNotifier 这里传递的数据类型为 String
16 | ValueNotifier _testValueNotifier = ValueNotifier('');
17 |
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | ///页面主体脚手架
22 | return Scaffold(
23 | appBar: AppBar(
24 | title: Text("测试"),
25 | ),
26 |
27 | /// 处理滑动
28 | body: Column(
29 | children: [
30 | SizedBox(
31 | height: 40,
32 | ),
33 | OutlineButton(
34 | child: Text("测试数据"),
35 | onPressed: () {
36 | testFunction();
37 | },
38 | ),
39 |
40 | SizedBox(
41 | height: 40,
42 | ),
43 | //ValueListenableBuilder是简易版的Provider
44 | buildValueListenableBuilder(),
45 | ],
46 | ),
47 | );
48 | }
49 |
50 | ///第二步定义 数据变化后监听的 Widget
51 | Widget buildValueListenableBuilder() {
52 | return ValueListenableBuilder(
53 | ///数据发生变化时回调
54 | builder: (context, value, child) {
55 | return Text(value);
56 | },
57 | ///监听的数据
58 | valueListenable: _testValueNotifier,
59 | child: Text(
60 | '未登录',
61 | style: TextStyle(color: Colors.red),
62 | ),
63 | );
64 | }
65 |
66 | ///第三步就是数据变化后
67 | void testFunction() {
68 | ///赋值更新
69 | _testValueNotifier.value = '传递的测试数据';
70 | }
71 |
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/lib/bloc/demo1/bloc_time.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | /// 创建人: Created by zhaolong
6 | /// 创建时间:Created by on 2020/10/20.
7 | ///
8 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
9 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
10 | /// 可关注博客:https://blog.csdn.net/zl18603543572
11 | ///
12 | /// 代码清单
13 | ///代码清单
14 | ///
15 |
16 |
17 | import 'package:flutter_bloc/flutter_bloc.dart';
18 | import 'package:intl/intl.dart';
19 | ///Bolc 的泛型数据类型
20 | ///在这里 int 代表输入的事件类型
21 | /// String 代表输出的数据结果
22 | class TimeCounterBloc extends Bloc {
23 | ///默认构造
24 | ///[initialState]默认的数据
25 | TimeCounterBloc(String initialState) : super(initialState);
26 |
27 | ///业务逻辑处理 [event] 事件标识
28 | @override
29 | Stream mapEventToState(int event) async* {
30 | ///获取当前的时间
31 | DateTime dateTime= DateTime.now();
32 | ///格式化时间 import 'package:intl/intl.dart';
33 | ///需要添加 intl 依赖
34 | String formatTime = DateFormat("HH:mm:ss").format(dateTime);
35 | ///发射更新数据
36 | yield formatTime;
37 | }
38 | }
--------------------------------------------------------------------------------
/lib/bloc/demo1/main_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_bloc/flutter_bloc.dart';
4 | import 'package:flutter_test_app/bloc/demo1/test_bloc_time_page.dart';
5 | import 'bloc_time.dart';
6 |
7 | ///flutter应用程序中的入口函数
8 | void main() => runApp(BlocMainApp());
9 |
10 | ///应用的根布局
11 | class BlocMainApp extends StatelessWidget {
12 | @override
13 | Widget build(BuildContext context) {
14 | ///构建Materia Desin 风格的应用程序
15 | return BlocProvider(
16 | create: (context) => TimeCounterBloc(""),
17 | child: MaterialApp(
18 | ///Android应用程序中任务栏中显示应用的名称
19 | title: "配制",
20 | theme: ThemeData(
21 | accentColor: Colors.blue,
22 | ///默认是 Brightness.light
23 | brightness: Brightness.light,
24 | ),
25 | ///默认的首页面
26 | home: TestBlocTimePage(),
27 | ),
28 | );
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lib/bloc/demo1/test_bloc_time_page.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | import 'package:flutter/cupertino.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:flutter_bloc/flutter_bloc.dart';
7 | import 'dart:async';
8 | import 'bloc_time.dart';
9 |
10 | ///Bloc 初探
11 | class TestBlocTimePage extends StatefulWidget {
12 | @override
13 | State createState() {
14 | return _TestABPageState();
15 | }
16 | }
17 |
18 | class _TestABPageState extends State {
19 |
20 | ///计时器
21 | Timer _timer;
22 | @override
23 | void initState() {
24 | super.initState();
25 | ///间隔1秒执行时间
26 | _timer= Timer.periodic(Duration(milliseconds: 1000), (timer) {
27 | ///发送事件
28 | BlocProvider.of(context).add(0);
29 | });
30 | }
31 |
32 |
33 | @override
34 | void dispose() {
35 | super.dispose();
36 | ///取消计时器
37 | _timer.cancel();
38 | }
39 | @override
40 | Widget build(BuildContext context) {
41 | ///页面主体脚手架
42 | return Scaffold(
43 | appBar: AppBar(
44 | title: Text("Bloc "),
45 | ),
46 | body:buildBlocBuilder(),
47 | );
48 | }
49 |
50 | ///代码清单1-1
51 | /// 通过 BlocBuilder 来消费事件结果
52 | Widget buildBlocBuilder() {
53 | return BlocBuilder(
54 | ///条件判断是否更新视图
55 | /// 参数 previous 上一次的数据
56 | /// 参数 current 当前的数据
57 | buildWhen: (String previous,String current){
58 | print("previous $previous current $current");
59 | return true;
60 | },
61 | ///入参 time 为BloC发射的数据
62 | builder: (context, time) {
63 | ///在这里 time 就是BloC回传的数据处理结果
64 | ///当然在这里是一个 String 类型
65 | return Container(
66 | ///外边距
67 | margin: EdgeInsets.only(left: 12,top: 12),
68 | child: Text(
69 | '$time',
70 | style: TextStyle(fontSize: 22.0, color: Colors.red),
71 | ),
72 | );
73 | },
74 | );
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/lib/bloc/demo2/bloc_number.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | import 'dart:math';
6 |
7 | /// 创建人: Created by zhaolong
8 | /// 创建时间:Created by on 2020/10/20.
9 | ///
10 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
11 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
12 | /// 可关注博客:https://blog.csdn.net/zl18603543572
13 | ///
14 | /// 代码清单
15 | ///代码清单
16 | ///
17 |
18 |
19 | import 'package:flutter_bloc/flutter_bloc.dart';
20 |
21 | ///Bolc 的泛型数据类型
22 | ///在这里 int 代表输入的事件类型
23 | /// String 代表输出的数据结果
24 | class NumberBloc extends Bloc {
25 | ///默认构造
26 | ///[initialState]默认的数据
27 | NumberBloc(int initialState) : super(initialState);
28 |
29 | ///业务逻辑处理 [event] 事件标识
30 | @override
31 | Stream mapEventToState(int event) async* {
32 |
33 | ///发射更新数据
34 | yield Random().nextInt(100);
35 | }
36 | }
--------------------------------------------------------------------------------
/lib/bloc/demo2/main_mul_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_bloc/flutter_bloc.dart';
4 | import 'package:flutter_test_app/bloc/demo1/bloc_time.dart';
5 | import 'package:flutter_test_app/bloc/demo1/test_bloc_time_page.dart';
6 | import 'package:flutter_test_app/bloc/demo2/test_mul_bloc_time_page.dart';
7 | import 'bloc_number.dart';
8 |
9 |
10 | ///flutter应用程序中的入口函数
11 | void main() => runApp(BlocMainApp());
12 |
13 | ///应用的根布局
14 | class BlocMainApp extends StatelessWidget {
15 | @override
16 | Widget build(BuildContext context) {
17 | ///构建Materia Desin 风格的应用程序
18 | return MaterialApp(
19 | ///Android应用程序中任务栏中显示应用的名称
20 | title: "配制",
21 | theme: ThemeData(
22 | accentColor: Colors.blue,
23 |
24 | ///默认是 Brightness.light
25 | brightness: Brightness.light,
26 | ),
27 |
28 | ///默认的首页面
29 | home: buildHomePage(),
30 | );
31 | }
32 |
33 | buildHomePage() {
34 | return MultiBlocProvider(
35 | providers: [
36 | BlocProvider(
37 | create: (BuildContext context) => TimeCounterBloc("00:00:00"),
38 | ),
39 | BlocProvider(
40 | create: (BuildContext context) => NumberBloc(0),
41 | ),
42 | ], child: TestMulBlocTimePage(),
43 | );
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/lib/bloc/demo2/test_mul_bloc_time_page.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | import 'package:flutter/cupertino.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:flutter_bloc/flutter_bloc.dart';
7 | import 'dart:async';
8 |
9 | import 'package:flutter_test_app/bloc/demo1/bloc_time.dart';
10 | import 'package:flutter_test_app/bloc/demo2/bloc_number.dart';
11 |
12 | ///Bloc 初探
13 | class TestMulBlocTimePage extends StatefulWidget {
14 | @override
15 | State createState() {
16 | return _TestABPageState();
17 | }
18 | }
19 |
20 | class _TestABPageState extends State {
21 |
22 | ///计时器
23 | Timer _timer;
24 | @override
25 | void initState() {
26 | super.initState();
27 | ///间隔1秒执行时间
28 | _timer= Timer.periodic(Duration(milliseconds: 1000), (timer) {
29 | ///发送事件
30 | BlocProvider.of(context).add(0);
31 |
32 | BlocProvider.of(context).add(0);
33 | });
34 | }
35 |
36 |
37 | @override
38 | void dispose() {
39 | super.dispose();
40 | ///取消计时器
41 | _timer.cancel();
42 | }
43 | @override
44 | Widget build(BuildContext context) {
45 | ///页面主体脚手架
46 | return Scaffold(
47 | appBar: AppBar(
48 | title: Text("Bloc "),
49 | ),
50 | body:Column(children: [
51 | buildBlocBuilder(),
52 | SizedBox(height: 22,),
53 | buildBlocBuilder2(),
54 | ],),
55 | );
56 | }
57 |
58 | ///代码清单1-1
59 | /// 通过 BlocBuilder 来消费事件结果
60 | Widget buildBlocBuilder() {
61 | return BlocBuilder(
62 | ///条件判断是否更新视图
63 | /// 参数 previous 上一次的数据
64 | /// 参数 current 当前的数据
65 | buildWhen: (String previous,String current){
66 | print("previous $previous current $current");
67 | return true;
68 | },
69 | ///入参 time 为BloC发射的数据
70 | builder: (context, time) {
71 | ///在这里 time 就是BloC回传的数据处理结果
72 | ///当然在这里是一个 String 类型
73 | return Container(
74 | ///外边距
75 | margin: EdgeInsets.only(left: 12,top: 12),
76 | child: Text(
77 | '$time',
78 | style: TextStyle(fontSize: 22.0, color: Colors.red),
79 | ),
80 | );
81 | },
82 | );
83 | }
84 |
85 | Widget buildBlocBuilder2() {
86 | return BlocBuilder(
87 | ///入参 number 为BloC发射的数据
88 | builder: (context, number) {
89 | ///在这里 time 就是BloC回传的数据处理结果
90 | ///当然在这里是一个 String 类型
91 | return Container(
92 | ///外边距
93 | margin: EdgeInsets.only(left: 12,top: 12),
94 | child: Text(
95 | ' 随机数字 $number',
96 | style: TextStyle(fontSize: 22.0, color: Colors.red),
97 | ),
98 | );
99 | },
100 | );
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/lib/canvas/cpi_audio_waveform.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 |
5 | /// 创建人: Created by zhaolong
6 | /// 创建时间:Created by on 2020/11/20.
7 | ///
8 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
9 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
10 | /// 可关注博客:https://blog.csdn.net/zl18603543572
11 | ///
12 | /// 代码清单
13 | ///代码清单
14 | void main() => runApp(MaterialApp(home: TestPage(),));
15 | class TestPage extends StatefulWidget {
16 | @override
17 | _TestPageState createState() => _TestPageState();
18 | }
19 |
20 | class _TestPageState extends State {
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return Scaffold(
25 | appBar: AppBar(
26 | title: Text(""),
27 | ),
28 | backgroundColor: Colors.white,
29 |
30 | ///填充布局
31 | body: MyHomePage(),
32 | );
33 | }
34 |
35 | }
36 |
37 | class MyHomePage extends StatelessWidget {
38 | @override
39 | Widget build(BuildContext context) {
40 | return Scaffold(
41 | body: Center(
42 | child: TweenAnimationBuilder(
43 | tween: Tween(begin: 0.0, end: 1.0),
44 | duration: Duration(seconds: 4),
45 | builder: (context, value, child) {
46 | return Container(
47 | width: 500,
48 | height: 100,
49 | child: Stack(
50 | children: [
51 | ShaderMask(
52 | shaderCallback: (rect) {
53 | return LinearGradient(
54 | begin: Alignment.centerLeft,
55 | end: Alignment.centerRight,
56 | stops: [
57 | value,
58 | value
59 | ],
60 | colors: [
61 | Colors.blue,
62 | Colors.grey.withAlpha(100)
63 | ]).createShader(rect);
64 | },
65 | child: Container(
66 | width: 500,
67 | height: 100,
68 | decoration: BoxDecoration(
69 | image: DecorationImage(
70 | image: Image.asset(
71 | "assets/images/audio_waveform.png")
72 | .image))),
73 | ),
74 | ],
75 | ),
76 | );
77 | })),
78 | );
79 | }
80 | }
--------------------------------------------------------------------------------
/lib/canvas/image/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'my-painter.dart';
4 |
5 | void main() {
6 | runApp(MyApp());
7 | }
8 |
9 | //绘制图片
10 | class MyApp extends StatelessWidget {
11 | @override
12 | Widget build(BuildContext context) {
13 | return MaterialApp(
14 | title: 'Flutter Tutorials',
15 | debugShowCheckedModeBanner: false,
16 | theme: ThemeData(
17 | primarySwatch: Colors.blue,
18 | visualDensity: VisualDensity.adaptivePlatformDensity,
19 | ),
20 | home: MyPainter(),
21 | );
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/canvas/image/my-canvas.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'dart:ui' as ui;
3 |
4 | class MyCanvas extends CustomPainter {
5 | ui.Image bgImage;
6 | int imageCount = 0;
7 | int selectedIndex = 0;
8 | MyCanvas(this.bgImage, this.imageCount, this.selectedIndex);
9 | @override
10 | void paint(Canvas canvas, Size size) {
11 | var offset = Offset(size.width / 2, size.height / 2);
12 | drawImage(canvas, offset);
13 | drawFrame(canvas, offset);
14 | drawDots(canvas, offset);
15 | }
16 |
17 | @override
18 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
19 | return true;
20 | }
21 |
22 | var W = 600.0;
23 | void drawFrame(Canvas canvas, Offset offset) {
24 | var rect = Rect.fromCenter(center: offset, width: W, height: W);
25 | var border = Paint()
26 | ..color = Colors.black
27 | ..strokeWidth = 10.0
28 | ..style = PaintingStyle.stroke;
29 |
30 | canvas.drawRect(rect, border);
31 | }
32 |
33 | void drawImage(Canvas canvas, Offset offset) {
34 | if (this.bgImage != null) {
35 | var rect = Rect.fromCenter(center: offset, width: W, height: W);
36 | // canvas.drawImage(this.bgImage, Offset(0, 0), Paint());
37 | paintImage(this.bgImage, rect, canvas, Paint(), BoxFit.cover);
38 | }
39 | }
40 |
41 | void drawDots(Canvas canvas, Offset offset) {
42 | var pOff = Paint()
43 | ..strokeWidth = 2.0
44 | ..style = PaintingStyle.stroke
45 | ..color = Colors.grey;
46 | var pOn = Paint()
47 | ..style = PaintingStyle.fill
48 | ..color = Colors.grey;
49 |
50 | var radius = 10.0;
51 | var k = 2 * radius + 5.0;
52 | var c = Offset(-k * (imageCount - 1.0) / 2.0, W / 2 + 20);
53 | for (var i = 0; i < imageCount; i++) {
54 | if (i == this.selectedIndex % imageCount) {
55 | canvas.drawCircle(c + offset, radius, pOn);
56 | } else {
57 | canvas.drawCircle(c + offset, radius, pOff);
58 | }
59 | c += Offset(k, 0);
60 | }
61 | }
62 |
63 | void paintImage(
64 | ui.Image image, Rect outputRect, Canvas canvas, Paint paint, BoxFit fit) {
65 | final Size imageSize =
66 | Size(image.width.toDouble(), image.height.toDouble());
67 | final FittedSizes sizes = applyBoxFit(fit, imageSize, outputRect.size);
68 | final Rect inputSubrect =
69 | Alignment.center.inscribe(sizes.source, Offset.zero & imageSize);
70 | final Rect outputSubrect =
71 | Alignment.center.inscribe(sizes.destination, outputRect);
72 | canvas.drawImageRect(image, inputSubrect, outputSubrect, paint);
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/lib/canvas/image/my-painter.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 | import 'dart:ui' as ui;
4 | import 'my-canvas.dart';
5 |
6 | class MyPainter extends StatefulWidget {
7 | @override
8 | _MyPainterState createState() => _MyPainterState();
9 | }
10 |
11 | class _MyPainterState extends State {
12 | @override
13 | void initState() {
14 | super.initState();
15 | // Load the images from assets
16 | loadImages();
17 | }
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | body: GestureDetector(
23 | onTap: () {
24 | setState(() {
25 | this.selectedIndex++;
26 | this.selectedImage = this.images.length > 0
27 | ? this.images[this.selectedIndex % this.images.length]
28 | : null;
29 | print(
30 | "Selected image index = ${this.selectedIndex % this.images.length}");
31 | });
32 | },
33 | child: CustomPaint(
34 | child: Container(),
35 | painter: MyCanvas(
36 | this.selectedImage, this.images.length, this.selectedIndex),
37 | ),
38 | ),
39 | );
40 | }
41 |
42 | var images = new List();
43 | ui.Image selectedImage;
44 | int selectedIndex = 0;
45 | void loadImages() {
46 | var names = ["3.webp", "1.webp", "2.webp"];
47 | names.forEach((name) {
48 | rootBundle.load("assets/images/banner$name").then((bd) {
49 | decodeImageFromList(bd.buffer.asUint8List()).then((img) {
50 | setState(() {
51 | this.images.add(img);
52 | this.selectedImage = this.images.length > 0 ? this.images[0] : null;
53 | });
54 | });
55 | });
56 | });
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/canvas/rain/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'weather_widget.dart';
4 |
5 | void main() {
6 | runApp(MyApp());
7 | }
8 |
9 | ///下雨
10 | class MyApp extends StatelessWidget {
11 | @override
12 | Widget build(BuildContext context) {
13 | return MaterialApp(
14 | title: 'Flutter Demo',
15 | debugShowCheckedModeBanner: false,
16 | theme: ThemeData(
17 | primarySwatch: Colors.blue,
18 | visualDensity: VisualDensity.adaptivePlatformDensity,
19 | ),
20 | home: WeatherWidget(),
21 | );
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/canvas/rain/my_rain_canvas.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | import 'particle.dart';
6 |
7 | class MyRainCanvas extends CustomPainter {
8 | final List particles;
9 | MyRainCanvas(this.particles);
10 |
11 | @override
12 | void paint(Canvas canvas, Size size) {
13 | var center = Offset(size.width / 2.0, size.height / 2.0);
14 | drawClouds(canvas, center);
15 | drawRain(canvas, center);
16 | }
17 |
18 | @override
19 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
20 | return true;
21 | }
22 |
23 | void drawClouds(Canvas canvas, Offset center) {
24 | var c = Paint()
25 | ..color = Color(0xff8e9aaf)
26 | ..style = PaintingStyle.fill;
27 |
28 | var p1 = Offset(-50, -40) + center;
29 | var r1 = 90.0;
30 | canvas.drawCircle(p1, r1, c);
31 |
32 | var p2 = Offset(-10, -50) + center;
33 | var r2 = 100.0;
34 | canvas.drawCircle(p2, r2, c);
35 |
36 | var p3 = Offset(10, -10) + center;
37 | var r3 = 90.0;
38 | canvas.drawCircle(p3, r3, c);
39 |
40 | var p4 = Offset(50, -10) + center;
41 | var r4 = 110.0;
42 | canvas.drawCircle(p4, r4, c);
43 |
44 | var p5 = Offset(150, -10) + center;
45 | var r5 = 60.0;
46 | canvas.drawCircle(p5, r5, c);
47 | }
48 |
49 | var W = 600.0;
50 | void drawRain(Canvas canvas, Offset center) {
51 | var rain = Paint()
52 | ..color = Color(0xffdee2ff) //Colors.black
53 | ..strokeWidth = 10.0
54 | ..style = PaintingStyle.stroke;
55 |
56 | var rect = Rect.fromCenter(center: center, width: 500, height: 600);
57 | canvas.clipRect(rect);
58 | canvas.save();
59 | canvas.translate(W - 250, -200);
60 | canvas.rotate(45.0 * pi / 180.0);
61 |
62 | particles.forEach((p) {
63 | var p2 = p.position + Offset(0, p.length);
64 | var dd = Offset(-50, 0);
65 | canvas.drawLine(p.position + center + dd, p2 + center + dd, rain);
66 | });
67 | canvas.restore();
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/lib/canvas/rain/particle.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | class Particle {
4 | Offset position;
5 | Offset original;
6 | double length;
7 | double speed;
8 | }
9 |
--------------------------------------------------------------------------------
/lib/canvas/rain/rain_widget.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:math';
3 |
4 | import 'package:flutter/material.dart';
5 | import 'my_rain_canvas.dart';
6 | import 'particle.dart';
7 |
8 | class RainWidget extends StatefulWidget {
9 | @override
10 | _RainWidgetState createState() => _RainWidgetState();
11 | }
12 |
13 | var rng = Random();
14 |
15 | class _RainWidgetState extends State {
16 | var particles = List();
17 | Timer timer;
18 | @override
19 | void initState() {
20 | super.initState();
21 |
22 | var xx = 0.0;
23 | // create particles
24 | for (var i = 0; i < 15; i++) {
25 | xx += rng.nextDouble() * 12.0 + 12.0;
26 | var dx = xx;
27 | var dy = -rng.nextDouble() * 150.0;
28 | // generate the length and speed
29 | var len = rng.nextDouble() * 30.0 + 30.0;
30 | var speed = rng.nextDouble() * 5.0 + 1.0;
31 | particles.add(Particle()
32 | ..position = Offset(dx, dy)
33 | ..original = Offset(dx, dy)
34 | ..speed = speed
35 | ..length = len);
36 | }
37 |
38 | // animation timer
39 | final fps = 50.0;
40 | var frameDuration = (1000 ~/ fps);
41 | timer = Timer.periodic(Duration(milliseconds: frameDuration), (timer) {
42 | setState(() {
43 | particles.forEach((p) {
44 | p.position += Offset(0, p.speed);
45 | if (p.position.dy > 200) {
46 | p.position = p.original;
47 | }
48 | });
49 | });
50 | });
51 | }
52 |
53 | @override
54 | void dispose() {
55 | timer?.cancel();
56 | super.dispose();
57 | }
58 |
59 | @override
60 | Widget build(BuildContext context) {
61 | return Container(
62 | child: CustomPaint(
63 | child: Container(),
64 | painter: MyRainCanvas(particles),
65 | ));
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/canvas/rain/weather_widget.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'my_weather_canvas.dart';
5 | import 'rain_widget.dart';
6 |
7 | class WeatherWidget extends StatefulWidget {
8 | @override
9 | _WeatherWidgetState createState() => _WeatherWidgetState();
10 | }
11 |
12 | class _WeatherWidgetState extends State {
13 | double t = 1.0;
14 | Timer timer;
15 | @override
16 | void initState() {
17 | super.initState();
18 | final fps = 50.0;
19 | var frameDuration = (1000 ~/ fps);
20 | timer = Timer.periodic(Duration(milliseconds: frameDuration), (timer) {
21 | setState(() {
22 | t = rng.nextDouble() < 0.001 ? 0.0 : t;
23 | t += 0.1;
24 | t = t > 1.0 ? 1.0 : t;
25 | });
26 | });
27 | }
28 |
29 | @override
30 | Widget build(BuildContext context) {
31 | return Container(
32 | child: CustomPaint(
33 | // depending on the weather condition, set the correct widget
34 | // in this case it's the rain widget. You could also have
35 | // sunny widget, snowy widget, etc..
36 | child: Center(child: Transform.scale(scale: 0.5, child: RainWidget())),
37 | painter: MyWeatherCanvas(t),
38 | ),
39 | );
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/clip/clip_main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_test_app/clip/test_clip_oval_page.dart';
4 | import 'package:flutter_test_app/clip/test_clip_react_page.dart';
5 |
6 |
7 | /// 创建人: Created by zhaolong
8 | /// 创建时间:Created by on 2020/10/11.
9 | ///
10 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
11 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
12 | /// 可关注博客:https://blog.csdn.net/zl18603543572
13 | ///
14 | /// 代码清单
15 | ///
16 |
17 | void main()=>runApp(TestClipMainPage());
18 | ///应用的根布局
19 | class TestClipMainPage extends StatelessWidget{
20 | @override
21 | Widget build(BuildContext context) {
22 | ///构建Materia Desin 风格的应用程序
23 | return MaterialApp(
24 | ///Android应用程序中任务栏中显示应用的名称
25 | title: " 配制",
26 | theme: ThemeData(
27 | accentColor: Colors.blue,
28 | ///默认是 Brightness.light
29 | brightness: Brightness.light,
30 | ),
31 | ///默认的首页面
32 | // home: ScrollHomePage(),
33 | home: TestClipReactPage(),
34 | // home: TestClipOvalPage(),
35 | // home: CustomScrollDemoPage(),
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/clip/test_clip_oval_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class TestClipOvalPage extends StatefulWidget {
5 | @override
6 | State createState() {
7 | return _ClipOvalState();
8 | }
9 | }
10 |
11 | class _ClipOvalState extends State {
12 | @override
13 | Widget build(BuildContext context) {
14 | return Scaffold(
15 | backgroundColor: Colors.grey,
16 | appBar: new AppBar(title: Text(" ClipOval "),),
17 | body: Container(
18 | width: 100,
19 | height: 100,
20 | ///裁剪组件
21 | child: ClipOval(
22 | ///一个图片
23 | child: new Image.network(
24 | imageUrl, //图片地址
25 | ///填充
26 | fit: BoxFit.fill),
27 | ),
28 | ),
29 | );
30 | }
31 |
32 | String imageUrl =
33 | "https://timgsa.baidu.com/timg?demo.image&quality=80&size=b9999_10000&sec=1578583093&di=0bf687d9589dc5c6c0778de9576ee077&imgtype=jpg&er=1&src=http%3A%2F%2Ffile.mumayi.com%2Fforum%2F201403%2F28%2F111010vhgc45hkh41f1mfd.jpg";
34 | }
35 |
--------------------------------------------------------------------------------
/lib/clip/test_clip_react_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class TestClipReactPage extends StatefulWidget {
5 | @override
6 | State createState() {
7 | return _ClipOvalState();
8 | }
9 | }
10 |
11 | class _ClipOvalState extends State {
12 | @override
13 | Widget build(BuildContext context) {
14 | return Scaffold(
15 | backgroundColor: Colors.grey,
16 | appBar: new AppBar(title: Text(" ClipOval "),),
17 | body: Container(
18 | width: 100,
19 | height: 100,
20 | ///裁剪组件
21 | child: ClipRect(
22 | ///一个图片
23 | child: new Image.network(
24 | imageUrl, //图片地址
25 | ///填充
26 | fit: BoxFit.fill),
27 | ),
28 | ),
29 | );
30 | }
31 |
32 | String imageUrl =
33 | "https://timgsa.baidu.com/timg?demo.image&quality=80&size=b9999_10000&sec=1578583093&di=0bf687d9589dc5c6c0778de9576ee077&imgtype=jpg&er=1&src=http%3A%2F%2Ffile.mumayi.com%2Fforum%2F201403%2F28%2F111010vhgc45hkh41f1mfd.jpg";
34 | }
35 |
--------------------------------------------------------------------------------
/lib/customDrawer/CustomDrawer.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:flutter/material.dart';
3 |
4 | import 'FirstLayer.dart';
5 | import 'HomePage.dart';
6 | import 'SecondLayer.dart';
7 | import 'ThirdLayer.dart';
8 |
9 |
10 | void main() {
11 | runApp(CustomDrawerApp());
12 | }
13 |
14 | class CustomDrawerApp extends StatelessWidget {
15 | @override
16 | Widget build(BuildContext context) {
17 | return MaterialApp(
18 | home: CustomDrawer(),
19 | );
20 | }
21 | }
22 |
23 | class CustomDrawer extends StatefulWidget {
24 | @override
25 | _CustomDrawerState createState() => _CustomDrawerState();
26 | }
27 |
28 | class _CustomDrawerState extends State {
29 | @override
30 | Widget build(BuildContext context) {
31 | return Scaffold(
32 | body: Stack(
33 | children: [
34 | FirstLayer(),
35 | SecondLayer(),
36 | ThirdLayer(),
37 | HomewPage(),
38 | ],
39 | ),
40 | );
41 | }
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/lib/customDrawer/FirstLayer.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class FirstLayer extends StatelessWidget {
4 | @override
5 | Widget build(BuildContext context) {
6 | return Container(
7 | height: MediaQuery.of(context).size.height,
8 | width: MediaQuery.of(context).size.width,
9 | decoration: BoxDecoration(
10 | gradient:
11 | LinearGradient(colors: [Color(0xFF4c41a3), Color(0xFF1f186f)])),
12 | );
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/lib/customDrawer/SecondLayer.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:matrix4_transform/matrix4_transform.dart';
3 |
4 | SecondLayerState secondLayerState;
5 |
6 | class SecondLayer extends StatefulWidget {
7 | @override
8 | SecondLayerState createState() => SecondLayerState();
9 |
10 | // openTab() => createState().openTab();
11 | }
12 |
13 | class SecondLayerState extends State {
14 | double xoffSet = 0;
15 | double yoffSet = 0;
16 | double angle = 0;
17 |
18 | bool isOpen = false;
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | secondLayerState = this;
23 | return AnimatedContainer(
24 | transform: Matrix4Transform()
25 | .translate(x: xoffSet, y: yoffSet)
26 | .rotate(angle)
27 | .matrix4,
28 | duration: Duration(milliseconds: 550),
29 | decoration: BoxDecoration(
30 | borderRadius: BorderRadius.circular(10), color: Color(0xFF4c41a3)),
31 | child: Column(
32 | children: [
33 | Row(
34 | children: [],
35 | )
36 | ],
37 | ));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/lib/customDrawer/main.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:flutter/material.dart';
3 |
4 | import 'CustomDrawer.dart';
5 |
6 | void main() {
7 | runApp(CustomDrawerApp());
8 | }
9 |
10 | class CustomDrawerApp extends StatelessWidget {
11 | @override
12 | Widget build(BuildContext context) {
13 | return MaterialApp(
14 | home: CustomDrawer(),
15 | );
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib/custom_tabbar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 |
5 | /// 创建人: Created by zhaolong
6 | /// 创建时间:Created by on 2020/10/30.
7 | ///
8 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
9 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
10 | /// 可关注博客:https://blog.csdn.net/zl18603543572
11 | ///
12 | /// 代码清单
13 | ///代码清单
14 | class CustomTabBar extends StatefulWidget {
15 | final TabController controller;
16 |
17 | CustomTabBar({@required this.controller,Key key}):super(key: key);
18 |
19 | @override
20 | _CustomTabBarState createState() => _CustomTabBarState();
21 | }
22 |
23 | class _CustomTabBarState extends State {
24 |
25 | @override
26 | Widget build(BuildContext context) {
27 | return Theme(
28 | data: ThemeData(
29 | ///默认显示的背影颜色
30 | backgroundColor: Colors.blue[500],
31 | ///点击的高亮颜色
32 | highlightColor: Colors.blueGrey[600],
33 | ///水波纹颜色
34 | splashColor: Color.fromRGBO(0, 0, 0, 0),
35 | ),
36 | child: new TabBar(
37 | controller: widget.controller,
38 | tabs: [
39 | new Tab(text: "首页", icon: new Icon(Icons.home)),
40 | new Tab(text: "发现", icon: new Icon(Icons.find_in_page)),
41 | new Tab(text: "动态", icon: new Icon(Icons.message)),
42 | new Tab(text: "我的", icon: new Icon(Icons.person)),
43 | ],
44 | indicatorWeight: 0.1,
45 | ),
46 | );;
47 | }
48 |
49 | }
--------------------------------------------------------------------------------
/lib/icon/round_corner_icon.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 |
4 |
5 | class RoundCornerIcon extends StatelessWidget {
6 |
7 | final IconData iconData;
8 | final Gradient gradient;
9 |
10 | const RoundCornerIcon({
11 | Key key,
12 | @required this.gradient,
13 | @required this.iconData,
14 | }) : assert(iconData != null),
15 | assert(gradient != null),
16 | super(key: key);
17 |
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | ///圆角裁剪
22 | return ClipRRect(
23 | ///四个圆角的角度
24 | borderRadius: BorderRadius.circular(5),
25 | ///被裁剪的子Widget
26 | child:Container(
27 | ///渐变样式的背景装饰
28 | decoration: BoxDecoration(
29 | gradient: gradient
30 | ),
31 | ///圆角背景大小
32 | height: 23,
33 | width: 23,
34 | ///中间的小图标
35 | child: Icon(
36 | ///图标数据
37 | iconData,
38 | ///图标大小
39 | size: 18,
40 | ///图标的颜色
41 | color: Colors.white,
42 | ),
43 | ),
44 | );
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/icon/test_round_icon_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_test_app/icon/round_corner_icon.dart';
4 |
5 | /// 创建人: Created by zhaolong
6 | /// 创建时间:Created by on 2020/10/15.
7 | ///
8 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
9 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
10 | /// 可关注博客:https://blog.csdn.net/zl18603543572
11 | ///
12 | /// 代码清单
13 | ///代码清单
14 | class TestRuondIconPage extends StatefulWidget {
15 | @override
16 | _TestRuondIconPageState createState() => _TestRuondIconPageState();
17 | }
18 |
19 | class _TestRuondIconPageState extends State {
20 | @override
21 | Widget build(BuildContext context) {
22 | return Scaffold(
23 | appBar: AppBar(
24 | title: Text("圆角图标"),
25 | ),
26 | backgroundColor: Colors.white,
27 |
28 | ///填充布局
29 | body: Container(
30 | width: double.infinity,
31 | height: double.infinity,
32 | child: Column(
33 | children: [
34 |
35 | SizedBox(height: 50,),
36 | buildDefaultIcon(),
37 |
38 | SizedBox(height: 50,),
39 | buildRoundCornerIcon(),
40 | ],
41 | )),
42 | );
43 | }
44 |
45 | RoundCornerIcon buildRoundCornerIcon() {
46 | return RoundCornerIcon(
47 | ///电话小图标
48 | iconData: CupertinoIcons.phone_solid,
49 | ///线性渐变的背景
50 | gradient: LinearGradient(
51 | ///颜色过渡
52 | colors: [
53 | Colors.redAccent,
54 | Colors.orange,
55 | ],
56 | ///颜色过渡的开始位置 左上角
57 | begin: Alignment.topLeft,
58 | ///颜色过渡的结束位置 右下角
59 | end: Alignment.bottomRight,
60 | ),
61 | );
62 | }
63 |
64 | buildDefaultIcon() {
65 | return Icon(
66 | ///图标数据
67 | CupertinoIcons.phone_solid,
68 | ///图标大小
69 | size: 18,
70 | );
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/lib/logindemo/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_test_app/logindemo/screens/login_screen.dart';
3 |
4 | void main() => runApp(MyApp());
5 |
6 | class MyApp extends StatelessWidget {
7 | // This widget is the root of your application.
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | title: 'Flutter Login UI',
12 | debugShowCheckedModeBanner: false,
13 | home: LoginScreen(),
14 | );
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/logindemo/utilities/constants.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | final kHintTextStyle = TextStyle(
4 | color: Colors.white54,
5 | fontFamily: 'OpenSans',
6 | );
7 |
8 | final kLabelStyle = TextStyle(
9 | color: Colors.white,
10 | fontWeight: FontWeight.bold,
11 | fontFamily: 'OpenSans',
12 | );
13 |
14 | final kBoxDecorationStyle = BoxDecoration(
15 | color: Color(0xFF6CA8F1),
16 | borderRadius: BorderRadius.circular(10.0),
17 | boxShadow: [
18 | BoxShadow(
19 | color: Colors.black12,
20 | blurRadius: 6.0,
21 | offset: Offset(0, 2),
22 | ),
23 | ],
24 | );
--------------------------------------------------------------------------------
/lib/progress/test_CircularProgressIndicator_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:animations/animations.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/gestures.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | /// 创建人: Created by zhaolong
7 | /// 创建时间:Created by on 2020/10/31.
8 | ///
9 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
10 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
11 | /// 可关注博客:https://blog.csdn.net/zl18603543572
12 | ///
13 | /// 代码清单 下拉刷新 RefreshIndicator
14 |
15 | void main() {
16 | runApp(RootPage());
17 | }
18 |
19 | class RootPage extends StatelessWidget {
20 | @override
21 | Widget build(BuildContext context) {
22 | return MaterialApp(
23 | home: HomePageRefreshIndicator(),
24 | );
25 | }
26 | }
27 |
28 | ///下拉刷新组件
29 | class HomePageRefreshIndicator extends StatefulWidget {
30 | @override
31 | _TestPageState createState() => _TestPageState();
32 | }
33 |
34 | class _TestPageState extends State {
35 | @override
36 | Widget build(BuildContext context) {
37 | return Scaffold(
38 | appBar: AppBar(
39 | title: Text("圆形"),
40 | ),
41 |
42 | body: Center(
43 | child: Container(
44 | width: 55,
45 | height: 55,
46 | child: CircularProgressIndicator(
47 | // value: 0.3,
48 | //进度高亮颜色
49 | valueColor: new AlwaysStoppedAnimation(Colors.blue),
50 | //总进度的颜色
51 | backgroundColor: Color(0xff00ff00),
52 | //圆圈的厚度
53 | strokeWidth: 6.0,
54 | ),
55 | ),
56 | ),
57 | );
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/lib/progress/test_CupertinoActivityIndicator_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:animations/animations.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/gestures.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | /// 创建人: Created by zhaolong
7 | /// 创建时间:Created by on 2020/10/31.
8 | ///
9 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
10 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
11 | /// 可关注博客:https://blog.csdn.net/zl18603543572
12 | ///
13 | /// 代码清单 下拉刷新 RefreshIndicator
14 |
15 | void main() {
16 | runApp(RootPage());
17 | }
18 |
19 | class RootPage extends StatelessWidget {
20 | @override
21 | Widget build(BuildContext context) {
22 | return MaterialApp(
23 | home: HomePageRefreshIndicator(),
24 | );
25 | }
26 | }
27 |
28 | class HomePageRefreshIndicator extends StatefulWidget {
29 | @override
30 | _TestPageState createState() => _TestPageState();
31 | }
32 |
33 | class _TestPageState extends State {
34 | @override
35 | Widget build(BuildContext context) {
36 | return Scaffold(
37 | appBar: AppBar(
38 | title: Text("苹果风格"),
39 | ),
40 | body: Center(
41 | child: Container(
42 | child: CupertinoActivityIndicator(
43 | //半径 外部设置大小约束无效果
44 | radius: 30,
45 | //是否转动 默认为 true 开启转动
46 | animating: true,
47 | ),
48 | ),
49 | ),
50 | );
51 | }
52 | }
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/lib/progress/test_CupertinoSliverIndicator_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:animations/animations.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/gestures.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | /// 创建人: Created by zhaolong
7 | /// 创建时间:Created by on 2020/10/31.
8 | ///
9 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
10 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
11 | /// 可关注博客:https://blog.csdn.net/zl18603543572
12 | ///
13 | /// 代码清单 下拉刷新 RefreshIndicator
14 |
15 | void main() {
16 | runApp(RootPage());
17 | }
18 |
19 | class RootPage extends StatelessWidget {
20 | @override
21 | Widget build(BuildContext context) {
22 | return MaterialApp(
23 | home: HomePageRefreshIndicator(),
24 | );
25 | }
26 | }
27 |
28 | ///下拉刷新组件
29 | class HomePageRefreshIndicator extends StatefulWidget {
30 | @override
31 | _TestPageState createState() => _TestPageState();
32 | }
33 |
34 | class _TestPageState extends State {
35 | @override
36 | Widget build(BuildContext context) {
37 | return Scaffold(
38 | appBar: AppBar(
39 | title: Text("下拉刷新"),
40 | ),
41 | body: CustomScrollView(
42 | slivers: [
43 | //下拉刷新组件
44 | CupertinoSliverRefreshControl(
45 | //下拉刷新回调
46 | onRefresh: () async {
47 | //模拟网络请求
48 | await Future.delayed(Duration(milliseconds: 3000));
49 | //结束刷新
50 | return Future.value(true);
51 | },
52 | ),
53 | //列表
54 | SliverList(
55 | delegate: SliverChildBuilderDelegate((content, index) {
56 | return ListTile(
57 | title: Text('测试数据$index'),
58 | );
59 | }, childCount: 100),
60 | )
61 | ],
62 | ),
63 | );
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/lib/progress/test_LinearProgressIndicator_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:animations/animations.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/gestures.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | /// 创建人: Created by zhaolong
7 | /// 创建时间:Created by on 2020/10/31.
8 | ///
9 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
10 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
11 | /// 可关注博客:https://blog.csdn.net/zl18603543572
12 | ///
13 | /// 代码清单 下拉刷新 RefreshIndicator
14 |
15 | void main() {
16 | runApp(RootPage());
17 | }
18 |
19 | class RootPage extends StatelessWidget {
20 | @override
21 | Widget build(BuildContext context) {
22 | return MaterialApp(
23 | home: HomePageRefreshIndicator(),
24 | );
25 | }
26 | }
27 |
28 | ///下拉刷新组件
29 | class HomePageRefreshIndicator extends StatefulWidget {
30 | @override
31 | _TestPageState createState() => _TestPageState();
32 | }
33 |
34 | class _TestPageState extends State {
35 | @override
36 | Widget build(BuildContext context) {
37 | return Scaffold(
38 | appBar: AppBar(
39 | title: Text("线性"),
40 | ),
41 |
42 | body: Container(
43 | margin: EdgeInsets.all(20),
44 | width: 300,
45 | //会覆盖 进度条的 minHeight
46 | height: 10,
47 | child: LinearProgressIndicator(
48 | // value: 0.3,
49 | //进度高亮颜色
50 | valueColor: new AlwaysStoppedAnimation(Colors.blue),
51 | //总进度的颜色
52 | backgroundColor: Color(0xff00ff00),
53 | //设置进度条的高度
54 | minHeight: 10,
55 | ),
56 | ),
57 | );
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/lib/progress/test_RefreshIndicator_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:animations/animations.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/gestures.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | /// 创建人: Created by zhaolong
7 | /// 创建时间:Created by on 2020/10/31.
8 | ///
9 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
10 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
11 | /// 可关注博客:https://blog.csdn.net/zl18603543572
12 | ///
13 | /// 代码清单 下拉刷新 RefreshIndicator
14 |
15 | void main() {
16 | runApp(RootPage());
17 | }
18 |
19 | class RootPage extends StatelessWidget {
20 | @override
21 | Widget build(BuildContext context) {
22 | return MaterialApp(
23 | home: HomePageRefreshIndicator(),
24 | );
25 | }
26 | }
27 |
28 | ///下拉刷新组件
29 | class HomePageRefreshIndicator extends StatefulWidget {
30 | @override
31 | _TestPageState createState() => _TestPageState();
32 | }
33 |
34 | class _TestPageState extends State {
35 | @override
36 | Widget build(BuildContext context) {
37 | return Scaffold(
38 | appBar: AppBar(
39 | title: Text("下拉刷新"),
40 | ),
41 | //下拉刷新组件
42 | body: RefreshIndicator(
43 | //圆圈进度颜色
44 | color: Colors.blue,
45 | //下拉停止的距离
46 | displacement: 44.0,
47 | //背景颜色
48 | backgroundColor: Colors.grey[200],
49 | onRefresh: () async {
50 | //模拟网络请求
51 | await Future.delayed(Duration(milliseconds: 2000));
52 | //结束刷新
53 | return Future.value(true);
54 | },
55 | //一个列表
56 | child: ListView.builder(
57 | itemBuilder: (BuildContext context, int index) {
58 | return Container(
59 | height: 66,
60 | child: Text("测试数据"),
61 | );
62 | },
63 | //列表数据源数量
64 | itemCount: 100,
65 | ),
66 | ),
67 | );
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/lib/progress/test_SmartRefresher1_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:animations/animations.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/gestures.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:pull_to_refresh/pull_to_refresh.dart';
6 |
7 | /// 创建人: Created by zhaolong
8 | /// 创建时间:Created by on 2020/10/31.
9 | ///
10 | /// 可关注公众号:我的大前端生涯 获取最新技术分享
11 | /// 可关注网易云课堂:https://study.163.com/instructor/1021406098.htm
12 | /// 可关注博客:https://blog.csdn.net/zl18603543572
13 | ///
14 | /// 代码清单 下拉刷新 RefreshIndicator
15 |
16 | void main() {
17 | runApp(RootPage());
18 | }
19 |
20 | class RootPage extends StatelessWidget {
21 | @override
22 | Widget build(BuildContext context) {
23 | return MaterialApp(
24 | home: HomePageRefreshIndicator(),
25 | );
26 | }
27 | }
28 |
29 | ///下拉刷新组件
30 | class HomePageRefreshIndicator extends StatefulWidget {
31 | @override
32 | _TestPageState createState() => _TestPageState();
33 | }
34 |
35 | class _TestPageState extends State {
36 | RefreshController _refreshController =
37 | RefreshController(initialRefresh: false);
38 |
39 | @override
40 | Widget build(BuildContext context) {
41 | return Scaffold(
42 | appBar: AppBar(
43 | title: Text("下拉刷新"),
44 | ),
45 | //下拉刷新组件
46 | body: SmartRefresher(
47 | controller: _refreshController,
48 | //水滴刷新头
49 | header: WaterDropMaterialHeader(),
50 | enablePullUp: true,
51 | onRefresh: () async {
52 | //模拟网络请求
53 | await Future.delayed(Duration(milliseconds: 2000));
54 | //结束刷新
55 | _refreshController.refreshCompleted();
56 | },
57 | //一个列表
58 | child: ListView.builder(
59 | itemBuilder: (BuildContext context, int index) {
60 | return Container(
61 | height: 66,
62 | child: Text("测试数据"),
63 | );
64 | },
65 | //列表数据源数量
66 | itemCount: 100,
67 | ),
68 | ),
69 | );
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/lib/provider/demo1/main_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_test_app/provider/demo1/test_provider_consumer_time_page.dart';
4 | import 'package:flutter_test_app/provider/demo1/test_provider_time_page.dart';
5 | import 'package:flutter_test_app/provider/demo2/test_provider_abc_page.dart';
6 | import 'package:provider/provider.dart';
7 | import 'time_model.dart';
8 |
9 | ///代码清单 1-1
10 | ///flutter应用程序中的入口函数
11 | void main() => runApp(
12 | ChangeNotifierProvider(
13 | create: (BuildContext context) {
14 | return TimeCounterModel();
15 | },
16 | child: ProviderMainApp(),
17 | ),
18 | );
19 |
20 | ///应用的根布局
21 | class ProviderMainApp extends StatelessWidget {
22 | @override
23 | Widget build(BuildContext context) {
24 | ///构建Materia Desin 风格的应用程序
25 | return MaterialApp(
26 | ///Android应用程序中任务栏中显示应用的名称
27 | title: "配制",
28 | theme: ThemeData(
29 | accentColor: Colors.blue,
30 |
31 | ///默认是 Brightness.light
32 | brightness: Brightness.light,
33 | ),
34 |
35 | ///默认的首页面
36 |
37 | home: ProviderHomePage(),
38 | );
39 | }
40 | }
41 |
42 | class ProviderHomePage extends StatefulWidget {
43 | @override
44 | State createState() {
45 | return _ProviderHomePageState();
46 | }
47 | }
48 |
49 | class _ProviderHomePageState extends State {
50 | final List