├── .editorconfig
├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── flutter_xmllayout_example
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── app.dart
├── components
│ └── InfiniteListView.dart
├── i18n
│ ├── ar.json
│ ├── en.json
│ └── gen
│ │ ├── delegate.dart
│ │ └── localizations.dart
├── main.dart
├── models
│ ├── ItemModel.dart
│ └── LoginResult.dart
├── pages
│ ├── home
│ │ ├── home.ctrl.dart
│ │ ├── home.xml
│ │ └── home.xml.dart
│ ├── item
│ │ ├── item.ctrl.dart
│ │ ├── item.xml
│ │ └── item.xml.dart
│ ├── list
│ │ ├── list.ctrl.dart
│ │ ├── list.xml
│ │ └── list.xml.dart
│ ├── login
│ │ ├── login.ctrl.dart
│ │ ├── login.xml
│ │ └── login.xml.dart
│ ├── settings
│ │ ├── settings.ctrl.dart
│ │ ├── settings.xml
│ │ └── settings.xml.dart
│ ├── signup
│ │ ├── signup.ctrl.dart
│ │ ├── signup.xml
│ │ └── signup.xml.dart
│ └── tabs
│ │ ├── tabs.ctrl.dart
│ │ ├── tabs.xml
│ │ └── tabs.xml.dart
├── pipes
│ ├── FormatCurrency.dart
│ ├── FormatDate.dart
│ └── Translate.dart
├── routes.dart
└── services
│ ├── AuthService.dart
│ ├── DataService.dart
│ ├── LocaleChanger.dart
│ ├── PersistentStorage.dart
│ └── ThemeChanger.dart
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.editorconfig:
--------------------------------------------------------------------------------
1 |
2 | [*]
3 | indent_style = tab
4 | indent_size = 2
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Symbolication related
37 | app.*.symbols
38 |
39 | # Obfuscation related
40 | app.*.map.json
41 |
42 | # Exceptions to above rules.
43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
44 |
--------------------------------------------------------------------------------
/.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: f7a6a7906be96d2288f5d63a5a54c515a6e987fe
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Waseem
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Flutter XML Layout example
2 |
3 | This is an example of using some features of Flutter XML Layout extension for vscode. The features used are:
4 | - Injecting [providers](https://pub.dev/packages/provider)
5 | - Localization
6 | - Form group & controls & validations
7 | - Passing parameters between pages (widgets)
8 | - Pipes (e.g. translate)
9 | - Custom properties (hero, margin, if, itemBuilder...)
10 | - Animation
11 | - Using mixin(s)
12 |
13 | For more information see the documentation on [github repository](https://github.com/waseemdev/vscode-flutter.xml-layout).
14 | To download the extension go to [vscode marketplace](https://marketplace.visualstudio.com/items?itemName=WaseemDev.flutter-xml-layout).
15 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.example.flutter_xmllayout_example"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | }
47 |
48 | buildTypes {
49 | release {
50 | // TODO: Add your own signing config for the release build.
51 | // Signing with the debug keys for now, so `flutter run --release` works.
52 | signingConfig signingConfigs.debug
53 | }
54 | }
55 | }
56 |
57 | flutter {
58 | source '../..'
59 | }
60 |
61 | dependencies {
62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63 | }
64 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
23 |
27 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/flutter_xmllayout_example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.flutter_xmllayout_example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
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.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/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-5.6.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 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "";
23 | dstSubfolderSpec = 10;
24 | files = (
25 | );
26 | name = "Embed Frameworks";
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXFrameworksBuildPhase section */
56 |
57 | /* Begin PBXGroup section */
58 | 9740EEB11CF90186004384FC /* Flutter */ = {
59 | isa = PBXGroup;
60 | children = (
61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
65 | );
66 | name = Flutter;
67 | sourceTree = "";
68 | };
69 | 97C146E51CF9000F007C117D = {
70 | isa = PBXGroup;
71 | children = (
72 | 9740EEB11CF90186004384FC /* Flutter */,
73 | 97C146F01CF9000F007C117D /* Runner */,
74 | 97C146EF1CF9000F007C117D /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | 97C146EF1CF9000F007C117D /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 97C146EE1CF9000F007C117D /* Runner.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | 97C146F01CF9000F007C117D /* Runner */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
92 | 97C147021CF9000F007C117D /* Info.plist */,
93 | 97C146F11CF9000F007C117D /* Supporting Files */,
94 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
95 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
96 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
97 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
98 | );
99 | path = Runner;
100 | sourceTree = "";
101 | };
102 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
103 | isa = PBXGroup;
104 | children = (
105 | );
106 | name = "Supporting Files";
107 | sourceTree = "";
108 | };
109 | /* End PBXGroup section */
110 |
111 | /* Begin PBXNativeTarget section */
112 | 97C146ED1CF9000F007C117D /* Runner */ = {
113 | isa = PBXNativeTarget;
114 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
115 | buildPhases = (
116 | 9740EEB61CF901F6004384FC /* Run Script */,
117 | 97C146EA1CF9000F007C117D /* Sources */,
118 | 97C146EB1CF9000F007C117D /* Frameworks */,
119 | 97C146EC1CF9000F007C117D /* Resources */,
120 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
121 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
122 | );
123 | buildRules = (
124 | );
125 | dependencies = (
126 | );
127 | name = Runner;
128 | productName = Runner;
129 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
130 | productType = "com.apple.product-type.application";
131 | };
132 | /* End PBXNativeTarget section */
133 |
134 | /* Begin PBXProject section */
135 | 97C146E61CF9000F007C117D /* Project object */ = {
136 | isa = PBXProject;
137 | attributes = {
138 | LastUpgradeCheck = 1020;
139 | ORGANIZATIONNAME = "";
140 | TargetAttributes = {
141 | 97C146ED1CF9000F007C117D = {
142 | CreatedOnToolsVersion = 7.3.1;
143 | LastSwiftMigration = 1100;
144 | };
145 | };
146 | };
147 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
148 | compatibilityVersion = "Xcode 9.3";
149 | developmentRegion = en;
150 | hasScannedForEncodings = 0;
151 | knownRegions = (
152 | en,
153 | Base,
154 | );
155 | mainGroup = 97C146E51CF9000F007C117D;
156 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
157 | projectDirPath = "";
158 | projectRoot = "";
159 | targets = (
160 | 97C146ED1CF9000F007C117D /* Runner */,
161 | );
162 | };
163 | /* End PBXProject section */
164 |
165 | /* Begin PBXResourcesBuildPhase section */
166 | 97C146EC1CF9000F007C117D /* Resources */ = {
167 | isa = PBXResourcesBuildPhase;
168 | buildActionMask = 2147483647;
169 | files = (
170 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
171 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
172 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
173 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
174 | );
175 | runOnlyForDeploymentPostprocessing = 0;
176 | };
177 | /* End PBXResourcesBuildPhase section */
178 |
179 | /* Begin PBXShellScriptBuildPhase section */
180 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
181 | isa = PBXShellScriptBuildPhase;
182 | buildActionMask = 2147483647;
183 | files = (
184 | );
185 | inputPaths = (
186 | );
187 | name = "Thin Binary";
188 | outputPaths = (
189 | );
190 | runOnlyForDeploymentPostprocessing = 0;
191 | shellPath = /bin/sh;
192 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
193 | };
194 | 9740EEB61CF901F6004384FC /* Run Script */ = {
195 | isa = PBXShellScriptBuildPhase;
196 | buildActionMask = 2147483647;
197 | files = (
198 | );
199 | inputPaths = (
200 | );
201 | name = "Run Script";
202 | outputPaths = (
203 | );
204 | runOnlyForDeploymentPostprocessing = 0;
205 | shellPath = /bin/sh;
206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
207 | };
208 | /* End PBXShellScriptBuildPhase section */
209 |
210 | /* Begin PBXSourcesBuildPhase section */
211 | 97C146EA1CF9000F007C117D /* Sources */ = {
212 | isa = PBXSourcesBuildPhase;
213 | buildActionMask = 2147483647;
214 | files = (
215 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
216 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
217 | );
218 | runOnlyForDeploymentPostprocessing = 0;
219 | };
220 | /* End PBXSourcesBuildPhase section */
221 |
222 | /* Begin PBXVariantGroup section */
223 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
224 | isa = PBXVariantGroup;
225 | children = (
226 | 97C146FB1CF9000F007C117D /* Base */,
227 | );
228 | name = Main.storyboard;
229 | sourceTree = "";
230 | };
231 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
232 | isa = PBXVariantGroup;
233 | children = (
234 | 97C147001CF9000F007C117D /* Base */,
235 | );
236 | name = LaunchScreen.storyboard;
237 | sourceTree = "";
238 | };
239 | /* End PBXVariantGroup section */
240 |
241 | /* Begin XCBuildConfiguration section */
242 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
243 | isa = XCBuildConfiguration;
244 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
245 | buildSettings = {
246 | ALWAYS_SEARCH_USER_PATHS = NO;
247 | CLANG_ANALYZER_NONNULL = YES;
248 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
249 | CLANG_CXX_LIBRARY = "libc++";
250 | CLANG_ENABLE_MODULES = YES;
251 | CLANG_ENABLE_OBJC_ARC = YES;
252 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
253 | CLANG_WARN_BOOL_CONVERSION = YES;
254 | CLANG_WARN_COMMA = YES;
255 | CLANG_WARN_CONSTANT_CONVERSION = YES;
256 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
258 | CLANG_WARN_EMPTY_BODY = YES;
259 | CLANG_WARN_ENUM_CONVERSION = YES;
260 | CLANG_WARN_INFINITE_RECURSION = YES;
261 | CLANG_WARN_INT_CONVERSION = YES;
262 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
263 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
264 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
265 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
266 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
267 | CLANG_WARN_STRICT_PROTOTYPES = YES;
268 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
269 | CLANG_WARN_UNREACHABLE_CODE = YES;
270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
271 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
272 | COPY_PHASE_STRIP = NO;
273 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
274 | ENABLE_NS_ASSERTIONS = NO;
275 | ENABLE_STRICT_OBJC_MSGSEND = YES;
276 | GCC_C_LANGUAGE_STANDARD = gnu99;
277 | GCC_NO_COMMON_BLOCKS = YES;
278 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
279 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
280 | GCC_WARN_UNDECLARED_SELECTOR = YES;
281 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
282 | GCC_WARN_UNUSED_FUNCTION = YES;
283 | GCC_WARN_UNUSED_VARIABLE = YES;
284 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
285 | MTL_ENABLE_DEBUG_INFO = NO;
286 | SDKROOT = iphoneos;
287 | SUPPORTED_PLATFORMS = iphoneos;
288 | TARGETED_DEVICE_FAMILY = "1,2";
289 | VALIDATE_PRODUCT = YES;
290 | };
291 | name = Profile;
292 | };
293 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
294 | isa = XCBuildConfiguration;
295 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
296 | buildSettings = {
297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
298 | CLANG_ENABLE_MODULES = YES;
299 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
300 | ENABLE_BITCODE = NO;
301 | FRAMEWORK_SEARCH_PATHS = (
302 | "$(inherited)",
303 | "$(PROJECT_DIR)/Flutter",
304 | );
305 | INFOPLIST_FILE = Runner/Info.plist;
306 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
307 | LIBRARY_SEARCH_PATHS = (
308 | "$(inherited)",
309 | "$(PROJECT_DIR)/Flutter",
310 | );
311 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterXmllayoutExample;
312 | PRODUCT_NAME = "$(TARGET_NAME)";
313 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
314 | SWIFT_VERSION = 5.0;
315 | VERSIONING_SYSTEM = "apple-generic";
316 | };
317 | name = Profile;
318 | };
319 | 97C147031CF9000F007C117D /* Debug */ = {
320 | isa = XCBuildConfiguration;
321 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
322 | buildSettings = {
323 | ALWAYS_SEARCH_USER_PATHS = NO;
324 | CLANG_ANALYZER_NONNULL = YES;
325 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
326 | CLANG_CXX_LIBRARY = "libc++";
327 | CLANG_ENABLE_MODULES = YES;
328 | CLANG_ENABLE_OBJC_ARC = YES;
329 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
330 | CLANG_WARN_BOOL_CONVERSION = YES;
331 | CLANG_WARN_COMMA = YES;
332 | CLANG_WARN_CONSTANT_CONVERSION = YES;
333 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
335 | CLANG_WARN_EMPTY_BODY = YES;
336 | CLANG_WARN_ENUM_CONVERSION = YES;
337 | CLANG_WARN_INFINITE_RECURSION = YES;
338 | CLANG_WARN_INT_CONVERSION = YES;
339 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
340 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
341 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
342 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
343 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
344 | CLANG_WARN_STRICT_PROTOTYPES = YES;
345 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
346 | CLANG_WARN_UNREACHABLE_CODE = YES;
347 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
348 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
349 | COPY_PHASE_STRIP = NO;
350 | DEBUG_INFORMATION_FORMAT = dwarf;
351 | ENABLE_STRICT_OBJC_MSGSEND = YES;
352 | ENABLE_TESTABILITY = YES;
353 | GCC_C_LANGUAGE_STANDARD = gnu99;
354 | GCC_DYNAMIC_NO_PIC = NO;
355 | GCC_NO_COMMON_BLOCKS = YES;
356 | GCC_OPTIMIZATION_LEVEL = 0;
357 | GCC_PREPROCESSOR_DEFINITIONS = (
358 | "DEBUG=1",
359 | "$(inherited)",
360 | );
361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
363 | GCC_WARN_UNDECLARED_SELECTOR = YES;
364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
365 | GCC_WARN_UNUSED_FUNCTION = YES;
366 | GCC_WARN_UNUSED_VARIABLE = YES;
367 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
368 | MTL_ENABLE_DEBUG_INFO = YES;
369 | ONLY_ACTIVE_ARCH = YES;
370 | SDKROOT = iphoneos;
371 | TARGETED_DEVICE_FAMILY = "1,2";
372 | };
373 | name = Debug;
374 | };
375 | 97C147041CF9000F007C117D /* Release */ = {
376 | isa = XCBuildConfiguration;
377 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
378 | buildSettings = {
379 | ALWAYS_SEARCH_USER_PATHS = NO;
380 | CLANG_ANALYZER_NONNULL = YES;
381 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
382 | CLANG_CXX_LIBRARY = "libc++";
383 | CLANG_ENABLE_MODULES = YES;
384 | CLANG_ENABLE_OBJC_ARC = YES;
385 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
386 | CLANG_WARN_BOOL_CONVERSION = YES;
387 | CLANG_WARN_COMMA = YES;
388 | CLANG_WARN_CONSTANT_CONVERSION = YES;
389 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
390 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
391 | CLANG_WARN_EMPTY_BODY = YES;
392 | CLANG_WARN_ENUM_CONVERSION = YES;
393 | CLANG_WARN_INFINITE_RECURSION = YES;
394 | CLANG_WARN_INT_CONVERSION = YES;
395 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
396 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
397 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
398 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
399 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
400 | CLANG_WARN_STRICT_PROTOTYPES = YES;
401 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
402 | CLANG_WARN_UNREACHABLE_CODE = YES;
403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
405 | COPY_PHASE_STRIP = NO;
406 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
407 | ENABLE_NS_ASSERTIONS = NO;
408 | ENABLE_STRICT_OBJC_MSGSEND = YES;
409 | GCC_C_LANGUAGE_STANDARD = gnu99;
410 | GCC_NO_COMMON_BLOCKS = YES;
411 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
412 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
413 | GCC_WARN_UNDECLARED_SELECTOR = YES;
414 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
415 | GCC_WARN_UNUSED_FUNCTION = YES;
416 | GCC_WARN_UNUSED_VARIABLE = YES;
417 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
418 | MTL_ENABLE_DEBUG_INFO = NO;
419 | SDKROOT = iphoneos;
420 | SUPPORTED_PLATFORMS = iphoneos;
421 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
422 | TARGETED_DEVICE_FAMILY = "1,2";
423 | VALIDATE_PRODUCT = YES;
424 | };
425 | name = Release;
426 | };
427 | 97C147061CF9000F007C117D /* Debug */ = {
428 | isa = XCBuildConfiguration;
429 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
430 | buildSettings = {
431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
432 | CLANG_ENABLE_MODULES = YES;
433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
434 | ENABLE_BITCODE = NO;
435 | FRAMEWORK_SEARCH_PATHS = (
436 | "$(inherited)",
437 | "$(PROJECT_DIR)/Flutter",
438 | );
439 | INFOPLIST_FILE = Runner/Info.plist;
440 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
441 | LIBRARY_SEARCH_PATHS = (
442 | "$(inherited)",
443 | "$(PROJECT_DIR)/Flutter",
444 | );
445 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterXmllayoutExample;
446 | PRODUCT_NAME = "$(TARGET_NAME)";
447 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
448 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
449 | SWIFT_VERSION = 5.0;
450 | VERSIONING_SYSTEM = "apple-generic";
451 | };
452 | name = Debug;
453 | };
454 | 97C147071CF9000F007C117D /* Release */ = {
455 | isa = XCBuildConfiguration;
456 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
457 | buildSettings = {
458 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
459 | CLANG_ENABLE_MODULES = YES;
460 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
461 | ENABLE_BITCODE = NO;
462 | FRAMEWORK_SEARCH_PATHS = (
463 | "$(inherited)",
464 | "$(PROJECT_DIR)/Flutter",
465 | );
466 | INFOPLIST_FILE = Runner/Info.plist;
467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
468 | LIBRARY_SEARCH_PATHS = (
469 | "$(inherited)",
470 | "$(PROJECT_DIR)/Flutter",
471 | );
472 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterXmllayoutExample;
473 | PRODUCT_NAME = "$(TARGET_NAME)";
474 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
475 | SWIFT_VERSION = 5.0;
476 | VERSIONING_SYSTEM = "apple-generic";
477 | };
478 | name = Release;
479 | };
480 | /* End XCBuildConfiguration section */
481 |
482 | /* Begin XCConfigurationList section */
483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
484 | isa = XCConfigurationList;
485 | buildConfigurations = (
486 | 97C147031CF9000F007C117D /* Debug */,
487 | 97C147041CF9000F007C117D /* Release */,
488 | 249021D3217E4FDB00AE95B9 /* Profile */,
489 | );
490 | defaultConfigurationIsVisible = 0;
491 | defaultConfigurationName = Release;
492 | };
493 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
494 | isa = XCConfigurationList;
495 | buildConfigurations = (
496 | 97C147061CF9000F007C117D /* Debug */,
497 | 97C147071CF9000F007C117D /* Release */,
498 | 249021D4217E4FDB00AE95B9 /* Profile */,
499 | );
500 | defaultConfigurationIsVisible = 0;
501 | defaultConfigurationName = Release;
502 | };
503 | /* End XCConfigurationList section */
504 | };
505 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
506 | }
507 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/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/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waseemdev/flutter_xmllayout_example/6dc567a41863ca65d4bda23c370d41e7a0072ae9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_xmllayout_example
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/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/app.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_localizations/flutter_localizations.dart';
3 | import 'package:flutter_xmllayout_example/routes.dart';
4 | import 'package:provider/provider.dart';
5 |
6 | import 'i18n/gen/delegate.dart';
7 | import 'pages/home/home.xml.dart';
8 | import 'services/LocaleChanger.dart';
9 | import 'services/ThemeChanger.dart';
10 |
11 | class MyApp extends StatelessWidget {
12 |
13 | const MyApp({
14 | Key key,
15 | this.routeObserver
16 | }) : super(key: key);
17 |
18 | final RouteObserver routeObserver;
19 |
20 | // This widget is the root of your application.
21 | @override
22 | Widget build(BuildContext context) {
23 | final localeChanger = Provider.of(context);
24 | final themeChanger = Provider.of(context);
25 |
26 | return MaterialApp(
27 | navigatorObservers: [routeObserver],
28 | title: 'Flutter Demo',
29 |
30 | //
31 | // theme
32 | //
33 | theme: themeChanger.theme,
34 |
35 | //
36 | // localization
37 | //
38 | localizationsDelegates: [
39 | GlobalMaterialLocalizations.delegate,
40 | GlobalWidgetsLocalizations.delegate,
41 | AppLocalizationsDelegate()
42 | ],
43 | supportedLocales: [Locale('en'), Locale('ar')],
44 | locale: localeChanger.locale,
45 |
46 | //
47 | // routing
48 | //
49 | onGenerateRoute: (RouteSettings settings) {
50 | return getRoute(settings);
51 | },
52 |
53 | home: HomePage(),
54 | );
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/lib/components/InfiniteListView.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:rxdart/rxdart.dart';
3 |
4 | typedef LoadMore = Future Function();
5 |
6 | typedef OnLoadMore = void Function();
7 |
8 | typedef ItemCount = int Function();
9 |
10 | typedef HasMore = bool Function();
11 |
12 | typedef OnLoadMoreFinished = void Function();
13 |
14 | /// A list view that can be used for incrementally loading items when the user scrolls.
15 | /// This is an extension of the ListView widget that uses the ListView.builder constructor.
16 | class InfiniteListView extends StatefulWidget {
17 | /// A callback that indicates if the collection associated with the ListView has more items that should be loaded
18 | final HasMore hasMore;
19 |
20 | /// A callback to an asynchronous function that would load more items
21 | final LoadMore loadMore;
22 |
23 | /// Determines when the list view should attempt to load more items based on of the index of the item is scrolling into view
24 | /// This is relative to the bottom of the list and has a default value of 0 so that it loads when the last item within the list view scrolls into view.
25 | /// As an example, setting this to 1 would attempt to load more items when the second last item within the list view scrolls into view
26 | final int loadMoreOffsetFromBottom;
27 | final Key key2;
28 | final Axis scrollDirection;
29 | final bool reverse;
30 | final ScrollController controller;
31 | final bool primary;
32 | final ScrollPhysics physics;
33 | final bool shrinkWrap;
34 | final EdgeInsetsGeometry padding;
35 | final double itemExtent;
36 | final IndexedWidgetBuilder itemBuilder;
37 | final AnimatedListItemBuilder animatedItemBuilder;
38 | final ItemCount itemCount;
39 | final Widget bottomWidget;
40 | final Widget topWidget;
41 | final bool addAutomaticKeepAlives;
42 | final bool addRepaintBoundaries;
43 | final double cacheExtent;
44 | final SliverGridDelegate gridDelegate;
45 | final int gridCrossAxisCount;
46 |
47 | /// A callback that is triggered when more items are being loaded
48 | final OnLoadMore onLoadMore;
49 |
50 | /// A callback that is triggered when items have finished being loaded
51 | final OnLoadMoreFinished onLoadMoreFinished;
52 |
53 | InfiniteListView(
54 | {@required this.hasMore,
55 | @required this.loadMore,
56 | this.loadMoreOffsetFromBottom = 0,
57 | this.key2,
58 | this.scrollDirection = Axis.vertical,
59 | this.reverse = false,
60 | this.controller,
61 | this.primary,
62 | this.physics,
63 | this.shrinkWrap = false,
64 | this.padding,
65 | this.itemExtent,
66 | this.itemBuilder,
67 | @required this.itemCount,
68 | this.animatedItemBuilder,
69 | this.bottomWidget,
70 | this.topWidget,
71 | this.gridDelegate,
72 | this.gridCrossAxisCount,
73 | this.addAutomaticKeepAlives = true,
74 | this.addRepaintBoundaries = true,
75 | this.cacheExtent,
76 | this.onLoadMore,
77 | this.onLoadMoreFinished});
78 |
79 | @override
80 | _InfiniteListViewState createState() => _InfiniteListViewState();
81 | }
82 |
83 | class _InfiniteListViewState extends State {
84 | bool _loadingMore = false;
85 | final PublishSubject _loadingMoreSubject = PublishSubject();
86 | Stream _loadingMoreStream;
87 |
88 | _InfiniteListViewState() {
89 | _loadingMoreStream =
90 | _loadingMoreSubject.switchMap((shouldLoadMore) => loadMore());
91 | }
92 |
93 | int _additionalWidgetsCount() {
94 | int res = widget.bottomWidget == null ? 0 : 1;
95 | res += widget.topWidget == null ? 0 : 1;
96 | return res;
97 | }
98 |
99 | int _itemCount() {
100 | return widget.itemCount() + _additionalWidgetsCount();
101 | }
102 |
103 | @override
104 | Widget build(BuildContext context) {
105 | return StreamBuilder(
106 | stream: _loadingMoreStream,
107 | builder: (context, snapshot) {
108 | return _buildListView();
109 | });
110 | }
111 |
112 | Widget _buildListView() {
113 | return ListView.builder(
114 | key: widget.key2,
115 | controller: widget.controller,
116 | scrollDirection: widget.scrollDirection,
117 | reverse: widget.reverse,
118 | primary: widget.primary,
119 | physics: widget.physics,
120 | shrinkWrap: widget.shrinkWrap,
121 | padding: widget.padding,
122 | itemExtent: widget.itemExtent,
123 | itemCount: _itemCount(),
124 | addAutomaticKeepAlives: widget.addAutomaticKeepAlives,
125 | addRepaintBoundaries: widget.addRepaintBoundaries,
126 | cacheExtent: widget.cacheExtent,
127 | itemBuilder: _itemBuilder
128 | );
129 | }
130 |
131 | Widget _itemBuilder(itemBuilderContext, index) {
132 | // if (widget.startAtIndex.value > -1) {
133 | // index += widget.startAtIndex.value;
134 |
135 | // if (index == widget.startAtIndex.itemsCount - _additionalWidgetsCount()) {
136 | // widget.startAtIndex.value = -1;
137 | // }
138 | // }
139 | if (!_loadingMore &&
140 | index == _itemCount() - widget.loadMoreOffsetFromBottom - _additionalWidgetsCount() &&
141 | widget.hasMore()) {
142 | _loadingMore = true;
143 | _loadingMoreSubject.add(true);
144 | }
145 |
146 | if (!_loadingMore && index == 0 && widget.topWidget != null) {
147 | return widget.topWidget;
148 | }
149 |
150 | if (index == _itemCount() - _additionalWidgetsCount() + (widget.topWidget != null ? 1 : 0)) {
151 | if (_loadingMore) {
152 | return widget.bottomWidget;
153 | }
154 | return null;
155 | }
156 |
157 | // decrement index
158 | index -= !_loadingMore && widget.topWidget != null ? 1 : 0;
159 |
160 | return widget.itemBuilder(itemBuilderContext, index);
161 | }
162 |
163 | Stream loadMore() async* {
164 | yield _loadingMore;
165 | if (widget.onLoadMore != null) {
166 | widget.onLoadMore();
167 | }
168 | await widget.loadMore();
169 | _loadingMore = false;
170 | yield _loadingMore;
171 | if (widget.onLoadMoreFinished != null) {
172 | widget.onLoadMoreFinished();
173 | }
174 | }
175 |
176 | @override
177 | void dispose() {
178 | _loadingMoreSubject.close();
179 | super.dispose();
180 | }
181 | }
--------------------------------------------------------------------------------
/lib/i18n/ar.json:
--------------------------------------------------------------------------------
1 | {
2 | "home": "الرئيسية",
3 | "login": "تسجيل دخول",
4 | "signup": "إنشاء حساب",
5 | "settings": "إعدادات",
6 | "list": "List page",
7 | "item": "Detail page",
8 | "Tabs": "Tabs page",
9 |
10 | "validations/password-length": "Passwords must be 8 charachter at least",
11 | "validations/password-not-match": "Passwords don't match",
12 | "validations/invalid-email": "Invalid email address",
13 | "required": "Required field"
14 | }
--------------------------------------------------------------------------------
/lib/i18n/en.json:
--------------------------------------------------------------------------------
1 | {
2 | "home": "Home",
3 | "login": "Login",
4 | "signup": "Signup",
5 | "settings": "Settings",
6 | "list": "List page",
7 | "item": "Detail page",
8 | "Tabs": "Tabs page",
9 |
10 | "validations/password-length": "Passwords must be 8 charachter at least",
11 | "validations/password-not-match": "Passwords don't match",
12 | "validations/invalid-email": "Invalid email address",
13 | "required": "Required field"
14 | }
--------------------------------------------------------------------------------
/lib/i18n/gen/delegate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/widgets.dart';
3 | import 'localizations.dart';
4 |
5 | class AppLocalizationsDelegate extends LocalizationsDelegate {
6 | const AppLocalizationsDelegate();
7 |
8 | @override
9 | bool isSupported(Locale locale) => ["ar", "en"].contains(locale.languageCode);
10 |
11 | @override
12 | Future load(Locale locale) {
13 | // Returning a SynchronousFuture here because an async "load" operation
14 | // isn't needed to produce an instance of AppLocalizations.
15 | return SynchronousFuture(AppLocalizations(locale));
16 | }
17 |
18 | @override
19 | bool shouldReload(AppLocalizationsDelegate old) => false;
20 | }
--------------------------------------------------------------------------------
/lib/i18n/gen/localizations.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 |
3 | class AppLocalizations {
4 | AppLocalizations(this.locale);
5 |
6 | final Locale locale;
7 |
8 | String getTranslation(String key) {
9 | final lang = _localizedValues[locale.languageCode];
10 | if (lang != null) {
11 | return lang[key];
12 | }
13 | return null;
14 | }
15 |
16 | static AppLocalizations of(BuildContext context) {
17 | return Localizations.of(context, AppLocalizations);
18 | }
19 |
20 | static Map> _localizedValues = {
21 | "ar": {
22 | "home": "الرئيسية",
23 | "login": "تسجيل دخول",
24 | "signup": "إنشاء حساب",
25 | "settings": "إعدادات",
26 | "list": "List page",
27 | "item": "Detail page",
28 | "Tabs": "Tabs page",
29 | "validations/password-length": "Passwords must be 8 charachter at least",
30 | "validations/password-not-match": "Passwords don't match",
31 | "validations/invalid-email": "Invalid email address",
32 | "required": "Required field"
33 | },
34 | "en": {
35 | "home": "Home",
36 | "login": "Login",
37 | "signup": "Signup",
38 | "settings": "Settings",
39 | "list": "List page",
40 | "item": "Detail page",
41 | "Tabs": "Tabs page",
42 | "validations/password-length": "Passwords must be 8 charachter at least",
43 | "validations/password-not-match": "Passwords don't match",
44 | "validations/invalid-email": "Invalid email address",
45 | "required": "Required field"
46 | }
47 | };
48 | }
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
3 | import 'package:provider/provider.dart';
4 | import 'package:shared_preferences/shared_preferences.dart';
5 |
6 | import 'app.dart';
7 | import 'pipes/FormatCurrency.dart';
8 | import 'pipes/FormatDate.dart';
9 | import 'pipes/Translate.dart';
10 | import 'services/AuthService.dart';
11 | import 'services/DataService.dart';
12 | import 'services/LocaleChanger.dart';
13 | import 'services/PersistentStorage.dart';
14 | import 'services/ThemeChanger.dart';
15 |
16 | void main() async {
17 | WidgetsFlutterBinding.ensureInitialized();
18 |
19 | final RouteObserver routeObserver = new RouteObserver();
20 | final _prefs = await SharedPreferences.getInstance();
21 |
22 | final persistentStorage = PersistentStorage(_prefs);
23 | final authService = AuthService(persistentStorage);
24 | authService.coldLogin();
25 |
26 | runApp(
27 | MultiProvider(
28 | //
29 | // registering dependencies
30 | //
31 | providers: [
32 | Provider>.value(value: routeObserver),
33 | Provider(create: (context) => _createPipeProvider()),
34 | Provider.value(value: persistentStorage),
35 | ChangeNotifierProvider(create: (_) => LocaleChanger(persistentStorage)),
36 | ChangeNotifierProvider(create: (_) => ThemeChanger(persistentStorage)),
37 | Provider.value(value: authService),
38 | Provider(create: (_) => DataService()),
39 | ],
40 | child: MyApp(routeObserver: routeObserver)
41 | )
42 | );
43 | }
44 |
45 | PipeProvider _createPipeProvider() {
46 | final PipeProvider pipeProvider = PipeProvider();
47 |
48 | //
49 | // registering pipes
50 | //
51 | pipeProvider.register(TranslatePipe());
52 | pipeProvider.register(FormatDatePipe());
53 | pipeProvider.register(FormatCurrencyPipe());
54 |
55 | return pipeProvider;
56 | }
57 |
--------------------------------------------------------------------------------
/lib/models/ItemModel.dart:
--------------------------------------------------------------------------------
1 |
2 | class ItemModel {
3 | final int id;
4 | final String title;
5 | final String imageUrl;
6 |
7 | ItemModel({this.id, this.title, this.imageUrl});
8 | }
9 |
--------------------------------------------------------------------------------
/lib/models/LoginResult.dart:
--------------------------------------------------------------------------------
1 |
2 | class LoginResult {
3 | String token;
4 | String error;
5 | bool succeeded;
6 | LoginResult({this.token, this.error, this.succeeded});
7 | }
8 |
--------------------------------------------------------------------------------
/lib/pages/home/home.ctrl.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'home.xml.dart';
3 |
4 | class HomeController extends HomeControllerBase {
5 |
6 | gotoLogin(context) {
7 | Navigator.of(context).pushNamed('/login');
8 | }
9 |
10 | gotoList(context) {
11 | Navigator.of(context).pushNamed('/list');
12 | }
13 |
14 | gotoSignup(context) {
15 | Navigator.of(context).pushNamed('/signup');
16 | }
17 |
18 | gotoSettings(context) {
19 | Navigator.of(context).pushNamed('/settings');
20 | }
21 |
22 | gotoTabs(context) {
23 | Navigator.of(context).pushNamed('/tabs');
24 | }
25 |
26 | @override
27 | void didLoad(BuildContext context) {
28 | }
29 |
30 | @override
31 | void onBuild(BuildContext context) {
32 | }
33 |
34 | @override
35 | void afterFirstBuild(BuildContext context) {
36 | }
37 |
38 | @override
39 | void dispose() {
40 | super.dispose();
41 | }
42 | }
--------------------------------------------------------------------------------
/lib/pages/home/home.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/lib/pages/home/home.xml.dart:
--------------------------------------------------------------------------------
1 | import 'home.ctrl.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
4 | import 'package:provider/provider.dart';
5 |
6 | class HomePage extends StatefulWidget {
7 |
8 | HomePage(
9 |
10 | );
11 |
12 | @override
13 | _HomePageState createState() => _HomePageState();
14 | }
15 |
16 | class _HomePageState extends State {
17 | HomeController ctrl;
18 |
19 |
20 | @override
21 | void initState() {
22 | super.initState();
23 | ctrl = new HomeController();
24 | WidgetsBinding.instance.addPostFrameCallback((_) => ctrl.afterFirstBuild(context));
25 | }
26 |
27 | @override
28 | void didChangeDependencies() {
29 | super.didChangeDependencies();
30 | ctrl._load(context);
31 | }
32 |
33 | @override
34 | void dispose() {
35 | ctrl.dispose();
36 | super.dispose();
37 | }
38 |
39 | @override
40 | Widget build(BuildContext context) {
41 | final _pipeProvider = Provider.of(context);
42 | final __widget = Scaffold(
43 | appBar: AppBar(
44 | title: Text(
45 | _pipeProvider.transform(context, "translate", 'home', []),
46 | ),
47 | ),
48 | body: Column(
49 | crossAxisAlignment: CrossAxisAlignment.center,
50 | mainAxisAlignment: MainAxisAlignment.center,
51 | children: [
52 | Padding(
53 | padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
54 | child: SizedBox(
55 | width: _pipeProvider.transform(context, "widthPercent", 100, []),
56 | child: RaisedButton(
57 | onPressed: () => ctrl.gotoLogin(context),
58 | child: Text(
59 | _pipeProvider.transform(context, "translate", 'login', []),
60 | ),
61 | ),
62 | ),
63 | ),
64 | Padding(
65 | padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
66 | child: SizedBox(
67 | width: _pipeProvider.transform(context, "widthPercent", 75, []),
68 | child: RaisedButton(
69 | onPressed: () => ctrl.gotoSignup(context),
70 | child: Text(
71 | _pipeProvider.transform(context, "translate", 'signup', []),
72 | ),
73 | ),
74 | ),
75 | ),
76 | Padding(
77 | padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
78 | child: SizedBox(
79 | width: _pipeProvider.transform(context, "widthPercent", 100, []),
80 | child: RaisedButton(
81 | onPressed: () => ctrl.gotoList(context),
82 | child: Text(
83 | _pipeProvider.transform(context, "translate", 'list', []),
84 | ),
85 | ),
86 | ),
87 | ),
88 | Padding(
89 | padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
90 | child: SizedBox(
91 | width: _pipeProvider.transform(context, "widthPercent", 75, []),
92 | child: RaisedButton(
93 | onPressed: () => ctrl.gotoSettings(context),
94 | child: Text(
95 | _pipeProvider.transform(context, "translate", 'settings', []),
96 | ),
97 | ),
98 | ),
99 | ),
100 | Padding(
101 | padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
102 | child: SizedBox(
103 | width: _pipeProvider.transform(context, "widthPercent", 75, []),
104 | child: RaisedButton(
105 | onPressed: () => ctrl.gotoTabs(context),
106 | child: Text(
107 | _pipeProvider.transform(context, "translate", 'tabs', []),
108 | ),
109 | ),
110 | ),
111 | ),
112 | ],
113 | ),
114 | );
115 | return __widget;
116 | }
117 | }
118 |
119 | class HomeControllerBase {
120 | bool _loaded = false;
121 |
122 |
123 | void _load(BuildContext context) {
124 | if (!_loaded) {
125 | _loaded = true;
126 | didLoad(context);
127 | }
128 |
129 | onBuild(context);
130 | }
131 |
132 | void didLoad(BuildContext context) {
133 | }
134 |
135 | void onBuild(BuildContext context) {
136 | }
137 |
138 | void afterFirstBuild(BuildContext context) {
139 | }
140 |
141 |
142 | @mustCallSuper
143 | void dispose() {
144 |
145 | }
146 | }
--------------------------------------------------------------------------------
/lib/pages/item/item.ctrl.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'item.xml.dart';
3 |
4 | class ItemPageController extends ItemPageControllerBase {
5 |
6 | animatePosition() {
7 | return Tween(
8 | begin: Offset(-1.1, 0),
9 | end: Offset(0, 0),
10 | ).animate(
11 | CurvedAnimation(
12 | // curve: Curves.easeOutCubic,
13 | curve: Interval(.5, 1, curve: Curves.easeOutCubic),
14 | parent: animation,
15 | ),
16 | );
17 | }
18 |
19 | @override
20 | void didLoad(BuildContext context) {
21 | }
22 |
23 | @override
24 | void onBuild(BuildContext context) {
25 | }
26 |
27 | @override
28 | void afterFirstBuild(BuildContext context) {
29 | }
30 |
31 | @override
32 | void dispose() {
33 | super.dispose();
34 | }
35 | }
--------------------------------------------------------------------------------
/lib/pages/item/item.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/lib/pages/item/item.xml.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_xmllayout_example/models/ItemModel.dart';
2 | import 'item.ctrl.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | class ItemPage extends StatefulWidget {
8 | final ItemModel item;
9 | final Animation animation;
10 | ItemPage({
11 | @required this.item,
12 | this.animation
13 | });
14 |
15 | @override
16 | _ItemPageState createState() => _ItemPageState();
17 | }
18 |
19 | class _ItemPageState extends State {
20 | ItemPageController ctrl;
21 |
22 |
23 | @override
24 | void initState() {
25 | super.initState();
26 | ctrl = new ItemPageController();
27 | ctrl._item = widget.item;
28 | ctrl._animation = widget.animation;
29 | WidgetsBinding.instance.addPostFrameCallback((_) => ctrl.afterFirstBuild(context));
30 | }
31 |
32 | @override
33 | void didChangeDependencies() {
34 | super.didChangeDependencies();
35 | ctrl._load(context);
36 | }
37 |
38 | @override
39 | void dispose() {
40 | ctrl.dispose();
41 | super.dispose();
42 | }
43 |
44 | @override
45 | Widget build(BuildContext context) {
46 | final _pipeProvider = Provider.of(context);
47 | final __widget = Scaffold(
48 | appBar: AppBar(
49 | title: Text(
50 | _pipeProvider.transform(context, "translate", 'item', []),
51 | ),
52 | ),
53 | body: Card(
54 | child: Column(
55 | crossAxisAlignment: CrossAxisAlignment.center,
56 | children: [
57 | Hero(
58 | tag: widget.item.imageUrl + widget.item.id.toString(),
59 | child: Image.network(
60 | widget.item.imageUrl,
61 | fit: BoxFit.cover,
62 | height: 400,
63 | width: _pipeProvider.transform(context, "widthPercent", 100, []),
64 | ),
65 | ),
66 | AnimatedBuilder(
67 | animation: widget.animation,
68 | builder: (context, child) {
69 | return SlideTransition(
70 | position: ctrl.animatePosition(),
71 | child: Container(
72 | color: Colors.grey.shade300,
73 | height: 80,
74 | margin: const EdgeInsets.fromLTRB(0, 10, 0, 0),
75 | width: _pipeProvider.transform(context, "widthPercent", 100, []),
76 | child: Center(
77 | child: Text(
78 | widget.item.title,
79 | style: TextStyle(
80 | fontSize: 20,
81 | ),
82 | ),
83 | ),
84 | ),
85 | );
86 | },
87 | ),
88 | ],
89 | ),
90 | ),
91 | );
92 | return __widget;
93 | }
94 | }
95 |
96 | class ItemPageControllerBase {
97 | bool _loaded = false;
98 | ItemModel _item;
99 | ItemModel get item => _item;
100 | Animation _animation;
101 | Animation get animation => _animation;
102 |
103 | void _load(BuildContext context) {
104 | if (!_loaded) {
105 | _loaded = true;
106 | didLoad(context);
107 | }
108 |
109 | onBuild(context);
110 | }
111 |
112 | void didLoad(BuildContext context) {
113 | }
114 |
115 | void onBuild(BuildContext context) {
116 | }
117 |
118 | void afterFirstBuild(BuildContext context) {
119 | }
120 |
121 |
122 | @mustCallSuper
123 | void dispose() {
124 |
125 | }
126 | }
--------------------------------------------------------------------------------
/lib/pages/list/list.ctrl.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:flutter_xmllayout_example/models/ItemModel.dart';
3 | import 'list.xml.dart';
4 |
5 | class ListController extends ListControllerBase {
6 | List items = [];
7 | bool _hasMore = true;
8 | int _page = 0;
9 |
10 |
11 | bool hasMore() {
12 | return _hasMore;
13 | }
14 |
15 | Future loadMore() async {
16 | final res = await dataService.loadItems(++_page);
17 | if (res.length == 0) {
18 | _hasMore = false;
19 | }
20 | items.addAll(res);
21 | }
22 |
23 | int getItemCount() {
24 | return items.length;
25 | }
26 |
27 | Future refreshData() async {
28 | _page = 0;
29 | items = await dataService.loadItems(_page);
30 | }
31 |
32 | gotoItem(ItemModel item, context) {
33 | Navigator.of(context).pushNamed('/item', arguments: item);
34 | }
35 |
36 | @override
37 | void didLoad(BuildContext context) {
38 | }
39 |
40 | @override
41 | void onBuild(BuildContext context) {
42 | }
43 |
44 | @override
45 | void afterFirstBuild(BuildContext context) {
46 | }
47 |
48 | @override
49 | void dispose() {
50 | super.dispose();
51 | }
52 | }
--------------------------------------------------------------------------------
/lib/pages/list/list.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/lib/pages/list/list.xml.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_xmllayout_example/services/DataService.dart';
2 | import 'package:flutter_xmllayout_example/components/InfiniteListView.dart';
3 | import 'package:flutter_xmllayout_example/models/ItemModel.dart';
4 | import 'list.ctrl.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
7 | import 'package:provider/provider.dart';
8 |
9 | class ListPage extends StatefulWidget {
10 |
11 | ListPage(
12 |
13 | );
14 |
15 | @override
16 | _ListPageState createState() => _ListPageState();
17 | }
18 |
19 | class _ListPageState extends State {
20 | ListController ctrl;
21 | DataService dataService;
22 |
23 |
24 | @override
25 | void initState() {
26 | super.initState();
27 | ctrl = new ListController();
28 | WidgetsBinding.instance.addPostFrameCallback((_) => ctrl.afterFirstBuild(context));
29 | }
30 |
31 | @override
32 | void didChangeDependencies() {
33 | super.didChangeDependencies();
34 | ctrl._dataService = dataService = Provider.of(context);
35 | ctrl._load(context);
36 | }
37 |
38 | @override
39 | void dispose() {
40 | ctrl.dispose();
41 | super.dispose();
42 | }
43 |
44 | @override
45 | Widget build(BuildContext context) {
46 | final _pipeProvider = Provider.of(context);
47 | final __widget = Scaffold(
48 | appBar: AppBar(
49 | title: Text(
50 | _pipeProvider.transform(context, "translate", 'list', []),
51 | ),
52 | ),
53 | body: RefreshIndicator(
54 | onRefresh: ctrl.refreshData,
55 | child: InfiniteListView(
56 | hasMore: ctrl.hasMore,
57 | itemCount: ctrl.getItemCount,
58 | loadMore: ctrl.loadMore,
59 | physics: const AlwaysScrollableScrollPhysics(),
60 | bottomWidget: Center(
61 | child: Padding(
62 | padding: const EdgeInsets.fromLTRB(0, 20, 0, 50),
63 | child: SizedBox(
64 | height: 28,
65 | width: 28,
66 | child: CircularProgressIndicator(
67 | strokeWidth: 2,
68 | ),
69 | ),
70 | ),
71 | ),
72 | itemBuilder: (BuildContext context, int index) {
73 | final ItemModel item = ctrl.items == null || ctrl.items.length <= index || ctrl.items.length == 0 ? null : ctrl.items[index];
74 | return GestureDetector(
75 | onTap: () => ctrl.gotoItem(item, context),
76 | child: Card(
77 | margin: const EdgeInsets.symmetric(vertical: 4, horizontal: 4),
78 | child: Column(
79 | crossAxisAlignment: CrossAxisAlignment.center,
80 | children: [
81 | Hero(
82 | tag: item.imageUrl + item.id.toString(),
83 | child: Image.network(
84 | item.imageUrl,
85 | fit: BoxFit.cover,
86 | height: 180,
87 | width: _pipeProvider.transform(context, "widthPercent", 100, []),
88 | ),
89 | ),
90 | Padding(
91 | padding: const EdgeInsets.all(16),
92 | child: Text(
93 | item.title,
94 | ),
95 | ),
96 | ],
97 | ),
98 | ),
99 | );
100 | },
101 | ),
102 | ),
103 | );
104 | return __widget;
105 | }
106 | }
107 |
108 | class ListControllerBase {
109 | bool _loaded = false;
110 | DataService _dataService;
111 | DataService get dataService => _dataService;
112 |
113 | void _load(BuildContext context) {
114 | if (!_loaded) {
115 | _loaded = true;
116 | didLoad(context);
117 | }
118 |
119 | onBuild(context);
120 | }
121 |
122 | void didLoad(BuildContext context) {
123 | }
124 |
125 | void onBuild(BuildContext context) {
126 | }
127 |
128 | void afterFirstBuild(BuildContext context) {
129 | }
130 |
131 |
132 | @mustCallSuper
133 | void dispose() {
134 |
135 | }
136 | }
--------------------------------------------------------------------------------
/lib/pages/login/login.ctrl.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
3 | import 'package:rxdart/rxdart.dart';
4 | import 'login.xml.dart';
5 |
6 | class LoginController extends LoginControllerBase {
7 | final errorMessage = BehaviorSubject.seeded('');
8 | BuildContext _context;
9 |
10 | LoginController() {
11 | formGroup.addAll([
12 | FormControl('email', '', validators: [Validators.required]),
13 | FormControl('password', '', validators: [Validators.required, FnValidator(_validatePassword)]),
14 | ]);
15 | formGroup.onSubmit(_login);
16 | }
17 |
18 | String _validatePassword(value) {
19 | if (value == null || value.toString().isEmpty) {
20 | return null; // Validators.required will handle it
21 | }
22 |
23 | if (value.toString().length < 8) {
24 | return 'validations/password-length';
25 | }
26 |
27 | return null; // no errors
28 | }
29 |
30 | Future _login(dynamic data) async {
31 | // call validate method only if you are not using formGroup.onSubmit & :formSubmit directive
32 | // await formGroup.validate();
33 | // if (!formGroup.valid) {
34 | // return;
35 | // }
36 |
37 | final result = await authService.login(data['email'], data['password']);
38 | if (result.succeeded) {
39 | Navigator.of(_context).pop();
40 | }
41 | else {
42 | errorMessage.value = result.error;
43 | }
44 | }
45 |
46 | @override
47 | void didLoad(BuildContext context) {
48 | }
49 |
50 | @override
51 | void onBuild(BuildContext context) {
52 | _context = context;
53 | }
54 |
55 | @override
56 | void afterFirstBuild(BuildContext context) {
57 | }
58 |
59 | @override
60 | void dispose() {
61 | super.dispose();
62 | errorMessage.close();
63 | }
64 | }
--------------------------------------------------------------------------------
/lib/pages/login/login.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/lib/pages/login/login.xml.dart:
--------------------------------------------------------------------------------
1 | import '../../services/AuthService.dart';
2 | import 'login.ctrl.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | class LoginPage extends StatefulWidget {
8 |
9 | LoginPage(
10 |
11 | );
12 |
13 | @override
14 | _LoginPageState createState() => _LoginPageState();
15 | }
16 |
17 | class _LoginPageState extends State with RouteAware {
18 | LoginController ctrl;
19 | AuthService authService;
20 | RouteObserver _routeObserver;
21 |
22 | // Called when the top route has been popped off, and the current route shows up.
23 | void didPopNext() {
24 | ctrl.didPopNext();
25 | }
26 |
27 | // Called when the current route has been pushed.
28 | void didPush() {
29 | ctrl.didPush();
30 | }
31 |
32 | // Called when the current route has been popped off.
33 | void didPop() {
34 | ctrl.didPop();
35 | }
36 |
37 | // Called when a new route has been pushed, and the current route is no longer visible.
38 | void didPushNext() {
39 | ctrl.didPushNext();
40 | }
41 |
42 | @override
43 | void initState() {
44 | super.initState();
45 | ctrl = new LoginController();
46 | WidgetsBinding.instance.addPostFrameCallback((_) => ctrl.afterFirstBuild(context));
47 | }
48 |
49 | @override
50 | void didChangeDependencies() {
51 | super.didChangeDependencies();
52 | _routeObserver = Provider.of>(context)..subscribe(this, ModalRoute.of(context));
53 | ctrl._authService = authService = Provider.of(context);
54 | ctrl._load(context);
55 | }
56 |
57 | @override
58 | void dispose() {
59 | ctrl.dispose();
60 | _routeObserver.unsubscribe(this);
61 | super.dispose();
62 | }
63 |
64 | @override
65 | Widget build(BuildContext context) {
66 | final _pipeProvider = Provider.of(context);
67 | final __widget = Scaffold(
68 | body: SingleChildScrollView(
69 | child: Padding(
70 | padding: const EdgeInsets.fromLTRB(12, 40, 12, 12),
71 | child: Column(
72 | children: [
73 | Padding(
74 | padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 0),
75 | child: Icon(
76 | Icons.home,
77 | size: 80,
78 | ),
79 | ),
80 | Card(
81 | elevation: 3,
82 | child: Padding(
83 | padding: const EdgeInsets.fromLTRB(0, 2, 0, 6),
84 | child: Column(
85 | children: [
86 | StreamBuilder(
87 | initialData: ctrl.formGroup.get('email').value,
88 | stream: ctrl.formGroup.get('email').valueStream,
89 | builder: (BuildContext context, ctrlFormGroupGetEmailValueStreamSnapshot) {
90 | return TextField(
91 | controller: ctrl._attachController(ctrl.formGroup, 'email', () => TextEditingController()),
92 | decoration: InputDecoration(
93 | contentPadding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
94 | enabledBorder: InputBorder.none,
95 | errorText: _pipeProvider.transform(context, "translate", ctrl.formGroup.get('email').firstErrorIfTouched, []),
96 | labelText: 'Email address',
97 | ),
98 | );
99 | },
100 | ),
101 | Padding(
102 | padding: const EdgeInsets.symmetric(vertical: 0, horizontal: 8),
103 | child: Divider(
104 |
105 | ),
106 | ),
107 | StreamBuilder(
108 | initialData: ctrl.formGroup.get('password').value,
109 | stream: ctrl.formGroup.get('password').valueStream,
110 | builder: (BuildContext context, ctrlFormGroupGetPasswordValueStreamSnapshot) {
111 | return TextField(
112 | controller: ctrl._attachController(ctrl.formGroup, 'password', () => TextEditingController()),
113 | obscureText: true,
114 | decoration: InputDecoration(
115 | contentPadding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
116 | enabledBorder: InputBorder.none,
117 | errorText: _pipeProvider.transform(context, "translate", ctrl.formGroup.get('password').firstErrorIfTouched, []),
118 | labelText: 'Password',
119 | ),
120 | );
121 | },
122 | ),
123 | ],
124 | ),
125 | ),
126 | ),
127 | StreamBuilder(
128 | initialData: ctrl.formGroup.submitEnabled,
129 | stream: ctrl.formGroup.submitEnabledStream,
130 | builder: (BuildContext context, ctrlFormGroupSubmitEnabledStreamSnapshot) {
131 | final ctrlFormGroupSubmitEnabledStreamValue = ctrlFormGroupSubmitEnabledStreamSnapshot.data;
132 | return Disable(
133 | event: ctrl.formGroup.submit,
134 | value: !(ctrlFormGroupSubmitEnabledStreamValue),
135 | builder: (BuildContext context, event) {
136 | return Padding(
137 | padding: const EdgeInsets.fromLTRB(0, 30, 0, 0),
138 | child: RaisedButton(
139 | onPressed: event,
140 | padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 0),
141 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
142 | child: Row(
143 | mainAxisAlignment: MainAxisAlignment.center,
144 | children: [
145 | Text(
146 | 'Login',
147 | ),
148 | Icon(
149 | Icons.arrow_forward,
150 | ),
151 | ],
152 | ),
153 | ),
154 | );
155 | },
156 | );
157 | },
158 | ),
159 | StreamBuilder(
160 | initialData: ctrl.errorMessage.value,
161 | stream: ctrl.errorMessage,
162 | builder: (BuildContext context, ctrlErrorMessageSnapshot) {
163 | final ctrlErrorMessageValue = ctrlErrorMessageSnapshot.data;
164 | if (ctrlErrorMessageValue == null) {
165 | return Container(width: 0, height: 0);
166 | }
167 | return Padding(
168 | padding: const EdgeInsets.all(16),
169 | child: Text(
170 | ctrlErrorMessageValue,
171 | ),
172 | );
173 | },
174 | ),
175 | ],
176 | ),
177 | ),
178 | ),
179 | );
180 | return __widget;
181 | }
182 | }
183 |
184 | class LoginControllerBase {
185 | bool _loaded = false;
186 | final formGroup = new FormGroup();
187 | AuthService _authService;
188 | AuthService get authService => _authService;
189 | Map _attachedControllers = Map();
190 |
191 | dynamic _attachController(FormGroup formGroup, String controlName, controllerBuilder) {
192 | if (_attachedControllers.containsKey(controlName)) {
193 | final controller = _attachedControllers[controlName];
194 | return controller;
195 | }
196 | final controller = controllerBuilder();
197 | _attachedControllers[controlName] = controller;
198 | formGroup.get(controlName).attachTextEditingController(controller);
199 | return controller;
200 | }
201 |
202 | void _load(BuildContext context) {
203 | if (!_loaded) {
204 | _loaded = true;
205 | didLoad(context);
206 | }
207 |
208 | onBuild(context);
209 | }
210 |
211 | void didLoad(BuildContext context) {
212 | }
213 |
214 | void onBuild(BuildContext context) {
215 | }
216 |
217 | void afterFirstBuild(BuildContext context) {
218 | }
219 |
220 | void didPopNext() {
221 | }
222 |
223 | void didPush() {
224 | }
225 |
226 | void didPop() {
227 | }
228 |
229 | void didPushNext() {
230 | }
231 |
232 | @mustCallSuper
233 | void dispose() {
234 | formGroup.dispose();
235 | }
236 | }
--------------------------------------------------------------------------------
/lib/pages/settings/settings.ctrl.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
3 | import 'settings.xml.dart';
4 |
5 | class SettingsController extends SettingsControllerBase {
6 |
7 | void _darkModeEnabledChanged(bool value) {
8 | themeChanger.changeTheme(value);
9 | }
10 |
11 | void _selectedLocaleChanged(String value) {
12 | localeChanger.changeLocale(value);
13 | // force reloading home
14 | // navigator.pushNamedAndRemoveUntil('/', (_) => false);
15 | }
16 |
17 | @override
18 | void didLoad(BuildContext context) {
19 | formGroup.addAll([
20 | FormControl('darkModeEnabled', themeChanger.darkModeEnabled, changesListener: _darkModeEnabledChanged),
21 | FormControl('selectedLocale', localeChanger.localeCode, changesListener: _selectedLocaleChanged),
22 | ]);
23 | }
24 |
25 | @override
26 | void onBuild(BuildContext context) {
27 | }
28 |
29 | @override
30 | void afterFirstBuild(BuildContext context) {
31 | }
32 |
33 | @override
34 | void dispose() {
35 | super.dispose();
36 | }
37 | }
--------------------------------------------------------------------------------
/lib/pages/settings/settings.xml:
--------------------------------------------------------------------------------
1 |
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 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/lib/pages/settings/settings.xml.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_xmllayout_example/services/LocaleChanger.dart';
2 | import 'package:flutter_xmllayout_example/services/ThemeChanger.dart';
3 | import 'settings.ctrl.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
6 | import 'package:provider/provider.dart';
7 |
8 | class SettingsPage extends StatefulWidget {
9 |
10 | SettingsPage(
11 |
12 | );
13 |
14 | @override
15 | _SettingsPageState createState() => _SettingsPageState();
16 | }
17 |
18 | class _SettingsPageState extends State with RouteAware {
19 | SettingsController ctrl;
20 | ThemeChanger themeChanger;
21 | LocaleChanger localeChanger;
22 | RouteObserver _routeObserver;
23 |
24 | // Called when the top route has been popped off, and the current route shows up.
25 | void didPopNext() {
26 | ctrl.didPopNext();
27 | }
28 |
29 | // Called when the current route has been pushed.
30 | void didPush() {
31 | ctrl.didPush();
32 | }
33 |
34 | // Called when the current route has been popped off.
35 | void didPop() {
36 | ctrl.didPop();
37 | }
38 |
39 | // Called when a new route has been pushed, and the current route is no longer visible.
40 | void didPushNext() {
41 | ctrl.didPushNext();
42 | }
43 |
44 | @override
45 | void initState() {
46 | super.initState();
47 | ctrl = new SettingsController();
48 | WidgetsBinding.instance.addPostFrameCallback((_) => ctrl.afterFirstBuild(context));
49 | }
50 |
51 | @override
52 | void didChangeDependencies() {
53 | super.didChangeDependencies();
54 | _routeObserver = Provider.of>(context)..subscribe(this, ModalRoute.of(context));
55 | ctrl._themeChanger = themeChanger = Provider.of(context);
56 | ctrl._localeChanger = localeChanger = Provider.of(context);
57 | ctrl._load(context);
58 | }
59 |
60 | @override
61 | void dispose() {
62 | ctrl.dispose();
63 | _routeObserver.unsubscribe(this);
64 | super.dispose();
65 | }
66 |
67 | @override
68 | Widget build(BuildContext context) {
69 | final _pipeProvider = Provider.of(context);
70 | final __widget = Scaffold(
71 | appBar: AppBar(
72 | title: Text(
73 | _pipeProvider.transform(context, "translate", 'settings', []),
74 | ),
75 | ),
76 | body: Column(
77 | children: [
78 | StreamBuilder(
79 | initialData: ctrl.formGroup.get('darkModeEnabled').value,
80 | stream: ctrl.formGroup.get('darkModeEnabled').valueStream,
81 | builder: (BuildContext context, ctrlFormGroupGetDarkModeEnabledValueStreamSnapshot) {
82 | final ctrlFormGroupGetDarkModeEnabledValueStreamValue = ctrlFormGroupGetDarkModeEnabledValueStreamSnapshot.data;
83 | return SwitchListTile(
84 | onChanged: (value) => ctrl.formGroup.get('darkModeEnabled').value = value,
85 | value: ctrlFormGroupGetDarkModeEnabledValueStreamValue,
86 | title: Text(
87 | 'Dark Mode',
88 | ),
89 | );
90 | },
91 | ),
92 | ListTile(
93 | title: Text(
94 | 'Language',
95 | ),
96 | trailing: DropdownButtonHideUnderline(
97 | child: StreamBuilder(
98 | initialData: ctrl.formGroup.get('selectedLocale').value,
99 | stream: ctrl.formGroup.get('selectedLocale').valueStream,
100 | builder: (BuildContext context, ctrlFormGroupGetSelectedLocaleValueStreamSnapshot) {
101 | final ctrlFormGroupGetSelectedLocaleValueStreamValue = ctrlFormGroupGetSelectedLocaleValueStreamSnapshot.data;
102 | return DropdownButton(
103 | onChanged: (value) => ctrl.formGroup.get('selectedLocale').value = value,
104 | value: ctrlFormGroupGetSelectedLocaleValueStreamValue,
105 | items: [
106 | DropdownMenuItem(
107 | value: 'ar',
108 | child: Text(
109 | 'العربية',
110 | ),
111 | ),
112 | DropdownMenuItem(
113 | value: 'en',
114 | child: Text(
115 | 'English',
116 | ),
117 | ),
118 | ],
119 | );
120 | },
121 | ),
122 | ),
123 | ),
124 | ],
125 | ),
126 | );
127 | return __widget;
128 | }
129 | }
130 |
131 | class SettingsControllerBase {
132 | bool _loaded = false;
133 | final formGroup = new FormGroup();
134 | ThemeChanger _themeChanger;
135 | ThemeChanger get themeChanger => _themeChanger;
136 | LocaleChanger _localeChanger;
137 | LocaleChanger get localeChanger => _localeChanger;
138 |
139 | void _load(BuildContext context) {
140 | if (!_loaded) {
141 | _loaded = true;
142 | didLoad(context);
143 | }
144 |
145 | onBuild(context);
146 | }
147 |
148 | void didLoad(BuildContext context) {
149 | }
150 |
151 | void onBuild(BuildContext context) {
152 | }
153 |
154 | void afterFirstBuild(BuildContext context) {
155 | }
156 |
157 | void didPopNext() {
158 | }
159 |
160 | void didPush() {
161 | }
162 |
163 | void didPop() {
164 | }
165 |
166 | void didPushNext() {
167 | }
168 |
169 | @mustCallSuper
170 | void dispose() {
171 | formGroup.dispose();
172 | }
173 | }
--------------------------------------------------------------------------------
/lib/pages/signup/signup.ctrl.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
3 | import 'package:rxdart/rxdart.dart';
4 | import 'signup.xml.dart';
5 |
6 | class SignupController extends SignupControllerBase {
7 | final errorMessage = BehaviorSubject.seeded('');
8 |
9 | SignupController() {
10 | formGroup.addAll([
11 | FormControl('email', '', validators: [Validators.required, FnValidator(_validateEmail)]),
12 | FormControl('password', '', validators: [Validators.required, FnValidator(_validatePassword)]),
13 | FormControl('confirmPassword', '', validators: [Validators.required]),
14 | ]);
15 | formGroup.onSubmit(_login);
16 | formGroup.setValidator(FnValidator(_validatePasswords));
17 | }
18 |
19 | String _validateEmail(value) {
20 | if (value == null || value.toString().isEmpty) {
21 | return null; // Validators.required will handle it
22 | }
23 |
24 | final valid = RegExp(r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$').hasMatch(value);
25 | if (!valid) {
26 | return 'validations/invalid-email';
27 | }
28 |
29 | return null; // no errors
30 | }
31 |
32 | String _validatePassword(value) {
33 | if (value == null || value.toString().isEmpty) {
34 | return null; // Validators.required will handle it
35 | }
36 |
37 | if (value.toString().length < 8) {
38 | return 'validations/password-length';
39 | }
40 |
41 | return null; // no errors
42 | }
43 |
44 | String _validatePasswords(value) {
45 | // don't validate if the inputs wasn't touched
46 | if (!formGroup.get('password').touched || !formGroup.get('confirmPassword').touched) {
47 | return null;
48 | }
49 |
50 | if (value['password'] != value['confirmPassword']) {
51 | return 'validations/password-not-match';
52 | }
53 |
54 | return null; // no errors
55 | }
56 |
57 | Future _login(dynamic data) async {
58 | // call validate method only if you are not using formGroup.onSubmit & :formSubmit directive
59 | // await formGroup.validate();
60 | // if (!formGroup.valid) {
61 | // return;
62 | // }
63 |
64 | //
65 | // final result = await authService.regsiter(data['email'], data['password'], data['confirmPassword']);
66 | await Future.delayed(Duration(seconds: 1));
67 |
68 | pageController.animateToPage(1, duration: Duration(milliseconds: 300), curve: Curves.easeIn);
69 | }
70 |
71 | @override
72 | void didLoad(BuildContext context) {
73 | }
74 |
75 | @override
76 | void onBuild(BuildContext context) {
77 | }
78 |
79 | @override
80 | void afterFirstBuild(BuildContext context) {
81 | }
82 |
83 | @override
84 | void dispose() {
85 | super.dispose();
86 | errorMessage.close();
87 | }
88 | }
--------------------------------------------------------------------------------
/lib/pages/signup/signup.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/lib/pages/signup/signup.xml.dart:
--------------------------------------------------------------------------------
1 | import 'signup.ctrl.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
4 | import 'package:provider/provider.dart';
5 |
6 | class SignupPage extends StatefulWidget {
7 |
8 | SignupPage(
9 |
10 | );
11 |
12 | @override
13 | _SignupPageState createState() => _SignupPageState();
14 | }
15 |
16 | class _SignupPageState extends State with TickerProviderStateMixin {
17 | SignupController ctrl;
18 | PageController pageController;
19 |
20 |
21 | @override
22 | void initState() {
23 | super.initState();
24 | ctrl = new SignupController();
25 | ctrl._pageController = pageController = new PageController();
26 | WidgetsBinding.instance.addPostFrameCallback((_) => ctrl.afterFirstBuild(context));
27 | }
28 |
29 | @override
30 | void didChangeDependencies() {
31 | super.didChangeDependencies();
32 | ctrl._load(context);
33 | }
34 |
35 | @override
36 | void dispose() {
37 | ctrl.dispose();
38 |
39 | super.dispose();
40 | }
41 |
42 | @override
43 | Widget build(BuildContext context) {
44 | final _pipeProvider = Provider.of(context);
45 | final __widget = Scaffold(
46 | appBar: AppBar(
47 | title: Text(
48 | _pipeProvider.transform(context, "translate", 'signup', []),
49 | ),
50 | ),
51 | body: Center(
52 | child: PageView(
53 | controller: ctrl.pageController,
54 | children: [
55 | Form(
56 | child: SingleChildScrollView(
57 | child: Padding(
58 | padding: const EdgeInsets.fromLTRB(12, 40, 12, 12),
59 | child: Column(
60 | children: [
61 | AnimationBuilder(
62 | autoTrigger: true,
63 | cycles: 5,
64 | duration: Duration(milliseconds: 1000),
65 | tweenMap: {
66 | "height": Tween(begin: 100, end: 150),
67 | "width": Tween(begin: 100, end: 200),
68 | "color": ColorTween(begin: Colors.blue, end: Colors.red)
69 | },
70 | builderMap: (Map animations, Widget child) {
71 | return Container(
72 | color: animations["color"].value,
73 | height: animations["height"].value,
74 | width: animations["width"].value,
75 | );
76 | },
77 | ),
78 | Card(
79 | elevation: 3,
80 | child: Padding(
81 | padding: const EdgeInsets.fromLTRB(0, 2, 0, 6),
82 | child: Column(
83 | children: [
84 | StreamBuilder(
85 | initialData: ctrl.formGroup.get('email').value,
86 | stream: ctrl.formGroup.get('email').valueStream,
87 | builder: (BuildContext context, ctrlFormGroupGetEmailValueStreamSnapshot) {
88 | return TextField(
89 | controller: ctrl._attachController(ctrl.formGroup, 'email', () => TextEditingController()),
90 | decoration: InputDecoration(
91 | contentPadding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
92 | enabledBorder: InputBorder.none,
93 | errorText: _pipeProvider.transform(context, "translate", ctrl.formGroup.get('email').firstErrorIfTouched, []),
94 | labelText: 'Email address',
95 | ),
96 | );
97 | },
98 | ),
99 | StreamBuilder(
100 | initialData: ctrl.formGroup.get('password').value,
101 | stream: ctrl.formGroup.get('password').valueStream,
102 | builder: (BuildContext context, ctrlFormGroupGetPasswordValueStreamSnapshot) {
103 | return TextField(
104 | controller: ctrl._attachController(ctrl.formGroup, 'password', () => TextEditingController()),
105 | obscureText: true,
106 | decoration: InputDecoration(
107 | contentPadding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
108 | enabledBorder: InputBorder.none,
109 | errorText: _pipeProvider.transform(context, "translate", ctrl.formGroup.get('password').firstErrorIfTouched, []),
110 | labelText: 'Password',
111 | ),
112 | );
113 | },
114 | ),
115 | StreamBuilder(
116 | initialData: ctrl.formGroup.get('confirmPassword').value,
117 | stream: ctrl.formGroup.get('confirmPassword').valueStream,
118 | builder: (BuildContext context, ctrlFormGroupGetConfirmPasswordValueStreamSnapshot) {
119 | return TextField(
120 | controller: ctrl._attachController(ctrl.formGroup, 'confirmPassword', () => TextEditingController()),
121 | obscureText: true,
122 | decoration: InputDecoration(
123 | contentPadding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
124 | enabledBorder: InputBorder.none,
125 | errorText: (_pipeProvider.transform(context, "translate", ctrl.formGroup.get('confirmPassword').firstErrorIfTouched, [])) ?? ctrl.formGroup.invalid ? (_pipeProvider.transform(context, "translate", ctrl.formGroup.getError(), [])) : null,
126 | labelText: 'Consfirm password',
127 | ),
128 | );
129 | },
130 | ),
131 | ],
132 | ),
133 | ),
134 | ),
135 | StreamBuilder(
136 | initialData: ctrl.formGroup.submitEnabled,
137 | stream: ctrl.formGroup.submitEnabledStream,
138 | builder: (BuildContext context, ctrlFormGroupSubmitEnabledStreamSnapshot) {
139 | final ctrlFormGroupSubmitEnabledStreamValue = ctrlFormGroupSubmitEnabledStreamSnapshot.data;
140 | return Disable(
141 | event: ctrl.formGroup.submit,
142 | value: !(ctrlFormGroupSubmitEnabledStreamValue),
143 | builder: (BuildContext context, event) {
144 | return Padding(
145 | padding: const EdgeInsets.fromLTRB(0, 30, 0, 0),
146 | child: RaisedButton(
147 | onPressed: event,
148 | padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 0),
149 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
150 | child: Row(
151 | crossAxisAlignment: CrossAxisAlignment.center,
152 | mainAxisAlignment: MainAxisAlignment.center,
153 | children: [
154 | Text(
155 | 'Register',
156 | ),
157 | Icon(
158 | Icons.arrow_forward,
159 | ),
160 | ],
161 | ),
162 | ),
163 | );
164 | },
165 | );
166 | },
167 | ),
168 | StreamBuilder(
169 | initialData: ctrl.errorMessage.value,
170 | stream: ctrl.errorMessage,
171 | builder: (BuildContext context, ctrlErrorMessageSnapshot) {
172 | final ctrlErrorMessageValue = ctrlErrorMessageSnapshot.data;
173 | if (ctrlErrorMessageValue == null) {
174 | return Container(width: 0, height: 0);
175 | }
176 | return Padding(
177 | padding: const EdgeInsets.all(16),
178 | child: Text(
179 | ctrlErrorMessageValue,
180 | ),
181 | );
182 | },
183 | ),
184 | ],
185 | ),
186 | ),
187 | ),
188 | ),
189 | Center(
190 | child: Column(
191 | children: [
192 | Text(
193 | 'signup result',
194 | ),
195 | ],
196 | ),
197 | ),
198 | ],
199 | ),
200 | ),
201 | );
202 | return __widget;
203 | }
204 | }
205 |
206 | class SignupControllerBase {
207 | bool _loaded = false;
208 | PageController _pageController;
209 | PageController get pageController => _pageController;
210 | final formGroup = new FormGroup();
211 | Map _attachedControllers = Map();
212 |
213 | dynamic _attachController(FormGroup formGroup, String controlName, controllerBuilder) {
214 | if (_attachedControllers.containsKey(controlName)) {
215 | final controller = _attachedControllers[controlName];
216 | return controller;
217 | }
218 | final controller = controllerBuilder();
219 | _attachedControllers[controlName] = controller;
220 | formGroup.get(controlName).attachTextEditingController(controller);
221 | return controller;
222 | }
223 |
224 | void _load(BuildContext context) {
225 | if (!_loaded) {
226 | _loaded = true;
227 | didLoad(context);
228 | }
229 |
230 | onBuild(context);
231 | }
232 |
233 | void didLoad(BuildContext context) {
234 | }
235 |
236 | void onBuild(BuildContext context) {
237 | }
238 |
239 | void afterFirstBuild(BuildContext context) {
240 | }
241 |
242 |
243 | @mustCallSuper
244 | void dispose() {
245 | pageController.dispose();
246 | formGroup.dispose();
247 | }
248 | }
--------------------------------------------------------------------------------
/lib/pages/tabs/tabs.ctrl.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:rxdart/rxdart.dart';
3 | import 'tabs.xml.dart';
4 |
5 | class TabsPageController extends TabsPageControllerBase {
6 | final selectedTab = BehaviorSubject.seeded(0);
7 |
8 | selectTab(i) {
9 | tabController.animateTo(i);
10 | selectedTab.value = i;
11 | }
12 |
13 | @override
14 | void didLoad(BuildContext context) {
15 | }
16 |
17 | @override
18 | void onBuild(BuildContext context) {
19 | }
20 |
21 | @override
22 | void afterFirstBuild(BuildContext context) {
23 | }
24 |
25 | @override
26 | void dispose() {
27 | super.dispose();
28 | selectedTab.close();
29 | }
30 | }
--------------------------------------------------------------------------------
/lib/pages/tabs/tabs.xml:
--------------------------------------------------------------------------------
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 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/lib/pages/tabs/tabs.xml.dart:
--------------------------------------------------------------------------------
1 | import 'tabs.ctrl.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_xmllayout_helpers/flutter_xmllayout_helpers.dart';
4 | import 'package:provider/provider.dart';
5 |
6 | class TabsPage extends StatefulWidget {
7 |
8 | TabsPage(
9 |
10 | );
11 |
12 | @override
13 | _TabsPageState createState() => _TabsPageState();
14 | }
15 |
16 | class _TabsPageState extends State with TickerProviderStateMixin {
17 | TabsPageController ctrl;
18 | TabController tabController;
19 |
20 |
21 | @override
22 | void initState() {
23 | super.initState();
24 | ctrl = new TabsPageController();
25 | ctrl._tabController = tabController = TabController(length: 3, vsync: this);
26 | WidgetsBinding.instance.addPostFrameCallback((_) => ctrl.afterFirstBuild(context));
27 | }
28 |
29 | @override
30 | void didChangeDependencies() {
31 | super.didChangeDependencies();
32 | ctrl._load(context);
33 | }
34 |
35 | @override
36 | void dispose() {
37 | ctrl.dispose();
38 |
39 | super.dispose();
40 | }
41 |
42 | @override
43 | Widget build(BuildContext context) {
44 | final _pipeProvider = Provider.of(context);
45 | final __widget = Scaffold(
46 | appBar: AppBar(
47 | title: Text(
48 | _pipeProvider.transform(context, "translate", 'tabs', []),
49 | ),
50 | ),
51 | body: TabBarView(
52 | controller: ctrl.tabController,
53 | physics: NeverScrollableScrollPhysics(),
54 | children: [
55 | Column(
56 | mainAxisAlignment: MainAxisAlignment.center,
57 | children: [
58 | Padding(
59 | padding: const EdgeInsets.symmetric(vertical: 100, horizontal: 0),
60 | child: Text(
61 | 'page 1',
62 | ),
63 | ),
64 | RaisedButton(
65 | onPressed: () => ctrl.selectTab(1),
66 | child: Text(
67 | 'Goto 2',
68 | ),
69 | ),
70 | ],
71 | ),
72 | Column(
73 | mainAxisAlignment: MainAxisAlignment.center,
74 | children: [
75 | Padding(
76 | padding: const EdgeInsets.symmetric(vertical: 100, horizontal: 0),
77 | child: Text(
78 | 'page 2',
79 | ),
80 | ),
81 | RaisedButton(
82 | onPressed: () => ctrl.selectTab(2),
83 | child: Text(
84 | 'Goto 3',
85 | ),
86 | ),
87 | ],
88 | ),
89 | Column(
90 | mainAxisAlignment: MainAxisAlignment.center,
91 | children: [
92 | Padding(
93 | padding: const EdgeInsets.symmetric(vertical: 100, horizontal: 0),
94 | child: Text(
95 | 'page 3',
96 | ),
97 | ),
98 | RaisedButton(
99 | onPressed: () => ctrl.selectTab(0),
100 | child: Text(
101 | 'Back to 1',
102 | ),
103 | ),
104 | ],
105 | ),
106 | ],
107 | ),
108 | bottomNavigationBar: Material(
109 | color: Colors.white,
110 | elevation: 8,
111 | child: TabBar(
112 | controller: ctrl.tabController,
113 | onTap: (i) => ctrl.selectTab(i),
114 | tabs: [
115 | Tab(
116 | icon: StreamBuilder(
117 | initialData: ctrl.selectedTab.value,
118 | stream: ctrl.selectedTab,
119 | builder: (BuildContext context, ctrlSelectedTabSnapshot) {
120 | final ctrlSelectedTabValue = ctrlSelectedTabSnapshot.data;
121 | if (ctrlSelectedTabValue == null) {
122 | return Container(width: 0, height: 0);
123 | }
124 | return Icon(
125 | Icons.home,
126 | color: (ctrlSelectedTabValue) == 0 ? Colors.blue : Colors.grey,
127 | );
128 | },
129 | ),
130 | ),
131 | Tab(
132 | icon: StreamBuilder(
133 | initialData: ctrl.selectedTab.value,
134 | stream: ctrl.selectedTab,
135 | builder: (BuildContext context, ctrlSelectedTabSnapshot) {
136 | final ctrlSelectedTabValue = ctrlSelectedTabSnapshot.data;
137 | if (ctrlSelectedTabValue == null) {
138 | return Container(width: 0, height: 0);
139 | }
140 | return Icon(
141 | Icons.widgets,
142 | color: (ctrlSelectedTabValue) == 1 ? Colors.blue : Colors.grey,
143 | );
144 | },
145 | ),
146 | ),
147 | Tab(
148 | icon: StreamBuilder(
149 | initialData: ctrl.selectedTab.value,
150 | stream: ctrl.selectedTab,
151 | builder: (BuildContext context, ctrlSelectedTabSnapshot) {
152 | final ctrlSelectedTabValue = ctrlSelectedTabSnapshot.data;
153 | if (ctrlSelectedTabValue == null) {
154 | return Container(width: 0, height: 0);
155 | }
156 | return Icon(
157 | Icons.info,
158 | color: (ctrlSelectedTabValue) == 2 ? Colors.blue : Colors.grey,
159 | );
160 | },
161 | ),
162 | ),
163 | ],
164 | ),
165 | ),
166 | );
167 | return __widget;
168 | }
169 | }
170 |
171 | class TabsPageControllerBase {
172 | bool _loaded = false;
173 | TabController _tabController;
174 | TabController get tabController => _tabController;
175 |
176 | void _load(BuildContext context) {
177 | if (!_loaded) {
178 | _loaded = true;
179 | didLoad(context);
180 | }
181 |
182 | onBuild(context);
183 | }
184 |
185 | void didLoad(BuildContext context) {
186 | }
187 |
188 | void onBuild(BuildContext context) {
189 | }
190 |
191 | void afterFirstBuild(BuildContext context) {
192 | }
193 |
194 |
195 | @mustCallSuper
196 | void dispose() {
197 |
198 | }
199 | }
--------------------------------------------------------------------------------
/lib/pipes/FormatCurrency.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:flutter_xmllayout_helpers/pipes/Pipe.dart';
3 | import 'package:intl/intl.dart';
4 |
5 | class FormatCurrencyPipe extends Pipe {
6 | String get name => 'formatCurrency';
7 |
8 | dynamic transform(BuildContext context, value, args) {
9 | final res = NumberFormat.currency(decimalDigits: 2).format(value is String ? num.tryParse(value) ?? 0 : value);
10 | return res;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/pipes/FormatDate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:flutter_xmllayout_helpers/pipes/Pipe.dart';
3 |
4 | class FormatDatePipe extends Pipe {
5 | String get name => 'formatDate';
6 |
7 | dynamic transform(BuildContext context, value, args) {
8 | if (value == null) {
9 | return '';
10 | }
11 | DateTime date;
12 | if (value is String) {
13 | date = DateTime.parse(value);
14 | }
15 | else if (value is DateTime) {
16 | date = value;
17 | }
18 | else {
19 | return 'Invalid date';
20 | }
21 |
22 | return '${date.year}-${date.month}-${date.day}';
23 | }
24 | }
--------------------------------------------------------------------------------
/lib/pipes/Translate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:flutter_xmllayout_example/i18n/gen/localizations.dart';
3 | import 'package:flutter_xmllayout_helpers/pipes/Pipe.dart';
4 |
5 | class TranslatePipe extends Pipe {
6 | String get name => 'translate';
7 |
8 | dynamic transform(BuildContext context, value, args) {
9 | return AppLocalizations.of(context).getTranslation(value) ?? value;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/lib/routes.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/widgets.dart';
3 |
4 | import 'models/ItemModel.dart';
5 | import 'pages/home/home.xml.dart';
6 | import 'pages/item/item.xml.dart';
7 | import 'pages/list/list.xml.dart';
8 | import 'pages/signup/signup.xml.dart';
9 | import 'pages/login/login.xml.dart';
10 | import 'pages/settings/settings.xml.dart';
11 | import 'pages/tabs/tabs.xml.dart';
12 |
13 | getRoute(RouteSettings settings) {
14 | switch (settings.name) {
15 | case '/login':
16 | return MaterialPageRoute(builder: (context) => LoginPage());
17 | case '/signup':
18 | return MaterialPageRoute(builder: (context) => SignupPage());
19 | case '/tabs':
20 | return MaterialPageRoute(builder: (context) => TabsPage());
21 | case '/settings':
22 | return MaterialPageRoute(builder: (context) => SettingsPage());
23 | case '/list':
24 | return MaterialPageRoute(builder: (context) => ListPage());
25 | case '/item':
26 | // use PageRouteBuilder for custom route animation
27 | return PageRouteBuilder(
28 | pageBuilder: (context, animation, secondaryAnimation) {
29 | return ItemPage(item: settings.arguments as ItemModel, animation: animation);
30 | },
31 | transitionDuration: Duration(milliseconds: 600)
32 | );
33 | // return MaterialPageRoute(builder: (context) => ItemPage(item: settings.arguments as ItemModel));
34 | }
35 | return MaterialPageRoute(builder: (context) => HomePage());
36 | }
--------------------------------------------------------------------------------
/lib/services/AuthService.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_xmllayout_example/models/LoginResult.dart';
2 | import 'package:rxdart/subjects.dart';
3 | import 'PersistentStorage.dart';
4 |
5 |
6 | class AuthService {
7 | final status = BehaviorSubject.seeded(false);
8 | String _token = '';
9 | String get token => _token;
10 | final PersistentStorage _storage;
11 |
12 | AuthService(this._storage);
13 |
14 | Future login(String email, String password) async {
15 | await Future.delayed(Duration(seconds: 4));
16 | return _parepareLoginResult('test_token', '');
17 | }
18 |
19 | LoginResult _parepareLoginResult(String token, String error) {
20 | final result = LoginResult(
21 | succeeded: (error == null || error.isEmpty) && token != null && token.isNotEmpty,
22 | token: token,
23 | error: error
24 | );
25 |
26 | _token = result.token;
27 | status.value = result.succeeded;
28 |
29 | if (result.succeeded) {
30 | _storage.setToken(result.token);
31 | }
32 |
33 | return result;
34 | }
35 |
36 | void coldLogin() {
37 | _token = _storage.getToken();
38 | if (_token != null && _token.isNotEmpty) {
39 | // todo check expiration
40 | status.value = true;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/services/DataService.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_xmllayout_example/models/ItemModel.dart';
2 |
3 | class DataService {
4 |
5 | Future> loadItems(int page) async {
6 | await Future.delayed(Duration(seconds: 1));
7 |
8 | // source: https://shibe.online/
9 | final images = [
10 | "https://cdn.shibe.online/shibes/98d0c554b013deca3e4fdc5b5ad190839f45afb5.jpg","https://cdn.shibe.online/shibes/4a07c8541ac693abe165366b6252006aeace2540.jpg","https://cdn.shibe.online/shibes/d3277191934648303826e6dd03aef45d37d7dfda.jpg","https://cdn.shibe.online/shibes/0a20baacdd012a7eddda02d86310aacb59f97792.jpg","https://cdn.shibe.online/shibes/8f675921917bceb7b6bb265e6b4714d2d06fa158.jpg","https://cdn.shibe.online/shibes/31dd5c6f22f0ba4f72c5b9c370ddda94bc46190a.jpg","https://cdn.shibe.online/shibes/7e580a4f1615c852ede081a1aedcc16e771d19d7.jpg","https://cdn.shibe.online/shibes/e50627e5876a72bcbdcfb53227c6d918b7d0e347.jpg","https://cdn.shibe.online/shibes/23a2a4ee1b272031caba1fa4358a60238464be61.jpg","https://cdn.shibe.online/shibes/a26096c3797c83134e1070ece11938be25b46897.jpg"
11 | ];
12 |
13 | return List.generate(10, (index) =>
14 | ItemModel(title: 'Item title #${index + 1 + page * 10}', imageUrl: images[index], id: index + page * 10),
15 | );
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib/services/LocaleChanger.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'PersistentStorage.dart';
3 |
4 | class LocaleChanger with ChangeNotifier {
5 | final PersistentStorage storage;
6 |
7 | Locale _locale;
8 | Locale get locale => _locale;
9 |
10 | String get localeCode => storage.localeCode;
11 |
12 | LocaleChanger(this.storage) {
13 | final code = storage.getLocale();
14 | if (code != null && code.isNotEmpty) {
15 | _locale = Locale(code);
16 | }
17 | else {
18 | _locale = Locale('en');
19 | }
20 | }
21 |
22 |
23 | void changeLocale(String code) {
24 | _locale = Locale(code);
25 | storage.setLocale(code);
26 | notifyListeners();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/services/PersistentStorage.dart:
--------------------------------------------------------------------------------
1 | import 'package:shared_preferences/shared_preferences.dart';
2 |
3 | class PersistentStorage {
4 | final SharedPreferences _prefs;
5 |
6 | static const String _localeField = 'locale';
7 | static const String _darkModeEnabledField = 'dark-mode';
8 | static const String _userTokenField = 'user-token';
9 |
10 | String _localeCode;
11 | String get localeCode => _localeCode ?? getLocale() ?? 'en';
12 | bool _darkModeEnabled;
13 | bool get darkModeEnabled => _darkModeEnabled ?? getDarkModeEnabled() ?? false;
14 | String _userToken;
15 | String get userToken => _userToken ?? getToken();
16 |
17 | PersistentStorage(this._prefs);
18 |
19 | String getLocale() {
20 | return _localeCode = _prefs.getString(_localeField);
21 | }
22 |
23 | void setLocale(String locale) {
24 | _prefs.setString(_localeField, _localeCode = locale);
25 | }
26 |
27 | bool getDarkModeEnabled() {
28 | return _darkModeEnabled = _prefs.getBool(_darkModeEnabledField);
29 | }
30 |
31 | void setDarkModeEnabled(bool enabled) {
32 | _prefs.setBool(_darkModeEnabledField, _darkModeEnabled = enabled);
33 | }
34 |
35 | String getToken() {
36 | return _userToken = _prefs.getString(_userTokenField);
37 | }
38 |
39 | void setToken(String token) {
40 | _prefs.setString(_userTokenField, _userToken = token);
41 | }
42 | }
--------------------------------------------------------------------------------
/lib/services/ThemeChanger.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | import 'package:flutter/material.dart';
4 | import 'PersistentStorage.dart';
5 |
6 | class ThemeChanger with ChangeNotifier {
7 | final PersistentStorage storage;
8 |
9 | bool get darkModeEnabled => storage.darkModeEnabled;
10 |
11 | ThemeChanger(this.storage);
12 |
13 | void changeTheme(bool darkMode) {
14 | storage.setDarkModeEnabled(darkMode);
15 | notifyListeners();
16 | }
17 |
18 | bool _isArabic() {
19 | return storage.getLocale() == 'ar';
20 | }
21 |
22 | ThemeData get theme {
23 | return darkModeEnabled ? _buildTheme(Brightness.dark) : _buildTheme(Brightness.light);
24 | }
25 |
26 | ThemeData _buildTheme(Brightness brightness) {
27 | final arabic = _isArabic();
28 |
29 | return ThemeData(
30 | brightness: brightness,
31 | primarySwatch: Colors.teal,
32 | fontFamily: arabic ? 'Roboto' : 'Roboto', // custom font depending on locale
33 | );
34 | }
35 | }
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | archive:
5 | dependency: transitive
6 | description:
7 | name: archive
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.0.13"
11 | args:
12 | dependency: transitive
13 | description:
14 | name: args
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "1.6.0"
18 | async:
19 | dependency: transitive
20 | description:
21 | name: async
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.4.1"
25 | boolean_selector:
26 | dependency: transitive
27 | description:
28 | name: boolean_selector
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "2.0.0"
32 | charcode:
33 | dependency: transitive
34 | description:
35 | name: charcode
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.3"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.14.12"
46 | convert:
47 | dependency: transitive
48 | description:
49 | name: convert
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "2.1.1"
53 | crypto:
54 | dependency: transitive
55 | description:
56 | name: crypto
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "2.1.4"
60 | cupertino_icons:
61 | dependency: "direct main"
62 | description:
63 | name: cupertino_icons
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "0.1.3"
67 | ffi:
68 | dependency: transitive
69 | description:
70 | name: ffi
71 | url: "https://pub.dartlang.org"
72 | source: hosted
73 | version: "0.1.3"
74 | file:
75 | dependency: transitive
76 | description:
77 | name: file
78 | url: "https://pub.dartlang.org"
79 | source: hosted
80 | version: "5.2.1"
81 | flutter:
82 | dependency: "direct main"
83 | description: flutter
84 | source: sdk
85 | version: "0.0.0"
86 | flutter_localizations:
87 | dependency: "direct main"
88 | description: flutter
89 | source: sdk
90 | version: "0.0.0"
91 | flutter_test:
92 | dependency: "direct dev"
93 | description: flutter
94 | source: sdk
95 | version: "0.0.0"
96 | flutter_web_plugins:
97 | dependency: transitive
98 | description: flutter
99 | source: sdk
100 | version: "0.0.0"
101 | flutter_xmllayout_helpers:
102 | dependency: "direct main"
103 | description:
104 | name: flutter_xmllayout_helpers
105 | url: "https://pub.dartlang.org"
106 | source: hosted
107 | version: "0.0.8"
108 | image:
109 | dependency: transitive
110 | description:
111 | name: image
112 | url: "https://pub.dartlang.org"
113 | source: hosted
114 | version: "2.1.12"
115 | intl:
116 | dependency: transitive
117 | description:
118 | name: intl
119 | url: "https://pub.dartlang.org"
120 | source: hosted
121 | version: "0.16.1"
122 | matcher:
123 | dependency: transitive
124 | description:
125 | name: matcher
126 | url: "https://pub.dartlang.org"
127 | source: hosted
128 | version: "0.12.6"
129 | meta:
130 | dependency: transitive
131 | description:
132 | name: meta
133 | url: "https://pub.dartlang.org"
134 | source: hosted
135 | version: "1.1.8"
136 | path:
137 | dependency: transitive
138 | description:
139 | name: path
140 | url: "https://pub.dartlang.org"
141 | source: hosted
142 | version: "1.6.4"
143 | path_provider_linux:
144 | dependency: transitive
145 | description:
146 | name: path_provider_linux
147 | url: "https://pub.dartlang.org"
148 | source: hosted
149 | version: "0.0.1+2"
150 | path_provider_platform_interface:
151 | dependency: transitive
152 | description:
153 | name: path_provider_platform_interface
154 | url: "https://pub.dartlang.org"
155 | source: hosted
156 | version: "1.0.3"
157 | path_provider_windows:
158 | dependency: transitive
159 | description:
160 | name: path_provider_windows
161 | url: "https://pub.dartlang.org"
162 | source: hosted
163 | version: "0.0.4+1"
164 | petitparser:
165 | dependency: transitive
166 | description:
167 | name: petitparser
168 | url: "https://pub.dartlang.org"
169 | source: hosted
170 | version: "2.4.0"
171 | platform:
172 | dependency: transitive
173 | description:
174 | name: platform
175 | url: "https://pub.dartlang.org"
176 | source: hosted
177 | version: "2.2.1"
178 | plugin_platform_interface:
179 | dependency: transitive
180 | description:
181 | name: plugin_platform_interface
182 | url: "https://pub.dartlang.org"
183 | source: hosted
184 | version: "1.0.3"
185 | process:
186 | dependency: transitive
187 | description:
188 | name: process
189 | url: "https://pub.dartlang.org"
190 | source: hosted
191 | version: "3.0.13"
192 | provider:
193 | dependency: "direct main"
194 | description:
195 | name: provider
196 | url: "https://pub.dartlang.org"
197 | source: hosted
198 | version: "3.2.0"
199 | quiver:
200 | dependency: transitive
201 | description:
202 | name: quiver
203 | url: "https://pub.dartlang.org"
204 | source: hosted
205 | version: "2.1.3"
206 | rxdart:
207 | dependency: "direct main"
208 | description:
209 | name: rxdart
210 | url: "https://pub.dartlang.org"
211 | source: hosted
212 | version: "0.22.6"
213 | shared_preferences:
214 | dependency: "direct main"
215 | description:
216 | name: shared_preferences
217 | url: "https://pub.dartlang.org"
218 | source: hosted
219 | version: "0.5.12"
220 | shared_preferences_linux:
221 | dependency: transitive
222 | description:
223 | name: shared_preferences_linux
224 | url: "https://pub.dartlang.org"
225 | source: hosted
226 | version: "0.0.2+2"
227 | shared_preferences_macos:
228 | dependency: transitive
229 | description:
230 | name: shared_preferences_macos
231 | url: "https://pub.dartlang.org"
232 | source: hosted
233 | version: "0.0.1+10"
234 | shared_preferences_platform_interface:
235 | dependency: transitive
236 | description:
237 | name: shared_preferences_platform_interface
238 | url: "https://pub.dartlang.org"
239 | source: hosted
240 | version: "1.0.4"
241 | shared_preferences_web:
242 | dependency: transitive
243 | description:
244 | name: shared_preferences_web
245 | url: "https://pub.dartlang.org"
246 | source: hosted
247 | version: "0.1.2+7"
248 | shared_preferences_windows:
249 | dependency: transitive
250 | description:
251 | name: shared_preferences_windows
252 | url: "https://pub.dartlang.org"
253 | source: hosted
254 | version: "0.0.1+1"
255 | sky_engine:
256 | dependency: transitive
257 | description: flutter
258 | source: sdk
259 | version: "0.0.99"
260 | source_span:
261 | dependency: transitive
262 | description:
263 | name: source_span
264 | url: "https://pub.dartlang.org"
265 | source: hosted
266 | version: "1.7.0"
267 | stack_trace:
268 | dependency: transitive
269 | description:
270 | name: stack_trace
271 | url: "https://pub.dartlang.org"
272 | source: hosted
273 | version: "1.9.3"
274 | stream_channel:
275 | dependency: transitive
276 | description:
277 | name: stream_channel
278 | url: "https://pub.dartlang.org"
279 | source: hosted
280 | version: "2.0.0"
281 | string_scanner:
282 | dependency: transitive
283 | description:
284 | name: string_scanner
285 | url: "https://pub.dartlang.org"
286 | source: hosted
287 | version: "1.0.5"
288 | term_glyph:
289 | dependency: transitive
290 | description:
291 | name: term_glyph
292 | url: "https://pub.dartlang.org"
293 | source: hosted
294 | version: "1.1.0"
295 | test_api:
296 | dependency: transitive
297 | description:
298 | name: test_api
299 | url: "https://pub.dartlang.org"
300 | source: hosted
301 | version: "0.2.15"
302 | typed_data:
303 | dependency: transitive
304 | description:
305 | name: typed_data
306 | url: "https://pub.dartlang.org"
307 | source: hosted
308 | version: "1.1.6"
309 | vector_math:
310 | dependency: transitive
311 | description:
312 | name: vector_math
313 | url: "https://pub.dartlang.org"
314 | source: hosted
315 | version: "2.0.8"
316 | win32:
317 | dependency: transitive
318 | description:
319 | name: win32
320 | url: "https://pub.dartlang.org"
321 | source: hosted
322 | version: "1.7.3"
323 | xdg_directories:
324 | dependency: transitive
325 | description:
326 | name: xdg_directories
327 | url: "https://pub.dartlang.org"
328 | source: hosted
329 | version: "0.1.0"
330 | xml:
331 | dependency: transitive
332 | description:
333 | name: xml
334 | url: "https://pub.dartlang.org"
335 | source: hosted
336 | version: "3.6.1"
337 | sdks:
338 | dart: ">=2.7.0 <3.0.0"
339 | flutter: ">=1.12.13+hotfix.5 <2.0.0"
340 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_xmllayout_example
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.7.0 <3.0.0"
22 |
23 | dependencies:
24 | flutter:
25 | sdk: flutter
26 | flutter_localizations:
27 | sdk: flutter
28 | provider: ^3.0.0+1
29 | flutter_xmllayout_helpers: 0.0.8
30 | rxdart: ^0.22.0
31 | shared_preferences: ^0.5.3+1
32 |
33 |
34 | # The following adds the Cupertino Icons font to your application.
35 | # Use with the CupertinoIcons class for iOS style icons.
36 | cupertino_icons: ^0.1.3
37 |
38 | dev_dependencies:
39 | flutter_test:
40 | sdk: flutter
41 |
42 | # For information on the generic Dart part of this file, see the
43 | # following page: https://dart.dev/tools/pub/pubspec
44 |
45 | # The following section is specific to Flutter.
46 | flutter:
47 |
48 | # The following line ensures that the Material Icons font is
49 | # included with your application, so that you can use the icons in
50 | # the material Icons class.
51 | uses-material-design: true
52 |
53 | # To add assets to your application, add an assets section, like this:
54 | # assets:
55 | # - images/a_dot_burr.jpeg
56 | # - images/a_dot_ham.jpeg
57 |
58 | # An image asset can refer to one or more resolution-specific "variants", see
59 | # https://flutter.dev/assets-and-images/#resolution-aware.
60 |
61 | # For details regarding adding assets from package dependencies, see
62 | # https://flutter.dev/assets-and-images/#from-packages
63 |
64 | # To add custom fonts to your application, add a fonts section here,
65 | # in this "flutter" section. Each entry in this list should have a
66 | # "family" key with the font family name, and a "fonts" key with a
67 | # list giving the asset and other descriptors for the font. For
68 | # example:
69 | # fonts:
70 | # - family: Schyler
71 | # fonts:
72 | # - asset: fonts/Schyler-Regular.ttf
73 | # - asset: fonts/Schyler-Italic.ttf
74 | # style: italic
75 | # - family: Trajan Pro
76 | # fonts:
77 | # - asset: fonts/TrajanPro.ttf
78 | # - asset: fonts/TrajanPro_Bold.ttf
79 | # weight: 700
80 | #
81 | # For details regarding fonts from package dependencies,
82 | # see https://flutter.dev/custom-fonts/#from-packages
83 |
--------------------------------------------------------------------------------
/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 | import 'package:flutter_xmllayout_example/app.dart';
11 |
12 | void main() {
13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
14 | // Build our app and trigger a frame.
15 | await tester.pumpWidget(MyApp());
16 |
17 | // Verify that our counter starts at 0.
18 | expect(find.text('0'), findsOneWidget);
19 | expect(find.text('1'), findsNothing);
20 |
21 | // Tap the '+' icon and trigger a frame.
22 | await tester.tap(find.byIcon(Icons.add));
23 | await tester.pump();
24 |
25 | // Verify that our counter has incremented.
26 | expect(find.text('0'), findsNothing);
27 | expect(find.text('1'), findsOneWidget);
28 | });
29 | }
30 |
--------------------------------------------------------------------------------