├── .gitignore
├── .metadata
├── README.md
├── android
├── app
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ └── com
│ │ │ └── nb
│ │ │ └── flutterwidgets
│ │ │ └── MainActivity.kt
│ │ └── res
│ │ ├── drawable
│ │ └── launch_background.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
├── font
│ └── ManigueStaile.ttf
└── images
│ ├── ic_launcher.png
│ └── image
│ ├── circle_10.png
│ ├── pic01.png
│ ├── pic02.png
│ ├── pic03.png
│ ├── pic04.png
│ ├── pic05.png
│ ├── pic06.png
│ ├── pic07.png
│ ├── pic08.png
│ ├── pic09.png
│ ├── pic10.png
│ └── pic11.png
├── doc
├── appbar
│ ├── app_bar_01.png
│ ├── app_bar_02.png
│ └── app_bar_03.png
├── bottomnavbar
│ └── bottom_navigation_bar_01.png
├── container
│ ├── container_01.png
│ └── container_02.png
├── dropdownbutton
│ └── drop-down-button-01.png
├── flutterlogo
│ └── flutterlogo_01.png
├── flutteropen.png
├── icon
│ └── icon_01.png
├── image
│ ├── image_01.png
│ ├── image_02.png
│ ├── image_03.png
│ └── image_04.png
├── intro
│ └── youtube.png
├── page_01.png
├── page_02.png
├── page_03.png
├── page_04.png
├── page_05.png
├── placeholder
│ └── placeholder_01.png
├── popupmenubutton
│ └── popup-menu-button-1.png
├── raisebutton
│ ├── raise_button_01.png
│ ├── raise_button_02.png
│ ├── raise_button_03.png
│ └── raise_button_04.png
├── row
│ ├── row_01.png
│ ├── row_02.png
│ └── row_03.png
├── scaffold
│ ├── scaffold_01.png
│ └── scaffold_02.png
├── simpledialog
│ └── simple-dialog-01.png
├── stack
│ └── Stack_01.jpg
├── tabbarview
│ └── tab-bar-view-01.png
└── text
│ ├── text_01.png
│ └── text_02.png
├── ios
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ └── contents.xcworkspacedata
└── Runner
│ ├── AppDelegate.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
├── const
│ ├── _const.dart
│ ├── color_const.dart
│ ├── img_const.dart
│ ├── page_item_const.dart
│ ├── page_name_const.dart
│ ├── size_const.dart
│ └── string_const.dart
├── main.dart
├── page
│ ├── _page.dart
│ ├── alertdialog
│ │ └── alert_dialog_page.dart
│ ├── anim
│ │ ├── AnimCrossFadePage.dart
│ │ ├── AnimListPage.dart
│ │ ├── AnimOpacityPage.dart
│ │ ├── AnimSizePage.dart
│ │ ├── AnimWidgetPage.dart
│ │ ├── AnimatedContainerPage.dart
│ │ ├── AnimatedModalPage.dart
│ │ ├── AnimationPage.dart
│ │ ├── DefaultTextPage.dart
│ │ ├── FadeTransitionPage.dart
│ │ ├── HeroPage.dart
│ │ ├── PhotoHero.dart
│ │ ├── PositionTransitionPage.dart
│ │ ├── PyhModelPage.dart
│ │ ├── RotationPage.dart
│ │ └── _anim.dart
│ ├── appbar
│ │ └── app_bar_page.dart
│ ├── assets
│ │ ├── AssetsPage.dart
│ │ └── _assets.dart
│ ├── async
│ │ ├── FuturePage.dart
│ │ ├── StreamBuilderPage.dart
│ │ └── _async.dart
│ ├── bottomnavbar
│ │ └── bottom_navigation_bar_page.dart
│ ├── bottomsheet
│ │ └── bottom_sheet_page.dart
│ ├── checkbox
│ │ └── CheckBoxPage.dart
│ ├── chip
│ │ └── chip_page.dart
│ ├── container
│ │ └── container_page.dart
│ ├── dropdownbutton
│ │ └── drop_down_button_page.dart
│ ├── empty_page.dart
│ ├── expansionpanel
│ │ └── expansion_panel_page.dart
│ ├── floatingbutton
│ │ └── floating_action_button_page.dart
│ ├── flutterlogo
│ │ └── flutter_logo_page.dart
│ ├── home_page.dart
│ ├── icon
│ │ └── icon_page.dart
│ ├── img
│ │ └── image_page.dart
│ ├── info
│ │ ├── CardPage.dart
│ │ ├── DataTablePage.dart
│ │ ├── ProgressIndicatorPage.dart
│ │ ├── TooltipPage.dart
│ │ └── _info.dart
│ ├── interation
│ │ ├── DismissiblePage.dart
│ │ ├── DraggablePage.dart
│ │ ├── GesturePage.dart
│ │ ├── NavPage.dart
│ │ ├── NavigatorPage.dart
│ │ ├── PointerPage.dart
│ │ ├── ScrollablePage.dart
│ │ └── _interaction.dart
│ ├── layoutsingle
│ │ ├── MixPage.dart
│ │ └── _layout_single.dart
│ ├── materialapp
│ │ └── material_app_page.dart
│ ├── muti
│ │ ├── ExpandPage.dart
│ │ ├── FlowPage.dart
│ │ ├── IndexStackPage.dart
│ │ ├── LayoutPage.dart
│ │ ├── MethodChannelPage.dart
│ │ └── _muti.dart
│ ├── painting
│ │ ├── PaintingPage.dart
│ │ └── _painting.dart
│ ├── placeholder
│ │ └── place_holder_page.dart
│ ├── popupmenubutton
│ │ └── popup_menu_button_page.dart
│ ├── rasisebutton
│ │ └── raise_button_page.dart
│ ├── row
│ │ └── row_column_page.dart
│ ├── scaffold
│ │ └── scaffold_page.dart
│ ├── simpledialog
│ │ └── simple_dialog_page.dart
│ ├── slider
│ │ └── slider_page.dart
│ ├── snackbar
│ │ └── snack_bar_page.dart
│ ├── stack
│ │ └── stack_page.dart
│ ├── stepper
│ │ └── stepper_page.dart
│ ├── tabview
│ │ └── tab_bar_view_page.dart
│ ├── text
│ │ └── text_page.dart
│ └── textfield
│ │ └── text_field_page.dart
└── util
│ ├── GradientUtil.dart
│ ├── SizeUtil.dart
│ └── _util.dart
├── pubspec.yaml
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.lock
4 | *.log
5 | *.pyc
6 | *.swp
7 | .DS_Store
8 | .atom/
9 | .buildlog/
10 | .history
11 | .svn/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # Visual Studio Code related
20 | .vscode/
21 |
22 | # Flutter/Dart/Pub related
23 | **/doc/api/
24 | .dart_tool/
25 | .flutter-plugins
26 | .packages
27 | .pub-cache/
28 | .pub/
29 | build/
30 |
31 | # Android related
32 | **/android/**/gradle-wrapper.jar
33 | **/android/.gradle
34 | **/android/captures/
35 | **/android/gradlew
36 | **/android/gradlew.bat
37 | **/android/local.properties
38 | **/android/**/GeneratedPluginRegistrant.java
39 |
40 | # iOS/XCode related
41 | **/ios/**/*.mode1v3
42 | **/ios/**/*.mode2v3
43 | **/ios/**/*.moved-aside
44 | **/ios/**/*.pbxuser
45 | **/ios/**/*.perspectivev3
46 | **/ios/**/*sync/
47 | **/ios/**/.sconsign.dblite
48 | **/ios/**/.tags*
49 | **/ios/**/.vagrant/
50 | **/ios/**/DerivedData/
51 | **/ios/**/Icon?
52 | **/ios/**/Pods/
53 | **/ios/**/.symlinks/
54 | **/ios/**/profile
55 | **/ios/**/xcuserdata
56 | **/ios/.generated/
57 | **/ios/Flutter/App.framework
58 | **/ios/Flutter/Flutter.framework
59 | **/ios/Flutter/Generated.xcconfig
60 | **/ios/Flutter/app.flx
61 | **/ios/Flutter/app.zip
62 | **/ios/Flutter/flutter_assets/
63 | **/ios/ServiceDefinitions.json
64 | **/ios/Runner/GeneratedPluginRegistrant.*
65 |
66 | # Exceptions to above rules.
67 | !**/ios/**/default.mode1v3
68 | !**/ios/**/default.mode2v3
69 | !**/ios/**/default.pbxuser
70 | !**/ios/**/default.perspectivev3
71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
72 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 8426910a19abc4ab081c58fd1a72c433353eaa31
8 | channel: master
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Flutter Widgets
2 | ### :heart: Star :heart: the repo to support the project or :smile:[Follow Me](https://github.com/nb312).Thanks!
3 | Facebook Page| Twitter | QQ Group | Developer |
4 | --- | --- | --- | ---
5 | [Flutter Open ](https://www.facebook.com/flutteropen) | [NieBin](https://twitter.com/niebin_gg) | 963828159 |[NieBin](https://github.com/nb312)
6 | # What it is?
7 | The Project is a flutter examples of the flutter widgets. Some example contain articles and code about flutter widgets.
8 |
9 | The whole artcile is here: [Flutter Widgets articles](https://flutteropen.gitbook.io/flutter-widgets)
10 |
11 | 

12 | 
13 | ### Base widgets
14 | 1 | 2 | 3 | 4 | 5 | 6
15 | --- | --- | --- | --- | --- | ---
16 | [Container](https://flutteropen.gitbook.io/widgets/flutter-widgets-01-container) | [Row/Column](https://flutteropen.gitbook.io/ebook/flutter-open-flutter-widgets-04-row-and-column) | [Image](https://flutteropen.gitbook.io/ebook/flutter-open-flutter-widgets-03-image) | [Text](https://flutteropen.gitbook.io/widgets/flutter-open-flutter-widgets-02-text) | [Icon](https://flutteropen.gitbook.io/ebook/flutter-open-flutter-widgets-05-icon) |
17 | [RaiseButton](https://flutteropen.gitbook.io/ebook/widgets-06-or-raisebutton) | [Scaffold](https://medium.com/flutteropen/flutter-widgets-scaffold-8673c0630ed4) | [AppBar](https://medium.com/flutteropen/flutter-widgets-07-appbar-86cae58244cd) | [FlutterLogo](https://medium.com/flutteropen/flutter-widgets-09-flutterlogo-5552b9021f8b) | [PlaceHolder](https://medium.com/flutteropen/flutter-widgets-10-placeholder-f8949a7dc273) |
18 | ### Navigation
19 | 1 | 2 | 3 | 4 | 5 |
20 | --- | --- | --- | --- | ---
21 | [Scaffold](https://medium.com/flutteropen/flutter-widgets-scaffold-8673c0630ed4) | [AppBar](https://medium.com/flutteropen/flutter-widgets-07-appbar-86cae58244cd) | [BottomNavigationBar](https://medium.com/flutteropen/flutter-widgets-11-bottomnavigationbar-3531d625fa0c) | [TabBar&TabBarView](https://medium.com/flutteropen/flutter-widgets-12-tabbarview-tabbar-4cdc2112991a) |
22 | MaterialApp | WidgetsApp | Drawer | |
23 |
24 | ### Button
25 | 1 | 2 | 3 | 4 | 5 |
26 | --- | --- | --- | --- | ---
27 | [RaiseButton](https://medium.com/flutteropen/widgets-06-raisebutton-6322e0bb2a95) | FloatingActionButton | FlatButton | IconButton | [DropdownButton](https://medium.com/flutteropen/flutter-widgets-13-dropdownbutton-d21e9c226f04)
28 | [PopupMenuButton](https://medium.com/flutteropen/widgets-14-popupmenubutton-1f1437bbdce2) | ButtonBar | | |
29 |
30 | ### Input & selection
31 | 1 | 2 | 3 | 4 |
32 | --- | --- | --- | ---
33 | TextField | CheckBox | Radio | Switch
34 | Slider | Date $Time Pickers | |
35 |
36 | ### Dialog
37 | 1 | 2 | 3 | 4 | 5 |
38 | --- | --- | --- | --- | ---
39 | [SimpleDialog](https://medium.com/flutteropen/flutter-widgets-17-simpledialog-1cf5bfd83f5f) | AlertDialog | BottomSheet | ExpansionPanel | SnackBar
40 |
41 | ### Information
42 | 1 | 2 | 3 | 4 | 5 |
43 | --- | --- | --- | --- | ---
44 | Image | Icon | Chip | Tooltip | DataTable |
45 | Card | LinearProgressIndicator | CircularProgressIndicator | GridView |
46 |
47 | ### Layout-single
48 | 1 | 2 | 3 | 4
49 | --- | --- | --- | ---
50 | ListTile | [Stepper](https://medium.com/flutteropen/flutter-widgets-16-stepper-485ad8d1a248) | Divider | LimitedBox
51 | Padding | Center | Align | FittedBox | AspectRatio
52 | Baseline | FractionallySizedBox | IntrinsicHeight
53 | OverflowBox | SizedBox | SizedOverflowBox | Transform
54 | ConstrainedBox | Offstage | CustomSingleChildLayout | IntrinsicWidth
55 |
56 | ### Layout-muti
57 | 1 | 2 | 3 | 4 | 5
58 | --- | --- | --- | --- | --
59 | Row | Column | [Stack](https://medium.com/flutteropen/flutter-widgets-15-stack-9637858f7c62) | IndexedStack | Expanded
60 | GridView | Flow | Table | Wrap |
61 | ListBody | CustomMultiChildLayout | LayoutBuilder | ListView |
62 |
63 | ### Assets
64 | Text | Asset | Input
65 | --- | --- | ---
66 | Text | Image | Form
67 | RichText | Icon | FormField
68 | DefaultTextStyle | RawImage | RawKeyBoardListener
69 | AssetBundle | |
70 |
71 | ### Animation
72 | 1 | 2 | 3 | 4
73 | --- | --- | --- | ---
74 | Animation | AnimatedContainer | AnimatedCrossFade | Hero
75 | FadeTransition | PositionedTransition | RotationTransion | ScaleTransition
76 | AnimatedDefaultTextStyle | AnimatedListState | AnimatedModalBarrier |
77 | AnimatedSize | AnimatedWidget | AnimatedWidgetBaseState | DecoratedTransition
78 | SlideTransition | AnimatedPhysicalModel | AnimatedPositioned | AnimatedBuilder
79 | SizeTransition | AnimatedOpacity |
80 |
81 | ### Interaction
82 | 1 | 2 | 3 | 4 | 5 |
83 | --- | --- | --- | --- | ---
84 | Draggable | LongPressDraggable | GestureDetector | DragTarget | Dismissible
85 | AbsorbPointer | Scrollable | Hero | Navigator | IgnorePointer
86 |
87 | Style | Async | Accessibility
88 | --- | --- | ---
89 | Padding | FutureBuilder | Semantic
90 | Theme | StreamBuilder | MergeSemantics
91 | MediaQuery | | ExcludeSemantics
92 |
93 | ### Painting & Effect
94 | 1 | 2 | 3 | 4 | 5 |
95 | --- | --- | --- | --- | ---
96 | Opacity | Transform | DecoratedBox | FractionalTranslation | RotatedBox
97 | ClipOval | ClipPath | ClipRect | CustomPaint | BackdropFilter
98 |
99 | ### Scrolling
100 | [This part link](https://github.com/nb312/flutter-layouts-exampls)
101 |
102 | 1 | 2 | 3 | 4
103 | --- | --- | --- | ---
104 | GridView | ListView | NestedScrollView | SingleChildScrollView
105 | CustomScrollview | NotificationListener | ScrollConfiguration
106 | Scrollable | PageView | Scrollable | RefreshIndicator
107 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.nb.flutterwidgets"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
47 | }
48 |
49 | buildTypes {
50 | release {
51 | // TODO: Add your own signing config for the release build.
52 | // Signing with the debug keys for now, so `flutter run --release` works.
53 | signingConfig signingConfigs.debug
54 | }
55 | }
56 | }
57 |
58 | flutter {
59 | source '../..'
60 | }
61 |
62 | dependencies {
63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
64 | testImplementation 'junit:junit:4.12'
65 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
67 | }
68 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
19 |
26 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/nb/flutterwidgets/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.nb.flutterwidgets
2 |
3 | import android.os.Bundle
4 | import android.widget.Toast
5 |
6 | import io.flutter.app.FlutterActivity
7 | import io.flutter.plugin.common.MethodChannel
8 | import io.flutter.plugins.GeneratedPluginRegistrant
9 |
10 | class MainActivity : FlutterActivity() {
11 | private val CHANNEL = "com.nb.hello/dev"
12 | private var count: Int = 0
13 | override fun onCreate(savedInstanceState: Bundle?) {
14 | super.onCreate(savedInstanceState)
15 |
16 | GeneratedPluginRegistrant.registerWith(this)
17 | MethodChannel(flutterView, CHANNEL).setMethodCallHandler { call, result ->
18 | result.success("nie_bin_${count++}")
19 | Toast.makeText(this, "Hello: ${call.arguments}", Toast.LENGTH_SHORT).show()
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.2.71'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.2.1'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/assets/font/ManigueStaile.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/font/ManigueStaile.ttf
--------------------------------------------------------------------------------
/assets/images/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/ic_launcher.png
--------------------------------------------------------------------------------
/assets/images/image/circle_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/circle_10.png
--------------------------------------------------------------------------------
/assets/images/image/pic01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic01.png
--------------------------------------------------------------------------------
/assets/images/image/pic02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic02.png
--------------------------------------------------------------------------------
/assets/images/image/pic03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic03.png
--------------------------------------------------------------------------------
/assets/images/image/pic04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic04.png
--------------------------------------------------------------------------------
/assets/images/image/pic05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic05.png
--------------------------------------------------------------------------------
/assets/images/image/pic06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic06.png
--------------------------------------------------------------------------------
/assets/images/image/pic07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic07.png
--------------------------------------------------------------------------------
/assets/images/image/pic08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic08.png
--------------------------------------------------------------------------------
/assets/images/image/pic09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic09.png
--------------------------------------------------------------------------------
/assets/images/image/pic10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic10.png
--------------------------------------------------------------------------------
/assets/images/image/pic11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/assets/images/image/pic11.png
--------------------------------------------------------------------------------
/doc/appbar/app_bar_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/appbar/app_bar_01.png
--------------------------------------------------------------------------------
/doc/appbar/app_bar_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/appbar/app_bar_02.png
--------------------------------------------------------------------------------
/doc/appbar/app_bar_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/appbar/app_bar_03.png
--------------------------------------------------------------------------------
/doc/bottomnavbar/bottom_navigation_bar_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/bottomnavbar/bottom_navigation_bar_01.png
--------------------------------------------------------------------------------
/doc/container/container_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/container/container_01.png
--------------------------------------------------------------------------------
/doc/container/container_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/container/container_02.png
--------------------------------------------------------------------------------
/doc/dropdownbutton/drop-down-button-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/dropdownbutton/drop-down-button-01.png
--------------------------------------------------------------------------------
/doc/flutterlogo/flutterlogo_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/flutterlogo/flutterlogo_01.png
--------------------------------------------------------------------------------
/doc/flutteropen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/flutteropen.png
--------------------------------------------------------------------------------
/doc/icon/icon_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/icon/icon_01.png
--------------------------------------------------------------------------------
/doc/image/image_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/image/image_01.png
--------------------------------------------------------------------------------
/doc/image/image_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/image/image_02.png
--------------------------------------------------------------------------------
/doc/image/image_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/image/image_03.png
--------------------------------------------------------------------------------
/doc/image/image_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/image/image_04.png
--------------------------------------------------------------------------------
/doc/intro/youtube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/intro/youtube.png
--------------------------------------------------------------------------------
/doc/page_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/page_01.png
--------------------------------------------------------------------------------
/doc/page_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/page_02.png
--------------------------------------------------------------------------------
/doc/page_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/page_03.png
--------------------------------------------------------------------------------
/doc/page_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/page_04.png
--------------------------------------------------------------------------------
/doc/page_05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/page_05.png
--------------------------------------------------------------------------------
/doc/placeholder/placeholder_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/placeholder/placeholder_01.png
--------------------------------------------------------------------------------
/doc/popupmenubutton/popup-menu-button-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/popupmenubutton/popup-menu-button-1.png
--------------------------------------------------------------------------------
/doc/raisebutton/raise_button_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/raisebutton/raise_button_01.png
--------------------------------------------------------------------------------
/doc/raisebutton/raise_button_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/raisebutton/raise_button_02.png
--------------------------------------------------------------------------------
/doc/raisebutton/raise_button_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/raisebutton/raise_button_03.png
--------------------------------------------------------------------------------
/doc/raisebutton/raise_button_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/raisebutton/raise_button_04.png
--------------------------------------------------------------------------------
/doc/row/row_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/row/row_01.png
--------------------------------------------------------------------------------
/doc/row/row_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/row/row_02.png
--------------------------------------------------------------------------------
/doc/row/row_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/row/row_03.png
--------------------------------------------------------------------------------
/doc/scaffold/scaffold_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/scaffold/scaffold_01.png
--------------------------------------------------------------------------------
/doc/scaffold/scaffold_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/scaffold/scaffold_02.png
--------------------------------------------------------------------------------
/doc/simpledialog/simple-dialog-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/simpledialog/simple-dialog-01.png
--------------------------------------------------------------------------------
/doc/stack/Stack_01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/stack/Stack_01.jpg
--------------------------------------------------------------------------------
/doc/tabbarview/tab-bar-view-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/tabbarview/tab-bar-view-01.png
--------------------------------------------------------------------------------
/doc/text/text_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/text/text_01.png
--------------------------------------------------------------------------------
/doc/text/text_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/doc/text/text_02.png
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterOpen/flutter-widgets/31eb957221035bf07b6fc10417be686ddb70c8d4/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 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_widgets
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/const/_const.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | export "page_item_const.dart";
7 | export 'img_const.dart';
8 | export 'page_name_const.dart';
9 | export 'color_const.dart';
10 | export 'size_const.dart';
11 | export 'string_const.dart';
12 |
--------------------------------------------------------------------------------
/lib/const/color_const.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 |
8 | const YELLOW = Color(0xfffbed96);
9 | const BLUE = Color(0xffabecd6);
10 | const BLUE_DEEP = Color(0xffA8CBFD);
11 | const BLUE_LIGHT = Color(0xffAED3EA);
12 | const PURPLE = Color(0xffccc3fc);
13 | const RED = Color(0xffF2A7B3);
14 | const GREEN = Color(0xffc7e5b4);
15 | const RED_LIGHT = Color(0xffFFC3A0);
16 | const TEXT_BLACK = Color(0xFF353535);
17 | const TEXT_BLACK_LIGHT = Color(0xFF34323D);
18 |
--------------------------------------------------------------------------------
/lib/const/img_const.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | const IMAGE_PATH = "assets/images";
7 |
8 | class PageImage {
9 | static const FLUTTER_OPEN = "$IMAGE_PATH/ic_launcher.png";
10 | static const PIC_01 = "$IMAGE_PATH/image/pic01.png";
11 | }
12 |
--------------------------------------------------------------------------------
/lib/const/page_name_const.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | class PageName {
7 | static const CONTAINER = "Contanter";
8 | static const TEXT = "Text";
9 | static const IMAGE = "Image";
10 | static const ROW_COLUMN = "Row & Column";
11 | static const ICON = "Icon";
12 | static const RAISE_BUTTON = "RaiseButton";
13 | static const APP_BAR = "AppBar";
14 | static const SCAFFOLD = "Scaffold";
15 | static const FLUTTER_LOGO = "FlutterLogo";
16 | static const PLACE_HOLDER = "PlaceHolder";
17 | static const BOTTOM_NAV_BAR = "BottomNavigationBar";
18 | static const TAB_VIEW = "TabView";
19 | static const FLOATING_ACTION_BUTTON = "FloatingActionButton";
20 | static const DROP_DOWN_BUTTON = "DropDownButton";
21 | static const POPUP_MENU_BUTTON = "PopupMenuButton";
22 | static const STACK = "Stack";
23 | static const STEPPER = "Stepper";
24 | static const SIMPLE_DIALOG = "SimpleDialog";
25 | static const ALERT_DIALOG = "AlertDialog";
26 | static const BOTTOM_SHEET = "BottomSheet";
27 | static const EXPANSION_PANEL = "ExpansionPanel";
28 | static const SNACK_BAR = "SnackBar";
29 | static const TEXT_FIELD = "TextField";
30 | static const CHIP = "Chip";
31 | static const SLIDER = "SLIDE";
32 | static const CHECK_BOX = "CheckBox";
33 | static const CARD = "CARD";
34 | static const TOOLTIP = "Tooltip";
35 | static const DATA_TABLE = "DataTable";
36 | static const PROGRESS_INDICATOR = "ProgressIndicator";
37 | static const MIX_SINGLE_LAYOUT = "MixLayout";
38 | static const INDEX_STACK = "IndexedStack";
39 | static const EXPANDED = "Expanded";
40 | static const FLOW = "Flow";
41 | static const LAYOUT = "Layout";
42 | static const METHOD_CHANNEL = "MethodChannel";
43 | static const ASSET_PAGE = "AssetsPage";
44 | static const ANIMATION = "AnimationPage";
45 | static const ANIM_CONTAINER = "AnimationContainer";
46 | static const ANIM_CROSS_FADE = "AnimationCrossFade";
47 | static const ANIM_HERO = "HeroPage";
48 | static const ANIM_FADE_TRANS = "FadeTranstion";
49 | static const ANIM_POSITION_TRANS = "PositionTransition";
50 | static const ANIM_ROTATION = "RotationTransition";
51 | static const ANIM_DEFAULT_TEXT = "DefaultText";
52 | static const ANIM_LIST = "AnimationList";
53 | static const ANIM_MODAL_BARRIER = "AnimatedModalBarrier";
54 | static const ANIM_SIZE = "AnimatedSize";
55 | static const ANIM_WIDGET = "AnimatedWidget";
56 | static const ANIM_PYH_MODEL = "PyhModel";
57 | static const ANIM_OPACITY = "OpacityPage";
58 | static const INTER_DRAG = "Draggable";
59 | static const INTER_GESTURE = "Gesture";
60 | static const INTER_DISMISSIBLE = "Dismissible";
61 | static const INTER_POINTER = "AbsorbPointer";
62 | static const INTER_SCROLLABLE = "Scrollable";
63 | static const INTER_NAV = "Navigator";
64 | static const ASYNC_FUTURE = "FutureBuilder";
65 | static const ASYNC_STREAM_BUILDER = "StreamBuilder";
66 | static const PAINT_OPACITY = "Opacity";
67 | }
68 |
--------------------------------------------------------------------------------
/lib/const/size_const.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 |
7 | const TEXT_NORMAL = 16.0;
8 | const TEXT_LARGE = 22.0;
9 | const TEXT_SMALL = 10.0;
10 |
--------------------------------------------------------------------------------
/lib/const/string_const.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | const FLUTTER_OPEN = 'Flutter Open';
7 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | ///Create by Flutter open
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_widgets/page/_page.dart';
4 | import 'package:flutter_widgets/util/_util.dart';
5 | import 'package:flutter_widgets/const/_const.dart';
6 |
7 | void main() => runApp(FlutterOpenApp());
8 |
9 | class FlutterOpenApp extends StatelessWidget {
10 | // This widget is the root of your application.
11 | @override
12 | Widget build(BuildContext context) {
13 | return MaterialApp(
14 | title: FLUTTER_OPEN,
15 | theme: ThemeData(
16 | primaryColor: BLUE_DEEP,
17 | accentColor: RED,
18 | ),
19 | home: HomePage(),
20 | routes: {
21 | PageName.CONTAINER: (context) => ContainerPage(),
22 | PageName.TEXT: (context) => TextPage(),
23 | PageName.IMAGE: (context) => ImagePage(),
24 | PageName.ROW_COLUMN: (context) => RowColumnPage(),
25 | PageName.ICON: (context) => IconPage(),
26 | PageName.RAISE_BUTTON: (context) => RaiseButtonPage(),
27 | PageName.APP_BAR: (context) => AppBarPage(),
28 | PageName.SCAFFOLD: (context) => ScaffoldPage(),
29 | PageName.FLUTTER_LOGO: (context) => FlutterLogoPage(),
30 | PageName.PLACE_HOLDER: (context) => PlaceHolderPage(),
31 | PageName.BOTTOM_NAV_BAR: (context) => BottomNavBarPage(),
32 | PageName.TAB_VIEW: (context) => TabBarViewPage(),
33 | PageName.FLOATING_ACTION_BUTTON: (context) =>
34 | FloatingActionButtonPage(),
35 | PageName.DROP_DOWN_BUTTON: (context) => DropDownButtonPage(),
36 | PageName.POPUP_MENU_BUTTON: (context) => PopupMenuButtonPage(),
37 | PageName.STACK: (context) => StackPage(),
38 | PageName.STEPPER: (context) => StepperPage(),
39 | PageName.SIMPLE_DIALOG: (context) => SimpleDialogPage(),
40 | PageName.ALERT_DIALOG: (context) => AlertDialogPage(),
41 | PageName.EXPANSION_PANEL: (context) => ExpansionPage(),
42 | PageName.SNACK_BAR: (context) => SnackPage(),
43 | PageName.TEXT_FIELD: (context) => TextFieldPage(),
44 | PageName.CHIP: (context) => ChipPage(),
45 | PageName.SLIDER: (context) => SliderPage(),
46 | PageName.CHECK_BOX: (context) => CheckBoxPage(),
47 | PageName.CARD: (context) => CardPage(),
48 | PageName.TOOLTIP: (context) => TooltipPage(),
49 | PageName.DATA_TABLE: (context) => DataTablePage(),
50 | PageName.PROGRESS_INDICATOR: (context) => ProgressIndicatorPage(),
51 | PageName.MIX_SINGLE_LAYOUT: (context) => MixPage(),
52 | PageName.INDEX_STACK: (context) => IndexStackPage(),
53 | PageName.EXPANDED: (context) => ExpandPage(),
54 | PageName.FLOW: (context) => FlowPage(),
55 | PageName.LAYOUT: (context) => LayoutPage(),
56 | PageName.METHOD_CHANNEL: (context) => MethodChannelPage(),
57 | PageName.ASSET_PAGE: (context) => AssetsPage(),
58 | PageName.ANIMATION: (context) => AnimationPage(),
59 | PageName.ANIM_CONTAINER: (context) => AnimatedContainerPage(),
60 | PageName.ANIM_CROSS_FADE: (context) => AnimCrossFadePage(),
61 | PageName.ANIM_HERO: (context) => HeroPage(),
62 | PageName.ANIM_FADE_TRANS: (context) => FadeTransitionPage(),
63 | PageName.ANIM_POSITION_TRANS: (context) => PositionTransitionPage(),
64 | PageName.ANIM_ROTATION: (context) => RotationPage(),
65 | PageName.ANIM_DEFAULT_TEXT: (context) => DefaultTextPage(),
66 | PageName.ANIM_LIST: (context) => AnimListPage(),
67 | PageName.ANIM_MODAL_BARRIER: (context) => AnimatedModalPage(),
68 | PageName.ANIM_SIZE: (context) => AnimSizePage(),
69 | PageName.ANIM_WIDGET: (context) => AnimWidgetPage(),
70 | PageName.ANIM_PYH_MODEL: (context) => PyhModelPage(),
71 | PageName.ANIM_OPACITY: (context) => AnimOpacityPage(),
72 | PageName.INTER_DRAG: (context) => DraggablePage(),
73 | PageName.INTER_GESTURE: (context) => GesturePage(),
74 | PageName.INTER_DISMISSIBLE: (context) => DismissiblePage(),
75 | PageName.INTER_POINTER: (context) => PointerPage(),
76 | PageName.INTER_NAV: (context) => NavigatorPage(),
77 | PageName.ASYNC_FUTURE: (context) => FuturePage(),
78 | PageName.ASYNC_STREAM_BUILDER: (context) => StreamBuilderPage(),
79 | PageName.PAINT_OPACITY: (context) => PaintingPage(),
80 | },
81 | );
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/lib/page/_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | export "home_page.dart";
7 | export 'empty_page.dart';
8 | export 'container/container_page.dart';
9 | export 'text/text_page.dart';
10 | export 'img/image_page.dart';
11 | export 'row/row_column_page.dart';
12 | export 'icon/icon_page.dart';
13 | export 'rasisebutton/raise_button_page.dart';
14 | export 'appbar/app_bar_page.dart';
15 | export 'scaffold/scaffold_page.dart';
16 | export 'flutterlogo/flutter_logo_page.dart';
17 | export 'placeholder/place_holder_page.dart';
18 | export 'bottomnavbar/bottom_navigation_bar_page.dart';
19 | export 'tabview/tab_bar_view_page.dart';
20 | export 'floatingbutton/floating_action_button_page.dart';
21 | export 'dropdownbutton/drop_down_button_page.dart';
22 | export 'popupmenubutton/popup_menu_button_page.dart';
23 | export 'stack/stack_page.dart';
24 | export 'stepper/stepper_page.dart';
25 | export 'simpledialog/simple_dialog_page.dart';
26 | export 'alertdialog/alert_dialog_page.dart';
27 | export 'bottomsheet/bottom_sheet_page.dart';
28 | export 'expansionpanel/expansion_panel_page.dart';
29 | export 'snackbar/snack_bar_page.dart';
30 | export 'textfield/text_field_page.dart';
31 | export 'chip/chip_page.dart';
32 | export 'slider/slider_page.dart';
33 | export 'checkbox/CheckBoxPage.dart';
34 | export 'info/_info.dart';
35 | export 'layoutsingle/_layout_single.dart';
36 | export 'muti/_muti.dart';
37 | export 'assets/_assets.dart';
38 | export 'anim/_anim.dart';
39 | export 'interation/_interaction.dart';
40 | export 'async/_async.dart';
41 | export 'painting/_painting.dart';
42 |
--------------------------------------------------------------------------------
/lib/page/alertdialog/alert_dialog_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class AlertDialogPage extends StatefulWidget {
10 | @override
11 | _AlertDialogState createState() => _AlertDialogState();
12 | }
13 |
14 | class _AlertDialogState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: Text(PageName.ALERT_DIALOG),
20 | ),
21 | body: SingleChildScrollView(
22 | child: Column(
23 | children: [
24 | //our code.
25 | AlertDialog(
26 | title: Text("Hello world!"),
27 | titlePadding:
28 | EdgeInsets.symmetric(vertical: 20, horizontal: 60),
29 | titleTextStyle: TextStyle(color: RED, fontSize: 30),
30 | content: Text(
31 | "Let's start for the first time.",
32 | ),
33 | contentTextStyle: TextStyle(color: PURPLE, fontSize: 30),
34 | contentPadding:
35 | EdgeInsets.symmetric(horizontal: 60, vertical: 10),
36 | actions: [
37 | FlatButton(
38 | onPressed: () {
39 | print("Click it again.");
40 | },
41 | child: Icon(Icons.airplanemode_active),
42 | color: TEXT_BLACK_LIGHT,
43 | ),
44 | FlatButton(
45 | onPressed: () {
46 | print("Click it again.");
47 | },
48 | child: Text(
49 | "Cancel",
50 | style: TextStyle(fontSize: 20),
51 | ),
52 | color: TEXT_BLACK_LIGHT,
53 | ),
54 | ],
55 | backgroundColor: BLUE_LIGHT,
56 | elevation: 10,
57 | shape: StadiumBorder(
58 | side: BorderSide(
59 | color: TEXT_BLACK_LIGHT,
60 | width: 1,
61 | ))),
62 | SizedBox(height: 100),
63 | ],
64 | ),
65 | ));
66 | }
67 | }
68 | //this.title,
69 | //this.titlePadding,
70 | //this.titleTextStyle,
71 | //this.content,
72 | //this.contentPadding = const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0),
73 | //this.contentTextStyle,
74 | //this.actions,
75 | //this.backgroundColor,
76 | //this.elevation,
77 | //this.semanticLabel,
78 | //this.shape,
79 |
--------------------------------------------------------------------------------
/lib/page/anim/AnimCrossFadePage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/7
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class AnimCrossFadePage extends StatefulWidget {
10 | @override
11 | _AnimCrossFadeState createState() => _AnimCrossFadeState();
12 | }
13 |
14 | class _AnimCrossFadeState extends State {
15 | bool _first = true;
16 |
17 | Widget _crossFade() => AnimatedCrossFade(
18 | duration: const Duration(seconds: 1),
19 | firstChild:
20 | const FlutterLogo(style: FlutterLogoStyle.horizontal, size: 100.0),
21 | firstCurve: Curves.easeIn,
22 | secondCurve: Curves.easeOut,
23 | secondChild:
24 | const FlutterLogo(style: FlutterLogoStyle.markOnly, size: 100.0),
25 | crossFadeState:
26 | _first ? CrossFadeState.showFirst : CrossFadeState.showSecond,
27 | );
28 |
29 | @override
30 | Widget build(BuildContext context) {
31 | return Scaffold(
32 | appBar: AppBar(
33 | title: Text(PageName.ANIM_CROSS_FADE),
34 | ),
35 | body: Container(
36 | child: Column(
37 | children: [
38 | _crossFade(),
39 | FloatingActionButton(onPressed: () {
40 | setState(() {
41 | _first = !_first;
42 | });
43 | })
44 | ],
45 | ),
46 | ),
47 | );
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/page/anim/AnimListPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/9
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class AnimListPage extends StatefulWidget {
10 | @override
11 | AnimListState createState() => AnimListState();
12 | }
13 |
14 | List list = [
15 | "Hello",
16 | "World",
17 | "AAAA",
18 | "BBBB",
19 | "CCCC",
20 | "DDDDD",
21 | "EEEE",
22 | "FFFF"
23 | ];
24 |
25 | class AnimListState extends State
26 | with SingleTickerProviderStateMixin {
27 | final _key = GlobalKey();
28 |
29 | Widget _itemBuilder(context, index, anim) => index == 0
30 | ? FloatingActionButton(
31 | child: Text("Click"),
32 | onPressed: () {
33 | if (list.length > 20) {
34 | var s = list.removeAt(1);
35 | _key.currentState.removeItem(
36 | 1,
37 | (context, anim) => ScaleTransition(
38 | scale: anim,
39 | child: Text(list[index]),
40 | ),
41 | );
42 | } else {
43 | list.insert(1, "Hello");
44 | _key.currentState.insertItem(1);
45 | }
46 | },
47 | )
48 | : Container(
49 | constraints: BoxConstraints.expand(height: 40),
50 | child: ScaleTransition(
51 | scale: anim,
52 | child: Text(list[index]),
53 | ));
54 |
55 | @override
56 | void initState() {
57 | super.initState();
58 | }
59 |
60 | @override
61 | Widget build(BuildContext context) {
62 | return Scaffold(
63 | appBar: AppBar(
64 | title: Text(PageName.ANIM_LIST),
65 | ),
66 | body: AnimatedList(
67 | key: _key,
68 | initialItemCount: list.length,
69 | itemBuilder: _itemBuilder,
70 | ));
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/lib/page/anim/AnimOpacityPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/10
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class AnimOpacityPage extends StatefulWidget {
10 | @override
11 | _AnimOpacityState createState() => _AnimOpacityState();
12 | }
13 |
14 | class _AnimOpacityState extends State {
15 | var op = 1.0;
16 |
17 | Widget _opacity() => AnimatedOpacity(
18 | opacity: op,
19 | duration: Duration(seconds: 1),
20 | child: Container(
21 | color: RED_LIGHT,
22 | child: Padding(
23 | padding: EdgeInsets.all(50),
24 | child: FloatingActionButton(onPressed: () {
25 | setState(() {
26 | op = op > 0.51 ? 0.5 : 1.0;
27 | });
28 | }),
29 | ),
30 | ),
31 | );
32 |
33 | @override
34 | Widget build(BuildContext context) {
35 | return Scaffold(
36 | appBar: AppBar(
37 | title: Text(PageName.ANIM_OPACITY),
38 | ),
39 | body: _opacity(),
40 | );
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/lib/page/anim/AnimSizePage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/10
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class AnimSizePage extends StatefulWidget {
10 | @override
11 | _AnimSizeState createState() => _AnimSizeState();
12 | }
13 |
14 | class _AnimSizeState extends State
15 | with SingleTickerProviderStateMixin {
16 | var _size = 100.0;
17 |
18 | Widget _sizeW() => AnimatedSize(
19 | duration: Duration(seconds: 3),
20 | vsync: this,
21 | child: InkWell(
22 | child: Container(
23 | constraints: BoxConstraints.expand(width: _size, height: _size),
24 | color: RED_LIGHT,
25 | child: Text("Click"),
26 | ),
27 | onTap: () {
28 | setState(() {
29 | _size = _size + 20.0;
30 | if (_size > 500) {
31 | _size = 10;
32 | }
33 | });
34 | },
35 | ),
36 | );
37 |
38 | @override
39 | void initState() {
40 | // _controller =
41 | // AnimationController(vsync: this, duration: Duration(seconds: 2));
42 | // CurvedAnimation curve =
43 | // CurvedAnimation(parent: _controller, curve: Curves.easeIn);
44 | //
45 | // _anim = Tween(begin: 0.0, end: 1.0).animate(curve);
46 | super.initState();
47 | }
48 |
49 | @override
50 | Widget build(BuildContext context) {
51 | return Scaffold(
52 | appBar: AppBar(
53 | title: Text(PageName.ANIM_SIZE),
54 | ),
55 | body: Column(
56 | children: [
57 | _sizeW(),
58 | ],
59 | ),
60 | );
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/lib/page/anim/AnimWidgetPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/10
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class AnimWidgetPage extends StatefulWidget {
10 | @override
11 | _AnimWidgetState createState() => _AnimWidgetState();
12 | }
13 |
14 | class _AnimWidgetState extends State
15 | with SingleTickerProviderStateMixin {
16 | Animation _anim;
17 | AnimationController _controller;
18 |
19 | @override
20 | void initState() {
21 | _controller =
22 | AnimationController(vsync: this, duration: Duration(seconds: 2));
23 | CurvedAnimation curve =
24 | CurvedAnimation(parent: _controller, curve: Curves.easeIn);
25 | _anim = Tween(begin: 0.0, end: 30.0).animate(curve);
26 | super.initState();
27 | }
28 |
29 | Widget _animWidget() => _AnimWidget(
30 | anim: _anim,
31 | child: Text("This is Animation Widget."),
32 | );
33 |
34 | @override
35 | Widget build(BuildContext context) {
36 | return Scaffold(
37 | appBar: AppBar(
38 | title: Text(PageName.ANIM_WIDGET),
39 | ),
40 | body: Column(
41 | children: [
42 | _animWidget(),
43 | FloatingActionButton(
44 | child: Text("Click me."),
45 | onPressed: () {
46 | _controller.reset();
47 | _controller.forward();
48 | },
49 | )
50 | ],
51 | ),
52 | );
53 | }
54 | }
55 |
56 | class _AnimWidget extends AnimatedWidget {
57 | const _AnimWidget({Key key, Animation anim, this.child})
58 | : super(key: key, listenable: anim);
59 |
60 | Animation get size => listenable;
61 | final Widget child;
62 |
63 | @override
64 | Widget build(BuildContext context) {
65 | return Container(
66 | constraints: BoxConstraints.expand(
67 | width: size.value * 10,
68 | height: size.value * 10,
69 | ),
70 | color: RED_LIGHT,
71 | child: child);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/lib/page/anim/AnimatedContainerPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/30
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 | import 'dart:math';
9 |
10 | class AnimatedContainerPage extends StatefulWidget {
11 | @override
12 | AnimatedState createState() => AnimatedState();
13 | }
14 |
15 | class AnimatedState extends State
16 | with SingleTickerProviderStateMixin {
17 | double w = 20.0;
18 | double h = 20.0;
19 |
20 | Widget _container() => Center(
21 | child: AnimatedContainer(
22 | duration: Duration(seconds: 1),
23 | child: Container(
24 | child: FloatingActionButton(
25 | onPressed: () {
26 | setState(() {
27 | w = w + 20;
28 | h = h + 20;
29 | print("h= $h,w=$w");
30 | });
31 | },
32 | child: Text("Button"),
33 | ),
34 | ),
35 | height: h,
36 | width: w,
37 | curve: Curves.elasticOut,
38 | ));
39 |
40 | @override
41 | Widget build(BuildContext context) {
42 | return Scaffold(
43 | appBar: AppBar(
44 | title: Text(PageName.ANIM_CONTAINER),
45 | ),
46 | body: SingleChildScrollView(
47 | child: Column(
48 | children: [
49 | _container(),
50 | ],
51 | ),
52 | ),
53 | );
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/lib/page/anim/AnimatedModalPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/10
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class AnimatedModalPage extends StatefulWidget {
10 | @override
11 | _AnimatedModalState createState() => _AnimatedModalState();
12 | }
13 |
14 | class _AnimatedModalState extends State
15 | with SingleTickerProviderStateMixin {
16 | Animation _animation;
17 | AnimationController _controller;
18 | bool _isClick = false;
19 |
20 | Widget _modalBarrier() => Container(
21 | constraints: BoxConstraints.expand(height: 100, width: 100),
22 | child: Stack(
23 | children: [
24 | AnimatedModalBarrier(
25 | color: _animation,
26 | ),
27 | Text("Click Me finsih this page!")
28 | ],
29 | ),
30 | );
31 |
32 | @override
33 | void initState() {
34 | _controller = AnimationController(
35 | vsync: this,
36 | duration: Duration(seconds: 2),
37 | );
38 | CurvedAnimation curve =
39 | CurvedAnimation(parent: _controller, curve: Curves.easeIn);
40 | _animation = Tween(begin: BLUE_DEEP, end: RED_LIGHT).animate(curve);
41 | super.initState();
42 | }
43 |
44 | @override
45 | Widget build(BuildContext context) {
46 | return Scaffold(
47 | appBar: AppBar(
48 | title: Text(""),
49 | ),
50 | body: Column(
51 | children: [
52 | _modalBarrier(),
53 | FloatingActionButton(
54 | child: Text("Click"),
55 | onPressed: () {
56 | setState(() {
57 | _isClick = !_isClick;
58 | });
59 | _controller.reset();
60 | _controller.forward();
61 | },
62 | )
63 | ],
64 | ));
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/page/anim/AnimationPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/26
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 | import 'dart:math';
9 |
10 | class AnimationPage extends StatefulWidget {
11 | @override
12 | AnimationState createState() => AnimationState();
13 | }
14 |
15 | class AnimationState extends State
16 | with SingleTickerProviderStateMixin {
17 | AnimationController controller;
18 | CurvedAnimation animation;
19 | Animation _animation;
20 |
21 | @override
22 | void initState() {
23 | controller =
24 | AnimationController(vsync: this, duration: Duration(seconds: 1));
25 | animation = CurvedAnimation(parent: controller, curve: Curves.easeIn);
26 | _animation = Tween(begin: 0.0, end: 1.0).animate(animation)
27 | ..addListener(() {
28 | setState(() {
29 | _animation.value;
30 | });
31 | print("value: ${_animation.value}");
32 | });
33 | super.initState();
34 | }
35 |
36 | @override
37 | Widget build(BuildContext context) {
38 | return Scaffold(
39 | appBar: AppBar(
40 | title: Text("AnimationPage"),
41 | ),
42 | body: Column(
43 | children: [
44 | Transform.translate(
45 | offset: Offset(100, _animation.value * 100),
46 | child: FloatingActionButton(
47 | onPressed: () {
48 | print("hello");
49 |
50 | controller.reset();
51 | controller.forward();
52 | },
53 | child: Text("Button"),
54 | ),
55 | ),
56 | Row(
57 | children: [
58 | Container(
59 | constraints: BoxConstraints.expand(height: 100, width: 100),
60 | child: FloatingActionButton(
61 | onPressed: () {
62 | animation.curve = Curves.bounceOut;
63 | controller.reset();
64 | controller.forward();
65 | },
66 | child: Text("bounceInOut"),
67 | heroTag: null,
68 | ),
69 | ),
70 | Container(
71 | constraints: BoxConstraints.expand(height: 100, width: 100),
72 | child: FloatingActionButton(
73 | onPressed: () {
74 | animation.curve = Curves.bounceIn;
75 | controller.reset();
76 | controller.forward();
77 | },
78 | child: Text("bounceIn"),
79 | heroTag: null,
80 | ),
81 | ),
82 | Container(
83 | constraints: BoxConstraints.expand(height: 100, width: 100),
84 | child: FloatingActionButton(
85 | onPressed: () {
86 | animation.curve = Curves.fastOutSlowIn;
87 | controller.reset();
88 | controller.forward();
89 | },
90 | heroTag: null,
91 | child: Text("fastOutSlowIn"),
92 | ),
93 | ),
94 | ],
95 | )
96 | ],
97 | ));
98 | }
99 |
100 | @override
101 | void dispose() {
102 | controller.dispose();
103 | super.dispose();
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/lib/page/anim/DefaultTextPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/9
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class DefaultTextPage extends StatefulWidget {
10 | @override
11 | DefaultState createState() => DefaultState();
12 | }
13 |
14 | class DefaultState extends State {
15 | Color _color = RED_LIGHT;
16 |
17 | Widget _defaultText() => Column(
18 | children: [
19 | AnimatedDefaultTextStyle(
20 | child: Text(
21 | "Default Text",
22 | style: TextStyle(fontSize: 20),
23 | ),
24 | style: TextStyle(color: _color),
25 | duration: Duration(seconds: 1),
26 | ),
27 | FloatingActionButton(
28 | child: Text("Click"),
29 | onPressed: () {
30 | setState(() {
31 | if (_color == RED_LIGHT) {
32 | _color = BLUE_DEEP;
33 | } else {
34 | _color = RED_LIGHT;
35 | }
36 | });
37 | },
38 | )
39 | ],
40 | );
41 |
42 | @override
43 | Widget build(BuildContext context) {
44 | return Scaffold(
45 | appBar: AppBar(
46 | title: Text(PageName.ANIM_DEFAULT_TEXT),
47 | ),
48 | body: Column(
49 | children: [
50 | _defaultText(),
51 | ],
52 | ),
53 | );
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/lib/page/anim/FadeTransitionPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/8
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | import "package:flutter/material.dart";
6 | import 'package:flutter_widgets/const/_const.dart';
7 |
8 | class FadeTransitionPage extends StatefulWidget {
9 | @override
10 | _FadeTransitionState createState() => _FadeTransitionState();
11 | }
12 |
13 | class _FadeTransitionState extends State
14 | with SingleTickerProviderStateMixin {
15 | Animation _opacityAnim;
16 | AnimationController _controller;
17 |
18 | Widget _fadeTrans() => FadeTransition(
19 | opacity: _opacityAnim,
20 | child: Text(
21 | "Hello world",
22 | style: TextStyle(color: RED_LIGHT),
23 | ),
24 | );
25 | @override
26 | void initState() {
27 | _controller =
28 | AnimationController(duration: Duration(seconds: 3), vsync: this);
29 | CurvedAnimation curvedAnimation =
30 | CurvedAnimation(parent: _controller, curve: Curves.easeOut);
31 | _opacityAnim = Tween(begin: 0.0, end: 1.0).animate(curvedAnimation);
32 | super.initState();
33 | }
34 |
35 | @override
36 | Widget build(BuildContext context) {
37 | return Scaffold(
38 | appBar: AppBar(
39 | title: Text(PageName.ANIM_FADE_TRANS),
40 | ),
41 | body: Column(
42 | children: [
43 | _fadeTrans(),
44 | FloatingActionButton(
45 | child: Text("Click Me"),
46 | onPressed: () {
47 | _controller.reset();
48 | _controller.forward();
49 | },
50 | )
51 | ],
52 | ),
53 | );
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/lib/page/anim/HeroPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/8
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 | import 'PhotoHero.dart';
9 |
10 | class HeroPage extends StatefulWidget {
11 | @override
12 | _HeroState createState() => _HeroState();
13 | }
14 |
15 | class _HeroState extends State {
16 | @override
17 | Widget build(BuildContext context) {
18 | return Scaffold(
19 | appBar: AppBar(
20 | title: const Text(PageName.ANIM_HERO),
21 | ),
22 | body: Center(
23 | child: PhotoHero(
24 | photo: PageImage.FLUTTER_OPEN,
25 | width: 400.0,
26 | onTap: () {
27 | Navigator.of(context)
28 | .push(MaterialPageRoute(builder: (BuildContext context) {
29 | return Scaffold(
30 | appBar: AppBar(
31 | title: const Text('Change pic Page'),
32 | ),
33 | body: Container(
34 | // The blue background emphasizes that it's a new route.
35 | color: RED_LIGHT,
36 | padding: const EdgeInsets.all(16.0),
37 | alignment: Alignment.topLeft,
38 | child: PhotoHero(
39 | photo: PageImage.FLUTTER_OPEN,
40 | width: 100.0,
41 | onTap: () {
42 | Navigator.of(context).pop();
43 | },
44 | ),
45 | ),
46 | );
47 | }));
48 | },
49 | ),
50 | ),
51 | );
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/lib/page/anim/PhotoHero.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/8
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | import "package:flutter/material.dart";
6 |
7 | class PhotoHero extends StatelessWidget {
8 | const PhotoHero({Key key, this.photo, this.onTap, this.width})
9 | : super(key: key);
10 |
11 | final String photo;
12 | final VoidCallback onTap;
13 | final double width;
14 |
15 | Widget build(BuildContext context) {
16 | return SizedBox(
17 | width: width,
18 | child: Hero(
19 | tag: photo,
20 | child: Material(
21 | color: Colors.transparent,
22 | child: InkWell(
23 | onTap: onTap,
24 | child: Image.asset(
25 | photo,
26 | fit: BoxFit.contain,
27 | ),
28 | ),
29 | ),
30 | ),
31 | );
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/lib/page/anim/PositionTransitionPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/9
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class PositionTransitionPage extends StatefulWidget {
10 | @override
11 | _PositionTransState createState() => _PositionTransState();
12 | }
13 |
14 | class _PositionTransState extends State
15 | with SingleTickerProviderStateMixin {
16 | Animation _rectAnim;
17 | AnimationController _controller;
18 |
19 | Widget _positionTrans() => PositionedTransition(
20 | rect: _rectAnim,
21 | child: Container(
22 | color: BLUE_DEEP,
23 | child: Text("Hello world"),
24 | ),
25 | );
26 |
27 | Widget _positionClick() => FloatingActionButton(
28 | child: Text("position click"),
29 | onPressed: () {
30 | _controller.reset();
31 | _controller.forward();
32 | },
33 | );
34 |
35 | @override
36 | void initState() {
37 | _controller =
38 | AnimationController(vsync: this, duration: Duration(seconds: 3));
39 | CurvedAnimation _curve =
40 | CurvedAnimation(parent: _controller, curve: Curves.easeOut);
41 | _rectAnim = RelativeRectTween(
42 | begin: RelativeRect.fromLTRB(00.0, 0.0, 0.0, 0.0),
43 | end: RelativeRect.fromLTRB(100.0, 100.0, 0, 00),
44 | ).animate(_curve)
45 | ..addListener(() {
46 | print("value = $_rectAnim");
47 | });
48 |
49 | super.initState();
50 | }
51 |
52 | @override
53 | Widget build(BuildContext context) {
54 | return Scaffold(
55 | appBar: AppBar(
56 | title: Text(PageName.ANIM_POSITION_TRANS),
57 | ),
58 | body: Column(
59 | mainAxisAlignment: MainAxisAlignment.start,
60 | crossAxisAlignment: CrossAxisAlignment.center,
61 | children: [
62 | Container(
63 | constraints: BoxConstraints.expand(width: 200, height: 200),
64 | color: RED_LIGHT,
65 | child: Stack(
66 | children: [
67 | _positionTrans(),
68 | ],
69 | ),
70 | ),
71 | _positionClick()
72 | ],
73 | ),
74 | );
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/lib/page/anim/PyhModelPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/10
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter_widgets/const/_const.dart";
7 | import 'package:flutter/material.dart';
8 |
9 | class PyhModelPage extends StatefulWidget {
10 | @override
11 | _BaseState createState() => _BaseState();
12 | }
13 |
14 | class _BaseState extends State {
15 | Color _color = RED_LIGHT;
16 |
17 | Widget _pyhModel() => AnimatedPhysicalModel(
18 | child: Container(
19 | child: Padding(
20 | padding: EdgeInsets.all(40),
21 | child: FloatingActionButton(onPressed: () {
22 | setState(() {
23 | _color = _color == RED_LIGHT ? PURPLE : RED_LIGHT;
24 | });
25 | }),
26 | ),
27 | ),
28 | shape: BoxShape.rectangle,
29 | elevation: 2,
30 | color: _color,
31 | shadowColor: BLUE_DEEP,
32 | duration: Duration(milliseconds: 100));
33 |
34 | @override
35 | Widget build(BuildContext context) {
36 | return Scaffold(
37 | appBar: AppBar(
38 | title: Text(PageName.ANIM_PYH_MODEL),
39 | ),
40 | body: _pyhModel(),
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/page/anim/RotationPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/9
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import 'package:flutter/material.dart';
7 | import 'package:flutter_widgets/const/_const.dart';
8 | import 'dart:math';
9 |
10 | class RotationPage extends StatefulWidget {
11 | @override
12 | _RotationState createState() => _RotationState();
13 | }
14 |
15 | class _RotationState extends State
16 | with SingleTickerProviderStateMixin {
17 | AnimationController _controller;
18 | Animation _rotationAnim;
19 | Animation _offsetAnim;
20 | Animation _decorationAnim;
21 |
22 | Widget _rotation() => RotationTransition(
23 | turns: _rotationAnim,
24 | alignment: Alignment.center,
25 | child: Text(
26 | "This is my first rotation transition.",
27 | style: TextStyle(color: BLUE_DEEP, fontSize: 10),
28 | ),
29 | );
30 |
31 | Widget _scale() => ScaleTransition(
32 | scale: _rotationAnim,
33 | child: Text("Scale transition."),
34 | );
35 |
36 | Widget _slide() => SlideTransition(
37 | position: _offsetAnim,
38 | child: Text(
39 | "Offset",
40 | style: TextStyle(color: PURPLE),
41 | ),
42 | );
43 |
44 | Widget _sizeTrans() => SizeTransition(
45 | sizeFactor: _rotationAnim,
46 | child: Container(
47 | width: 100,
48 | height: 100,
49 | color: RED_LIGHT,
50 | ),
51 | );
52 |
53 | Widget _decoratedTrans() => DecoratedBoxTransition(
54 | decoration: _decorationAnim,
55 | child: Container(
56 | constraints: BoxConstraints.expand(height: 100, width: 200),
57 | child: InkWell(
58 | child: Center(
59 | child: Text("Click Me"),
60 | ),
61 | onTap: () {
62 | _controller.reset();
63 | _controller.forward();
64 | },
65 | ),
66 | ));
67 |
68 | @override
69 | void initState() {
70 | _controller = AnimationController(
71 | vsync: this,
72 | duration: Duration(seconds: 3),
73 | );
74 | CurvedAnimation _curve =
75 | CurvedAnimation(parent: _controller, curve: Curves.elasticIn);
76 | _rotationAnim = Tween(begin: 0.0, end: pi).animate(_curve);
77 | _offsetAnim =
78 | Tween(begin: Offset(0.0, 0.0), end: Offset(5.0, 1.0)).animate(_curve);
79 | _decorationAnim = DecorationTween(
80 | begin: ShapeDecoration(
81 | shape: StadiumBorder(
82 | side: BorderSide(color: RED_LIGHT, width: 1))),
83 | end: ShapeDecoration(
84 | shape: CircleBorder(side: BorderSide(color: BLUE, width: 4))))
85 | .animate(_curve);
86 | super.initState();
87 | }
88 |
89 | @override
90 | Widget build(BuildContext context) {
91 | return Scaffold(
92 | appBar: AppBar(
93 | title: Text(PageName.ANIM_ROTATION),
94 | ),
95 | body: Column(
96 | crossAxisAlignment: CrossAxisAlignment.center,
97 | mainAxisAlignment: MainAxisAlignment.center,
98 | children: [
99 | _rotation(),
100 | _scale(),
101 | _slide(),
102 | _sizeTrans(),
103 | _decoratedTrans(),
104 | ],
105 | ),
106 | );
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lib/page/anim/_anim.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/26
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | export "AnimationPage.dart";
6 | export 'AnimatedContainerPage.dart';
7 | export 'AnimCrossFadePage.dart';
8 | export 'HeroPage.dart';
9 | export 'FadeTransitionPage.dart';
10 | export 'PositionTransitionPage.dart';
11 | export 'RotationPage.dart';
12 | export 'DefaultTextPage.dart';
13 | export 'AnimListPage.dart';
14 | export 'AnimatedModalPage.dart';
15 | export 'AnimSizePage.dart';
16 | export 'AnimWidgetPage.dart';
17 | export 'PyhModelPage.dart';
18 | export 'AnimOpacityPage.dart';
19 |
--------------------------------------------------------------------------------
/lib/page/appbar/app_bar_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class AppBarPage extends StatefulWidget {
10 | @override
11 | _AppBarState createState() => _AppBarState();
12 | }
13 |
14 | class _AppBarState extends State {
15 | AppBar _titleBar() => AppBar(
16 | title: Text(PageName.APP_BAR),
17 | );
18 |
19 | AppBar _autoLeadBar() => AppBar(
20 | title: Text(PageName.APP_BAR),
21 | automaticallyImplyLeading: false,
22 | );
23 |
24 | AppBar _leadingBar() => AppBar(
25 | title: Text(PageName.APP_BAR),
26 | leading: InkWell(
27 | child: Icon(Icons.menu),
28 | onTap: () {
29 | print("click menu");
30 | },
31 | ),
32 | );
33 |
34 | AppBar _actionBar() => AppBar(
35 | title: Text(PageName.APP_BAR),
36 | actions: [
37 | InkWell(
38 | child: Icon(Icons.search),
39 | onTap: () {
40 | print("click search");
41 | },
42 | ),
43 | SizedBox(width: 10),
44 | InkWell(
45 | child: Icon(Icons.more_vert),
46 | onTap: () {
47 | print("click more");
48 | },
49 | ),
50 | SizedBox(width: 20)
51 | ],
52 | );
53 |
54 | Widget _bottomBar() => AppBar(
55 | title: Text(PageName.APP_BAR),
56 | bottom: PreferredSize(
57 | child: Container(
58 | alignment: Alignment.center,
59 | color: RED,
60 | constraints: BoxConstraints.expand(height: 50),
61 | child: Text(
62 | "bottom",
63 | style: TextStyle(fontSize: 30),
64 | ),
65 | ),
66 | preferredSize: Size(50, 50),
67 | ),
68 | );
69 |
70 | Widget _elevationBar() => AppBar(
71 | title: Text(PageName.APP_BAR),
72 | elevation: 10,
73 | );
74 |
75 | Widget _backgroundBar() => AppBar(
76 | title: Text(PageName.APP_BAR),
77 | backgroundColor: PURPLE,
78 | );
79 |
80 | Widget _brightBar() => AppBar(
81 | title: Text(PageName.APP_BAR),
82 | // brightness: Brightness.dark,dark
83 | );
84 |
85 | Widget _iconThemeBar() => AppBar(
86 | title: Text(PageName.APP_BAR),
87 | iconTheme: IconThemeData(color: Colors.white, size: 20, opacity: 0.9),
88 | );
89 |
90 | Widget _textThemeBar() => AppBar(
91 | title: Text(PageName.APP_BAR),
92 | textTheme:
93 | TextTheme(title: TextStyle(color: Colors.white, fontSize: 30)),
94 | );
95 |
96 | Widget _primaryBar() => AppBar(
97 | title: Text(PageName.APP_BAR),
98 | primary: false,
99 | );
100 |
101 | Widget _centerBar() => AppBar(
102 | title: Text(PageName.APP_BAR),
103 | centerTitle: true,
104 | );
105 |
106 | Widget _spaceBar() => AppBar(
107 | title: Text(PageName.APP_BAR),
108 | titleSpacing: 20,
109 | );
110 |
111 | Widget _toolBar() => AppBar(
112 | title: Text(PageName.APP_BAR),
113 | toolbarOpacity: 0.5,
114 | );
115 |
116 | Widget _bottomOpBar() => AppBar(
117 | title: Text(PageName.APP_BAR),
118 | bottomOpacity: 0.5,
119 | bottom: PreferredSize(
120 | child: Container(
121 | alignment: Alignment.center,
122 | color: RED,
123 | constraints: BoxConstraints.expand(height: 50),
124 | child: Text(
125 | "bottom with bottomOpacity = 0.5 ",
126 | style: TextStyle(fontSize: 20),
127 | ),
128 | ),
129 | preferredSize: Size(50, 50),
130 | ),
131 | );
132 |
133 | @override
134 | Widget build(BuildContext context) {
135 | return Scaffold(
136 | body: CustomScrollView(
137 | slivers: [
138 | SliverAppBar(
139 | // title: Text("hello"),
140 | expandedHeight: 100,
141 | pinned: true,
142 | flexibleSpace: FlexibleSpaceBar(
143 | title: Text(PageName.APP_BAR),
144 | centerTitle: false,
145 | collapseMode: CollapseMode.parallax,
146 | background: Container(
147 | color: RED,
148 | constraints: BoxConstraints.expand(height: 100),
149 | child: Image.asset(
150 | PageImage.FLUTTER_OPEN,
151 | fit: BoxFit.cover,
152 | ),
153 | ),
154 | ),
155 | ),
156 | SliverList(
157 | delegate: SliverChildListDelegate([
158 | SizedBox(
159 | height: 1000,
160 | ),
161 | ]),
162 | )
163 | ],
164 | ),
165 | );
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/lib/page/assets/AssetsPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/26
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class AssetsPage extends StatefulWidget {
10 | @override
11 | _AssetsState createState() => _AssetsState();
12 | }
13 |
14 | class _AssetsState extends State {
15 | final _formKey = GlobalKey();
16 | final _fieldKey = GlobalKey();
17 | var _value = "Hello world";
18 | var _count = 0;
19 |
20 | // this.onWillPop,
21 | // this.onChanged,
22 | Future _willPop() async {
23 | return _formKey.currentState.validate();
24 | }
25 |
26 | Widget _form() => Form(
27 | key: _formKey,
28 | autovalidate: true,
29 | onWillPop: _willPop,
30 | onChanged: () {
31 | print("onChange.value= ${_fieldKey.currentState.value}");
32 | },
33 | child: Column(
34 | crossAxisAlignment: CrossAxisAlignment.start,
35 | children: [
36 | TextFormField(
37 | key: _fieldKey,
38 | validator: (value) {
39 | if (value.isEmpty) {
40 | return 'Please enter some text';
41 | }
42 | if (value == "hello world") {
43 | return 'This is is hello world';
44 | }
45 | return null;
46 | },
47 | ),
48 | Padding(
49 | padding: const EdgeInsets.symmetric(vertical: 16.0),
50 | child: RaisedButton(
51 | onPressed: () {
52 | // Validate will return true if the form is valid, or false if
53 | // the form is invalid.
54 | if (_formKey.currentState.validate()) {
55 | // Process data.
56 | print("print you.");
57 | }
58 | },
59 | child: Text('Submit'),
60 | ),
61 | ),
62 | ],
63 | ),
64 | );
65 |
66 | // @required this.text,
67 | // this.textAlign = TextAlign.start,
68 | // this.textDirection,
69 | // this.softWrap = true,
70 | // this.overflow = TextOverflow.clip,
71 | // this.textScaleFactor = 1.0,
72 | // this.maxLines,
73 | // this.locale,
74 | // this.strutStyle,
75 | // this.textWidthBasis = TextWidthBasis.parent,
76 | //
77 | List _spans() => [
78 | TextSpan(
79 | style: TextStyle(color: RED_LIGHT),
80 | text: "Hello",
81 | ),
82 | TextSpan(
83 | style: TextStyle(color: BLUE_DEEP, fontSize: 20),
84 | text: "World",
85 | ),
86 | ];
87 |
88 | Widget _rich() => Column(
89 | crossAxisAlignment: CrossAxisAlignment.start,
90 | children: [
91 | RichText(
92 | text: TextSpan(
93 | style: TextStyle(),
94 | // text: "Hello",
95 | children: _spans()),
96 | overflow: TextOverflow.ellipsis,
97 | ),
98 | ],
99 | );
100 |
101 | // @required this.builder,
102 | // this.onSaved,
103 | // this.validator,
104 | // this.initialValue,
105 | // this.autovalidate = false,
106 | // this.enabled = true,
107 | // this.enabled = false,
108 | Widget _formField() => FormField(
109 | builder: (FormFieldState s) {
110 | return FloatingActionButton(
111 | child: Text("Button $_value"),
112 | onPressed: () {
113 | _count++;
114 | s.setValue("${s.value}$_count");
115 | s.save();
116 | },
117 | );
118 | },
119 | onSaved: (String v) {
120 | print("value: $v");
121 | setState(() {
122 | _value = v;
123 | });
124 | },
125 | initialValue: _value,
126 | validator: (String v) {
127 | if (v.isEmpty) {
128 | return "Do not allow you to empty.";
129 | }
130 | },
131 | autovalidate: true,
132 | enabled: true,
133 | );
134 |
135 | Widget _defaultStyle() => DefaultTextStyle(
136 | style: TextStyle(color: BLUE),
137 | child: Column(
138 | crossAxisAlignment: CrossAxisAlignment.start,
139 | children: [
140 | Text("Hello\ngive me some shine."),
141 | Text("World"),
142 | ],
143 | ),
144 | );
145 |
146 | //TODO no done.
147 | Widget _rawImg(BuildContext context) => RawImage();
148 |
149 | Widget _assetBundle() {
150 | DefaultAssetBundle.of(context).loadString("");
151 | AssetImage(
152 | "",
153 | bundle: DefaultAssetBundle.of(context),
154 | );
155 | }
156 |
157 | @override
158 | Widget build(BuildContext context) {
159 | return Scaffold(
160 | appBar: AppBar(
161 | title: Text(PageName.ASSET_PAGE),
162 | ),
163 | body: SingleChildScrollView(
164 | child: Column(
165 | crossAxisAlignment: CrossAxisAlignment.start,
166 | children: [
167 | _form(),
168 | _rich(),
169 | _formField(),
170 | _defaultStyle(),
171 | ],
172 | ),
173 | ),
174 | );
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/lib/page/assets/_assets.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/26
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | export "AssetsPage.dart";
7 |
--------------------------------------------------------------------------------
/lib/page/async/FuturePage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import "package:flutter_widgets/const/_const.dart";
8 |
9 | class FuturePage extends StatefulWidget {
10 | @override
11 | _FutureState createState() => _FutureState();
12 | }
13 |
14 | class _FutureState extends State {
15 | Future _getData() async {
16 | return "Hello world";
17 | }
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | appBar: AppBar(
23 | title: Text(PageName.ASYNC_FUTURE),
24 | ),
25 | body: Container(
26 | child: FutureBuilder(
27 | future: _getData(), // a previously-obtained Future or null
28 | builder: (BuildContext context, AsyncSnapshot snapshot) {
29 | switch (snapshot.connectionState) {
30 | case ConnectionState.none:
31 | return Text('Press button to start.');
32 | case ConnectionState.active:
33 | case ConnectionState.waiting:
34 | return Text('Awaiting result...');
35 | case ConnectionState.done:
36 | if (snapshot.hasError) return Text('Error: ${snapshot.error}');
37 | return Text('Result: ${snapshot.data}');
38 | }
39 | return null; // unreachable
40 | },
41 | ),
42 | ),
43 | );
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/lib/page/async/StreamBuilderPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | import "package:flutter/material.dart";
6 | import 'package:flutter_widgets/const/_const.dart';
7 |
8 | class StreamBuilderPage extends StatefulWidget {
9 | @override
10 | _StreamBuilderState createState() => _StreamBuilderState();
11 | }
12 |
13 | class _StreamBuilderState extends State {
14 | Stream> _stream() =>
15 | Stream>.fromFuture(_futureList());
16 |
17 | Future> _futureList() async {
18 | return _listData;
19 | }
20 |
21 | List _listData = [
22 | "Hello",
23 | "World",
24 | "World",
25 | "World",
26 | "World",
27 | "World",
28 | "World",
29 | "World",
30 | "World",
31 | "World",
32 | "World",
33 | "World",
34 | "World",
35 | "World",
36 | "World",
37 | "World",
38 | "World",
39 | "World",
40 | "World",
41 | "World",
42 | "World",
43 | "World",
44 | ];
45 |
46 | Widget _streamBuildList() => StreamBuilder(
47 | builder: (BuildContext context, AsyncSnapshot> snapshot) {
48 | switch (snapshot.connectionState) {
49 | case ConnectionState.none:
50 | return Text('Press button to start.');
51 | case ConnectionState.active:
52 | case ConnectionState.waiting:
53 | return Text('Awaiting result...');
54 | case ConnectionState.done:
55 | if (snapshot.hasError) return Text('Error: ${snapshot.error}');
56 | return ListView.builder(
57 | itemCount: snapshot.data.length,
58 | itemBuilder: (context, index) => Container(
59 | constraints: BoxConstraints.expand(height: 100),
60 | color: index % 2 == 0 ? RED_LIGHT : PURPLE,
61 | child: Text(
62 | snapshot.data[index],
63 | style: TextStyle(color: TEXT_BLACK, fontSize: 20),
64 | ),
65 | ));
66 | }
67 | return null; // unreachable
68 | },
69 | stream: _stream(),
70 | );
71 |
72 | @override
73 | Widget build(BuildContext context) {
74 | return Scaffold(
75 | appBar: AppBar(
76 | title: Text(PageName.ASYNC_STREAM_BUILDER),
77 | ),
78 | body: _streamBuildList(),
79 | );
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/lib/page/async/_async.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | export "FuturePage.dart";
7 | export 'StreamBuilderPage.dart';
8 |
--------------------------------------------------------------------------------
/lib/page/bottomsheet/bottom_sheet_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class BottomSheetPage extends StatefulWidget {
10 | @override
11 | _BottomSheetState createState() => _BottomSheetState();
12 | }
13 |
14 | class _BottomSheetState extends State
15 | with SingleTickerProviderStateMixin {
16 | var _key = GlobalKey();
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return Scaffold(
21 | key: _key,
22 | appBar: AppBar(
23 | title: Text(PageName.BOTTOM_SHEET),
24 | ),
25 | body: Container(
26 | child: FlatButton(
27 | onPressed: () {
28 | print("Hello");
29 | _key.currentState.showBottomSheet(
30 | (context) => Container(
31 | constraints: BoxConstraints.expand(height: 100),
32 | color: GREEN,
33 | ),
34 | );
35 | },
36 | child: Text("Hello")),
37 | ),
38 | bottomSheet: BottomSheet(
39 | onClosing: () {
40 | print("Close");
41 | },
42 | builder: (context) => Container(
43 | decoration: ShapeDecoration(
44 | color: RED_LIGHT,
45 | shape: RoundedRectangleBorder(
46 | borderRadius: BorderRadius.only(
47 | topLeft: Radius.circular(20),
48 | topRight: Radius.circular(20)),
49 | ),
50 | ),
51 | constraints: BoxConstraints.expand(height: 240),
52 | child: ListView(
53 | children: [
54 | Container(
55 | padding: EdgeInsets.symmetric(vertical: 20),
56 | alignment: Alignment.center,
57 | child: Text(
58 | "Select lanuage.",
59 | style: TextStyle(color: TEXT_BLACK, fontSize: 30),
60 | ),
61 | ),
62 | Divider(
63 | height: 1,
64 | color: TEXT_BLACK_LIGHT,
65 | ),
66 | Container(
67 | padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
68 | alignment: Alignment.centerLeft,
69 | child: Text(
70 | "English.",
71 | style: TextStyle(color: TEXT_BLACK_LIGHT, fontSize: 20),
72 | ),
73 | ),
74 | Divider(
75 | height: 1,
76 | color: TEXT_BLACK_LIGHT,
77 | ),
78 | Container(
79 | padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
80 | alignment: Alignment.centerLeft,
81 | child: Text(
82 | "Chinese.",
83 | style: TextStyle(color: TEXT_BLACK_LIGHT, fontSize: 20),
84 | ),
85 | ),
86 | Divider(
87 | height: 1,
88 | color: TEXT_BLACK_LIGHT,
89 | ),
90 | Container(
91 | padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
92 | alignment: Alignment.centerLeft,
93 | child: Text(
94 | "India.",
95 | style: TextStyle(color: TEXT_BLACK_LIGHT, fontSize: 20),
96 | ),
97 | ),
98 | Divider(
99 | height: 1,
100 | color: TEXT_BLACK_LIGHT,
101 | ),
102 | ],
103 | ),
104 | ),
105 | ),
106 | );
107 | }
108 | }
109 |
110 | /// this.animationController,
111 | // this.enableDrag = true,
112 | // this.elevation = 0.0,
113 | // @required this.onClosing,
114 | // @required this.builder
115 |
--------------------------------------------------------------------------------
/lib/page/checkbox/CheckBoxPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/12
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class CheckBoxPage extends StatefulWidget {
10 | @override
11 | CheckBoxState createState() => CheckBoxState();
12 | }
13 |
14 | class CheckBoxState extends State {
15 | bool _value = false;
16 | var _radioValue = "Name";
17 |
18 | Widget _checkBox() => Checkbox(
19 | value: _value,
20 | onChanged: (value) {
21 | setState(() {
22 | _value = value;
23 | });
24 | },
25 | activeColor: RED_LIGHT,
26 | tristate: true,
27 | );
28 |
29 | Widget _radio() => Row(
30 | children: [
31 | Radio(
32 | value: "2",
33 | groupValue: "2" == _radioValue ? "2" : null,
34 | onChanged: (value) {
35 | print("value = $value");
36 | setState(() {
37 | _radioValue = value;
38 | });
39 | },
40 | ),
41 | Radio(
42 | value: "1",
43 | groupValue: "1" == _radioValue ? "1" : null,
44 | onChanged: (value) {
45 | print("value = $value");
46 | setState(() {
47 | _radioValue = value;
48 | });
49 | },
50 | )
51 | ],
52 | );
53 |
54 | Widget _switch() => Switch.adaptive(
55 | value: _value,
56 | activeColor: BLUE_LIGHT,
57 | activeTrackColor: RED_LIGHT,
58 | onChanged: (value) {
59 | setState(() {
60 | _value = value;
61 | });
62 | });
63 | DateTime _selectTime = DateTime(2019, 3, 12);
64 |
65 | Widget _datePicker() => MonthPicker(
66 | selectedDate: _selectTime,
67 | // currentDate: DateTime(2019, 5, 12),
68 | onChanged: (time) {
69 | print("select= $time");
70 | setState(() {
71 | _selectTime = time;
72 | });
73 | },
74 | firstDate: DateTime(2019, 1, 1),
75 | lastDate: DateTime(3000, 12, 30),
76 | // displayedMonth: DateTime(2019, 5),
77 | );
78 |
79 | @override
80 | Widget build(BuildContext context) {
81 | return Scaffold(
82 | appBar: AppBar(
83 | title: Text(PageName.CHECK_BOX),
84 | ),
85 | // body: SingleChildScrollView(
86 | // child: Column(
87 | // children: [
88 | // _checkBox(),
89 | // _radio(),
90 | // _switch(),
91 | //
92 | // ],
93 | // ),
94 | // ));
95 | body: FloatingActionButton(onPressed: () {
96 | showTimePicker(
97 | context: context,
98 | initialTime: TimeOfDay(
99 | hour: 12,
100 | minute: 12,
101 | ),
102 |
103 | );
104 | }),
105 | );
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/lib/page/chip/chip_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class ChipPage extends StatefulWidget {
10 | @override
11 | _ChipState createState() => _ChipState();
12 | }
13 |
14 | class _ChipState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: Text(PageName.CHIP),
20 | ),
21 | body: Container(
22 | margin: EdgeInsets.symmetric(horizontal: 10),
23 | child: InputChip(
24 | avatar: Image.asset(PageImage.PIC_01),
25 | label: Text(
26 | "Text",
27 | style: TextStyle(color: RED),
28 | ),
29 | pressElevation: 1,
30 | labelPadding: EdgeInsets.symmetric(horizontal: 20),
31 | deleteIcon: Icon(Icons.airplanemode_active),
32 | deleteIconColor: RED_LIGHT,
33 |
34 | isEnabled: true,
35 | clipBehavior: Clip.antiAlias,
36 | backgroundColor: BLUE_LIGHT,
37 | deleteButtonTooltipMessage: "Hhhh--gehhh",
38 | onPressed: () {
39 | print("Hello");
40 | },
41 | materialTapTargetSize: MaterialTapTargetSize.padded,
42 |
43 | tooltip: "Hello world",
44 | // onSelected: (isS) {
45 | // print("world");
46 | // },
47 | onDeleted: () {
48 | print("onDeleted");
49 | },
50 | ),
51 | ));
52 | }
53 | }
54 | //({
55 | //Key key,
56 | //this.avatar,
57 | //@required this.label,
58 | //this.labelStyle,
59 | //this.labelPadding,
60 | //this.deleteIcon,
61 | //this.onDeleted,
62 | //this.deleteIconColor,
63 | //this.deleteButtonTooltipMessage,
64 | //this.shape,
65 | //this.clipBehavior = Clip.none,
66 | //this.backgroundColor,
67 | //this.padding,
68 | //this.materialTapTargetSize,
69 | //}) : assert(label != null),
70 | //
71 |
--------------------------------------------------------------------------------
/lib/page/container/container_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 | import 'dart:math';
9 |
10 | class ContainerPage extends StatefulWidget {
11 | @override
12 | State createState() => _ContainerState();
13 | }
14 |
15 | class _ContainerState extends State {
16 | @override
17 | Widget build(BuildContext context) {
18 | return Scaffold(
19 | appBar: AppBar(
20 | title: Text(PageName.CONTAINER),
21 | ),
22 | body: SingleChildScrollView(
23 | child: Column(
24 | crossAxisAlignment: CrossAxisAlignment.start,
25 | children: [
26 | Container(
27 | color: RED,
28 | child: Text("Hello world"),
29 | ),
30 | Container(
31 | color: GREEN,
32 | child: Text("Color color"),
33 | ),
34 | Container(
35 | color: YELLOW,
36 | padding:
37 | EdgeInsets.only(left: 10.0, right: 50.0, top: 10, bottom: 30),
38 | child: Container(
39 | color: BLUE_DEEP,
40 | child: Text("this.padding"),
41 | ),
42 | ),
43 | Container(
44 | width: 200.0,
45 | height: 100.0,
46 | color: GREEN,
47 | child: Text("width = 200 , height = 100"),
48 | ),
49 | Container(
50 | color: RED,
51 | child: Container(
52 | margin:
53 | EdgeInsets.only(left: 10.0, right: 50.0, top: 10, bottom: 30),
54 | color: GREEN,
55 | child: Text("this.margin"),
56 | ),
57 | ),
58 | Container(
59 | color: BLUE_LIGHT,
60 | alignment: Alignment.bottomRight,
61 | height: 200,
62 | child: Text("this.alignment"),
63 | ),
64 | Container(
65 | color: YELLOW,
66 | height: 100.0,
67 | alignment: AlignmentDirectional.bottomEnd,
68 | child: Text(
69 | "HellH",
70 | textDirection: TextDirection.rtl,
71 | ),
72 | ),
73 | Container(
74 | color: BLUE_LIGHT,
75 | constraints: BoxConstraints.expand(height: 50.0),
76 | child: Text("BoxConstraints constraints"),
77 | ),
78 | Container(
79 | constraints: BoxConstraints.expand(height: 100.0),
80 | padding: EdgeInsets.all(10),
81 | decoration: ShapeDecoration(
82 | shape: RoundedRectangleBorder(
83 | borderRadius: BorderRadius.all(
84 | Radius.circular(10.0),
85 | ),
86 | ),
87 | color: RED),
88 | child: Text("decoration: ShapeDecoration"),
89 | ),
90 | Container(
91 | constraints: BoxConstraints.expand(height: 200.0),
92 | alignment: Alignment.center,
93 | padding: EdgeInsets.all(10),
94 | decoration: BoxDecoration(
95 | gradient: LinearGradient(colors: [BLUE_LIGHT, YELLOW]),
96 | shape: BoxShape.circle),
97 | child: Text("decoration: BoxDecoration"),
98 | ),
99 | Container(
100 | padding: EdgeInsets.only(top: 10, left: 10),
101 | constraints: BoxConstraints.expand(height: 100, width: 100),
102 | color: BLUE_LIGHT,
103 | child: Text("this.transform"),
104 | ),
105 | Container(
106 | padding: EdgeInsets.only(top: 10, left: 10),
107 | constraints: BoxConstraints.expand(width: 100, height: 100),
108 | color: RED_LIGHT,
109 | transform: Matrix4.rotationY(pi / 4)..rotateX(pi / 4),
110 | child: Text("this.transform"),
111 | )
112 | ],
113 | )),
114 | );
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/lib/page/dropdownbutton/drop_down_button_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class DropDownButtonPage extends StatefulWidget {
10 | @override
11 | _DropDownButtonState createState() => _DropDownButtonState();
12 | }
13 |
14 | class _DropDownButtonState extends State {
15 | var _value = "1";
16 |
17 | DropdownButton _normalDown() => DropdownButton(
18 | items: [
19 | DropdownMenuItem(
20 | value: "1",
21 | child: Text(
22 | "First",
23 | ),
24 | ),
25 | DropdownMenuItem(
26 | value: "2",
27 | child: Text(
28 | "Second",
29 | ),
30 | ),
31 | ],
32 | onChanged: (value) {
33 | setState(() {
34 | _value = value;
35 | });
36 | },
37 | value: _value,
38 | );
39 |
40 | DropdownButton _itemDown() => DropdownButton(
41 | items: [
42 | DropdownMenuItem(
43 | value: "1",
44 | child: Row(
45 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
46 | children: [
47 | Icon(Icons.build),
48 | SizedBox(width: 10),
49 | Text(
50 | "build",
51 | ),
52 | ],
53 | ),
54 | ),
55 | DropdownMenuItem(
56 | value: "2",
57 | child: Row(
58 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
59 | children: [
60 | Icon(Icons.settings),
61 | SizedBox(width: 10),
62 | Text(
63 | "Setting",
64 | ),
65 | ],
66 | ),
67 | ),
68 | ],
69 | onChanged: (value) {
70 | setState(() {
71 | _value = value;
72 | });
73 | },
74 | value: _value,
75 | isExpanded: true,
76 | );
77 |
78 | DropdownButton _hintDown() => DropdownButton(
79 | items: [
80 | DropdownMenuItem(
81 | value: "1",
82 | child: Text(
83 | "First",
84 | ),
85 | ),
86 | DropdownMenuItem(
87 | value: "2",
88 | child: Text(
89 | "Second",
90 | ),
91 | ),
92 | ],
93 | onChanged: (value) {
94 | print("value: $value");
95 | },
96 | hint: Text(
97 | "Please select the number!",
98 | style: TextStyle(
99 | color: TEXT_BLACK,
100 | ),
101 | ),
102 | );
103 |
104 | DropdownButton _hint2Down() => DropdownButton(
105 | items: null,
106 | onChanged: null,
107 | disabledHint: Text("You can't select anything."),
108 | );
109 |
110 | DropdownButton _normal2Down() => DropdownButton(
111 | items: [
112 | DropdownMenuItem(
113 | value: "1",
114 | child: Text(
115 | "First",
116 | ),
117 | ),
118 | DropdownMenuItem(
119 | value: "2",
120 | child: Text(
121 | "Second",
122 | ),
123 | ),
124 | ],
125 | onChanged: (value) {
126 | setState(() {
127 | _value = value;
128 | });
129 | },
130 | value: _value,
131 | elevation: 2,
132 | style: TextStyle(color: PURPLE, fontSize: 30),
133 | isDense: true,
134 | iconSize: 40.0,
135 | );
136 |
137 | @override
138 | Widget build(BuildContext context) {
139 | return Scaffold(
140 | appBar: AppBar(
141 | title: Text(PageName.DROP_DOWN_BUTTON),
142 | ),
143 | body: SingleChildScrollView(
144 | child: Column(
145 | children: [
146 | //our code.
147 | Container(
148 | color: RED,
149 | child: _normalDown(),
150 | ),
151 | SizedBox(height: 10),
152 | Container(
153 | padding: EdgeInsets.symmetric(horizontal: 20),
154 | color: BLUE,
155 | child: _itemDown(),
156 | ),
157 | SizedBox(height: 10),
158 | Container(
159 | padding: EdgeInsets.symmetric(horizontal: 20),
160 | color: YELLOW,
161 | child: _hintDown(),
162 | ),
163 | SizedBox(height: 10),
164 | Container(
165 | padding: EdgeInsets.symmetric(horizontal: 20),
166 | color: GREEN,
167 | child: _hint2Down(),
168 | ),
169 | SizedBox(height: 10),
170 | Container(
171 | color: RED,
172 | alignment: Alignment.topRight,
173 | child: _normal2Down(),
174 | ),
175 | SizedBox(height: 600)
176 | ],
177 | ),
178 | ),
179 | );
180 | }
181 | }
182 |
--------------------------------------------------------------------------------
/lib/page/empty_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 |
8 | class EmptyPage extends StatefulWidget {
9 | @override
10 | _EmptyState createState() => _EmptyState();
11 | }
12 |
13 | class _EmptyState extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | return Scaffold(
17 | appBar: AppBar(
18 | title: Text("empty"),
19 | ),
20 | body: Text("This is an empty page"),
21 | );
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/page/expansionpanel/expansion_panel_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class ExpansionPage extends StatefulWidget {
10 | @override
11 | _ExpansionState createState() => _ExpansionState();
12 | }
13 |
14 | class _ExpansionState extends State {
15 | var isA = true;
16 | var isB = true;
17 |
18 | Widget _expan() => ExpansionPanelList(
19 | children: [
20 | ExpansionPanel(
21 | headerBuilder: (context, isE) => Container(
22 | child: Text("A"),
23 | alignment: Alignment.centerLeft,
24 | ),
25 | body: Container(
26 | color: BLUE_LIGHT,
27 | constraints: BoxConstraints.expand(height: 100),
28 | alignment: Alignment.center,
29 | child: Text("AAAAA"),
30 | ),
31 | isExpanded: isA,
32 | ),
33 | ExpansionPanel(
34 | headerBuilder: (context, isE) => Container(
35 | child: Text("B"),
36 | alignment: Alignment.centerLeft,
37 | ),
38 | body: Container(
39 | color: BLUE_LIGHT,
40 | constraints: BoxConstraints.expand(height: 100),
41 | alignment: Alignment.center,
42 | child: Text("BBBBB"),
43 | ),
44 | isExpanded: isB,
45 | ),
46 | ],
47 | expansionCallback: (index, isE) {
48 | print("index: $index, isE: $isE");
49 | setState(() {
50 | if (index == 0) {
51 | isA = !isE;
52 | } else {
53 | isB = !isE;
54 | }
55 | });
56 | },
57 | );
58 |
59 | Widget _radio() => ExpansionPanelList.radio(
60 | children: [
61 | ExpansionPanelRadio(
62 | value: "a",
63 | headerBuilder: (context, isE) => Container(
64 | child: Text("A"),
65 | alignment: Alignment.centerLeft,
66 | ),
67 | body: Container(
68 | color: BLUE_LIGHT,
69 | constraints: BoxConstraints.expand(height: 100),
70 | alignment: Alignment.center,
71 | child: Text("AAAAA"),
72 | ),
73 | ),
74 | ExpansionPanelRadio(
75 | value: "b",
76 | headerBuilder: (context, isE) => Container(
77 | child: Text("B"),
78 | alignment: Alignment.centerLeft,
79 | ),
80 | body: Container(
81 | color: BLUE_LIGHT,
82 | constraints: BoxConstraints.expand(height: 100),
83 | alignment: Alignment.center,
84 | child: Text("BBBBB"),
85 | ),
86 | ),
87 | ],
88 | expansionCallback: (index, isE) {
89 | print("index: $index, isE: $isE");
90 | setState(() {});
91 | },
92 | );
93 |
94 | @override
95 | Widget build(BuildContext context) {
96 | return Scaffold(
97 | appBar: AppBar(
98 | title: Text(PageName.EXPANSION_PANEL),
99 | ),
100 | body: Container(
101 | constraints: BoxConstraints.expand(),
102 | child: SingleChildScrollView(
103 | child: Column(
104 | children: [
105 | _expan(),
106 | _radio()
107 | ],
108 | ))),
109 | );
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/lib/page/floatingbutton/floating_action_button_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class FloatingActionButtonPage extends StatefulWidget {
10 | @override
11 | _FloatingActionButtonState createState() => _FloatingActionButtonState();
12 | }
13 |
14 | class _FloatingActionButtonState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: Text(PageName.FLOATING_ACTION_BUTTON),
20 | ),
21 | body: SingleChildScrollView(
22 | child: Column(
23 | children: [
24 | Container(
25 | constraints: BoxConstraints.expand(height: 50),
26 | child: FloatingActionButton(
27 | onPressed: () {
28 | print("click");
29 | },
30 | child: Icon(Icons.airplanemode_active),
31 | ),
32 | ),
33 | SizedBox(
34 | height: 10,
35 | ),
36 | Container(
37 | constraints: BoxConstraints.expand(height: 80),
38 | child: FloatingActionButton(
39 | onPressed: () {
40 | print("Click the button");
41 | },
42 | tooltip: "Long-press, so what do you want?",
43 | backgroundColor: PURPLE,
44 | child: Icon(Icons.adb),
45 | ),
46 | ),
47 | //our code here.
48 | Container(
49 | child: FloatingActionButton(
50 | onPressed: () {
51 | print("Click the button");
52 | },
53 | backgroundColor: BLUE,
54 | mini: true,
55 | child: Icon(
56 | Icons.adb,
57 | ),
58 | ),
59 | ),
60 | SizedBox(
61 | height: 600,
62 | )
63 | ],
64 | ),
65 | ),
66 | );
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/lib/page/flutterlogo/flutter_logo_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class FlutterLogoPage extends StatefulWidget {
10 | @override
11 | _FlutterLogoState createState() => _FlutterLogoState();
12 | }
13 |
14 | class _FlutterLogoState extends State {
15 | var _size = 50.0;
16 |
17 | Widget _styleLogo() => Column(
18 | children: [
19 | Row(
20 | mainAxisAlignment: MainAxisAlignment.spaceAround,
21 | children: [
22 | Text(
23 | "markOnly",
24 | style: TextStyle(color: Colors.blueAccent, fontSize: 30),
25 | ),
26 | Text(
27 | "horizontal",
28 | style: TextStyle(color: Colors.orangeAccent, fontSize: 30),
29 | ),
30 | Text(
31 | "stacked",
32 | style: TextStyle(color: Colors.purpleAccent, fontSize: 30),
33 | )
34 | ],
35 | ),
36 | Row(
37 | mainAxisAlignment: MainAxisAlignment.spaceAround,
38 | children: [
39 | FlutterLogo(
40 | size: 100,
41 | colors: Colors.blue,
42 | style: FlutterLogoStyle.markOnly,
43 | ),
44 | FlutterLogo(
45 | size: 100,
46 | colors: Colors.orange,
47 | style: FlutterLogoStyle.horizontal,
48 | ),
49 | FlutterLogo(
50 | size: 100,
51 | colors: Colors.purple,
52 | style: FlutterLogoStyle.stacked,
53 | ),
54 | ],
55 | ),
56 | ],
57 | );
58 |
59 | Widget _durLogo() => Row(
60 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
61 | children: [
62 | FlutterLogo(
63 | size: _size,
64 | colors: Colors.blue,
65 | duration: Duration(seconds: 2),
66 | curve: Curves.bounceOut,
67 | ),
68 | Container(
69 | width: 100,
70 | height: 100,
71 | child: RaisedButton(
72 |
73 | padding: EdgeInsets.all(10),
74 | color: GREEN,
75 | child: Text(
76 | "Change\nSize",
77 | style: TextStyle(
78 | color: TEXT_BLACK,
79 | fontSize: 20,
80 | ),
81 | textAlign: TextAlign.center,
82 | ),
83 | onPressed: () {
84 | setState(() {
85 | _size += 50;
86 | if (_size > 200) {
87 | _size = 50.0;
88 | }
89 | });
90 | },
91 | shape: CircleBorder(side: BorderSide(color: RED, width: 10)),
92 | ),
93 | )
94 | ],
95 | );
96 |
97 | @override
98 | Widget build(BuildContext context) {
99 | return Scaffold(
100 | appBar: AppBar(
101 | title: Text(PageName.FLUTTER_LOGO),
102 | ),
103 | body: SingleChildScrollView(
104 | child: Column(
105 | crossAxisAlignment: CrossAxisAlignment.start,
106 | children: [
107 | //our code
108 | FlutterLogo(
109 | size: 100,
110 | ),
111 | Container(
112 | constraints: BoxConstraints.expand(height: 100),
113 | child: Row(
114 | mainAxisAlignment: MainAxisAlignment.spaceAround,
115 | children: [
116 | FlutterLogo(
117 | colors: Colors.red,
118 | size: 100,
119 | ),
120 | FlutterLogo(
121 | colors: Colors.green,
122 | size: 100,
123 | ),
124 | FlutterLogo(
125 | colors: Colors.yellow,
126 | size: 100,
127 | ),
128 | ],
129 | ),
130 | ),
131 | _styleLogo(),
132 | _durLogo(),
133 | SizedBox(height: 600)
134 | ],
135 | ),
136 | ),
137 | );
138 | }
139 | }
140 |
141 | /// this.colors,
142 | // this.textColor = const Color(0xFF616161),
143 | // this.style = FlutterLogoStyle.markOnly,
144 | // this.duration = const Duration(milliseconds: 750),
145 | // this.curve = Curves.fastOutSlowIn,
146 |
--------------------------------------------------------------------------------
/lib/page/home_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 | import 'package:flutter_widgets/util/_util.dart';
9 |
10 | class HomePage extends StatefulWidget {
11 | @override
12 | _HomeState createState() => _HomeState();
13 | }
14 |
15 | class _HomeState extends State {
16 | var opacity = 0.8;
17 |
18 | LinearGradient _itemGradient(index) {
19 | var gradient = GradientUtil.red(
20 | begin: AlignmentDirectional.topStart,
21 | end: AlignmentDirectional.bottomEnd,
22 | opacity: opacity);
23 | switch (index % 4) {
24 | case 0:
25 | gradient = GradientUtil.red(
26 | begin: AlignmentDirectional.topStart,
27 | end: AlignmentDirectional.bottomEnd,
28 | opacity: opacity);
29 | break;
30 | case 1:
31 | gradient = GradientUtil.greenPurple(
32 | begin: AlignmentDirectional.topStart,
33 | end: AlignmentDirectional.bottomEnd,
34 | opacity: opacity);
35 | break;
36 | case 2:
37 | gradient = GradientUtil.greenRed(
38 | begin: AlignmentDirectional.topStart,
39 | end: AlignmentDirectional.bottomEnd,
40 | opacity: opacity);
41 | break;
42 | case 3:
43 | gradient = GradientUtil.yellowBlue(
44 | begin: AlignmentDirectional.topStart,
45 | end: AlignmentDirectional.bottomEnd,
46 | opacity: opacity);
47 | break;
48 | }
49 | return gradient;
50 | }
51 |
52 | Widget _item(context, index) {
53 | return InkWell(
54 | child: Card(
55 | child: Stack(
56 | children: [
57 | // Center(
58 | // child: Image.asset(
59 | // PAGE_ITEMS[index]["img"],
60 | // fit: BoxFit.cover,
61 | // ),
62 | // ),
63 | Container(
64 | constraints: BoxConstraints.expand(),
65 | decoration: BoxDecoration(gradient: _itemGradient(index)),
66 | ),
67 | Center(
68 | child: Text(
69 | PAGE_ITEMS[index]["title"],
70 | style: TextStyle(
71 | color: TEXT_BLACK_LIGHT,
72 | fontSize: TEXT_LARGE,
73 | fontWeight: FontWeight.w700),
74 | ),
75 | )
76 | ],
77 | )),
78 | onTap: () {
79 | Navigator.pushNamed(context, PAGE_ITEMS[index]["click"]);
80 | },
81 | );
82 | }
83 |
84 | @override
85 | Widget build(BuildContext context) {
86 | SizeUtil.getInstance(key: SizeKeyConst.DEVICE_KEY).logicSize =
87 | MediaQuery.of(context).size;
88 | // var size = MediaQuery.of(context).size;
89 | // print("size:width.${size.width},height.${size.height}");
90 | SizeUtil.initDesignSize();
91 | return Scaffold(
92 | appBar: AppBar(
93 | title: Text(FLUTTER_OPEN),
94 | ),
95 | body: GridView.builder(
96 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
97 | crossAxisCount: 2,
98 | mainAxisSpacing: 4,
99 | crossAxisSpacing: 4,
100 | childAspectRatio: 2),
101 | itemBuilder: (context, index) {
102 | return _item(context, index);
103 | },
104 | itemCount: PAGE_ITEMS.length,
105 | ),
106 | );
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lib/page/icon/icon_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class IconPage extends StatefulWidget {
10 | @override
11 | _IconState createState() => _IconState();
12 | }
13 |
14 | class _IconState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: Text(PageName.ICON),
20 | ),
21 | body: SingleChildScrollView(
22 | child: Column(
23 | children: [
24 | Icon(
25 | Icons.ac_unit,
26 | size: 100,
27 | color: RED,
28 | ),
29 | Icon(
30 | Icons.chrome_reader_mode,
31 | size: 200,
32 | color: GREEN,
33 | textDirection: TextDirection.ltr,
34 | ),
35 | Icon(
36 | Icons.chrome_reader_mode,
37 | size: 200,
38 | color: BLUE_DEEP,
39 | textDirection: TextDirection.rtl,
40 | ),
41 | Icon(
42 | Icons.build,
43 | size: 200,
44 | color: PURPLE,
45 | textDirection: TextDirection.ltr,
46 | ),
47 | Icon(
48 | Icons.build,
49 | size: 200,
50 | color: BLUE_DEEP,
51 | textDirection: TextDirection.rtl,
52 | )
53 | ],
54 | ),
55 | ),
56 | );
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/page/info/CardPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class CardPage extends StatefulWidget {
10 | @override
11 | CardState createState() => CardState();
12 | }
13 |
14 | class CardState extends State {
15 | Widget _card(double elevation) => Container(
16 | constraints: BoxConstraints.expand(height: 100),
17 | child: Card(
18 | child: Center(
19 | child: Text("Hello"),
20 | ),
21 | color: RED_LIGHT,
22 | margin: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
23 | shape: Border(
24 | top: BorderSide(color: BLUE_LIGHT, width: 2),
25 | bottom: BorderSide(color: YELLOW, width: 3)),
26 | clipBehavior: Clip.antiAlias,
27 | elevation: elevation,
28 | ),
29 | );
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | return Scaffold(
34 | appBar: AppBar(
35 | title: Text(PageName.CARD),
36 | ),
37 | body: Column(
38 | children: [
39 | _card(1),
40 | _card(5),
41 | _card(10),
42 | ],
43 | ),
44 | );
45 | }
46 | }
47 | //({
48 | //Key key,
49 | //this.color,
50 | //this.elevation = 1.0,
51 | //this.shape,
52 | //this.margin = const EdgeInsets.all(4.0),
53 | //this.clipBehavior = Clip.none,
54 | //this.child,
55 | //this.semanticContainer = true,
56 | //})
57 |
--------------------------------------------------------------------------------
/lib/page/info/DataTablePage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/15
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class DataTablePage extends StatefulWidget {
10 | @override
11 | DataTableState createState() => DataTableState();
12 | }
13 |
14 | class DataTableState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | // TODO: implement
18 | return Scaffold(
19 | appBar: AppBar(
20 | title: Text(PageName.DATA_TABLE),
21 | ),
22 | body: DataTable(
23 | sortColumnIndex: 3,
24 | columns: [
25 | DataColumn(label: Text("Hello")),
26 | DataColumn(label: Text("Hello1")),
27 | DataColumn(label: Text("Hell2")),
28 | DataColumn(label: Text("Hell3")),
29 | ],
30 | rows: [
31 | DataRow(cells: [
32 | DataCell(Text("a"), placeholder: true),
33 | DataCell(Text("b")),
34 | DataCell(Text("c")),
35 | DataCell(Text("d")),
36 | ]),
37 | DataRow(cells: [
38 | DataCell(
39 | EditableText(
40 | controller: TextEditingController(text: "a1"),
41 | focusNode: FocusNode(debugLabel: "debug"),
42 | style: TextStyle(color: BLUE),
43 | backgroundCursorColor: RED,
44 | cursorColor: TEXT_BLACK,
45 | ),
46 | showEditIcon: true, onTap: () {
47 | print("Hello");
48 | }),
49 | DataCell(Text("c2")),
50 | DataCell(Text("b3")),
51 | DataCell(Text("a4")),
52 | ]),
53 | ],
54 | ),
55 | );
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/lib/page/info/ProgressIndicatorPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/17
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class ProgressIndicatorPage extends StatefulWidget {
10 | @override
11 | ProgressIndicatorState createState() => ProgressIndicatorState();
12 | }
13 |
14 | class ProgressIndicatorState extends State
15 | with SingleTickerProviderStateMixin {
16 | var t = Tween(begin: BLUE, end: YELLOW);
17 | AnimationController _controller;
18 | var pro = Tween(begin: 0.0, end: 1.0);
19 | var len = 0.0;
20 |
21 | @override
22 | void initState() {
23 | super.initState();
24 | _controller =
25 | AnimationController(vsync: this, duration: Duration(seconds: 10));
26 | pro.animate(_controller).addListener(() => setState(() {
27 | print("len = $len");
28 | len = _controller.value;
29 | }));
30 | _controller.forward();
31 | }
32 |
33 | Widget _lineIndicator() => Container(
34 | constraints: BoxConstraints.expand(width: 100, height: 10),
35 | child: LinearProgressIndicator(
36 | backgroundColor: BLUE,
37 | value: len,
38 | ),
39 | );
40 |
41 | Widget _circleIndicator() => Container(
42 | constraints: BoxConstraints.expand(width: 100, height: 100),
43 | child: CircularProgressIndicator(
44 | value: len,
45 | backgroundColor: YELLOW,
46 | // valueColor: t.animate(_controller),
47 | strokeWidth: 10,
48 | ),
49 | );
50 |
51 | @override
52 | Widget build(BuildContext context) {
53 | return Scaffold(
54 | appBar: AppBar(
55 | title: Text(PageName.PROGRESS_INDICATOR),
56 | ),
57 | body: Center(
58 | child: Column(
59 | children: [
60 | _lineIndicator(),
61 | _circleIndicator(),
62 | ],
63 | ),
64 | ));
65 | }
66 |
67 | @override
68 | void dispose() {
69 | super.dispose();
70 | _controller.dispose();
71 | }
72 | }
73 | //Key key,
74 | // double value,
75 | //Color backgroundColor,
76 | // Animation valueColor,
77 | //String semanticsLabel,
78 | // String semanticsValue,
79 | //}
80 |
--------------------------------------------------------------------------------
/lib/page/info/TooltipPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class TooltipPage extends StatefulWidget {
10 | @override
11 | TooltipState createState() => TooltipState();
12 | }
13 |
14 | class TooltipState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: Text(PageName.TOOLTIP),
20 | ),
21 | body: Tooltip(
22 | message: "Good morning,sir!",
23 | child: Text("Hello world"),
24 | preferBelow: true,
25 | padding: EdgeInsets.symmetric(vertical: 10),
26 | ));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/page/info/_info.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | export "CardPage.dart";
7 | export "TooltipPage.dart";
8 | export 'DataTablePage.dart';
9 | export 'ProgressIndicatorPage.dart';
10 |
--------------------------------------------------------------------------------
/lib/page/interation/DismissiblePage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/12
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import "package:flutter_widgets/const/_const.dart";
8 |
9 | class DismissiblePage extends StatefulWidget {
10 | @override
11 | _DismissibleState createState() => _DismissibleState();
12 | }
13 |
14 | class _DismissibleState extends State {
15 | var _key = GlobalKey();
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return Scaffold(
20 | appBar: AppBar(
21 | title: Text(PageName.INTER_DISMISSIBLE),
22 | ),
23 | body: Dismissible(
24 | key: _key,
25 | child: Container(
26 | constraints: BoxConstraints.expand(height: 100),
27 | alignment: Alignment.center,
28 | child: Text(
29 | "Hello",
30 | style: TextStyle(color: TEXT_BLACK, fontSize: 20),
31 | ),
32 | color: BLUE,
33 | ),
34 | background: Container(
35 | color: RED_LIGHT,
36 | constraints: BoxConstraints.expand(height: 100, width: 40),
37 | alignment: Alignment.center,
38 | child: Text(
39 | "Remove",
40 | style: TextStyle(color: TEXT_BLACK_LIGHT, fontSize: 10),
41 | ),
42 | ),
43 | direction: DismissDirection.startToEnd,
44 | onDismissed: (direction) {
45 | print("Dissmiss");
46 | _key.currentState.dispose();
47 | }),
48 | );
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/lib/page/interation/DraggablePage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/11
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import "package:flutter_widgets/const/_const.dart";
8 |
9 | class DraggablePage extends StatefulWidget {
10 | @override
11 | _DragState createState() => _DragState();
12 | }
13 |
14 | class _DragState extends State {
15 | String _value = "";
16 |
17 | Widget _draggable(String _data) => Draggable(
18 | child: Text(
19 | "$_data",
20 | style: TextStyle(color: RED_LIGHT, fontSize: 30),
21 | ),
22 | feedback: Text(
23 | "$_data",
24 | style: TextStyle(color: BLUE_DEEP),
25 | ),
26 | childWhenDragging: Container(),
27 | maxSimultaneousDrags: 1,
28 | onDragCompleted: () {
29 | print("Complete.");
30 | },
31 | onDragStarted: () {
32 | print("Start");
33 | },
34 | onDraggableCanceled: (v, off) {
35 | print("Cancel");
36 | },
37 | data: _data,
38 | );
39 |
40 | Widget _target() => DragTarget(
41 | builder: (context, List candidateData, rejectedData) =>
42 | Container(
43 | constraints: BoxConstraints.expand(height: 100),
44 | color: GREEN,
45 | alignment: Alignment.center,
46 | child: Text(
47 | candidateData.length > 0 ? candidateData[0] : _value,
48 | style: TextStyle(color: Colors.white, fontSize: 30),
49 | ),
50 | ),
51 | onAccept: (value) {
52 | print("Accept value= $value");
53 | _value = value;
54 | },
55 | onLeave: (value) {
56 | print("leave = $value");
57 | },
58 | onWillAccept: (value) {
59 | print("Will Accept: value = $value");
60 | return true;
61 | },
62 | );
63 |
64 | @override
65 | Widget build(BuildContext context) {
66 | return Scaffold(
67 | appBar: AppBar(
68 | title: Text(PageName.INTER_DRAG),
69 | ),
70 | body: Column(
71 | children: [
72 | Text(" You should drag the text and put it into the green area,"
73 | "then you can see the text changed."),
74 | _draggable("Hello"),
75 | _draggable("World"),
76 | _target(),
77 | ],
78 | ));
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/lib/page/interation/GesturePage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/12
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import "package:flutter_widgets/const/_const.dart";
8 |
9 | class GesturePage extends StatefulWidget {
10 | @override
11 | _GestureState createState() => _GestureState();
12 | }
13 |
14 | class _GestureState extends State {
15 | Widget _gesture(context) => GestureDetector(
16 | child: Text("You can tab me then look the log."),
17 | onTap: () {
18 | print("Hello world");
19 | Scaffold.of(context).showSnackBar(
20 | SnackBar(
21 | content: Text("You have click me."),
22 | ),
23 | );
24 | },
25 | );
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | return Scaffold(
30 | appBar: AppBar(
31 | title: Text(PageName.INTER_GESTURE),
32 | ),
33 | body: Builder(
34 | builder: (context) => _gesture(context),
35 | ),
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/page/interation/NavPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/15
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class NavPage extends StatefulWidget {
10 | @override
11 | _NavState createState() => _NavState();
12 | }
13 |
14 | class _NavState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: Text("NavPage"),
20 | ),
21 | body: Center(
22 | child: FloatingActionButton(
23 | onPressed: () {
24 | Navigator.pop(context, "My name is Nie Bin");
25 | },
26 | child: Text("back"),
27 | backgroundColor: BLUE_LIGHT,
28 | ),
29 | ));
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lib/page/interation/NavigatorPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/15
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 | import 'NavPage.dart';
9 |
10 | class NavigatorPage extends StatefulWidget {
11 | @override
12 | _NavigatorState createState() => _NavigatorState();
13 | }
14 |
15 | class _NavigatorState extends State {
16 | Future _startPage() async {
17 | var content = await Navigator.push(
18 | context,
19 | MaterialPageRoute(
20 | builder: (context) => NavPage(),
21 | ),
22 | );
23 | print("Content: $content");
24 | }
25 |
26 | Widget _pushWithBack() => FlatButton(
27 | onPressed: () {
28 | print("Hello world");
29 | _startPage();
30 | },
31 | child: Text("jump"),
32 | color: PURPLE,
33 | );
34 |
35 | Future _transPage() {
36 | Navigator.push(
37 | context,
38 | PageRouteBuilder(
39 | opaque: false,
40 | barrierColor: GREEN,
41 | pageBuilder: (BuildContext context, _, __) {
42 | return NavPage();
43 | },
44 | transitionsBuilder:
45 | (___, Animation animation, ____, Widget child) {
46 | return FadeTransition(
47 | opacity: animation,
48 | child: RotationTransition(
49 | turns: Tween(begin: 0.5, end: 2.0).animate(animation),
50 | child: child,
51 | ),
52 | );
53 | }));
54 | }
55 |
56 | Widget _transButton() => FlatButton(
57 | child: Text("Trans"),
58 | color: RED_LIGHT,
59 | onPressed: () {
60 | _transPage();
61 | },
62 | );
63 |
64 | Widget _slidButton(BuildContext context) => FlatButton(
65 | child: Text("Slid"),
66 | color: RED_LIGHT,
67 | onPressed: () {
68 | Navigator.push(context, SlideRightRoute(page: NavPage()));
69 | },
70 | );
71 |
72 | Widget _doublePage(BuildContext context) => Container(
73 | constraints: BoxConstraints.expand(height: 100),
74 | child: FlatButton(
75 | child: Text("Double Page"),
76 | color: RED_LIGHT,
77 | onPressed: () {
78 | Navigator.push(context,
79 | EnterExitRoute(exitPage: widget, enterPage: NavPage()));
80 | },
81 | ),
82 | );
83 |
84 | @override
85 | Widget build(BuildContext context) {
86 | return Scaffold(
87 | appBar: AppBar(
88 | title: Text(PageName.INTER_NAV),
89 | ),
90 | body: Column(
91 | mainAxisAlignment: MainAxisAlignment.spaceAround,
92 | children: [
93 | Container(
94 | constraints: BoxConstraints.expand(height: 100),
95 | child: _pushWithBack(),
96 | ),
97 | Container(
98 | constraints: BoxConstraints.expand(height: 100),
99 | child: _transButton(),
100 | ),
101 | Container(
102 | constraints: BoxConstraints.expand(height: 100),
103 | child: _slidButton(context),
104 | ),
105 | _doublePage(context),
106 | ],
107 | ),
108 | );
109 | }
110 | }
111 |
112 | class SlideRightRoute extends PageRouteBuilder {
113 | final Widget page;
114 |
115 | SlideRightRoute({this.page})
116 | : super(
117 | pageBuilder: (
118 | BuildContext context,
119 | Animation animation,
120 | Animation secondaryAnimation,
121 | ) =>
122 | page,
123 | transitionsBuilder: (
124 | BuildContext context,
125 | Animation animation,
126 | Animation secondaryAnimation,
127 | Widget child,
128 | ) =>
129 | SlideTransition(
130 | position: Tween(
131 | begin: const Offset(-1, 0),
132 | end: Offset.zero,
133 | ).animate(animation),
134 | child: child,
135 | ),
136 | barrierColor: GREEN,
137 | );
138 | }
139 |
140 | class EnterExitRoute extends PageRouteBuilder {
141 | final Widget enterPage;
142 | final Widget exitPage;
143 |
144 | EnterExitRoute({this.exitPage, this.enterPage})
145 | : super(
146 | pageBuilder: (
147 | BuildContext context,
148 | Animation animation,
149 | Animation secondaryAnimation,
150 | ) =>
151 | enterPage,
152 | transitionsBuilder: (
153 | BuildContext context,
154 | Animation animation,
155 | Animation secondaryAnimation,
156 | Widget child,
157 | ) =>
158 | Stack(
159 | children: [
160 | SlideTransition(
161 | position: new Tween(
162 | begin: const Offset(0.0, 0.0),
163 | end: const Offset(-1.0, -1.0),
164 | ).animate(animation),
165 | child: exitPage,
166 | ),
167 | SlideTransition(
168 | position: new Tween(
169 | begin: const Offset(1.0, 1.0),
170 | end: Offset.zero,
171 | ).animate(animation),
172 | child: enterPage,
173 | )
174 | ],
175 | ),
176 | );
177 | }
178 |
--------------------------------------------------------------------------------
/lib/page/interation/PointerPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class PointerPage extends StatefulWidget {
10 | @override
11 | _PointerState createState() => _PointerState();
12 | }
13 |
14 | class _PointerState extends State {
15 | Widget _absorb() => Container(
16 | constraints: BoxConstraints.expand(height: 100),
17 | child: AbsorbPointer(
18 | child: GestureDetector(
19 | onTap: () {
20 | print("You have touch me.");
21 | },
22 | child: Text(
23 | "It can absorb the pointer touching when you click it. but you should set the parameter of the absorbing to the 'true'"),
24 | ),
25 | absorbing: true,
26 | ),
27 | color: RED_LIGHT,
28 | );
29 |
30 | Widget _ignore() => Container(
31 | color: BLUE_LIGHT,
32 | child: IgnorePointer(
33 | child: GestureDetector(
34 | onTap: () {
35 | print("Hello world");
36 | },
37 | child: Text(
38 | "IgnorePointer,you can change the paramter of the ignoring to see the effect."),
39 | ),
40 | ignoring: true,
41 | ),
42 | );
43 |
44 | @override
45 | Widget build(BuildContext context) {
46 | return Scaffold(
47 | appBar: AppBar(
48 | title: Text(PageName.INTER_POINTER),
49 | ),
50 | body: Column(
51 | children: [
52 | _absorb(),
53 | _ignore(),
54 | ],
55 | ),
56 | );
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/page/interation/ScrollablePage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class ScrollablePage extends StatefulWidget {
10 | @override
11 | _ScrollableState createState() => _ScrollableState();
12 | }
13 |
14 | class _ScrollableState extends State {
15 | Widget _scrollBuilder(BuildContext context, position) => Container(
16 | child: Column(
17 | children: _list(),
18 | ),
19 | );
20 |
21 | List _list() {
22 | List list = List();
23 | for (int i = 0; i < 20; i++) {
24 | list.add(Container(
25 | constraints: BoxConstraints.expand(height: 100),
26 | color: i % 2 == 0 ? RED_LIGHT : BLUE_LIGHT,
27 | ));
28 | }
29 | return list;
30 | }
31 |
32 | @override
33 | Widget build(BuildContext context) {
34 | //it scrollable failed, so if you want to scroll a view, you can consider to use the CustomScrollView
35 | return Scrollable(viewportBuilder: _scrollBuilder);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/page/interation/_interaction.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/11
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | export "DraggablePage.dart";
7 | export "GesturePage.dart";
8 | export "DismissiblePage.dart";
9 | export "PointerPage.dart";
10 | export "ScrollablePage.dart";
11 | export "NavigatorPage.dart";
12 |
--------------------------------------------------------------------------------
/lib/page/layoutsingle/_layout_single.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/17
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | export "MixPage.dart";
7 |
--------------------------------------------------------------------------------
/lib/page/materialapp/material_app_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 |
8 | class EmptyPage extends StatefulWidget {
9 | @override
10 | _EmptyState createState() => _EmptyState();
11 | }
12 |
13 | class _EmptyState extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | return Scaffold(
17 | appBar: AppBar(
18 | title: Text("empty"),
19 | ),
20 | body: WidgetsApp(color: null),
21 | );
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/page/muti/ExpandPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/22
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class ExpandPage extends StatefulWidget {
10 | @override
11 | ExpandState createState() => ExpandState();
12 | }
13 |
14 | class ExpandState extends State {
15 | Widget _normal() => Row(
16 | children: [
17 | Expanded(
18 | flex: 5,
19 | child: Text(
20 | "Hello world dsdsdsdsdsdsdsdsssssssssssssss",
21 | style: TextStyle(fontSize: 20),
22 | ),
23 | ),
24 | Expanded(
25 | flex: 1,
26 | child: Text("Hello"),
27 | )
28 | ],
29 | );
30 |
31 | /// when you use these code, you may get some bad display on you screen.
32 | Widget _abnormal() => Row(
33 | children: [
34 | Text(
35 | "Hello world dsdsdsdsdsdsdsdsssssssssssssss",
36 | style: TextStyle(fontSize: 20),
37 | ),
38 | Text("Hello"),
39 | ],
40 | );
41 |
42 | @override
43 | Widget build(BuildContext context) {
44 | return Scaffold(
45 | appBar: AppBar(
46 | title: Text(PageName.EXPANDED),
47 | ),
48 | body: Container(
49 | child: Column(
50 | children: [
51 | _normal(),
52 | _abnormal(),
53 | ],
54 | ),
55 | ),
56 | );
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/page/muti/FlowPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/24
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class FlowPage extends StatefulWidget {
10 | @override
11 | FlowState createState() => FlowState();
12 | }
13 |
14 | class FlowState extends State {
15 | Widget _flow() => Flow(
16 | delegate: MFlowDelegate(),
17 | children: [
18 | Container(
19 | constraints: BoxConstraints.expand(height: 100, width: 200),
20 | color: RED,
21 | ),
22 | Container(
23 | constraints: BoxConstraints.expand(height: 100, width: 100),
24 | alignment: Alignment.center,
25 | color: BLUE,
26 | )
27 | ],
28 | );
29 |
30 | /// this.direction = Axis.horizontal,
31 | // this.alignment = WrapAlignment.start,
32 | // this.spacing = 0.0,
33 | // this.runAlignment = WrapAlignment.start,
34 | // this.runSpacing = 0.0,
35 | // this.crossAxisAlignment = WrapCrossAlignment.start,
36 | // this.textDirection,
37 | // this.verticalDirection = VerticalDirection.down,
38 |
39 | Widget _wrap() => Wrap(
40 | spacing: 8.0,
41 | // gap between adjacent chips
42 | runSpacing: 10.0,
43 | // gap between lines
44 | alignment: WrapAlignment.spaceAround,
45 | direction: Axis.horizontal,
46 | runAlignment: WrapAlignment.spaceEvenly,
47 | crossAxisAlignment: WrapCrossAlignment.center,
48 | verticalDirection: VerticalDirection.down,
49 | children: [
50 | Chip(
51 | avatar: CircleAvatar(
52 | backgroundColor: Colors.blue.shade900, child: Text('AH')),
53 | label: Text('Hamilton'),
54 | ),
55 | Chip(
56 | avatar: CircleAvatar(
57 | backgroundColor: Colors.blue.shade900, child: Text('ML')),
58 | label: Text('Lafayette'),
59 | ),
60 | Chip(
61 | avatar: CircleAvatar(
62 | backgroundColor: Colors.blue.shade900, child: Text('HM')),
63 | label: Text('Mulligan'),
64 | ),
65 | Chip(
66 | avatar: CircleAvatar(
67 | backgroundColor: Colors.blue.shade900, child: Text('JL')),
68 | label: Text('Laurens'),
69 | ),
70 | ],
71 | );
72 |
73 | // this.children = const [],
74 | // this.columnWidths,
75 | // this.defaultColumnWidth = const FlexColumnWidth(1.0),
76 | // this.textDirection,
77 | // this.border,
78 | // this.defaultVerticalAlignment = TableCellVerticalAlignment.top,
79 | // this.textBaseline,
80 | Widget _table() => Table(
81 | border: TableBorder.all(color: RED, width: 1, style: BorderStyle.solid),
82 | defaultVerticalAlignment: TableCellVerticalAlignment.middle,
83 | children: [
84 | TableRow(children: [
85 | Container(
86 | constraints: BoxConstraints.expand(height: 100),
87 | alignment: Alignment.center,
88 | child: Text(
89 | "HHHH",
90 | textAlign: TextAlign.center,
91 | ),
92 | ),
93 | Text("HHHH"),
94 | Text("HHHH"),
95 | Text("HHHH"),
96 | Text("HHHH"),
97 | ]),
98 | TableRow(children: [
99 | Text("HHHH"),
100 | Text("HHHH"),
101 | Text("HHHH"),
102 | Text("HHHH"),
103 | Text("HHHH"),
104 | ]),
105 | ],
106 | );
107 |
108 | @override
109 | Widget build(BuildContext context) {
110 | return Scaffold(
111 | appBar: AppBar(
112 | title: Text(PageName.FLOW),
113 | ),
114 | body: SingleChildScrollView(
115 | child: Column(
116 | children: [
117 | Container(
118 | constraints: BoxConstraints.expand(height: 400),
119 | child: _flow(),
120 | ),
121 | Container(
122 | constraints: BoxConstraints.expand(height: 100),
123 | child: _wrap(),
124 | ),
125 | Container(
126 | constraints: BoxConstraints.expand(height: 400),
127 | child: _table(),
128 | )
129 | ],
130 | ),
131 | ));
132 | }
133 | }
134 |
135 | class MFlowDelegate extends FlowDelegate {
136 | @override
137 | void paintChildren(FlowPaintingContext context) {
138 | context.paintChild(0, transform: Matrix4.rotationZ(1));
139 | context.paintChild(1,
140 | transform: Matrix4.translationValues(100, 0, 0)..rotateZ(1));
141 | }
142 |
143 | @override
144 | bool shouldRepaint(MFlowDelegate oldDelegate) {
145 | return true;
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/lib/page/muti/IndexStackPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/22
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class IndexStackPage extends StatefulWidget {
10 | @override
11 | IndexStackState createState() => IndexStackState();
12 | }
13 |
14 | class IndexStackState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(title: Text(PageName.INDEX_STACK)),
19 | body: IndexedStack(
20 | ///this can show only one child,so you should assign a value to index.
21 | alignment: Alignment.centerRight,
22 | index: 2, //
23 | children: [
24 | Container(
25 | constraints: BoxConstraints.expand(height: 100, width: 100),
26 | color: RED,
27 | ),
28 | Container(
29 | constraints: BoxConstraints.expand(height: 100, width: 200),
30 | color: YELLOW,
31 | ),
32 | Container(
33 | constraints: BoxConstraints.expand(height: 100, width: 150),
34 | color: BLUE_DEEP,
35 | ),
36 | ],
37 | ),
38 | );
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/lib/page/muti/LayoutPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/26
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | import "package:flutter/material.dart";
6 | import 'package:flutter_widgets/const/_const.dart';
7 |
8 | class LayoutPage extends StatefulWidget {
9 | @override
10 | LayoutState createState() => LayoutState();
11 | }
12 |
13 | class LayoutState extends State {
14 | Widget _builder(BuildContext context, BoxConstraints constraints) =>
15 | Container(
16 | constraints:
17 | BoxConstraints.expand(height: 100, width: constraints.maxWidth),
18 | color: RED,
19 | );
20 |
21 | Widget _listView() => ListView(
22 | shrinkWrap: true,
23 | itemExtent: 100,
24 | controller: ScrollController(initialScrollOffset: 100),
25 | children: [
26 | Container(
27 | constraints: BoxConstraints.expand(height: 100),
28 | color: RED,
29 | ),
30 | Container(
31 | constraints: BoxConstraints.expand(height: 100),
32 | color: BLUE,
33 | ),
34 | Container(
35 | constraints: BoxConstraints.expand(height: 100),
36 | color: YELLOW,
37 | ),
38 | Container(
39 | constraints: BoxConstraints.expand(height: 100),
40 | color: RED_LIGHT,
41 | ),
42 | Container(
43 | constraints: BoxConstraints.expand(height: 100),
44 | color: BLUE_DEEP,
45 | ),
46 | Container(
47 | constraints: BoxConstraints.expand(height: 100),
48 | color: RED,
49 | ),
50 | Container(
51 | constraints: BoxConstraints.expand(height: 100),
52 | color: BLUE,
53 | ),
54 | Container(
55 | constraints: BoxConstraints.expand(height: 100),
56 | color: YELLOW,
57 | ),
58 | Container(
59 | constraints: BoxConstraints.expand(height: 100),
60 | color: RED_LIGHT,
61 | ),
62 | Container(
63 | constraints: BoxConstraints.expand(height: 100),
64 | color: BLUE_DEEP,
65 | )
66 | ],
67 | );
68 |
69 | @override
70 | Widget build(BuildContext context) {
71 | return Scaffold(
72 | appBar: AppBar(
73 | title: Text(""),
74 | ),
75 | body: _listView(),
76 | );
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/lib/page/muti/MethodChannelPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/26
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | /// this page is for calling the android native code.
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 | import 'package:flutter/services.dart';
9 |
10 | class MethodChannelPage extends StatefulWidget {
11 | @override
12 | _MethodChannelState createState() => _MethodChannelState();
13 | }
14 |
15 | class _MethodChannelState extends State {
16 | static const platform = MethodChannel("com.nb.hello/dev");
17 | String _name = "";
18 |
19 | Future _click() async {
20 | String name;
21 | try {
22 | name = await platform.invokeMethod("get");
23 | } on PlatformException catch (e) {
24 | name = "Exception";
25 | }
26 | setState(() {
27 | _name = name;
28 | });
29 | }
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | return Scaffold(
34 | appBar: AppBar(
35 | title: Text(PageName.METHOD_CHANNEL),
36 | ),
37 | body: Center(
38 | child: Column(
39 | children: [
40 | Text("Hello world! $_name"),
41 | Divider(height: 10),
42 | FloatingActionButton(
43 | child: Text("Click"),
44 | onPressed: _click,
45 | )
46 | ],
47 | ),
48 | ),
49 | );
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/lib/page/muti/_muti.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/22
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | export "IndexStackPage.dart";
7 | export "ExpandPage.dart";
8 | export 'FlowPage.dart';
9 | export 'LayoutPage.dart';
10 | export 'MethodChannelPage.dart';
11 |
--------------------------------------------------------------------------------
/lib/page/painting/PaintingPage.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/15
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 | import 'dart:math';
9 |
10 | class PaintingPage extends StatefulWidget {
11 | @override
12 | _OpacityState createState() => _OpacityState();
13 | }
14 |
15 | class _OpacityState extends State {
16 | Widget _opacity() => Container(
17 | constraints: BoxConstraints.expand(height: 100),
18 | child: Opacity(
19 | opacity: 0.7,
20 | child: Text(
21 | "Opacity",
22 | style: TextStyle(color: TEXT_BLACK),
23 | ),
24 | ),
25 | color: RED_LIGHT,
26 | );
27 |
28 | Widget _transform() => Container(
29 | constraints: BoxConstraints.expand(height: 100),
30 | child: Transform.rotate(
31 | angle: pi / 2,
32 | child: Center(
33 | child: Text("Transform"),
34 | ),
35 | ),
36 | color: BLUE_LIGHT,
37 | );
38 |
39 | Widget _decorated() => Container(
40 | constraints: BoxConstraints.expand(height: 100),
41 | child: DecoratedBox(
42 | position: DecorationPosition.foreground,
43 | decoration: ShapeDecoration(
44 | shape: StadiumBorder(
45 | side: BorderSide(color: TEXT_BLACK, width: 10),
46 | ),
47 | ),
48 | child: Container(
49 | color: PURPLE,
50 | child: Center(
51 | child: Text("DecoratedBox"),
52 | ),
53 | )));
54 |
55 | Widget _fraction() => Container(
56 | constraints: BoxConstraints.expand(height: 100),
57 | child: FractionalTranslation(
58 | translation: Offset(0.3, 0.1),
59 | child: Container(
60 | color: BLUE_LIGHT,
61 | ),
62 | ),
63 | );
64 |
65 | Widget _rotation() => Container(
66 | constraints: BoxConstraints.expand(height: 100),
67 | child: RotatedBox(
68 | quarterTurns: 3,
69 | child: Container(
70 | color: GREEN,
71 | child: Center(
72 | child: Text("RotatedBox"),
73 | ),
74 | ),
75 | ),
76 | );
77 |
78 | Widget _clipOval() => Container(
79 | constraints: BoxConstraints.expand(height: 100),
80 | child: ClipOval(
81 | clipper: MyClipper(),
82 | child: Container(
83 | color: RED_LIGHT,
84 | ),
85 | ),
86 | );
87 |
88 | Widget _clipPath() => Container(
89 | constraints: BoxConstraints.expand(height: 100),
90 | child: ClipPath(
91 | clipper: MPathClipper(),
92 | child: Container(color: PURPLE),
93 | ),
94 | );
95 |
96 | Widget _clipRect() => Container(
97 | constraints: BoxConstraints.expand(height: 100),
98 | child: ClipRect(
99 | clipper: MyClipper(),
100 | child: Container(
101 | color: BLUE_DEEP,
102 | ),
103 | ),
104 | );
105 |
106 | Widget _custom() => Container(
107 | constraints: BoxConstraints.expand(height: 200),
108 | child: CustomPaint(
109 | painter: MCustomPainter(),
110 | child: Center(
111 | child: Text("CustomPaint"),
112 | ),
113 | ),
114 | );
115 |
116 | @override
117 | Widget build(BuildContext context) {
118 | return Scaffold(
119 | appBar: AppBar(
120 | title: Text("Hello world"),
121 | ),
122 | body: SingleChildScrollView(
123 | child: Column(
124 | children: [
125 | _opacity(),
126 | _transform(),
127 | _decorated(),
128 | _fraction(),
129 | _rotation(),
130 | _clipOval(),
131 | _clipPath(),
132 | _clipRect(),
133 | _custom(),
134 | ],
135 | ),
136 | ),
137 | );
138 | }
139 | }
140 |
141 | class MCustomPainter extends CustomPainter {
142 | @override
143 | void paint(Canvas canvas, Size size) {
144 | canvas.drawCircle(
145 | Offset(size.width / 2, size.height / 2),
146 | 100,
147 | Paint()
148 | ..color = RED_LIGHT
149 | ..isAntiAlias = true
150 | ..strokeWidth = 10);
151 | }
152 |
153 | @override
154 | bool shouldRepaint(CustomPainter oldDelegate) {
155 | return true;
156 | }
157 | }
158 |
159 | class MPathClipper extends CustomClipper {
160 | @override
161 | Path getClip(Size size) {
162 | return Path()
163 | ..moveTo(100.0, 50.0)
164 | ..addArc(
165 | Rect.fromCenter(
166 | center: Offset(100.0, 50.0), height: 50.0, width: 50.0),
167 | 0,
168 | pi / 2);
169 | }
170 |
171 | @override
172 | bool shouldReclip(CustomClipper oldClipper) {
173 | return true;
174 | }
175 | }
176 |
177 | class MyClipper extends CustomClipper {
178 | @override
179 | Rect getClip(Size size) {
180 | return Rect.fromCenter(
181 | center: Offset(50.0, 50.0), height: 100.0, width: 50.0);
182 | }
183 |
184 | @override
185 | bool shouldReclip(CustomClipper oldClipper) {
186 | return true;
187 | }
188 | }
189 |
--------------------------------------------------------------------------------
/lib/page/painting/_painting.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/6/15
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | export "PaintingPage.dart";
6 |
--------------------------------------------------------------------------------
/lib/page/placeholder/place_holder_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class PlaceHolderPage extends StatefulWidget {
10 | @override
11 | _PlaceHolderState createState() => _PlaceHolderState();
12 | }
13 |
14 | class _PlaceHolderState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: Text(PageName.PLACE_HOLDER),
20 | ),
21 | body: SingleChildScrollView(
22 | child: Column(
23 | children: [
24 | //our code here.
25 | Container(
26 | height: 100,
27 | child: Placeholder(),
28 | ),
29 | SizedBox(height: 10),
30 | Container(
31 | height: 100,
32 | child: Placeholder(color: RED),
33 | ),
34 | SizedBox(height: 20),
35 | Container(
36 | height: 100,
37 | child: Placeholder(
38 | color: GREEN,
39 | strokeWidth: 20,
40 | ),
41 | ),
42 | SizedBox(height: 20),
43 | Placeholder(
44 | color: RED,
45 | strokeWidth: 4,
46 | fallbackWidth: 10,
47 | fallbackHeight: 100,
48 | ),
49 | SizedBox(height: 20),
50 | Container(
51 | constraints: BoxConstraints.expand(height: 100, width: 100),
52 | child: Placeholder(
53 | color: BLUE_DEEP,
54 | strokeWidth: 4,
55 | fallbackWidth: 10,
56 | fallbackHeight: 100,
57 | ),
58 | ),
59 | SizedBox(height: 600)
60 | ],
61 | ),
62 | ),
63 | );
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/lib/page/simpledialog/simple_dialog_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class SimpleDialogPage extends StatefulWidget {
10 | @override
11 | _DialogState createState() => _DialogState();
12 | }
13 |
14 | class _DialogState extends State {
15 | Widget _padDialog() => SimpleDialog(
16 | title: Text(
17 | "Do you know why?",
18 | textAlign: TextAlign.center,
19 | ),
20 | titlePadding: EdgeInsets.symmetric(
21 | horizontal: 30,
22 | vertical: 20,
23 | ),
24 | children: [
25 | Text(
26 | "Sometime,we learn very well,because we want to it.",
27 | textAlign: TextAlign.center,
28 | )
29 | ],
30 | contentPadding: EdgeInsets.symmetric(
31 | horizontal: 40,
32 | vertical: 20,
33 | ),
34 | );
35 |
36 | Widget _colorDialog() => SimpleDialog(
37 | title: Text(
38 | "Message",
39 | textAlign: TextAlign.center,
40 | ),
41 | children: [
42 | Text(
43 | "You must learn it carefully.",
44 | textAlign: TextAlign.center,
45 | ),
46 | ],
47 | backgroundColor: RED,
48 | elevation: 4,
49 | );
50 |
51 | Widget _shapeDialog() => SimpleDialog(
52 | title: Text(
53 | "Be careful!",
54 | textAlign: TextAlign.center,
55 | ),
56 | children: [
57 | Text(
58 | "If you write a message, you should care about the message.",
59 | textAlign: TextAlign.center,
60 | ),
61 | ],
62 | backgroundColor: BLUE_LIGHT,
63 | elevation: 4,
64 | shape: StadiumBorder(
65 | side: BorderSide(
66 | style: BorderStyle.none,
67 | ),
68 | ),
69 | );
70 |
71 | Widget _alertDialog() => AlertDialog(
72 | title: Text(
73 | "How to follow us?",
74 | textAlign: TextAlign.center,
75 | ),
76 | titleTextStyle: TextStyle(
77 | color: TEXT_BLACK, fontSize: 30, fontWeight: FontWeight.w700),
78 | titlePadding: EdgeInsets.symmetric(horizontal: 30, vertical: 20),
79 | content: Text("1. You should login in the facebook.\n"
80 | "2. You should search the Flutter Open.\n"
81 | "3. Then, you can follow the Flutter Open."),
82 | contentPadding: EdgeInsets.symmetric(horizontal: 20, vertical: 20),
83 | contentTextStyle: TextStyle(color: TEXT_BLACK_LIGHT, fontSize: 16),
84 | actions: [
85 | Container(
86 | height: 40,
87 | width: 100,
88 | child: FlatButton(
89 | child: Text(
90 | "Sure",
91 | style: TextStyle(color: TEXT_BLACK_LIGHT),
92 | ),
93 | color: RED_LIGHT,
94 | onPressed: () {
95 | print("Hello");
96 | },
97 | ),
98 | )
99 | ],
100 | shape: RoundedRectangleBorder(
101 | side: BorderSide(
102 | style: BorderStyle.none,
103 | ),
104 | borderRadius: BorderRadius.circular(10)
105 | ),
106 | );
107 |
108 | @override
109 | Widget build(BuildContext context) {
110 | return Scaffold(
111 | appBar: AppBar(
112 | title: Text(PageName.SIMPLE_DIALOG),
113 | ),
114 | body: SingleChildScrollView(
115 | child: Column(
116 | children: [
117 | SimpleDialog(
118 | title: Text("What do we do?"),
119 | children: [
120 | Text("This is our tutorial about the SimpleDialog."),
121 | ],
122 | ),
123 | _padDialog(),
124 | _colorDialog(),
125 | _shapeDialog(),
126 | _alertDialog(),
127 | SizedBox(height: 600),
128 | ],
129 | ),
130 | ),
131 | );
132 | }
133 | }
134 | //SimpleDialog(
135 | //title: Text(
136 | //"Hello world~",
137 | //textAlign: TextAlign.center,
138 | //),
139 | //titlePadding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
140 | //contentPadding:
141 | //EdgeInsets.symmetric(vertical: 10, horizontal: 20),
142 | //backgroundColor: GREEN,
143 | //elevation: 20,
144 | //shape: StadiumBorder(
145 | //side: BorderSide(style: BorderStyle.none),
146 | //),
147 | //children: [
148 | //Text(
149 | //"This is the content of this dialog.",
150 | //textAlign: TextAlign.center,
151 | //),
152 | //],
153 | //),
154 |
--------------------------------------------------------------------------------
/lib/page/slider/slider_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/5/12
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class SliderPage extends StatefulWidget {
10 | @override
11 | SliderState createState() => SliderState();
12 | }
13 |
14 | class SliderState extends State {
15 | double index = 0.0;
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return Scaffold(
20 | appBar: AppBar(
21 | title: Text(PageName.SLIDER),
22 | ),
23 | body: Slider(
24 | value: index < 0.0 ? 0.0 : index,
25 | min: 0.0,
26 | max: 100.0,
27 | onChanged: (double newValue) {
28 | print("newValue= $newValue");
29 | setState(() {
30 | index = newValue;
31 | });
32 | },
33 | label: "${index.round()} Dollar",
34 | onChangeStart: (value) {
35 | print("start = $value");
36 | },
37 | onChangeEnd: (endValue) {
38 | print("end = $endValue");
39 | },
40 | divisions: 100,
41 | semanticFormatterCallback: (value) {
42 | return "$value hello";
43 | },
44 | ),
45 | );
46 | }
47 | }
48 |
49 | //({
50 | //Key key,
51 | //@required this.value,
52 | //@required this.onChanged,
53 | //this.onChangeStart,
54 | //this.onChangeEnd,
55 | //this.min = 0.0,
56 | //this.max = 1.0,
57 | //this.divisions,
58 | //this.label,
59 | //this.activeColor,
60 | //this.inactiveColor,
61 | //this.semanticFormatterCallback,
62 | //})
63 |
--------------------------------------------------------------------------------
/lib/page/snackbar/snack_bar_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class SnackPage extends StatefulWidget {
10 | @override
11 | _SnackState createState() => _SnackState();
12 | }
13 |
14 | class _SnackState extends State {
15 | GlobalKey _key = GlobalKey();
16 |
17 | Widget _snackSample() => SnackBar(
18 | content: Text(
19 | "You have a message!",
20 | style: TextStyle(
21 | color: TEXT_BLACK,
22 | fontSize: 20,
23 | ),
24 | textAlign: TextAlign.center,
25 | ),
26 | backgroundColor: BLUE_LIGHT,
27 | );
28 |
29 | Widget _snackAction() => SnackBar(
30 | content: Text(
31 | "Test the action in the SnackBar.",
32 | style: TextStyle(
33 | color: TEXT_BLACK,
34 | fontSize: 20,
35 | ),
36 | textAlign: TextAlign.center,
37 | ),
38 | action: SnackBarAction(
39 | label: "I Know!",
40 | textColor: Colors.white,
41 | disabledTextColor: TEXT_BLACK_LIGHT,
42 | onPressed: () {
43 | print("I know you are testing the action in the SnackBar!");
44 | },
45 | ),
46 | backgroundColor: BLUE_LIGHT,
47 | );
48 |
49 | Widget _snackDuration() => SnackBar(
50 | content: Text(
51 | "You have a message!",
52 | style: TextStyle(
53 | color: TEXT_BLACK,
54 | fontSize: 20,
55 | ),
56 | textAlign: TextAlign.center,
57 | ),
58 | backgroundColor: BLUE_LIGHT,
59 | duration: Duration(milliseconds: 100),
60 | );
61 |
62 | @override
63 | Widget build(BuildContext context) {
64 | return Scaffold(
65 | key: _key,
66 | appBar: AppBar(
67 | title: Text(PageName.SNACK_BAR),
68 | ),
69 | body: Center(
70 | child: RaisedButton(
71 | onPressed: () {
72 | final bar = _snackAction();
73 | _key.currentState.showSnackBar(bar);
74 | },
75 | child: Text("Show the snack bar"),
76 | color: RED,
77 | ),
78 | ));
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/lib/page/stepper/stepper_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class StepperPage extends StatefulWidget {
10 | @override
11 | _StepperState createState() => _StepperState();
12 | }
13 |
14 | class _StepperState extends State {
15 | var _index = 0;
16 |
17 | Widget _simpleStep() => Container(
18 | color: RED,
19 | child: Stepper(
20 | steps: [
21 | Step(
22 | title: Text("Start"),
23 | content: Text("Before starting, we should create a page."),
24 | ),
25 | Step(
26 | title: Text("Constructor"),
27 | content: Text("Let's look at its construtor."),
28 | ),
29 | ],
30 | ),
31 | );
32 |
33 | Widget _steps() => Container(
34 | margin: EdgeInsets.only(top: 10),
35 | color: GREEN,
36 | child: Stepper(
37 | steps: [
38 | Step(
39 | title: Text("First"),
40 | subtitle: Text("This is our first article"),
41 | content: Text(
42 | "In this article, I will tell you how to create a page."),
43 | ),
44 | Step(
45 | title: Text("Second"),
46 | subtitle: Text("Constructor"),
47 | content: Text("Let's look at its construtor."),
48 | state: StepState.editing,
49 | isActive: true),
50 | Step(
51 | title: Text("Third"),
52 | subtitle: Text("Constructor"),
53 | content: Text("Let's look at its construtor."),
54 | state: StepState.error),
55 | ],
56 | ),
57 | );
58 |
59 | Widget _typeStep() => Container(
60 | margin: EdgeInsets.only(top: 10),
61 | constraints: BoxConstraints.expand(height: 200),
62 | color: BLUE_LIGHT,
63 | child: Stepper(
64 | type: StepperType.horizontal,
65 | steps: [
66 | Step(
67 | title: Text("First"),
68 | content: Text("This is our first example."),
69 | ),
70 | Step(
71 | title: Text("Second"),
72 | content: Text("This is our second example."),
73 | ),
74 | ],
75 | ),
76 | );
77 |
78 | Widget _tabStep() => Container(
79 | margin: EdgeInsets.only(top: 10),
80 | color: PURPLE,
81 | child: Stepper(
82 | steps: [
83 | Step(
84 | title: Text("First"),
85 | content: Text("This is our first example."),
86 | ),
87 | Step(
88 | title: Text("Second"),
89 | content: Text("This is our second example."),
90 | ),
91 | Step(
92 | title: Text("Third"),
93 | content: Text("This is our third example."),
94 | ),
95 | Step(
96 | title: Text("Forth"),
97 | content: Text("This is our forth example."),
98 | ),
99 | ],
100 | currentStep: _index,
101 | onStepTapped: (index) {
102 | setState(() {
103 | _index = index;
104 | });
105 | },
106 | onStepCancel: () {
107 | print("You are clicking the cancel button.");
108 | },
109 | onStepContinue: () {
110 | print("You are clicking the continue button.");
111 | },
112 | ),
113 | );
114 |
115 | Widget _builderStep() => Container(
116 | margin: EdgeInsets.only(top: 10),
117 | color: RED,
118 | child: Stepper(
119 | steps: [
120 | Step(
121 | title: Text("First"),
122 | content: Text("This is our first example."),
123 | ),
124 | Step(
125 | title: Text("Second"),
126 | content: Text("This is our second example."),
127 | ),
128 | Step(
129 | title: Text("Third"),
130 | content: Text("This is our third example."),
131 | ),
132 | Step(
133 | title: Text("Forth"),
134 | content: Text("This is our forth example."),
135 | ),
136 | ],
137 | currentStep: _index,
138 | onStepTapped: (index) {
139 | setState(() {
140 | _index = index;
141 | });
142 | },
143 | controlsBuilder: (BuildContext context,
144 | {VoidCallback onStepContinue, VoidCallback onStepCancel}) =>
145 | Container(),
146 | ),
147 | );
148 |
149 | @override
150 | Widget build(BuildContext context) {
151 | return Scaffold(
152 | appBar: AppBar(
153 | title: Text(PageName.STEPPER),
154 | ),
155 | body: SingleChildScrollView(
156 | child: Column(
157 | children: [
158 | //our code.
159 | _simpleStep(),
160 | _steps(),
161 | _typeStep(),
162 | _tabStep(),
163 | _builderStep(),
164 | SizedBox(height: 600)
165 | ],
166 | ),
167 | ));
168 | }
169 | }
170 |
171 | //Stepper(
172 | //steps: [
173 | //Step(
174 | //title: Text("Start"),
175 | //content: Text(
176 | //"Before start, we should create a page to contain our page."),
177 | //),
178 | //Step(
179 | //title: Text("Construtor"),
180 | //content:
181 | //Text("Flutter open is a community that help people to learn."),
182 | //),
183 | //],
184 | //type: StepperType.vertical,
185 | //currentStep: _index,
186 | //onStepTapped: (index) {
187 | //setState(() {
188 | //_index = index;
189 | //});
190 | //},
191 | //controlsBuilder: (BuildContext context,
192 | //{VoidCallback onStepContinue, VoidCallback onStepCancel}) {
193 | //return Container();
194 | //},
195 | //),
196 |
--------------------------------------------------------------------------------
/lib/page/textfield/text_field_page.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class TextFieldPage extends StatefulWidget {
10 | @override
11 | _TextFieldState createState() => _TextFieldState();
12 | }
13 |
14 | class _TextFieldState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: Text(PageName.TEXT_FIELD),
20 | ),
21 | body: TextField(
22 | controller: TextEditingController(text: "Hello"),
23 | decoration: InputDecoration(
24 | labelText: "World",
25 | helperText: "AAA",
26 | hintText: "HHH",
27 | // errorText: "What?",
28 | hasFloatingPlaceholder: true,
29 | isDense: false,
30 | contentPadding: EdgeInsets.symmetric(vertical: 10),
31 | // prefixText: "name:",
32 | prefixIcon: Icon(Icons.airplanemode_active),
33 | suffixText: "Suf",
34 | suffixIcon: Icon(Icons.forward),
35 | counterText: "1000",
36 | filled: false,
37 | fillColor: RED,
38 | errorBorder:
39 | UnderlineInputBorder(borderRadius: BorderRadius.circular(100)),
40 | semanticCounterText: "semati",
41 | alignLabelWithHint: true),
42 | keyboardType: TextInputType.url,
43 | onTap: () {
44 | print("Tab");
45 | },
46 | onChanged: (value) {
47 | print("value: $value");
48 | },
49 | onSubmitted: (v) {
50 | print("v: $v");
51 | },
52 | ),
53 | );
54 | }
55 | }
56 | //this.icon,
57 | //this.labelText,
58 | //this.labelStyle,
59 | //this.helperText,
60 | //this.helperStyle,
61 | //this.hintText,
62 | //this.hintStyle,
63 | //this.hintMaxLines,
64 | //this.errorText,
65 | //this.errorStyle,
66 | //this.errorMaxLines,
67 | //this.hasFloatingPlaceholder = true,
68 | //this.isDense,
69 | //this.contentPadding,
70 | //this.prefixIcon,
71 | //this.prefix,
72 | //this.prefixText,
73 | //this.prefixStyle,
74 | //this.suffixIcon,
75 | //this.suffix,
76 | //this.suffixText,
77 | //this.suffixStyle,
78 | //this.counterText,
79 | //this.counterStyle,
80 | //this.filled,
81 | //this.fillColor,
82 | //this.errorBorder,
83 | //this.focusedBorder,
84 | //this.focusedErrorBorder,
85 | //this.disabledBorder,
86 | //this.enabledBorder,
87 | //this.border,
88 | //this.enabled = true,
89 | //this.semanticCounterText,
90 | //this.alignLabelWithHint,
91 |
--------------------------------------------------------------------------------
/lib/util/GradientUtil.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2018/12/28
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import "package:flutter/material.dart";
7 | import 'package:flutter_widgets/const/_const.dart';
8 |
9 | class GradientUtil {
10 | static LinearGradient _getLinearGradient(Color left, Color right,
11 | {begin = AlignmentDirectional.centerStart,
12 | end = AlignmentDirectional.centerEnd,
13 | opacity = 1.0}) =>
14 | LinearGradient(
15 | colors: [
16 | left.withOpacity(opacity),
17 | right.withOpacity(opacity),
18 | ],
19 | begin: begin,
20 | end: end,
21 | );
22 |
23 | static LinearGradient yellowGreen(
24 | {begin = AlignmentDirectional.centerStart,
25 | end = AlignmentDirectional.centerEnd,
26 | opacity = 1.0}) =>
27 | _getLinearGradient(YELLOW, GREEN,
28 | begin: begin, end: end, opacity: opacity);
29 |
30 | static LinearGradient red(
31 | {begin = AlignmentDirectional.centerStart,
32 | end = AlignmentDirectional.centerEnd,
33 | opacity = 1.0}) =>
34 | _getLinearGradient(RED_LIGHT, RED,
35 | begin: begin, end: end, opacity: opacity);
36 |
37 | static LinearGradient yellowBlue(
38 | {begin = AlignmentDirectional.centerStart,
39 | end = AlignmentDirectional.centerEnd,
40 | opacity = 1.0}) =>
41 | _getLinearGradient(YELLOW, BLUE,
42 | begin: begin, end: end, opacity: opacity);
43 |
44 | static LinearGradient blue(
45 | {begin = AlignmentDirectional.centerStart,
46 | end = AlignmentDirectional.centerEnd,
47 | opacity = 1.0}) =>
48 | _getLinearGradient(BLUE_LIGHT, BLUE_DEEP,
49 | begin: begin, end: end, opacity: opacity);
50 |
51 | static LinearGradient greenRed(
52 | {begin = AlignmentDirectional.centerStart,
53 | end = AlignmentDirectional.centerEnd,
54 | opacity = 1.0}) =>
55 | _getLinearGradient(GREEN, RED, begin: begin, end: end, opacity: opacity);
56 |
57 | static LinearGradient greenPurple(
58 | {begin = AlignmentDirectional.centerStart,
59 | end = AlignmentDirectional.centerEnd,
60 | opacity = 1.0}) =>
61 | _getLinearGradient(GREEN, PURPLE,
62 | begin: begin, end: end, opacity: opacity);
63 | }
64 |
--------------------------------------------------------------------------------
/lib/util/SizeUtil.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2018/12/26
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 | ///
6 | import 'package:flutter/material.dart';
7 | import 'dart:math';
8 |
9 | class SizeKeyConst {
10 | static const DEVICE_KEY = "device_size";
11 | }
12 |
13 | class SizeUtil {
14 | static Map _keyValues = Map();
15 |
16 | static initDesignSize() {
17 | // getInstance(key: SizeKeyConst.ROUND_ANGLE_KEY).designSize =
18 | // Size(500.0, 500.0);
19 | }
20 |
21 | static SizeUtil getInstance({key = SizeKeyConst.DEVICE_KEY}) {
22 | if (_keyValues.containsKey(key)) {
23 | return _keyValues[key];
24 | } else {
25 | _keyValues[key] = SizeUtil();
26 | return _keyValues[key];
27 | }
28 | }
29 |
30 | Size _designSize;
31 |
32 | set designSize(Size size) {
33 | _designSize = size;
34 | }
35 |
36 | //logic size in device
37 | Size _logicalSize;
38 |
39 | //device pixel radio.
40 |
41 | get width => _logicalSize.width;
42 |
43 | get height => _logicalSize.height;
44 |
45 | set logicSize(Size size) => _logicalSize = size;
46 |
47 | //@param w is the design w;
48 | double getAxisX(double w) {
49 | return (w * width) / _designSize.width;
50 | }
51 |
52 | // the y direction
53 | double getAxisY(double h) {
54 | return (h * height) / _designSize.height;
55 | }
56 |
57 | // diagonal direction value with design size s.
58 | double getAxisBoth(double s) {
59 | return s *
60 | sqrt((width * width + height * height) /
61 | (_designSize.width * _designSize.width +
62 | _designSize.height * _designSize.height));
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/lib/util/_util.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// Created by NieBin on 2019/1/13
3 | /// Github: https://github.com/nb312
4 | /// Email: niebin312@gmail.com
5 |
6 | export "SizeUtil.dart";
7 | export "GradientUtil.dart";
8 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_widgets
2 | description: A new Flutter application.
3 |
4 | # The following defines the version and build number for your application.
5 | # A version number is three numbers separated by dots, like 1.2.43
6 | # followed by an optional build number separated by a +.
7 | # Both the version and the builder number may be overridden in flutter
8 | # build by specifying --build-name and --build-number, respectively.
9 | # Read more about versioning at semver.org.
10 | version: 1.0.0+1
11 |
12 | environment:
13 | sdk: ">=2.0.0-dev.68.0 <3.0.0"
14 |
15 | dependencies:
16 | flutter:
17 | sdk: flutter
18 |
19 | # The following adds the Cupertino Icons font to your application.
20 | # Use with the CupertinoIcons class for iOS style icons.
21 | cupertino_icons: ^0.1.2
22 |
23 | dev_dependencies:
24 | flutter_test:
25 | sdk: flutter
26 |
27 |
28 | # For information on the generic Dart part of this file, see the
29 | # following page: https://www.dartlang.org/tools/pub/pubspec
30 |
31 | # The following section is specific to Flutter.
32 | flutter:
33 |
34 | # The following line ensures that the Material Icons font is
35 | # included with your application, so that you can use the icons in
36 | # the material Icons class.
37 | uses-material-design: true
38 | assets:
39 | - assets/images/
40 | - assets/images/image/
41 | - assets/font/
42 | fonts:
43 | - family: manigu
44 | fonts:
45 | - asset: assets/font/ManigueStaile.ttf
46 |
47 |
48 | # To add assets to your application, add an assets section, like this:
49 | # assets:
50 | # - images/a_dot_burr.jpeg
51 | # - images/a_dot_ham.jpeg
52 |
53 | # An image asset can refer to one or more resolution-specific "variants", see
54 | # https://flutter.io/assets-and-images/#resolution-aware.
55 |
56 | # For details regarding adding assets from package dependencies, see
57 | # https://flutter.io/assets-and-images/#from-packages
58 |
59 | # To add custom fonts to your application, add a fonts section here,
60 | # in this "flutter" section. Each entry in this list should have a
61 | # "family" key with the font family name, and a "fonts" key with a
62 | # list giving the asset and other descriptors for the font. For
63 | # example:
64 | # fonts:
65 | # - family: Schyler
66 | # fonts:
67 | # - asset: fonts/Schyler-Regular.ttf
68 | # - asset: fonts/Schyler-Italic.ttf
69 | # style: italic
70 | # - family: Trajan Pro
71 | # fonts:
72 | # - asset: fonts/TrajanPro.ttf
73 | # - asset: fonts/TrajanPro_Bold.ttf
74 | # weight: 700
75 | #
76 | # For details regarding fonts from package dependencies,
77 | # see https://flutter.io/custom-fonts/#from-packages
78 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:flutter_widgets/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(FlutterOpenApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------