├── .gitignore ├── LICENSE ├── README.md ├── android ├── .project ├── .settings │ └── org.eclipse.buildship.core.prefs ├── app │ ├── .classpath │ ├── .project │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── build.gradle │ ├── google-services.json │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── playgroundflutter │ │ │ └── MainActivity.java │ │ └── res │ │ ├── drawable │ │ └── launch_background.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── demo.flr ├── fonts │ ├── gotham │ │ ├── GothamBold.ttf │ │ ├── GothamLight.ttf │ │ ├── GothamMedium.ttf │ │ └── GothamThin.otf │ ├── icofont │ │ └── icofont.ttf │ ├── montserrat │ │ ├── Montserrat-Bold.ttf │ │ ├── Montserrat-Medium.ttf │ │ └── Montserrat-Regular.ttf │ ├── roboto │ │ ├── Roboto-Bold.ttf │ │ ├── Roboto-Medium.ttf │ │ └── Roboto-Regular.ttf │ └── rubik │ │ ├── Rubik-Black.ttf │ │ ├── Rubik-BlackItalic.ttf │ │ ├── Rubik-Bold.ttf │ │ ├── Rubik-BoldItalic.ttf │ │ ├── Rubik-Italic.ttf │ │ ├── Rubik-Light.ttf │ │ ├── Rubik-LightItalic.ttf │ │ ├── Rubik-Medium.ttf │ │ ├── Rubik-MediumItalic.ttf │ │ ├── Rubik-Regular.ttf │ │ └── SIL Open Font License.txt ├── images │ ├── ar-glasses.png │ ├── cactus.png │ ├── gas.png │ ├── gas2.png │ ├── img1.png │ ├── img2.png │ ├── img3.png │ ├── img4.png │ ├── img5.png │ ├── img6.png │ ├── leaves.png │ ├── map.png │ ├── myAvatar.png │ ├── ng1.jpg │ ├── ng2.jpg │ ├── ng3.jpg │ └── splash-full-sml.jpg └── videos │ └── SampleVideo_1280x720_1mb.mp4 ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── main.m ├── lib ├── bloc │ └── theme.bloc.dart ├── components │ ├── FlipBoxBar │ │ ├── flip_box.dart │ │ └── flip_box_bar.dart │ └── ProgressButton │ │ └── progress-button.dart ├── configs │ ├── ioc.dart │ ├── routes.dart │ └── themes.dart ├── constants │ ├── database.dart │ └── navigation.dart ├── data │ ├── calls_data.dart │ ├── chats_data.dart │ ├── furniture_data.dart │ ├── game-organizer-data.dart │ ├── hotels_data.dart │ ├── icons.dart │ ├── real_estate_data.dart │ ├── sidemenu.dart │ └── trending.dart ├── environment.dart ├── environment │ └── environment.dart ├── home.dart ├── main.dart ├── models │ ├── baseball.model.dart │ ├── baseball.model.g.dart │ ├── call_model.dart │ ├── chat_model.dart │ ├── furniture_model.dart │ ├── game_organizer_model.dart │ ├── menu_item.model.dart │ ├── quant_hotels.model.dart │ ├── rates.model.dart │ ├── real_estate_model.dart │ ├── stackoverflow.model.dart │ └── stackoverflow_response.model.dart ├── pages │ ├── code_examples │ │ ├── auth_google │ │ │ └── auth_google.dart │ │ ├── download_and_shared │ │ │ ├── download_and_share.dart │ │ │ └── progress_bar.dart │ │ ├── firebase_crud │ │ │ └── firebase_crud.dart │ │ ├── mapbox │ │ │ └── mapbox.dart │ │ ├── navigation-bars │ │ │ ├── 3d_bottom_navigation_bar.dart │ │ │ └── bottom_with_float_button.dart │ │ ├── pdf_and_csv │ │ │ ├── csv.dart │ │ │ ├── pdf.dart │ │ │ ├── pdf_viewer.dart │ │ │ └── view_csv_data.dart │ │ ├── progress-button │ │ │ └── progress-button.dart │ │ ├── redux │ │ │ ├── preview_question.dart │ │ │ ├── question_item.dart │ │ │ ├── redux.viewmodel.dart │ │ │ └── redux_flutter.dart │ │ ├── screenshots │ │ │ ├── preview.dart │ │ │ └── screenshots.dart │ │ ├── sqlite │ │ │ └── sqlite.dart │ │ ├── touchid │ │ │ └── touchid.dart │ │ └── webview │ │ │ └── webview.dart │ └── templates │ │ ├── calculator-check-list-clone │ │ ├── calculator-check-list.dart │ │ ├── calculator_bloc.dart │ │ └── tab-indicator.dart │ │ ├── chat.dart │ │ ├── crypto-blockchain-wallet-clone │ │ └── crypto-blockchain-wallet.dart │ │ ├── daycare-clone │ │ └── daycare-home.dart │ │ ├── furniture-clone │ │ ├── furniture-category-home.dart │ │ ├── furniture-category-item.dart │ │ ├── furniture-content-section.dart │ │ └── furniture-home.dart │ │ ├── game-organizer-clone │ │ ├── game-organizer-detail.dart │ │ ├── game-organizer-helper.dart │ │ ├── game-organizer-home.dart │ │ ├── game-organizer-item.dart │ │ └── line-painter.dart │ │ ├── greenery-clone │ │ ├── greenery-details.dart │ │ └── greenery-home.dart │ │ ├── hospital-dashboard-clone │ │ ├── account.card.dart │ │ ├── appointment.card.dart │ │ ├── chart-painter.dart │ │ ├── current-data-chart-painter..dart │ │ └── hospital-dashboard-home.dart │ │ ├── network-of-gas-stations-clone │ │ ├── animated-container.dart │ │ ├── network-bottom-navigate.dart │ │ ├── network-gas-home.dart │ │ ├── network-of-gas-stations-home.dart │ │ └── network-slide-item.dart │ │ ├── news-app-concept-clone │ │ ├── bottom-bar.dart │ │ ├── categories-navigator.dart │ │ ├── news-app-concept-details.dart │ │ └── news-app-concept-home.dart │ │ ├── profile-one.dart │ │ ├── quant-hotels-booking-clone │ │ └── quant-hotels-booking-clone.dart │ │ ├── rahul-sliver-profile-demo │ │ ├── rahul-profile-detail-panel.dart │ │ └── rahul-sliver-profile.dart │ │ ├── real-estate-clone │ │ ├── components │ │ │ ├── real-estate-active-tab.dart │ │ │ └── real-estate-bottom-bar.dart │ │ ├── real-estate-home-details.dart │ │ └── real-estate-home.dart │ │ ├── smart-home-clone │ │ ├── bottom-bar.dart │ │ ├── curve-clipper.dart │ │ └── smart-home-home.dart │ │ ├── smart-plant-clone │ │ ├── chart-painter.dart │ │ └── smart-plant-home.dart │ │ ├── stayfit-health-clone │ │ ├── progress_bar.dart │ │ └── stayfit-health-home.dart │ │ ├── trending.dart │ │ └── whatsapp-clone │ │ ├── pages │ │ ├── call_details.dart │ │ ├── calls_sceen.dart │ │ ├── camera_sceen.dart │ │ ├── chats_sceen.dart │ │ └── status_sceen.dart │ │ └── whatsapp_home.dart ├── plugins │ └── camera_manager.dart ├── services │ ├── auth.service.dart │ ├── database.service.dart │ ├── firebase_basebal_team.service.dart │ ├── notification.service.dart │ ├── sqlite_basebal_team.service.dart │ ├── stack_overflow.service.dart │ └── web.client.dart ├── shared │ ├── utils │ │ └── touchid.util.dart │ └── widgets │ │ └── crud_demo_list_item.widget.dart └── store │ ├── actions │ └── stack_overflow.action.dart │ ├── middlewares │ └── stack_overflow.middleware.dart │ ├── reducers │ ├── reducer.dart │ └── stack_overflow.reducer.dart │ ├── selectors │ └── stack_overflow.selector.dart │ ├── state │ ├── app.state.dart │ └── stack_overflow.state.dart │ └── store.dart ├── pubspec.yaml ├── screenshots ├── ss1.png ├── ss10.gif ├── ss10.png ├── ss11.gif ├── ss11.png ├── ss12.gif ├── ss12.png ├── ss13.png ├── ss14.png ├── ss15.png ├── ss16.png ├── ss17.png ├── ss18.png ├── ss19.png ├── ss2.png ├── ss20.png ├── ss21.png ├── ss22.png ├── ss23.png ├── ss24.png ├── ss3.gif ├── ss3.png ├── ss4.png ├── ss5.gif ├── ss5.png ├── ss6.gif ├── ss6.png ├── ss7.gif ├── ss7.png ├── ss8.gif ├── ss8.png ├── ss9.gif └── ss9.png └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # Visual Studio Code related 20 | .vscode/ 21 | 22 | # Flutter/Dart/Pub related 23 | **/doc/api/ 24 | .dart_tool/ 25 | .flutter-plugins 26 | .packages 27 | .pub-cache/ 28 | .pub/ 29 | build/ 30 | 31 | # Android related 32 | **/android/**/gradle-wrapper.jar 33 | **/android/.gradle 34 | **/android/captures/ 35 | **/android/gradlew 36 | **/android/gradlew.bat 37 | **/android/local.properties 38 | **/android/**/GeneratedPluginRegistrant.java 39 | 40 | # iOS/XCode related 41 | **/ios/**/*.mode1v3 42 | **/ios/**/*.mode2v3 43 | **/ios/**/*.moved-aside 44 | **/ios/**/*.pbxuser 45 | **/ios/**/*.perspectivev3 46 | **/ios/**/*sync/ 47 | **/ios/**/.sconsign.dblite 48 | **/ios/**/.tags* 49 | **/ios/**/.vagrant/ 50 | **/ios/**/DerivedData/ 51 | **/ios/**/Icon? 52 | **/ios/**/Pods/ 53 | **/ios/**/.symlinks/ 54 | **/ios/**/profile 55 | **/ios/**/xcuserdata 56 | **/ios/.generated/ 57 | **/ios/Flutter/App.framework 58 | **/ios/Flutter/Flutter.framework 59 | **/ios/Flutter/Generated.xcconfig 60 | **/ios/Flutter/app.flx 61 | **/ios/Flutter/app.zip 62 | **/ios/Flutter/flutter_assets/ 63 | **/ios/ServiceDefinitions.json 64 | **/ios/Runner/GeneratedPluginRegistrant.* 65 | 66 | # Exceptions to above rules. 67 | !**/ios/**/default.mode1v3 68 | !**/ios/**/default.mode2v3 69 | !**/ios/**/default.pbxuser 70 | !**/ios/**/default.perspectivev3 71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 72 | ios/Flutter/flutter_export_environment.sh 73 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Javier 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 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir= 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /android/app/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /android/app/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir=.. 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.playgroundflutter" 37 | minSdkVersion 21 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'androidx.test:runner:1.1.1' 60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 61 | implementation 'com.google.firebase:firebase-core:16.0.9' 62 | } 63 | 64 | apply plugin: 'com.google.gms.google-services' -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "170634458887", 4 | "firebase_url": "https://playground-flutter-fd5ca.firebaseio.com", 5 | "project_id": "playground-flutter-fd5ca", 6 | "storage_bucket": "playground-flutter-fd5ca.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:170634458887:android:e5ffd269b3f69000", 12 | "android_client_info": { 13 | "package_name": "com.example.playgroundflutter" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "170634458887-v7cpqgltrfbe47poqaung1t9m8lt509t.apps.googleusercontent.com", 19 | "client_type": 1, 20 | "android_info": { 21 | "package_name": "com.example.playgroundflutter", 22 | "certificate_hash": "5d1c4448310ac2cf701384e34564cef9da2b5954" 23 | } 24 | }, 25 | { 26 | "client_id": "170634458887-omkd6qp8p6mbururji6b1mhr5m0edmgm.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ], 30 | "api_key": [ 31 | { 32 | "current_key": "AIzaSyBDFHag05ZHFL4q3snWyzynWh2GEWGR7o4" 33 | } 34 | ], 35 | "services": { 36 | "appinvite_service": { 37 | "other_platform_oauth_client": [ 38 | { 39 | "client_id": "170634458887-omkd6qp8p6mbururji6b1mhr5m0edmgm.apps.googleusercontent.com", 40 | "client_type": 3 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | ], 47 | "configuration_version": "1" 48 | } -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 22 | 23 | 30 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/example/playgroundflutter/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.playgroundflutter; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterFragmentActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterFragmentActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.3.2' 9 | classpath 'com.google.gms:google-services:4.2.0' 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | google() 16 | jcenter() 17 | } 18 | } 19 | 20 | rootProject.buildDir = '../build' 21 | subprojects { 22 | project.buildDir = "${rootProject.buildDir}/${project.name}" 23 | } 24 | subprojects { 25 | project.evaluationDependsOn(':app') 26 | } 27 | 28 | task clean(type: Delete) { 29 | delete rootProject.buildDir 30 | } 31 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /assets/demo.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/demo.flr -------------------------------------------------------------------------------- /assets/fonts/gotham/GothamBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/gotham/GothamBold.ttf -------------------------------------------------------------------------------- /assets/fonts/gotham/GothamLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/gotham/GothamLight.ttf -------------------------------------------------------------------------------- /assets/fonts/gotham/GothamMedium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/gotham/GothamMedium.ttf -------------------------------------------------------------------------------- /assets/fonts/gotham/GothamThin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/gotham/GothamThin.otf -------------------------------------------------------------------------------- /assets/fonts/icofont/icofont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/icofont/icofont.ttf -------------------------------------------------------------------------------- /assets/fonts/montserrat/Montserrat-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/montserrat/Montserrat-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/montserrat/Montserrat-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/montserrat/Montserrat-Medium.ttf -------------------------------------------------------------------------------- /assets/fonts/montserrat/Montserrat-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/montserrat/Montserrat-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/roboto/Roboto-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/roboto/Roboto-Medium.ttf -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/roboto/Roboto-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/rubik/Rubik-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/rubik/Rubik-Black.ttf -------------------------------------------------------------------------------- /assets/fonts/rubik/Rubik-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/rubik/Rubik-BlackItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/rubik/Rubik-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/rubik/Rubik-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/rubik/Rubik-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/rubik/Rubik-BoldItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/rubik/Rubik-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/rubik/Rubik-Italic.ttf -------------------------------------------------------------------------------- /assets/fonts/rubik/Rubik-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/rubik/Rubik-Light.ttf -------------------------------------------------------------------------------- /assets/fonts/rubik/Rubik-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/rubik/Rubik-LightItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/rubik/Rubik-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/rubik/Rubik-Medium.ttf -------------------------------------------------------------------------------- /assets/fonts/rubik/Rubik-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/rubik/Rubik-MediumItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/rubik/Rubik-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/fonts/rubik/Rubik-Regular.ttf -------------------------------------------------------------------------------- /assets/images/ar-glasses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/ar-glasses.png -------------------------------------------------------------------------------- /assets/images/cactus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/cactus.png -------------------------------------------------------------------------------- /assets/images/gas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/gas.png -------------------------------------------------------------------------------- /assets/images/gas2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/gas2.png -------------------------------------------------------------------------------- /assets/images/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/img1.png -------------------------------------------------------------------------------- /assets/images/img2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/img2.png -------------------------------------------------------------------------------- /assets/images/img3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/img3.png -------------------------------------------------------------------------------- /assets/images/img4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/img4.png -------------------------------------------------------------------------------- /assets/images/img5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/img5.png -------------------------------------------------------------------------------- /assets/images/img6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/img6.png -------------------------------------------------------------------------------- /assets/images/leaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/leaves.png -------------------------------------------------------------------------------- /assets/images/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/map.png -------------------------------------------------------------------------------- /assets/images/myAvatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/myAvatar.png -------------------------------------------------------------------------------- /assets/images/ng1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/ng1.jpg -------------------------------------------------------------------------------- /assets/images/ng2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/ng2.jpg -------------------------------------------------------------------------------- /assets/images/ng3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/ng3.jpg -------------------------------------------------------------------------------- /assets/images/splash-full-sml.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/images/splash-full-sml.jpg -------------------------------------------------------------------------------- /assets/videos/SampleVideo_1280x720_1mb.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/assets/videos/SampleVideo_1280x720_1mb.mp4 -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/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/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | playground_flutter 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/bloc/theme.bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:playground_flutter/configs/themes.dart'; 4 | 5 | class ThemeBloc { 6 | final StreamController _themeController = StreamController(); 7 | get changeTheme => _themeController.sink.add; 8 | get themeEnabled => _themeController.stream; 9 | } 10 | 11 | final themeBloc = ThemeBloc(); 12 | -------------------------------------------------------------------------------- /lib/components/FlipBoxBar/flip_box.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:math'; 3 | 4 | /// FlipBox constructs a Box consisting of two planes which can be controlled using a given Animation Controller. 5 | class FlipBox extends StatefulWidget { 6 | /// The widget on the top side of the box. (Here, "top" refers to position in Stack). 7 | final Widget bottomChild; 8 | 9 | /// The widget in front of the user initially. 10 | final Widget topChild; 11 | 12 | /// The height of the box (Carries the BottomNavigationBar height). 13 | final double height; 14 | 15 | /// The animation controller to control the flip animation. 16 | final AnimationController controller; 17 | 18 | /// Callback for when the box is selected (Not when the box is reversed). 19 | final VoidCallback onTapped; 20 | 21 | FlipBox({ 22 | this.bottomChild, 23 | this.topChild, 24 | this.height = 80.0, 25 | this.controller, 26 | this.onTapped, 27 | }); 28 | 29 | @override 30 | _FlipBoxState createState() => _FlipBoxState(); 31 | } 32 | 33 | class _FlipBoxState extends State with SingleTickerProviderStateMixin { 34 | /// Tween for going from 0 to pi/2 radian and vice versa. 35 | Animation animation; 36 | 37 | /// Controller for controlling the Box. 38 | AnimationController controller; 39 | 40 | @override 41 | void initState() { 42 | super.initState(); 43 | if (widget.controller == null) { 44 | controller = AnimationController( 45 | vsync: this, duration: Duration(milliseconds: 2000)); 46 | } else { 47 | controller = widget.controller; 48 | } 49 | animation = Tween(begin: 0.0, end: pi / 2).animate( 50 | CurvedAnimation(parent: controller, curve: Curves.elasticInOut), 51 | ); 52 | 53 | controller.addListener(() { 54 | setState(() {}); 55 | }); 56 | } 57 | 58 | @override 59 | Widget build(BuildContext context) { 60 | return Container( 61 | height: widget.height, 62 | width: double.infinity, 63 | child: Stack( 64 | children: [ 65 | Transform( 66 | alignment: Alignment.center, 67 | transform: Matrix4.identity() 68 | ..setEntry(3, 2, 0.001) 69 | ..translate(0.0, -(cos(animation.value) * (widget.height / 2)), 70 | ((-widget.height / 2) * sin(animation.value))) 71 | ..rotateX(-(pi / 2) + animation.value), 72 | child: Container( 73 | child: Center(child: widget.bottomChild), 74 | ), 75 | ), 76 | GestureDetector( 77 | onTap: () { 78 | widget.onTapped(); 79 | controller.forward(); 80 | }, 81 | child: animation.value < (85 * pi / 180) 82 | ? Transform( 83 | alignment: Alignment.center, 84 | transform: Matrix4.identity() 85 | ..setEntry(3, 2, 0.001) 86 | ..translate( 87 | 0.0, 88 | (widget.height / 2) * sin(animation.value), 89 | -((widget.height / 2) * cos(animation.value)), 90 | ) 91 | ..rotateX(animation.value), 92 | child: Container( 93 | child: Center(child: widget.topChild), 94 | ), 95 | ) 96 | : Container(), 97 | ), 98 | ], 99 | ), 100 | ); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /lib/configs/ioc.dart: -------------------------------------------------------------------------------- 1 | import 'package:get_it/get_it.dart'; 2 | import 'package:playground_flutter/services/firebase_basebal_team.service.dart'; 3 | import 'package:playground_flutter/services/sqlite_basebal_team.service.dart'; 4 | import 'package:playground_flutter/services/database.service.dart'; 5 | import 'package:playground_flutter/services/stack_overflow.service.dart'; 6 | import 'package:playground_flutter/services/web.client.dart'; 7 | import 'package:playground_flutter/shared/utils/touchid.util.dart'; 8 | 9 | final GetIt ioc = GetIt.instance; 10 | 11 | class Ioc { 12 | static setupIocDependency() { 13 | ioc.registerSingleton(new WebClient()); 14 | ioc.registerSingleton(new StackOverflowService()); 15 | ioc.registerSingleton(new SqliteDatabaseService()); 16 | ioc.registerSingleton(new SqliteBaseballService()); 17 | ioc.registerSingleton(new FirebaseBaseballService()); 18 | ioc.registerSingleton(new TouchIdUtil()); 19 | } 20 | 21 | static T get() { 22 | return ioc.get(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/configs/themes.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | enum Themes { 4 | light, 5 | dark, 6 | whapsapp, 7 | gameOrganizer, 8 | smartHome, 9 | networkGas, 10 | sliverProfile, 11 | stayfit, 12 | calculator 13 | } 14 | 15 | ThemeData getThemeByType(Themes type) { 16 | switch (type) { 17 | case Themes.dark: 18 | return ThemeData( 19 | brightness: Brightness.light, 20 | ); 21 | case Themes.whapsapp: 22 | return ThemeData( 23 | primaryColor: new Color(0xff075E54), 24 | accentColor: new Color(0xff25D366), 25 | fontFamily: 'Rubik', 26 | ); 27 | case Themes.smartHome: 28 | return ThemeData( 29 | brightness: Brightness.light, 30 | backgroundColor: Color(0xfff7f8f9), 31 | fontFamily: 'Rubik', 32 | cardColor: Colors.white, 33 | accentColor: Color(0xffff1e39), 34 | //textTheme: TextTheme(), 35 | ); 36 | case Themes.gameOrganizer: 37 | return ThemeData( 38 | brightness: Brightness.light, 39 | appBarTheme: AppBarTheme( 40 | color: new Color(0xff00b965), 41 | ), 42 | accentColor: new Color(0xff00b965), 43 | backgroundColor: Color(0xfff7f8f9), 44 | fontFamily: 'Rubik', 45 | cardColor: Colors.white, 46 | //textTheme: TextTheme(), 47 | ); 48 | case Themes.networkGas: 49 | { 50 | return ThemeData( 51 | brightness: Brightness.light, 52 | fontFamily: 'Roboto', 53 | ); 54 | } 55 | case Themes.sliverProfile: 56 | { 57 | return ThemeData( 58 | brightness: Brightness.light, 59 | textTheme: TextTheme( 60 | title: TextStyle( 61 | color: Colors.black, 62 | )), 63 | fontFamily: 'Roboto', 64 | ); 65 | } 66 | case Themes.stayfit: 67 | { 68 | return ThemeData( 69 | brightness: Brightness.light, 70 | fontFamily: 'Gotham', 71 | ); 72 | } 73 | case Themes.calculator: 74 | return ThemeData( 75 | brightness: Brightness.dark, 76 | fontFamily: 'Roboto', 77 | backgroundColor: Color(0xff464c51), 78 | textTheme: TextTheme( 79 | body1: TextStyle( 80 | letterSpacing: 1.3, 81 | ), 82 | ), 83 | ); 84 | default: 85 | return ThemeData( 86 | brightness: Brightness.light, 87 | fontFamily: 'Rubik', 88 | ); 89 | } 90 | } 91 | 92 | const Color _kKeyUmbraOpacity = Color(0x33000000); // alpha = 0.2 93 | const Color _kKeyPenumbraOpacity = Color(0x24000000); // alpha = 0.14 94 | const Color _kAmbientShadowOpacity = Color(0x1F000000); // alpha = 0.12 95 | 96 | List shadow1 = [ 97 | BoxShadow( 98 | offset: Offset(0.0, 0.3), 99 | blurRadius: 0.3, 100 | spreadRadius: -0.3, 101 | color: _kKeyUmbraOpacity.withOpacity(0.5), 102 | ), 103 | BoxShadow( 104 | offset: Offset(0.0, 0.3), 105 | blurRadius: 0.3, 106 | spreadRadius: 0.0, 107 | color: _kKeyPenumbraOpacity.withOpacity(0.5), 108 | ), 109 | BoxShadow( 110 | offset: Offset(0.0, 0.3), 111 | blurRadius: 0.3, 112 | spreadRadius: 0.0, 113 | color: _kAmbientShadowOpacity.withOpacity(0.5), 114 | ), 115 | ]; 116 | -------------------------------------------------------------------------------- /lib/constants/database.dart: -------------------------------------------------------------------------------- 1 | class DatabaseContants { 2 | static const String TEAMS_TABLE_NAME = "baseball_teams"; 3 | } 4 | -------------------------------------------------------------------------------- /lib/constants/navigation.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class NavigationConstrants { 4 | static final navKey = new GlobalKey(); 5 | 6 | // Notification routes 7 | static const String NOTIFICATION_SUCCESS = "notification-success-route"; 8 | static const String NOTIFICATION_ERROR = "notification-error-route"; 9 | static const String NOTIFICATION_INFO = "notification-info-route"; 10 | 11 | // Pages routes 12 | static const String BottomBarWithFloatButton = "/BottomBarWithFloatButton"; 13 | static const String ThreeDimenssionBottomNavigationBar = "/ThreeDimenssionBottomNavigationBar"; 14 | static const String Trending = "/Trending"; 15 | static const String ProfileOne = "/ProfileOne"; 16 | static const String WhatsApp = "/WhatsApp"; 17 | static const String Greenery = "/Greenery"; 18 | static const String ProgressButton = "/ProgressButton"; 19 | static const String Daycare = "/Daycare"; 20 | static const String RealEstate = "/RealEstate"; 21 | static const String SmartPlant = "/SmartPlant"; 22 | static const String HospitalDashboard = "/HospitalDashboard"; 23 | static const String NewsAppConcept = "/NewsAppConcept"; 24 | static const String Furniture = "/Furniture"; 25 | static const String GameOrganizer = "/GameOrganizer"; 26 | static const String SmartHome = "/SmartHome"; 27 | static const String GoogleAuth = "/GoogleAuth"; 28 | static const String WebviewFlutter = "/WebviewFlutter"; 29 | static const String ReduxFlutter = "/ReduxFlutter"; 30 | static const String ReduxViewQuestion = "/redux-view-question"; 31 | static const String CryptoBlockchainWallet = "/CryptoBlockchainWallet"; 32 | static const String NetworkGasStationHome = "/NetworkGasStation"; 33 | static const String MapBoxDemo = "/MapBoxDemo"; 34 | static const String SqliteDemo = "/SqliteDemo"; 35 | static const String FirebaseDemo = "/FirebaseDemo"; 36 | static const String PdfGeneratorDemo = "/PdfGeneratorDemo"; 37 | static const String CsvGeneratorDemo = "/CsvGeneratorDemo"; 38 | static const String RahulSliverProfile = "/RahulSliverProfile"; 39 | static const String TouchIdDemo = "/TouchIdDemo"; 40 | static const String DownloadAndShareDemo = "/DownloadAndShareDemo"; 41 | static const String ScreenshotDemo = "/ScreenshotDemo"; 42 | static const String CalculatorChecklistHome = "/CalculatorChecklist"; 43 | static const String StayfitHealthHome = "/StayfitHealth"; 44 | static const String QuantHotelsBookingPage = "/QuantHotelsBookingPage"; 45 | } 46 | -------------------------------------------------------------------------------- /lib/data/calls_data.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:playground_flutter/models/call_model.dart'; 4 | 5 | final List calls = [ 6 | new CallModel( 7 | name: 'Javier González', 8 | time: "12:30 PM", 9 | type: CallType.Call, 10 | avatar: 11 | "http://www.usanetwork.com/sites/usanetwork/files/styles/629x720/public/suits_cast_harvey.jpg?itok=fpTOeeBb", 12 | ), 13 | new CallModel( 14 | name: 'Daynelis Cruz', 15 | time: "12:32 PM", 16 | type: CallType.Call, 17 | avatar: 18 | "https://heavyeditorial.files.wordpress.com/2017/07/jessica-johnson-5.jpg?w=531&quality=65&strip=all&h=531", 19 | ), 20 | new CallModel( 21 | name: 'Javier González', 22 | time: "12:35 PM", 23 | type: CallType.Video, 24 | avatar: 25 | "http://www.usanetwork.com/sites/usanetwork/files/styles/629x720/public/suits_cast_harvey.jpg?itok=fpTOeeBb", 26 | ), 27 | new CallModel( 28 | name: 'Daynelis Cruz', 29 | time: "12:36 PM", 30 | type: CallType.Call, 31 | avatar: 32 | "https://heavyeditorial.files.wordpress.com/2017/07/jessica-johnson-5.jpg?w=531&quality=65&strip=all&h=531", 33 | ), 34 | ]; 35 | -------------------------------------------------------------------------------- /lib/data/chats_data.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:playground_flutter/models/chat_model.dart'; 3 | 4 | final List chats = [ 5 | new ChatModel( 6 | name: 'Javier González', 7 | message: 8 | "Mima estoy en el Shopping, quieres que compre algo para la cena ?", 9 | time: "12:30 PM", 10 | avatar: 11 | "http://www.usanetwork.com/sites/usanetwork/files/styles/629x720/public/suits_cast_harvey.jpg?itok=fpTOeeBb", 12 | ), 13 | new ChatModel( 14 | name: 'Daynelis Cruz', 15 | message: "Revisa si hay tomates frescos en el mercado", 16 | time: "12:32 PM", 17 | avatar: 18 | "https://heavyeditorial.files.wordpress.com/2017/07/jessica-johnson-5.jpg?w=531&quality=65&strip=all&h=531", 19 | ), 20 | new ChatModel( 21 | name: 'Javier González', 22 | message: "OK, algo más ?", 23 | time: "12:35 PM", 24 | avatar: 25 | "http://www.usanetwork.com/sites/usanetwork/files/styles/629x720/public/suits_cast_harvey.jpg?itok=fpTOeeBb", 26 | ), 27 | new ChatModel( 28 | name: 'Daynelis Cruz', 29 | message: "No, solo eso necesito", 30 | time: "12:36 PM", 31 | avatar: 32 | "https://heavyeditorial.files.wordpress.com/2017/07/jessica-johnson-5.jpg?w=531&quality=65&strip=all&h=531", 33 | ), 34 | ]; 35 | -------------------------------------------------------------------------------- /lib/data/furniture_data.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/models/furniture_model.dart'; 2 | 3 | List furnitureResult = [ 4 | new FurnitureModel( 5 | img: 6 | 'https://ae01.alicdn.com/kf/HTB1bxKJJpXXXXcaXXXXq6xXFXXXF/Free-Shipping-DIY-House-Decoration-Wooden-Background-TV-Wall-Shelf-for-Living-Room-3D-Wooden-Wall.jpg_640x640.jpg', 7 | description: '088 Alisha Hill Apt. 345', 8 | name: 'Family House', 9 | priceOff: '800', 10 | price: '1000', 11 | ), 12 | new FurnitureModel( 13 | img: 14 | 'http://www.banana-film.com/wp-content/uploads/2018/06/country-kitchen-fresh-country-kitchen-chandelier-ideas-home-design-of-country-kitchen.jpg', 15 | description: '088 Alisha Hill Apt. 345', 16 | name: 'Family House', 17 | priceOff: '2000', 18 | price: '3500', 19 | ), 20 | new FurnitureModel( 21 | img: 22 | 'http://roetsjordanbrewery.com/wp-content/uploads/2018/09/traditional-kitchen-cabinet-ideas-grey-fitted-kitchens-traditional-open-kitchen-designs.jpg', 23 | description: '088 Alisha Hill Apt. 345', 24 | name: 'Family House', 25 | priceOff: '1000', 26 | price: '3200', 27 | ), 28 | ]; 29 | -------------------------------------------------------------------------------- /lib/data/game-organizer-data.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:playground_flutter/data/icons.dart'; 3 | import 'package:playground_flutter/models/game_organizer_model.dart'; 4 | 5 | final List organizerTodayData = [ 6 | new GameOrganizerModelModel( 7 | name: 'Tennis', 8 | city: 'New York', 9 | country: 'USA', 10 | date: 'April 1, 2019', 11 | hour: '12:30', 12 | playersWithMaybe: 4, 13 | playersWithNo: 2, 14 | playersWithYes: 8, 15 | color: Color(0xfffcb35f), 16 | icon: tennis, 17 | ), 18 | ]; 19 | 20 | final List organizerOtherData = [ 21 | new GameOrganizerModelModel( 22 | name: 'Golf', 23 | city: 'New York', 24 | country: 'USA', 25 | date: 'April 1, 2019', 26 | hour: '12:30', 27 | playersWithMaybe: 4, 28 | playersWithNo: 2, 29 | playersWithYes: 8, 30 | color: Color(0xff7872f8), 31 | icon: golf_field, 32 | ), 33 | new GameOrganizerModelModel( 34 | name: 'Football', 35 | city: 'New York', 36 | country: 'USA', 37 | date: 'April 1, 2019', 38 | hour: '12:30', 39 | playersWithMaybe: 4, 40 | playersWithNo: 2, 41 | playersWithYes: 8, 42 | color: Color(0xff2a8cee), 43 | icon: football, 44 | ), 45 | new GameOrganizerModelModel( 46 | name: 'Football A.', 47 | city: 'New York', 48 | country: 'USA', 49 | date: 'April 1, 2019', 50 | hour: '12:30', 51 | playersWithMaybe: 4, 52 | playersWithNo: 2, 53 | playersWithYes: 8, 54 | color: Colors.redAccent, 55 | icon: football_american, 56 | ), 57 | new GameOrganizerModelModel( 58 | name: 'Baseball', 59 | city: 'New York', 60 | country: 'USA', 61 | date: 'April 1, 2019', 62 | hour: '12:30', 63 | playersWithMaybe: 4, 64 | playersWithNo: 2, 65 | playersWithYes: 8, 66 | color: Color(0xff00b966), 67 | icon: baseball, 68 | ) 69 | ]; 70 | -------------------------------------------------------------------------------- /lib/data/hotels_data.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/models/quant_hotels.model.dart'; 2 | 3 | final List hotels = [ 4 | new QuantHotelModel( 5 | img: 6 | "https://x.cdrst.com/foto/hotel-sf/14aff/granderesp/hotel-mandarin-oriental-paris-habitacion-875d86d.jpg", 7 | name: "Mandarin Oriental", 8 | price: 80, 9 | reviews: 4, 10 | ), 11 | new QuantHotelModel( 12 | img: 13 | "http://cdmxtravel.com/assets/cache/26505e0494662534f633586941b77d0c/discover-3598-1-spa-hotel-jw-marriott-mexico-city_848x476_adaptiveResize.jpg", 14 | name: "JW Mariott Hotel", 15 | price: 75, 16 | reviews: 3.8, 17 | ) 18 | ]; 19 | -------------------------------------------------------------------------------- /lib/data/icons.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const baseball = IconData(0xed8e, fontFamily: 'Iconfont'); 4 | const badminton = IconData(0xed8d, fontFamily: 'Iconfont'); 5 | const basketball = IconData(0xed91, fontFamily: 'Iconfont'); 6 | const canoe = IconData(0xed98, fontFamily: 'Iconfont'); 7 | const football_american = IconData(0xed9f, fontFamily: 'Iconfont'); 8 | const football = IconData(0xeda0, fontFamily: 'Iconfont'); 9 | const golf_field = IconData(0xeda7, fontFamily: 'Iconfont'); 10 | const volleyball = IconData(0xedda, fontFamily: 'Iconfont'); 11 | const tennis = IconData(0xedd4, fontFamily: 'Iconfont'); 12 | const history = IconData(0xef46, fontFamily: 'Iconfont'); 13 | const users = IconData(0xed08, fontFamily: 'Iconfont'); 14 | -------------------------------------------------------------------------------- /lib/data/real_estate_data.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/models/real_estate_model.dart'; 2 | 3 | List realEstatesResult = [ 4 | new RealEstateModel( 5 | img: 'https://rew-feed-images.global.ssl.fastly.net/creb/_cloud_media/listing/detached/c4241465-3-o.jpg', 6 | address: '088 Alisha Hill Apt. 345', 7 | name: 'Family House', 8 | priceOff: '33%' 9 | ), 10 | new RealEstateModel( 11 | img: 'http://www.grandviewriverhouse.com/box/sm/inspiring-european-cottage-style-house-plans-on-interior-decor_bathroom-inspiration.jpg', 12 | address: '55 Alisha Hill Apt. 345', 13 | name: 'ArtHouse', 14 | priceOff: '50%' 15 | ), 16 | new RealEstateModel( 17 | img: 'https://www.ryanhomes.com/rh-community-gallery-NewAspectRatio/969616de-2e2c-4229-8941-05dcfc63f3b5/db/969616de-2e2c-4229-8941-05dcfc63f3b5.jpg', 18 | address: '088 Alisha Hill Apt. 345', 19 | name: 'Family House', 20 | priceOff: '15%' 21 | ), 22 | ]; -------------------------------------------------------------------------------- /lib/data/trending.dart: -------------------------------------------------------------------------------- 1 | class Product { 2 | String title; 3 | String image; 4 | 5 | Product(this.title, this.image); 6 | } 7 | 8 | class TrendingModel { 9 | String title; 10 | List items; 11 | 12 | TrendingModel(this.title, this.items); 13 | } 14 | 15 | List trending = [ 16 | new TrendingModel("Popular Trending Tec", [ 17 | new Product("Play Station", 18 | "https://www.howtogeek.com/wp-content/uploads/2016/01/steam-and-xbox-controllers.jpg"), 19 | new Product("XBox", 20 | "https://www.howtogeek.com/wp-content/uploads/2016/01/steam-and-xbox-controllers.jpg"), 21 | new Product("Electronics", 22 | "http://images4.fanpop.com/image/photos/21600000/Electronics-hd-wallpaper-21627626-1920-1200.jpg"), 23 | ]), 24 | new TrendingModel("Popular Trending Travel", [ 25 | new Product("Moscu", 26 | "https://cms.hostelworld.com/hwblog/wp-content/uploads/sites/2/2017/08/girlgoneabroad-1170x805.jpg"), 27 | new Product("Varadero", "http://www.aphamok.com/images/travel.jpg"), 28 | new Product("Cancun", 29 | "https://thenationalwealthcenterreview.com/wp-content/uploads/2015/06/travel.jpg"), 30 | ]), 31 | ]; 32 | -------------------------------------------------------------------------------- /lib/environment.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | import 'package:playground_flutter/configs/ioc.dart'; 4 | import 'package:playground_flutter/services/database.service.dart'; 5 | import 'package:playground_flutter/store/store.dart'; 6 | 7 | class Environment { 8 | static setup() async { 9 | // Make sure that the binary messenger binding are properly initialiazed 10 | WidgetsFlutterBinding.ensureInitialized(); 11 | 12 | // lock orientation position 13 | SystemChrome.setPreferredOrientations([ 14 | DeviceOrientation.portraitDown, 15 | DeviceOrientation.portraitUp, 16 | ]); 17 | 18 | // transparent status bar 19 | SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( 20 | statusBarColor: Colors.transparent, 21 | statusBarIconBrightness: Brightness.light, 22 | )); 23 | 24 | Ioc.setupIocDependency(); 25 | await Ioc.get().initDatabase(); 26 | 27 | return await createStore(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/environment/environment.dart: -------------------------------------------------------------------------------- 1 | class Environment { 2 | static String api = 'https://api.stackexchange.com/2.2/questions'; 3 | static String tokenKey = '@token'; 4 | } 5 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_redux/flutter_redux.dart'; 3 | import 'package:playground_flutter/bloc/theme.bloc.dart'; 4 | import 'package:playground_flutter/configs/routes.dart'; 5 | import 'package:playground_flutter/configs/themes.dart'; 6 | import 'package:playground_flutter/constants/navigation.dart'; 7 | import 'package:playground_flutter/environment.dart'; 8 | import 'package:playground_flutter/store/state/app.state.dart'; 9 | import 'package:redux/redux.dart'; 10 | 11 | void main() async { 12 | final Store store = await Environment.setup(); 13 | 14 | return runApp(MyApp(store)); 15 | } 16 | 17 | class MyApp extends StatelessWidget { 18 | final Store store; 19 | 20 | MyApp(this.store); 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return StoreProvider( 25 | store: store, 26 | child: StreamBuilder( 27 | stream: themeBloc.themeEnabled, 28 | builder: (context, snapshot) { 29 | return MaterialApp( 30 | title: 'Flutter Demo', 31 | theme: getThemeByType(snapshot.data), 32 | initialRoute: '/', 33 | debugShowCheckedModeBanner: false, 34 | onGenerateRoute: generateRoutes, 35 | //routes: routes, 36 | navigatorKey: NavigationConstrants.navKey, 37 | ); 38 | }), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/models/baseball.model.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | 4 | part 'baseball.model.g.dart'; 5 | 6 | @JsonSerializable() 7 | class BaseballModel { 8 | dynamic key; 9 | String name; 10 | String coach; 11 | int players; 12 | 13 | BaseballModel({ 14 | this.key, 15 | this.name = "", 16 | this.coach = "", 17 | this.players = 0, 18 | }); 19 | 20 | factory BaseballModel.fromJson(Map json) => 21 | _$BaseballModelFromJson(json); 22 | 23 | Map toJson() => _$BaseballModelToJson(this); 24 | 25 | BaseballModel.fromSnapshot(DocumentSnapshot snapshot) 26 | : key = snapshot.documentID, 27 | name = snapshot['name'], 28 | coach = snapshot['coach'], 29 | players = snapshot['players']; 30 | } 31 | -------------------------------------------------------------------------------- /lib/models/baseball.model.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'baseball.model.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | BaseballModel _$BaseballModelFromJson(Map json) { 10 | return BaseballModel( 11 | key: json['key'], 12 | name: json['name'] as String, 13 | coach: json['coach'] as String, 14 | players: json['players'] as int); 15 | } 16 | 17 | Map _$BaseballModelToJson(BaseballModel instance) => 18 | { 19 | 'key': instance.key, 20 | 'name': instance.name, 21 | 'coach': instance.coach, 22 | 'players': instance.players 23 | }; 24 | -------------------------------------------------------------------------------- /lib/models/call_model.dart: -------------------------------------------------------------------------------- 1 | enum CallType { Call, Video } 2 | 3 | class CallModel { 4 | final String name; 5 | final String time; 6 | final String avatar; 7 | final CallType type; 8 | 9 | CallModel({this.name, this.type, this.time, this.avatar}); 10 | } 11 | -------------------------------------------------------------------------------- /lib/models/chat_model.dart: -------------------------------------------------------------------------------- 1 | class ChatModel { 2 | final String name; 3 | final String message; 4 | final String time; 5 | final String avatar; 6 | 7 | ChatModel({this.name, this.message, this.time, this.avatar}); 8 | } 9 | -------------------------------------------------------------------------------- /lib/models/furniture_model.dart: -------------------------------------------------------------------------------- 1 | class FurnitureModel { 2 | final String img; 3 | final String name; 4 | final String description; 5 | final String priceOff; 6 | final String price; 7 | 8 | FurnitureModel( 9 | {this.img, this.name, this.description, this.priceOff, this.price}); 10 | } 11 | -------------------------------------------------------------------------------- /lib/models/game_organizer_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class GameOrganizerModelModel { 4 | final String name; 5 | final String country; 6 | final String city; 7 | final String hour; 8 | final String date; 9 | final int playersWithYes; 10 | final int playersWithNo; 11 | final int playersWithMaybe; 12 | final Color color; 13 | final IconData icon; 14 | 15 | GameOrganizerModelModel({ 16 | this.name, 17 | this.country, 18 | this.city, 19 | this.hour, 20 | this.date, 21 | this.playersWithYes, 22 | this.playersWithNo, 23 | this.playersWithMaybe, 24 | this.color, 25 | this.icon, 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /lib/models/menu_item.model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | enum MenuItemType { TEMPLATE, COMPONENT, CODE } 4 | 5 | class MenuModel { 6 | IconData icon; 7 | String title; 8 | String route; 9 | bool isRoot; 10 | MenuItemType type; 11 | 12 | MenuModel({ 13 | this.title, 14 | this.icon, 15 | this.route, 16 | this.isRoot = false, 17 | this.type = MenuItemType.TEMPLATE, 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /lib/models/quant_hotels.model.dart: -------------------------------------------------------------------------------- 1 | class QuantHotelModel { 2 | final String name; 3 | final String img; 4 | final double reviews; 5 | final double price; 6 | 7 | QuantHotelModel({ 8 | this.name, 9 | this.img, 10 | this.reviews, 11 | this.price, 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /lib/models/rates.model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | 3 | class RateModel { 4 | double buy; 5 | double sell; 6 | 7 | RateModel({ 8 | @required this.buy, 9 | @required this.sell, 10 | }); 11 | } 12 | 13 | class RatesModel { 14 | RateModel usd; 15 | RateModel euro; 16 | 17 | RatesModel({ 18 | @required this.usd, 19 | @required this.euro, 20 | }); 21 | 22 | RatesModel.fromSnapshot(Map snapshot) 23 | : usd = new RateModel(buy: snapshot['USD']['buy'], sell: snapshot['USD']['sell']), 24 | euro = new RateModel(buy: snapshot['EUR']['buy'], sell: snapshot['EUR']['sell']); 25 | } -------------------------------------------------------------------------------- /lib/models/real_estate_model.dart: -------------------------------------------------------------------------------- 1 | class RealEstateModel { 2 | final String img; 3 | final String name; 4 | final String address; 5 | final String priceOff; 6 | 7 | RealEstateModel({this.img, this.name, this.address, this.priceOff}); 8 | } 9 | -------------------------------------------------------------------------------- /lib/models/stackoverflow.model.dart: -------------------------------------------------------------------------------- 1 | class StackOverflowModel { 2 | List tags; 3 | Owner owner; 4 | bool isAnswered; 5 | int viewCount; 6 | int closedDate; 7 | int answerCount; 8 | int score; 9 | int lastActivityDate; 10 | int creationDate; 11 | int lastEditDate; 12 | int questionId; 13 | String link; 14 | String closedReason; 15 | String title; 16 | 17 | StackOverflowModel({ 18 | this.tags, 19 | this.owner, 20 | this.isAnswered, 21 | this.viewCount, 22 | this.closedDate, 23 | this.answerCount, 24 | this.score, 25 | this.lastActivityDate, 26 | this.creationDate, 27 | this.lastEditDate, 28 | this.questionId, 29 | this.link, 30 | this.closedReason, 31 | this.title, 32 | }); 33 | 34 | StackOverflowModel.fromJson(Map json) { 35 | tags = json['tags'].cast(); 36 | owner = json['owner'] != null ? new Owner.fromJson(json['owner']) : null; 37 | isAnswered = json['is_answered']; 38 | viewCount = json['view_count']; 39 | answerCount = json['answer_count']; 40 | score = json['score']; 41 | lastActivityDate = json['last_activity_date']; 42 | creationDate = json['creation_date']; 43 | questionId = json['question_id']; 44 | link = json['link']; 45 | title = json['title']; 46 | } 47 | 48 | Map toJson() { 49 | final Map data = new Map(); 50 | data['tags'] = this.tags; 51 | if (this.owner != null) { 52 | data['owner'] = this.owner.toJson(); 53 | } 54 | data['is_answered'] = this.isAnswered; 55 | data['view_count'] = this.viewCount; 56 | data['answer_count'] = this.answerCount; 57 | data['score'] = this.score; 58 | data['last_activity_date'] = this.lastActivityDate; 59 | data['creation_date'] = this.creationDate; 60 | data['last_edit_date'] = this.lastEditDate; 61 | data['question_id'] = this.questionId; 62 | data['link'] = this.link; 63 | data['title'] = this.title; 64 | return data; 65 | } 66 | 67 | @override 68 | String toString() { 69 | return toJson().toString(); 70 | } 71 | } 72 | 73 | class Owner { 74 | int reputation; 75 | int userId; 76 | String userType; 77 | int acceptRate; 78 | String profileImage; 79 | String displayName; 80 | String link; 81 | 82 | Owner( 83 | {this.reputation, 84 | this.userId, 85 | this.userType, 86 | this.acceptRate, 87 | this.profileImage, 88 | this.displayName, 89 | this.link}); 90 | 91 | Owner.fromJson(Map json) { 92 | reputation = json['reputation']; 93 | userId = json['user_id']; 94 | userType = json['user_type']; 95 | acceptRate = json['accept_rate']; 96 | profileImage = json['profile_image']; 97 | displayName = json['display_name']; 98 | link = json['link']; 99 | } 100 | 101 | Map toJson() { 102 | final Map data = new Map(); 103 | data['reputation'] = this.reputation; 104 | data['user_id'] = this.userId; 105 | data['user_type'] = this.userType; 106 | data['accept_rate'] = this.acceptRate; 107 | data['profile_image'] = this.profileImage; 108 | data['display_name'] = this.displayName; 109 | data['link'] = this.link; 110 | return data; 111 | } 112 | 113 | @override 114 | String toString() { 115 | return toJson().toString(); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /lib/models/stackoverflow_response.model.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/models/stackoverflow.model.dart'; 2 | 3 | class StackOverflowResponseModel { 4 | List items; 5 | bool hasMore; 6 | 7 | StackOverflowResponseModel({ 8 | this.items, 9 | this.hasMore, 10 | }); 11 | 12 | StackOverflowResponseModel.fromJson(Map json) { 13 | if (json['items'] != null) { 14 | items = new List(); 15 | json['items'].forEach((v) { 16 | items.add(new StackOverflowModel.fromJson(v)); 17 | }); 18 | } 19 | hasMore = json['has_more']; 20 | } 21 | 22 | Map toJson() { 23 | final Map data = new Map(); 24 | if (this.items != null) { 25 | data['items'] = this.items.map((v) => v.toJson()).toList(); 26 | } 27 | data['has_more'] = this.hasMore; 28 | return data; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/pages/code_examples/auth_google/auth_google.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:google_sign_in/google_sign_in.dart'; 4 | import 'package:playground_flutter/services/auth.service.dart'; 5 | import 'package:flutter_signin_button/flutter_signin_button.dart'; 6 | 7 | class GoogleAuth extends StatefulWidget { 8 | const GoogleAuth({Key key}) : super(key: key); 9 | 10 | @override 11 | _GoogleAuthState createState() => _GoogleAuthState(); 12 | } 13 | 14 | class _GoogleAuthState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | body: Container( 19 | height: MediaQuery.of(context).size.height, 20 | width: MediaQuery.of(context).size.width, 21 | decoration: BoxDecoration( 22 | image: DecorationImage( 23 | image: NetworkImage( 24 | "https://secureservercdn.net/160.153.137.153/2xp.765.myftpupload.com/wp-content/uploads/2016/02/3D-Abstract-Art-Dark-Cubes-Wall-iPhone-6-Plus-HD-Wallpaper.jpg"), 25 | fit: BoxFit.cover, 26 | ), 27 | ), 28 | alignment: Alignment.center, 29 | child: Column( 30 | mainAxisAlignment: MainAxisAlignment.center, 31 | crossAxisAlignment: CrossAxisAlignment.center, 32 | children: [ 33 | StreamBuilder( 34 | stream: authService.onGoogleCurrentUserChanged, 35 | builder: (BuildContext context, 36 | AsyncSnapshot snapshot) { 37 | if (snapshot.hasData) { 38 | return SignInButton( 39 | Buttons.Google, 40 | text: "Logout ( ${snapshot.data.email} )", 41 | onPressed: () async { 42 | await authService.signOutGoogle(); 43 | }, 44 | ); 45 | } 46 | 47 | return SignInButton( 48 | Buttons.Google, 49 | text: "Sign up with Google", 50 | onPressed: () async { 51 | await authService.signInWithGoogle(); 52 | }, 53 | ); 54 | }, 55 | ), 56 | StreamBuilder( 57 | stream: FirebaseAuth.instance.onAuthStateChanged, 58 | builder: 59 | (BuildContext context, AsyncSnapshot snapshot) { 60 | if (snapshot.hasData) { 61 | return SignInButtonBuilder( 62 | text: "Logout ( ${snapshot.data.email} )", 63 | icon: Icons.email, 64 | onPressed: () async { 65 | await authService.signOutFirebase(); 66 | }, 67 | backgroundColor: Colors.blueGrey[700], 68 | ); 69 | } 70 | 71 | return SignInButtonBuilder( 72 | text: 'Sign in with Email', 73 | icon: Icons.email, 74 | onPressed: () async { 75 | await authService.signInFirebase( 76 | "test@gmail.com", "test123"); 77 | }, 78 | backgroundColor: Colors.blueGrey[700], 79 | ); 80 | }, 81 | ), 82 | ], 83 | ), 84 | ), 85 | ); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/pages/code_examples/download_and_shared/progress_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:math'; 3 | 4 | class ProgressPainter extends CustomPainter { 5 | final Color defaultCircleColor; 6 | final Color percentageCompletedCircleColor; 7 | final double completedPercentage; 8 | final double circleWidth; 9 | 10 | ProgressPainter({ 11 | this.defaultCircleColor, 12 | this.percentageCompletedCircleColor, 13 | this.completedPercentage, 14 | this.circleWidth, 15 | }); 16 | 17 | getPaint(Color color) { 18 | return Paint() 19 | ..color = color 20 | ..strokeCap = StrokeCap.round 21 | ..style = PaintingStyle.stroke 22 | ..strokeWidth = circleWidth; 23 | } 24 | 25 | @override 26 | void paint(Canvas canvas, Size size) { 27 | Paint defaultCirclePaint = getPaint(defaultCircleColor); 28 | Paint progressCirclePaint = getPaint(percentageCompletedCircleColor); 29 | 30 | Offset center = Offset(size.width / 2, size.height / 2); 31 | double radius = min(size.width / 2, size.height / 2); 32 | canvas.drawCircle(center, radius, defaultCirclePaint); 33 | 34 | double arcAngle = 2 * pi * (completedPercentage / 100); 35 | canvas.drawArc(Rect.fromCircle(center: center, radius: radius), -pi / 2, 36 | arcAngle, false, progressCirclePaint); 37 | } 38 | 39 | @override 40 | bool shouldRepaint(CustomPainter painter) { 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/pages/code_examples/mapbox/mapbox.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mapbox_gl/mapbox_gl.dart'; 3 | 4 | class MapBoxDemo extends StatefulWidget { 5 | const MapBoxDemo({Key key}) : super(key: key); 6 | 7 | @override 8 | _MapBoxDemoState createState() => _MapBoxDemoState(); 9 | } 10 | 11 | class _MapBoxDemoState extends State { 12 | static final CameraPosition _kInitialPosition = const CameraPosition( 13 | target: LatLng(-34.89052276039318, -56.18051875904071), 14 | zoom: 11.0, 15 | ); 16 | 17 | MapboxMapController mapController; 18 | CameraPosition _position = _kInitialPosition; 19 | CameraTargetBounds _cameraTargetBounds = CameraTargetBounds.unbounded; 20 | MinMaxZoomPreference _minMaxZoomPreference = MinMaxZoomPreference.unbounded; 21 | String _styleString = MapboxStyles.MAPBOX_STREETS; 22 | 23 | MyLocationTrackingMode _myLocationTrackingMode = 24 | MyLocationTrackingMode.Tracking; 25 | 26 | @override 27 | void initState() { 28 | super.initState(); 29 | } 30 | 31 | void _onMapChanged() { 32 | setState(() { 33 | _extractMapInfo(); 34 | }); 35 | } 36 | 37 | void _extractMapInfo() { 38 | _position = mapController.cameraPosition; 39 | } 40 | 41 | @override 42 | void dispose() { 43 | mapController.removeListener(_onMapChanged); 44 | super.dispose(); 45 | } 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | final MapboxMap mapboxMap = MapboxMap( 50 | onMapCreated: onMapCreated, 51 | initialCameraPosition: _kInitialPosition, 52 | trackCameraPosition: true, 53 | compassEnabled: true, 54 | cameraTargetBounds: _cameraTargetBounds, 55 | minMaxZoomPreference: _minMaxZoomPreference, 56 | styleString: _styleString, 57 | rotateGesturesEnabled: true, 58 | scrollGesturesEnabled: true, 59 | tiltGesturesEnabled: true, 60 | zoomGesturesEnabled: true, 61 | myLocationEnabled: true, 62 | myLocationTrackingMode: _myLocationTrackingMode, 63 | onMapClick: (point, latLng) async { 64 | print( 65 | "${point.x},${point.y} ${latLng.latitude}/${latLng.longitude}"); 66 | List features = 67 | await mapController.queryRenderedFeatures(point, [], null); 68 | if (features.length > 0) { 69 | print(features[0]); 70 | } 71 | }, 72 | onCameraTrackingDismissed: () { 73 | this.setState(() { 74 | _myLocationTrackingMode = MyLocationTrackingMode.None; 75 | }); 76 | }); 77 | 78 | return Scaffold( 79 | appBar: AppBar( 80 | title: Text('MapBox'), 81 | ), 82 | body: mapboxMap, 83 | ); 84 | } 85 | 86 | void onMapCreated(MapboxMapController controller) { 87 | mapController = controller; 88 | mapController.addListener(_onMapChanged); 89 | _extractMapInfo(); 90 | setState(() {}); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/pages/code_examples/navigation-bars/3d_bottom_navigation_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:playground_flutter/components/FlipBoxBar/flip_box_bar.dart'; 4 | 5 | class ThreeDimenssionBottomNavigationBar extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text('3D BottomNavigationBar'), 11 | ), 12 | bottomNavigationBar: FlipBoxBar( 13 | items: [ 14 | FlipBarItem( 15 | icon: Icon(Icons.map), 16 | text: Text("Map"), 17 | frontColor: Colors.blue, 18 | backColor: Colors.blueAccent), 19 | FlipBarItem( 20 | icon: Icon(Icons.add), 21 | text: Text("Add"), 22 | frontColor: Colors.cyan, 23 | backColor: Colors.cyanAccent), 24 | FlipBarItem( 25 | icon: Icon(Icons.chrome_reader_mode), 26 | text: Text("Read"), 27 | frontColor: Colors.orange, 28 | backColor: Colors.orangeAccent), 29 | FlipBarItem( 30 | icon: Icon(Icons.print), 31 | text: Text("Print"), 32 | frontColor: Colors.purple, 33 | backColor: Colors.purpleAccent), 34 | FlipBarItem( 35 | icon: Icon(Icons.print), 36 | text: Text("Print"), 37 | frontColor: Colors.pink, 38 | backColor: Colors.pinkAccent), 39 | ], 40 | onIndexChanged: (newIndex) { 41 | print(newIndex); 42 | }, 43 | )); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/pages/code_examples/navigation-bars/bottom_with_float_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class BottomBarWithFloatButton extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Scaffold( 7 | appBar: AppBar( 8 | title: Text('BottomBarWithFloatButton'), 9 | ), 10 | bottomNavigationBar: new BottomAppBar( 11 | child: new Container( 12 | height: 60.0, 13 | color: Colors.white, 14 | child: new Row( 15 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 16 | mainAxisSize: MainAxisSize.max, 17 | children: [ 18 | new Container( 19 | width: MediaQuery.of(context).size.width / 5, 20 | child: new Icon(Icons.home, size: 35.0), 21 | ), 22 | new Container( 23 | width: MediaQuery.of(context).size.width / 5, 24 | child: new Icon(Icons.monochrome_photos, size: 35.0), 25 | ), 26 | new Container(width: MediaQuery.of(context).size.width / 5), 27 | new Container( 28 | width: MediaQuery.of(context).size.width / 5, 29 | child: new Icon(Icons.account_circle, size: 35.0), 30 | ), 31 | new Container( 32 | width: MediaQuery.of(context).size.width / 5, 33 | child: new Icon(Icons.shopping_cart, size: 35.0), 34 | ) 35 | ], 36 | ), 37 | ), 38 | ), 39 | floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, 40 | floatingActionButton: FloatingActionButton( 41 | tooltip: 'Increment', 42 | child: Icon(Icons.add), 43 | onPressed: () {}, 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/pages/code_examples/pdf_and_csv/csv.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:path_provider/path_provider.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:playground_flutter/configs/ioc.dart'; 5 | import 'package:playground_flutter/models/baseball.model.dart'; 6 | import 'package:playground_flutter/pages/code_examples/pdf_and_csv/view_csv_data.dart'; 7 | import 'package:playground_flutter/services/sqlite_basebal_team.service.dart'; 8 | import 'package:playground_flutter/shared/widgets/crud_demo_list_item.widget.dart'; 9 | import 'package:csv/csv.dart'; 10 | 11 | class CsvGeneratorDemo extends StatelessWidget { 12 | final SqliteBaseballService _databaseService = 13 | Ioc.get(); 14 | 15 | CsvGeneratorDemo({Key key}) : super(key: key); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: AppBar( 21 | title: Text('CSV generate and load'), 22 | actions: [ 23 | InkWell( 24 | onTap: () => _generateCSVAndView(context), 25 | child: Align( 26 | alignment: Alignment.center, 27 | child: Text('CSV'), 28 | ), 29 | ), 30 | SizedBox(width: 10), 31 | ], 32 | ), 33 | body: StreamBuilder( 34 | stream: _databaseService.list(), 35 | builder: (_, AsyncSnapshot> snapshot) { 36 | if (!snapshot.hasData) { 37 | return Center( 38 | child: Text( 39 | "No data found !!!", 40 | style: TextStyle( 41 | color: Colors.red, 42 | ), 43 | ), 44 | ); 45 | } 46 | 47 | return ListView( 48 | children: snapshot.data.map((item) { 49 | return CrudDemoListItem( 50 | item: item, 51 | onPressedDelete: (item) {}, 52 | onPressedEdit: (item) {}, 53 | ); 54 | }).toList(), 55 | ); 56 | }), 57 | ); 58 | } 59 | 60 | Future _generateCSVAndView(context) async { 61 | List data = await _databaseService.list().first; 62 | List> csvData = [ 63 | // headers 64 | ['Name', 'Coach', 'players'], 65 | // data 66 | ...data.map((item) => [item.name, item.coach, item.players.toString()]), 67 | ]; 68 | 69 | String csv = const ListToCsvConverter().convert(csvData); 70 | 71 | final String dir = (await getApplicationDocumentsDirectory()).path; 72 | final String path = '$dir/baseball_teams.csv'; 73 | 74 | // create file 75 | final File file = File(path); 76 | // Save csv string using default configuration 77 | // , as field separator 78 | // " as text delimiter and 79 | // \r\n as eol. 80 | await file.writeAsString(csv); 81 | 82 | Navigator.of(context).push( 83 | MaterialPageRoute( 84 | builder: (_) => LoadAndViewCsvPage(path: path), 85 | ), 86 | ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /lib/pages/code_examples/pdf_and_csv/pdf.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:pdf/widgets.dart' as pdfLib; 3 | import 'package:path_provider/path_provider.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:playground_flutter/configs/ioc.dart'; 6 | import 'package:playground_flutter/models/baseball.model.dart'; 7 | import 'package:playground_flutter/pages/code_examples/pdf_and_csv/pdf_viewer.dart'; 8 | import 'package:playground_flutter/services/sqlite_basebal_team.service.dart'; 9 | import 'package:playground_flutter/shared/widgets/crud_demo_list_item.widget.dart'; 10 | 11 | class PdfGeneratorDemo extends StatelessWidget { 12 | final SqliteBaseballService _databaseService = 13 | Ioc.get(); 14 | 15 | PdfGeneratorDemo({Key key}) : super(key: key); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: AppBar( 21 | title: Text('Pdf - generate and view'), 22 | actions: [ 23 | IconButton( 24 | icon: Icon(Icons.picture_as_pdf), 25 | onPressed: () => _generatePdfAndView(context), 26 | ), 27 | SizedBox(width: 10), 28 | ], 29 | ), 30 | body: StreamBuilder( 31 | stream: _databaseService.list(), 32 | builder: (_, AsyncSnapshot> snapshot) { 33 | if (!snapshot.hasData) { 34 | return Center( 35 | child: Text( 36 | "No data found !!!", 37 | style: TextStyle( 38 | color: Colors.red, 39 | ), 40 | ), 41 | ); 42 | } 43 | 44 | return ListView( 45 | children: snapshot.data.map((item) { 46 | return CrudDemoListItem( 47 | item: item, 48 | onPressedDelete: (item) {}, 49 | onPressedEdit: (item) {}, 50 | ); 51 | }).toList(), 52 | ); 53 | }), 54 | ); 55 | } 56 | 57 | _generatePdfAndView(context) async { 58 | List data = await _databaseService.list().first; 59 | final pdfLib.Document pdf = pdfLib.Document(deflate: zlib.encode); 60 | 61 | pdf.addPage( 62 | pdfLib.MultiPage( 63 | build: (context) => [ 64 | pdfLib.Table.fromTextArray(context: context, data: >[ 65 | ['Name', 'Coach', 'players'], 66 | ...data.map( 67 | (item) => [item.name, item.coach, item.players.toString()]) 68 | ]), 69 | ], 70 | ), 71 | ); 72 | 73 | final String dir = (await getApplicationDocumentsDirectory()).path; 74 | final String path = '$dir/baseball_teams.pdf'; 75 | final File file = File(path); 76 | await file.writeAsBytes(pdf.save()); 77 | Navigator.of(context).push( 78 | MaterialPageRoute( 79 | builder: (_) => PdfViewerPage(path: path), 80 | ), 81 | ); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /lib/pages/code_examples/pdf_and_csv/pdf_viewer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_full_pdf_viewer/full_pdf_viewer_scaffold.dart'; 3 | 4 | class PdfViewerPage extends StatelessWidget { 5 | final String path; 6 | const PdfViewerPage({Key key, this.path}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return PDFViewerScaffold( 11 | path: path, 12 | ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/pages/code_examples/pdf_and_csv/view_csv_data.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | import 'package:csv/csv.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:playground_flutter/models/baseball.model.dart'; 6 | 7 | class LoadAndViewCsvPage extends StatelessWidget { 8 | final String path; 9 | const LoadAndViewCsvPage({Key key, this.path}) : super(key: key); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | appBar: AppBar( 15 | title: Text('Load and View Csv data'), 16 | ), 17 | body: FutureBuilder( 18 | future: _loadCsvData(), 19 | builder: (_, AsyncSnapshot> snapshot) { 20 | if (snapshot.hasData) { 21 | return Padding( 22 | padding: const EdgeInsets.all(16), 23 | child: Column( 24 | children: snapshot.data 25 | .map( 26 | (row) => Padding( 27 | padding: const EdgeInsets.symmetric(vertical: 10), 28 | child: Row( 29 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 30 | crossAxisAlignment: CrossAxisAlignment.center, 31 | children: [ 32 | // Name 33 | Text(row[0]), 34 | //Coach 35 | Text(row[1]), 36 | ], 37 | ), 38 | ), 39 | ) 40 | .toList(), 41 | ), 42 | ); 43 | } 44 | 45 | return Center( 46 | child: Text('no data found !!!'), 47 | ); 48 | }, 49 | ), 50 | ); 51 | } 52 | 53 | // load csv as string and transform to List> 54 | /* 55 | [ 56 | ['Name', 'Coach', 'Players'], 57 | ['Name1', 'Coach1', '5'], 58 | etc 59 | ] 60 | */ 61 | Future>> _loadCsvData() async { 62 | final file = new File(path).openRead(); 63 | return await file 64 | .transform(utf8.decoder) 65 | .transform(new CsvToListConverter()) 66 | .toList(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/pages/code_examples/progress-button/progress-button.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:math'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:playground_flutter/components/ProgressButton/progress-button.dart' 5 | as ProgressButtonComponent; 6 | import 'package:playground_flutter/constants/navigation.dart'; 7 | import 'package:playground_flutter/models/rates.model.dart'; 8 | import 'package:playground_flutter/services/web.client.dart'; 9 | 10 | class ProgressButton extends StatefulWidget { 11 | @override 12 | _ProgressButtonState createState() => _ProgressButtonState(); 13 | } 14 | 15 | class _ProgressButtonState extends State { 16 | final GlobalKey _formKey = GlobalKey(); 17 | 18 | Future _createMovement(done) async { 19 | await Future.delayed(Duration(seconds: 1)); 20 | 21 | // find more example in redux service. :) 22 | //dynamic ratesResponse = await http.get('currency/latest'); 23 | //RatesModel rates = RatesModel.fromSnapshot(ratesResponse["rates"]); 24 | 25 | //print(ratesResponse); 26 | 27 | bool successFlag = Random().nextInt(50) % 2 == 0 ? true : false; 28 | 29 | if (successFlag) { 30 | Navigator.of(context) 31 | .pushNamed(NavigationConstrants.NOTIFICATION_SUCCESS); 32 | } else { 33 | Navigator.of(context).pushNamed(NavigationConstrants.NOTIFICATION_ERROR); 34 | } 35 | return done(successFlag); 36 | } 37 | 38 | @override 39 | Widget build(BuildContext context) { 40 | return Scaffold( 41 | appBar: AppBar( 42 | title: Text("Progress Button"), 43 | ), 44 | body: SingleChildScrollView( 45 | child: Padding( 46 | padding: const EdgeInsets.all(8.0), 47 | child: Form( 48 | key: _formKey, 49 | child: Column( 50 | children: [ 51 | TextFormField( 52 | textAlign: TextAlign.start, 53 | textInputAction: TextInputAction.next, 54 | keyboardType: TextInputType.text, 55 | style: TextStyle(fontSize: 18), 56 | decoration: InputDecoration( 57 | hintStyle: TextStyle(fontSize: 20), 58 | enabledBorder: OutlineInputBorder( 59 | borderSide: BorderSide(color: Colors.blue), 60 | ), 61 | focusedBorder: OutlineInputBorder( 62 | borderSide: BorderSide(color: Colors.blue), 63 | ), 64 | border: OutlineInputBorder( 65 | borderSide: BorderSide(color: Colors.blue)), 66 | hintText: "Title del movimiento", 67 | ), 68 | ), 69 | SizedBox(height: 10), 70 | TextFormField( 71 | textAlign: TextAlign.start, 72 | textInputAction: TextInputAction.next, 73 | keyboardType: TextInputType.text, 74 | style: TextStyle(fontSize: 18), 75 | decoration: InputDecoration( 76 | hintStyle: TextStyle(fontSize: 20), 77 | enabledBorder: OutlineInputBorder( 78 | borderSide: BorderSide(color: Colors.blue), 79 | ), 80 | focusedBorder: OutlineInputBorder( 81 | borderSide: BorderSide(color: Colors.blue), 82 | ), 83 | border: OutlineInputBorder( 84 | borderSide: BorderSide(color: Colors.blue)), 85 | hintText: "Description del movimiento", 86 | ), 87 | ), 88 | ProgressButtonComponent.ProgressButton( 89 | title: "Crear", 90 | operation: _createMovement, 91 | canExecuteOperation: () => _formKey.currentState.validate(), 92 | ), 93 | ], 94 | ), 95 | ), 96 | ), 97 | ), 98 | ); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /lib/pages/code_examples/redux/preview_question.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_redux/flutter_redux.dart'; 3 | import 'package:playground_flutter/models/stackoverflow.model.dart'; 4 | import 'package:playground_flutter/store/state/app.state.dart'; 5 | import 'package:webview_flutter/webview_flutter.dart'; 6 | 7 | class PreviewQuestion extends StatelessWidget { 8 | const PreviewQuestion({Key key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return SafeArea( 13 | child: StoreConnector( 14 | converter: (store) => store.state.stackOverflowState.selected, 15 | builder: (_, StackOverflowModel vm) => WebView( 16 | key: Key("webview"), 17 | initialUrl: vm.link, 18 | javascriptMode: JavascriptMode.unrestricted, 19 | ), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/pages/code_examples/redux/redux.viewmodel.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/models/stackoverflow.model.dart'; 2 | import 'package:playground_flutter/store/actions/stack_overflow.action.dart'; 3 | import 'package:playground_flutter/store/selectors/stack_overflow.selector.dart'; 4 | import 'package:playground_flutter/store/state/app.state.dart'; 5 | import 'package:playground_flutter/store/state/stack_overflow.state.dart'; 6 | import 'package:redux/redux.dart'; 7 | 8 | class ReduxViewModel { 9 | final StackOverflowState state; 10 | final List questions; 11 | final Function(StackOverflowModel) onDelete; 12 | final Function(StackOverflowModel) onView; 13 | final Function onLoad; 14 | 15 | ReduxViewModel({ 16 | this.state, 17 | this.onDelete, 18 | this.onView, 19 | this.onLoad, 20 | this.questions, 21 | }); 22 | 23 | static ReduxViewModel fromStore(Store store) { 24 | return new ReduxViewModel( 25 | state: store.state.stackOverflowState, 26 | // use the selector that i create before. 27 | // toList because its a list of questions. !!! 28 | questions: 29 | questionsByFilterSelector(store.state.stackOverflowState).toList(), 30 | onDelete: (question) => store.dispatch( 31 | new DeleteQuestionAction(question: question), 32 | ), 33 | onView: (question) => store.dispatch( 34 | new ViewQuestionAction(question: question), 35 | ), 36 | onLoad: () => store.dispatch( 37 | new LoadQuestionAction(paginate: false), 38 | ), 39 | ); 40 | } 41 | 42 | // method to check if the state changed 43 | @override 44 | int get hashCode => state.uuid.hashCode; 45 | 46 | bool operator ==(other) { 47 | bool result = identical(this, other) || other is ReduxViewModel; 48 | 49 | if (result) { 50 | if (state.uuid != (other as ReduxViewModel).state.uuid) { 51 | return false; 52 | } 53 | } 54 | 55 | return result; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/pages/code_examples/screenshots/preview.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class PreviewScreenshot extends StatelessWidget { 6 | final Uint8List photo; 7 | const PreviewScreenshot({Key key, this.photo}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: Text('Screenshot'), 14 | ), 15 | body: Center( 16 | child: Container( 17 | height: MediaQuery.of(context).size.height, 18 | width: MediaQuery.of(context).size.width, 19 | decoration: BoxDecoration( 20 | image: DecorationImage( 21 | image: Image.memory(photo).image, 22 | fit: BoxFit.contain, 23 | ), 24 | ), 25 | ), 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/pages/code_examples/screenshots/screenshots.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/rendering.dart'; 4 | import 'package:flutter_redux/flutter_redux.dart'; 5 | import 'dart:ui' as ui; 6 | import 'package:playground_flutter/models/stackoverflow.model.dart'; 7 | import 'package:playground_flutter/pages/code_examples/redux/question_item.dart'; 8 | import 'package:playground_flutter/pages/code_examples/redux/redux.viewmodel.dart'; 9 | import 'package:playground_flutter/pages/code_examples/screenshots/preview.dart'; 10 | import 'package:playground_flutter/store/actions/stack_overflow.action.dart'; 11 | import 'package:playground_flutter/store/state/app.state.dart'; 12 | 13 | class ScreenshotPage extends StatefulWidget { 14 | ScreenshotPage({Key key}) : super(key: key); 15 | 16 | _ScreenshotPageState createState() => _ScreenshotPageState(); 17 | } 18 | 19 | class _ScreenshotPageState extends State { 20 | GlobalKey _globalKey = new GlobalKey(); 21 | 22 | Future _captureScreenshot(_globalKey) async { 23 | try { 24 | RenderRepaintBoundary boundary = 25 | _globalKey.currentContext.findRenderObject(); 26 | ui.Image image = await boundary.toImage(); 27 | ByteData byteData = 28 | await image.toByteData(format: ui.ImageByteFormat.png); 29 | var png = byteData.buffer.asUint8List(); 30 | 31 | Navigator.of(context).push( 32 | MaterialPageRoute( 33 | builder: (_) => new PreviewScreenshot(photo: png), 34 | ), 35 | ); 36 | } catch (e) { 37 | print(e); 38 | } 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return Scaffold( 44 | appBar: AppBar( 45 | title: Text('Screenshot'), 46 | actions: [ 47 | IconButton( 48 | icon: Icon(Icons.photo), 49 | onPressed: () { 50 | _captureScreenshot(_globalKey); 51 | }, 52 | ) 53 | ], 54 | ), 55 | body: StoreConnector( 56 | distinct: true, 57 | converter: (store) => ReduxViewModel.fromStore(store), 58 | onInit: (store) => 59 | store.dispatch(new LoadQuestionAction(paginate: false)), 60 | builder: (_, vm) { 61 | // global and first loading indicator 62 | if (vm.state.loading) { 63 | return Center( 64 | child: Theme( 65 | data: Theme.of(context).copyWith(accentColor: Colors.blue), 66 | child: CircularProgressIndicator(), 67 | ), 68 | ); 69 | } 70 | 71 | return RepaintBoundary( 72 | key: _globalKey, 73 | child: ListView.builder( 74 | itemCount: vm.questions.length, 75 | itemBuilder: (_, int index) { 76 | StackOverflowModel model = vm.questions[index]; 77 | GlobalKey _globalKey = new GlobalKey(); 78 | return RepaintBoundary( 79 | key: _globalKey, 80 | child: QuestionItem( 81 | key: Key(model.questionId.toString()), 82 | model: model, 83 | onDelete: vm.onDelete, 84 | onView: (item) { 85 | _captureScreenshot(_globalKey); 86 | }, 87 | ), 88 | ); 89 | }, 90 | ), 91 | ); 92 | }, 93 | ), 94 | ); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/pages/code_examples/webview/webview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:webview_flutter/webview_flutter.dart'; 3 | 4 | const String flutterUrl = "https://flutter.dev/"; 5 | const String wikiUrl = "https://google.com"; 6 | 7 | class WebviewFlutter extends StatelessWidget { 8 | WebViewController _controller; 9 | 10 | WebviewFlutter({Key key}) : super(key: key); 11 | 12 | _back() async { 13 | if (await _controller.canGoBack()) { 14 | await _controller.goBack(); 15 | } 16 | } 17 | 18 | _forward() async { 19 | if (await _controller.canGoForward()) { 20 | await _controller.goForward(); 21 | } 22 | } 23 | 24 | _loadPage() async { 25 | var url = await _controller.currentUrl(); 26 | _controller.loadUrl( 27 | url == "https://flutter.dev/" 28 | ? 'https://google.com' 29 | : "https://flutter.dev/", 30 | ); 31 | } 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | return Scaffold( 36 | appBar: AppBar( 37 | title: Text('WebView'), 38 | actions: [ 39 | IconButton( 40 | onPressed: _back, 41 | icon: Icon(Icons.arrow_back_ios), 42 | ), 43 | IconButton( 44 | onPressed: _forward, 45 | icon: Icon(Icons.arrow_forward_ios), 46 | ), 47 | SizedBox(width: 10), 48 | ], 49 | ), 50 | floatingActionButton: FloatingActionButton( 51 | onPressed: _loadPage, 52 | child: Icon(Icons.refresh), 53 | ), 54 | body: SafeArea( 55 | child: WebView( 56 | key: Key("webview"), 57 | initialUrl: flutterUrl, 58 | javascriptMode: JavascriptMode.unrestricted, 59 | onWebViewCreated: (WebViewController webViewController) { 60 | _controller = webViewController; 61 | }, 62 | ), 63 | ), 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/pages/templates/calculator-check-list-clone/calculator_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:rxdart/subjects.dart'; 5 | 6 | class Operation { 7 | final double value; 8 | final String description; 9 | final String id; 10 | 11 | Operation({ 12 | @required this.id, 13 | @required this.value, 14 | @required this.description, 15 | }); 16 | } 17 | 18 | class OperationsBloc { 19 | List _operations = []; 20 | final ReplaySubject> _operations$ = new ReplaySubject(); 21 | final ReplaySubject _total$ = new ReplaySubject(); 22 | 23 | OperationsBloc() { 24 | _operations$.stream.listen(_computeTotal); 25 | } 26 | 27 | Stream> operations() { 28 | return _operations$.stream; 29 | } 30 | 31 | Stream total() { 32 | return _total$.stream; 33 | } 34 | 35 | addOperation(Operation op) { 36 | _operations.add(op); 37 | _operations$.sink.add(_operations); 38 | } 39 | 40 | deleteOperation(Operation op) { 41 | _operations = _operations.where((o) => o.id != op.id).toList(); 42 | _operations$.sink.add(_operations); 43 | } 44 | 45 | dispose() { 46 | _operations$.close(); 47 | _total$.close(); 48 | _operations = []; 49 | } 50 | 51 | _computeTotal(List operations) { 52 | _total$.sink.add(operations.fold(0, (value, op2) => value + op2.value)); 53 | } 54 | } 55 | 56 | final operationsBloc = new OperationsBloc(); 57 | -------------------------------------------------------------------------------- /lib/pages/templates/calculator-check-list-clone/tab-indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomTabIndicator extends Decoration { 4 | const CustomTabIndicator({ 5 | this.borderSide = const BorderSide(width: 2.0, color: Colors.white), 6 | this.insets = EdgeInsets.zero, 7 | }) : assert(borderSide != null), 8 | assert(insets != null); 9 | 10 | final BorderSide borderSide; 11 | final EdgeInsetsGeometry insets; 12 | 13 | @override 14 | Decoration lerpFrom(Decoration a, double t) { 15 | if (a is UnderlineTabIndicator) { 16 | return UnderlineTabIndicator( 17 | borderSide: BorderSide.lerp(a.borderSide, borderSide, t), 18 | insets: EdgeInsetsGeometry.lerp(a.insets, insets, t), 19 | ); 20 | } 21 | return super.lerpFrom(a, t); 22 | } 23 | 24 | @override 25 | Decoration lerpTo(Decoration b, double t) { 26 | if (b is UnderlineTabIndicator) { 27 | return UnderlineTabIndicator( 28 | borderSide: BorderSide.lerp(borderSide, b.borderSide, t), 29 | insets: EdgeInsetsGeometry.lerp(insets, b.insets, t), 30 | ); 31 | } 32 | return super.lerpTo(b, t); 33 | } 34 | 35 | @override 36 | _UnderlinePainter createBoxPainter([VoidCallback onChanged]) { 37 | return _UnderlinePainter(this, onChanged); 38 | } 39 | } 40 | 41 | class _UnderlinePainter extends BoxPainter { 42 | _UnderlinePainter(this.decoration, VoidCallback onChanged) 43 | : assert(decoration != null), 44 | super(onChanged); 45 | 46 | final CustomTabIndicator decoration; 47 | 48 | BorderSide get borderSide => decoration.borderSide; 49 | EdgeInsetsGeometry get insets => decoration.insets; 50 | 51 | Rect _indicatorRectFor(Rect rect, TextDirection textDirection) { 52 | assert(rect != null); 53 | assert(textDirection != null); 54 | final Rect indicator = insets.resolve(textDirection).deflateRect(rect); 55 | return Rect.fromLTWH( 56 | indicator.left, 57 | indicator.bottom - borderSide.width, 58 | indicator.width, 59 | borderSide.width, 60 | ); 61 | } 62 | 63 | @override 64 | void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) { 65 | assert(configuration != null); 66 | assert(configuration.size != null); 67 | final Rect rect = offset & configuration.size; 68 | final TextDirection textDirection = configuration.textDirection; 69 | final Rect indicator = _indicatorRectFor(rect, textDirection).deflate(borderSide.width / 2.0); 70 | final Paint paint = borderSide.toPaint()..strokeCap = StrokeCap.round; 71 | canvas.drawLine(indicator.bottomLeft, indicator.bottomRight, paint); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/pages/templates/crypto-blockchain-wallet-clone/crypto-blockchain-wallet.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CryptoBlockchainWallet extends StatelessWidget { 4 | const CryptoBlockchainWallet({Key key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Container(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/pages/templates/furniture-clone/furniture-category-item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:playground_flutter/pages/templates/furniture-clone/furniture-category-home.dart'; 3 | 4 | Color primaryColor = Color(0xffdc2f2e); 5 | 6 | class FurnitureCategoryItem extends StatelessWidget { 7 | final int newItemCount; 8 | 9 | const FurnitureCategoryItem({Key key, this.newItemCount = 0}) 10 | : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Container( 15 | height: 90, 16 | width: 110, 17 | child: Stack( 18 | children: [ 19 | Container( 20 | width: 90, 21 | height: 90, 22 | child: InkWell( 23 | onTap: () { 24 | Navigator.of(context).push( 25 | MaterialPageRoute( 26 | builder: (c) => FurnitureCategoryHome(), 27 | ), 28 | ); 29 | }, 30 | child: Material( 31 | elevation: 2, 32 | borderRadius: BorderRadius.all( 33 | Radius.circular(5), 34 | ), 35 | child: Column( 36 | mainAxisAlignment: MainAxisAlignment.center, 37 | crossAxisAlignment: CrossAxisAlignment.center, 38 | children: [ 39 | Icon( 40 | Icons.event_seat, 41 | size: 40, 42 | ), 43 | Text( 44 | "Chair", 45 | style: TextStyle( 46 | fontSize: 16, 47 | ), 48 | ), 49 | ], 50 | ), 51 | ), 52 | ), 53 | ), 54 | Visibility( 55 | visible: newItemCount != 0, 56 | child: Positioned( 57 | top: 8, 58 | right: 10, 59 | child: Container( 60 | width: 30, 61 | height: 20, 62 | decoration: BoxDecoration( 63 | color: primaryColor, 64 | border: Border.all(color: Colors.white), 65 | borderRadius: BorderRadius.circular(10), 66 | ), 67 | child: Text( 68 | newItemCount.toString(), 69 | textAlign: TextAlign.center, 70 | style: TextStyle( 71 | color: Colors.white, 72 | fontSize: 15, 73 | ), 74 | ), 75 | ), 76 | ), 77 | ), 78 | ], 79 | ), 80 | ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/pages/templates/game-organizer-clone/game-organizer-helper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | Color textColor = new Color(0xffa8b6c2); 4 | 5 | Widget buildDetailInfo( 6 | {String title1, String value1, String title2, String value2}) { 7 | return Padding( 8 | padding: const EdgeInsets.only( 9 | top: 10, 10 | bottom: 10, 11 | ), 12 | child: Row( 13 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 14 | crossAxisAlignment: CrossAxisAlignment.center, 15 | children: [ 16 | buildDetailInfoItem(title1, value1), 17 | buildDetailInfoItem(title2, value2), 18 | ], 19 | ), 20 | ); 21 | } 22 | 23 | Widget buildDetailInfoItem(String title1, String value1) { 24 | return Expanded( 25 | child: Column( 26 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 27 | crossAxisAlignment: CrossAxisAlignment.start, 28 | children: [ 29 | Text( 30 | title1, 31 | style: TextStyle( 32 | color: textColor, 33 | fontSize: 16, 34 | ), 35 | ), 36 | SizedBox(height: 5), 37 | Text( 38 | value1, 39 | style: TextStyle( 40 | fontSize: 16, 41 | fontWeight: FontWeight.w500, 42 | ), 43 | ), 44 | ], 45 | ), 46 | ); 47 | } 48 | -------------------------------------------------------------------------------- /lib/pages/templates/game-organizer-clone/line-painter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:path_drawing/path_drawing.dart'; 3 | import 'dart:math' as math; 4 | 5 | class LinePainter extends CustomPainter { 6 | Paint backgroundPaint = Paint() 7 | ..color = Colors.grey.withOpacity(0.4) 8 | ..style = PaintingStyle.stroke 9 | ..strokeCap = StrokeCap.square 10 | ..strokeWidth = 1; 11 | 12 | @override 13 | void paint(Canvas canvas, Size size) { 14 | Path backgroundPath = Path(); 15 | 16 | backgroundPath.moveTo(0, size.height / 2); 17 | backgroundPath.lineTo(size.width, size.height / 2); 18 | 19 | canvas.drawPath( 20 | dashPath( 21 | backgroundPath, 22 | dashArray: CircularIntervalList([3, 6]), 23 | ), 24 | backgroundPaint, 25 | ); 26 | } 27 | 28 | @override 29 | bool shouldRepaint(CustomPainter oldDelegate) { 30 | return false; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/pages/templates/hospital-dashboard-clone/account.card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | Color primaryColor = Color(0xff0074ff); 4 | 5 | class AccountCard extends StatelessWidget { 6 | final bool active; 7 | final String name; 8 | final String id; 9 | final String hour; 10 | 11 | const AccountCard( 12 | {Key key, this.active = false, this.name, this.hour, this.id}) 13 | : super(key: key); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Container( 18 | width: MediaQuery.of(context).size.width, 19 | height: MediaQuery.of(context).size.height, 20 | padding: const EdgeInsets.only(left: 3), 21 | decoration: BoxDecoration( 22 | borderRadius: BorderRadius.all(Radius.circular(8)), 23 | color: active ? primaryColor : Colors.white, 24 | ), 25 | child: Container( 26 | color: Colors.white, 27 | child: Row( 28 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 29 | crossAxisAlignment: CrossAxisAlignment.center, 30 | children: [ 31 | Container( 32 | width: 40, 33 | height: 40, 34 | decoration: BoxDecoration( 35 | shape: BoxShape.circle, 36 | color: Colors.grey, 37 | image: DecorationImage( 38 | fit: BoxFit.cover, 39 | image: NetworkImage( 40 | "http://www.usanetwork.com/sites/usanetwork/files/styles/629x720/public/suits_cast_harvey.jpg?itok=fpTOeeBb"), 41 | ), 42 | ), 43 | ), 44 | Container( 45 | width: 180, 46 | child: ListTile( 47 | title: Text( 48 | name, 49 | style: TextStyle( 50 | fontWeight: FontWeight.bold, 51 | ), 52 | ), 53 | subtitle: Text(id), 54 | ), 55 | ), 56 | Row( 57 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 58 | crossAxisAlignment: CrossAxisAlignment.center, 59 | children: [ 60 | Text( 61 | hour, 62 | style: TextStyle( 63 | fontWeight: FontWeight.bold, 64 | ), 65 | ), 66 | SizedBox(width: 10), 67 | Icon( 68 | Icons.check_circle, 69 | size: 30, 70 | color: Color(0xff26e56d), 71 | ), 72 | Icon( 73 | Icons.cancel, 74 | size: 30, 75 | color: Color(0xffff4077), 76 | ), 77 | ], 78 | ), 79 | ], 80 | ), 81 | ), 82 | ); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/pages/templates/hospital-dashboard-clone/appointment.card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:playground_flutter/pages/templates/hospital-dashboard-clone/current-data-chart-painter..dart'; 3 | 4 | class AppointmentCard extends StatelessWidget { 5 | const AppointmentCard({Key key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Row( 10 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 11 | crossAxisAlignment: CrossAxisAlignment.center, 12 | children: [ 13 | _buildItem("Today", "18 Patients", Color(0xff0074ff)), 14 | _buildDivider(), 15 | _buildItem("Canceled", "7 Patients", Color(0xffff1759)), 16 | ], 17 | ); 18 | } 19 | 20 | Widget _buildDivider() { 21 | return Flexible( 22 | flex: 1, 23 | child: SizedBox( 24 | width: 5, 25 | child: Container( 26 | alignment: Alignment.centerRight, 27 | height: 70, 28 | decoration: BoxDecoration( 29 | border: Border( 30 | right: BorderSide( 31 | width: 1, 32 | color: Colors.grey.withOpacity(0.4), 33 | ), 34 | ), 35 | ), 36 | ), 37 | ), 38 | ); 39 | } 40 | 41 | Widget _buildItem(String title, String subtitle, Color chartColor) { 42 | return Flexible( 43 | flex: 5, 44 | child: Container( 45 | height: 80, 46 | child: Padding( 47 | padding: const EdgeInsets.fromLTRB(10, 10, 10, 10), 48 | child: Row( 49 | crossAxisAlignment: CrossAxisAlignment.center, 50 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 51 | children: [ 52 | Container( 53 | width: 60, 54 | height: 80, 55 | child: CustomPaint( 56 | painter: CurrentDataChartPainter( 57 | chartColor, 58 | ), 59 | ), 60 | ), 61 | Expanded( 62 | child: Container( 63 | child: Column( 64 | mainAxisAlignment: MainAxisAlignment.center, 65 | crossAxisAlignment: CrossAxisAlignment.start, 66 | children: [ 67 | Text( 68 | title, 69 | style: TextStyle( 70 | fontSize: 19, 71 | fontWeight: FontWeight.bold, 72 | ), 73 | ), 74 | Text( 75 | subtitle, 76 | style: TextStyle( 77 | fontSize: 17, 78 | color: Colors.grey, 79 | ), 80 | ), 81 | ], 82 | ), 83 | ), 84 | ), 85 | ], 86 | ), 87 | ), 88 | ), 89 | ); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /lib/pages/templates/hospital-dashboard-clone/chart-painter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:path_drawing/path_drawing.dart'; 3 | import 'dart:math' as math; 4 | 5 | class ChartPainter extends CustomPainter { 6 | Paint backgroundPaint = Paint() 7 | ..color = Color(0xff4298ff) 8 | ..style = PaintingStyle.stroke 9 | ..strokeCap = StrokeCap.round 10 | ..strokeWidth = 2; 11 | 12 | Paint valuePaint = Paint() 13 | ..color = Colors.white 14 | ..style = PaintingStyle.stroke 15 | ..strokeCap = StrokeCap.round 16 | ..strokeWidth = 2; 17 | 18 | @override 19 | void paint(Canvas canvas, Size size) { 20 | Path backgroundPath = Path(); 21 | Path valuePath = Path(); 22 | 23 | int jump = 23; 24 | 25 | for (double i = 1; i < 16.0; i++) { 26 | if (i % 2 != 0) { 27 | backgroundPath.moveTo(jump * i, 0); 28 | backgroundPath.lineTo(jump * i, size.height); 29 | } 30 | 31 | int random = range(50, (size.height - (size.height * .3)).toInt()); 32 | 33 | valuePath.moveTo(jump * i, random.toDouble()); 34 | valuePath.lineTo(jump * i, random.toDouble() + size.height * .3); 35 | } 36 | 37 | canvas.drawPath( 38 | dashPath( 39 | backgroundPath, 40 | dashArray: CircularIntervalList([3, 6]), 41 | ), 42 | backgroundPaint, 43 | ); 44 | 45 | canvas.drawPath(valuePath, valuePaint); 46 | } 47 | 48 | @override 49 | bool shouldRepaint(CustomPainter oldDelegate) { 50 | return false; 51 | } 52 | 53 | int range(int minOrMax, [int max]) { 54 | if (max == null) { 55 | max = minOrMax; 56 | minOrMax = 0; 57 | } 58 | 59 | return math.Random().nextInt(max - minOrMax) + minOrMax; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/pages/templates/hospital-dashboard-clone/current-data-chart-painter..dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CurrentDataChartPainter extends CustomPainter { 4 | final Color color; 5 | 6 | CurrentDataChartPainter(this.color); 7 | 8 | @override 9 | void paint(Canvas canvas, Size size) { 10 | Paint trackBarPaint = Paint() 11 | ..color = color 12 | ..style = PaintingStyle.stroke 13 | ..strokeCap = StrokeCap.round 14 | ..strokeWidth = 5; 15 | 16 | Paint trackBarPaintOpacity = Paint() 17 | ..color = color.withOpacity(0.3) 18 | ..style = PaintingStyle.stroke 19 | ..strokeCap = StrokeCap.round 20 | ..strokeWidth = 5; 21 | 22 | Path trackBarPath = Path(); 23 | Path trackBarPathOpacity = Path(); 24 | 25 | List val = [ 26 | size.height * 0.3, 27 | size.height * 0.4, 28 | size.height * 0.7, 29 | size.height * 0.15, 30 | size.height * 0.35, 31 | ]; 32 | 33 | double origin = 10; 34 | 35 | for (int i = 0; i < val.length; i++) { 36 | if (i != 3) { 37 | trackBarPathOpacity.moveTo(origin, size.height); 38 | trackBarPathOpacity.lineTo(origin, val[i]); 39 | } else { 40 | trackBarPath.moveTo(origin, size.height); 41 | trackBarPath.lineTo(origin, val[i]); 42 | } 43 | 44 | origin = origin + size.width * 0.15; 45 | } 46 | 47 | canvas.drawPath(trackBarPath, trackBarPaint); 48 | canvas.drawPath(trackBarPathOpacity, trackBarPaintOpacity); 49 | } 50 | 51 | @override 52 | bool shouldRepaint(CustomPainter oldDelegate) { 53 | return false; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/pages/templates/network-of-gas-stations-clone/animated-container.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class NetworkAnimatedContainer extends StatefulWidget { 4 | final Widget child; 5 | final int waitTime; 6 | final AnimationController controller; 7 | 8 | NetworkAnimatedContainer({ 9 | Key key, 10 | this.child, 11 | this.waitTime = 200, 12 | this.controller, 13 | }) : super(key: key); 14 | 15 | NetworkAnimatedContainerState createState() => 16 | NetworkAnimatedContainerState(); 17 | } 18 | 19 | class NetworkAnimatedContainerState extends State 20 | with SingleTickerProviderStateMixin { 21 | Animation _animation; 22 | AnimationController _controller; 23 | 24 | @override 25 | void initState() { 26 | super.initState(); 27 | _controller = widget.controller ?? 28 | AnimationController( 29 | vsync: this, 30 | duration: Duration(seconds: 1), 31 | ); 32 | 33 | _animation = new Tween(begin: -1.0, end: 0.0).animate( 34 | new CurvedAnimation( 35 | parent: _controller, 36 | curve: Curves.elasticOut, 37 | ), 38 | ); 39 | 40 | _controller.addListener(() { 41 | setState(() {}); 42 | }); 43 | 44 | WidgetsBinding.instance.addPostFrameCallback((_) async { 45 | await _animate(); 46 | }); 47 | } 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | double width = MediaQuery.of(context).size.width; 52 | return Transform( 53 | transform: new Matrix4.translationValues(_animation.value * width, 0, 0), 54 | child: widget.child, 55 | ); 56 | } 57 | 58 | Future _animate() async { 59 | await Future.delayed(Duration(milliseconds: widget.waitTime)); 60 | _controller.forward(); 61 | } 62 | 63 | @override 64 | void dispose() { 65 | _controller?.dispose(); 66 | super.dispose(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/pages/templates/network-of-gas-stations-clone/network-of-gas-stations-home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:playground_flutter/bloc/theme.bloc.dart'; 3 | import 'package:playground_flutter/configs/themes.dart'; 4 | import 'package:playground_flutter/pages/templates/network-of-gas-stations-clone/network-bottom-navigate.dart'; 5 | import 'package:playground_flutter/pages/templates/network-of-gas-stations-clone/network-gas-home.dart'; 6 | import 'package:playground_flutter/pages/templates/network-of-gas-stations-clone/network-slide-item.dart'; 7 | 8 | Color color1 = Color(0xff3f8abb); 9 | 10 | class NetworkGasStationHome extends StatefulWidget { 11 | const NetworkGasStationHome({Key key}) : super(key: key); 12 | 13 | @override 14 | _NetworkGasStationHomeState createState() => _NetworkGasStationHomeState(); 15 | } 16 | 17 | class _NetworkGasStationHomeState extends State { 18 | PageController _pageController; 19 | 20 | @override 21 | void initState() { 22 | themeBloc.changeTheme(Themes.networkGas); 23 | _pageController = PageController( 24 | initialPage: 0, 25 | ); 26 | 27 | super.initState(); 28 | } 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | return Scaffold( 33 | backgroundColor: Colors.white, 34 | body: SafeArea( 35 | child: Column( 36 | children: [ 37 | Container( 38 | alignment: Alignment.centerRight, 39 | padding: const EdgeInsets.only(right: 20), 40 | child: InkWell( 41 | onTap: () { 42 | Navigator.of(context).push( 43 | MaterialPageRoute( 44 | builder: (_) => NetworkGasHome(), 45 | ), 46 | ); 47 | }, 48 | child: Text("Skip"), 49 | ), 50 | ), 51 | Flexible( 52 | flex: 9, 53 | child: PageView( 54 | controller: _pageController, 55 | children: [ 56 | Container( 57 | child: NetworkSlideItem( 58 | title: "The location of the vehicle", 59 | msg: 60 | "Call mobile refills using the geolocation of your location", 61 | icon: Icons.location_on, 62 | ), 63 | ), 64 | Container( 65 | child: NetworkSlideItem( 66 | title: "Payment online", 67 | msg: "Online Payment directly from your mobile phone", 68 | icon: Icons.attach_money, 69 | ), 70 | ), 71 | Container( 72 | child: NetworkSlideItem( 73 | title: "Filling the car", 74 | msg: "Is carried out without your participation", 75 | icon: Icons.vpn_key, 76 | ), 77 | ), 78 | ], 79 | ), 80 | ), 81 | Flexible( 82 | flex: 1, 83 | child: NetworkBottomNavigate( 84 | pageController: _pageController, 85 | ), 86 | ) 87 | ], 88 | ), 89 | ), 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/pages/templates/network-of-gas-stations-clone/network-slide-item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:playground_flutter/pages/templates/network-of-gas-stations-clone/animated-container.dart'; 3 | 4 | Color color1 = Color(0xff3f8abb); 5 | 6 | class NetworkSlideItem extends StatelessWidget { 7 | final String title; 8 | final String msg; 9 | 10 | final IconData icon; 11 | 12 | const NetworkSlideItem({ 13 | Key key, 14 | this.title, 15 | this.msg, 16 | this.icon, 17 | }) : super(key: key); 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Column( 22 | mainAxisSize: MainAxisSize.max, 23 | children: [ 24 | Flexible( 25 | flex: 9, 26 | child: LayoutBuilder( 27 | builder: (_, constraints) { 28 | return Stack( 29 | fit: StackFit.expand, 30 | children: [ 31 | Positioned( 32 | height: constraints.maxHeight, 33 | width: constraints.maxWidth, 34 | child: Padding( 35 | padding: const EdgeInsets.fromLTRB(20, 0, 20, 0), 36 | child: NetworkAnimatedContainer( 37 | waitTime: 240, 38 | child: Image( 39 | image: ExactAssetImage("assets/images/ng1.jpg"), 40 | fit: BoxFit.fill, 41 | ), 42 | ), 43 | ), 44 | ), 45 | Positioned( 46 | top: constraints.maxHeight * .8, 47 | right: 20, 48 | child: NetworkAnimatedContainer( 49 | waitTime: 280, 50 | child: Icon( 51 | icon, 52 | size: 100, 53 | color: color1, 54 | ), 55 | ), 56 | ), 57 | ], 58 | ); 59 | }, 60 | ), 61 | ), 62 | SizedBox(height: 20), 63 | Flexible( 64 | flex: 1, 65 | child: Column( 66 | mainAxisAlignment: MainAxisAlignment.center, 67 | children: [ 68 | NetworkAnimatedContainer( 69 | waitTime: 200, 70 | child: Text( 71 | title, 72 | style: TextStyle( 73 | fontWeight: FontWeight.bold, 74 | fontSize: 15, 75 | ), 76 | ), 77 | ), 78 | SizedBox(height: 10), 79 | Container( 80 | width: MediaQuery.of(context).size.width * .7, 81 | child: NetworkAnimatedContainer( 82 | waitTime: 300, 83 | child: Text( 84 | msg, 85 | textAlign: TextAlign.center, 86 | style: TextStyle( 87 | color: Colors.grey, 88 | fontSize: 15, 89 | ), 90 | ), 91 | ), 92 | ), 93 | ], 94 | ), 95 | ) 96 | ], 97 | ); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /lib/pages/templates/news-app-concept-clone/categories-navigator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | Color color = Color(0xff59c2ff); 4 | 5 | class CategoriesNavigator extends StatefulWidget { 6 | final Function(int index) onChangeActiveTab; 7 | final List categories; 8 | 9 | CategoriesNavigator({Key key, this.onChangeActiveTab, this.categories}) 10 | : super(key: key); 11 | 12 | _CategoriesNavigatorState createState() => _CategoriesNavigatorState(); 13 | } 14 | 15 | class _CategoriesNavigatorState extends State { 16 | int _activeInndex = 0; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | double width = MediaQuery.of(context).size.width; 21 | double height = MediaQuery.of(context).size.height; 22 | 23 | List items = []; 24 | 25 | for (int index = 0; index < widget.categories.length; index++) { 26 | items.add( 27 | GestureDetector( 28 | onTap: () { 29 | if (_activeInndex != index) { 30 | setState(() { 31 | _activeInndex = index; 32 | widget.onChangeActiveTab(index); 33 | }); 34 | } 35 | }, 36 | child: Row( 37 | children: [ 38 | Column( 39 | mainAxisAlignment: MainAxisAlignment.start, 40 | crossAxisAlignment: CrossAxisAlignment.center, 41 | children: [ 42 | Text( 43 | widget.categories[index], 44 | style: TextStyle( 45 | color: index == _activeInndex 46 | ? Colors.black 47 | : Colors.grey[300], 48 | fontSize: 20, 49 | fontWeight: FontWeight.w500, 50 | ), 51 | ), 52 | Visibility( 53 | visible: _activeInndex == index, 54 | child: Padding( 55 | padding: const EdgeInsets.only(top: 5), 56 | child: Container( 57 | height: 5, 58 | width: 5, 59 | decoration: BoxDecoration( 60 | shape: BoxShape.circle, 61 | color: color, 62 | ), 63 | ), 64 | ), 65 | ), 66 | ], 67 | ), 68 | SizedBox(width: width / 11), 69 | ], 70 | ), 71 | ), 72 | ); 73 | } 74 | 75 | return Container( 76 | height: 40, 77 | width: width, 78 | child: ListView( 79 | padding: EdgeInsets.only(left: 20), 80 | scrollDirection: Axis.horizontal, 81 | children: items.toList(), 82 | ), 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/pages/templates/rahul-sliver-profile-demo/rahul-profile-detail-panel.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class RahulProfileDetail extends StatelessWidget { 4 | const RahulProfileDetail({Key key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Padding( 9 | padding: const EdgeInsets.only( 10 | left: 50, 11 | right: 50, 12 | top: 5, 13 | ), 14 | child: Column( 15 | mainAxisSize: MainAxisSize.max, 16 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 17 | crossAxisAlignment: CrossAxisAlignment.center, 18 | children: [ 19 | Container( 20 | height: 90, 21 | width: 90, 22 | decoration: BoxDecoration( 23 | shape: BoxShape.circle, 24 | image: DecorationImage( 25 | fit: BoxFit.fill, 26 | image: new NetworkImage( 27 | "http://www.usanetwork.com/sites/usanetwork/files/styles/629x720/public/suits_cast_harvey.jpg?itok=fpTOeeBb"), 28 | ), 29 | ), 30 | ), 31 | Text( 32 | "@javico_glez", 33 | style: TextStyle( 34 | fontWeight: FontWeight.bold, 35 | ), 36 | ), 37 | Text("0 Video"), 38 | Row( 39 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 40 | crossAxisAlignment: CrossAxisAlignment.center, 41 | children: [ 42 | Column( 43 | crossAxisAlignment: CrossAxisAlignment.center, 44 | children: [ 45 | Text( 46 | "9", 47 | style: TextStyle( 48 | fontWeight: FontWeight.bold, 49 | fontSize: 18, 50 | ), 51 | ), 52 | Text("Following"), 53 | ], 54 | ), 55 | Column( 56 | crossAxisAlignment: CrossAxisAlignment.center, 57 | children: [ 58 | Text( 59 | "1", 60 | style: TextStyle( 61 | fontWeight: FontWeight.bold, 62 | fontSize: 18, 63 | ), 64 | ), 65 | Text("Fallowers"), 66 | ], 67 | ), 68 | Column( 69 | crossAxisAlignment: CrossAxisAlignment.center, 70 | children: [ 71 | Text( 72 | "0", 73 | style: TextStyle( 74 | fontWeight: FontWeight.bold, 75 | fontSize: 18, 76 | ), 77 | ), 78 | Text("Heart"), 79 | ], 80 | ) 81 | ], 82 | ), 83 | Row( 84 | mainAxisAlignment: MainAxisAlignment.center, 85 | crossAxisAlignment: CrossAxisAlignment.center, 86 | children: [ 87 | RaisedButton( 88 | color: Color(0xFFf23b55), 89 | child: Text( 90 | 'Edit Profile', 91 | style: TextStyle( 92 | color: Colors.white, 93 | ), 94 | ), 95 | onPressed: () {}, 96 | ), 97 | SizedBox(width: 10), 98 | Icon(Icons.bookmark_border), 99 | ], 100 | ) 101 | ], 102 | ), 103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /lib/pages/templates/real-estate-clone/components/real-estate-active-tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class RealEstateActiveTab extends AnimatedWidget { 4 | final IconData icon; 5 | final String text; 6 | 7 | RealEstateActiveTab({Key key, Animation animation, this.icon, this.text}) 8 | : super(key: key, listenable: animation); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | final Animation animation = listenable; 13 | 14 | return Transform( 15 | transform: Matrix4.diagonal3Values(animation.value, 1, 1), 16 | child: Container( 17 | width: 120, 18 | height: 60, 19 | decoration: BoxDecoration( 20 | color: Color(0xFFe2d7f5), 21 | borderRadius: BorderRadius.only( 22 | topLeft: Radius.circular(20), 23 | bottomLeft: Radius.circular(20), 24 | bottomRight: Radius.circular(20), 25 | ), 26 | ), 27 | child: Row( 28 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 29 | crossAxisAlignment: CrossAxisAlignment.center, 30 | children: [ 31 | Icon( 32 | icon, 33 | color: Color(0xff6732c1), 34 | size: 30, 35 | ), 36 | Text( 37 | text, 38 | style: TextStyle( 39 | color: Color(0xff6732c1), 40 | fontSize: 18, 41 | ), 42 | ) 43 | ], 44 | ), 45 | ), 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/pages/templates/real-estate-clone/components/real-estate-bottom-bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:playground_flutter/pages/templates/real-estate-clone/components/real-estate-active-tab.dart'; 3 | 4 | class RealEstateBottomBar extends StatefulWidget { 5 | @override 6 | _RealEstateBottomBarState createState() => _RealEstateBottomBarState(); 7 | } 8 | 9 | class _RealEstateBottomBarState extends State 10 | with SingleTickerProviderStateMixin { 11 | Animation _animation; 12 | AnimationController _controller; 13 | int _currentActiveTab = 0; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | _controller = 19 | AnimationController(vsync: this, duration: Duration(seconds: 1)); 20 | _animation = new Tween(begin: 0.0, end: 1.0).animate( 21 | new CurvedAnimation(parent: _controller, curve: Curves.elasticOut)); 22 | 23 | _controller.forward(); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Container( 29 | padding: EdgeInsets.only(right: 16, bottom: 5, top: 10, left: 16), 30 | height: 60, 31 | width: MediaQuery.of(context).size.width, 32 | child: Row( 33 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 34 | crossAxisAlignment: CrossAxisAlignment.center, 35 | children: [ 36 | _buildTab('Home', Icons.home, 0), 37 | _buildTab('Favorite', Icons.bookmark_border, 1), 38 | _buildTab('Message', Icons.chat_bubble_outline, 2), 39 | _buildTab('Profile', Icons.perm_identity, 3), 40 | ], 41 | ), 42 | ); 43 | } 44 | 45 | Widget _buildTab(String text, IconData icon, int index) { 46 | return _currentActiveTab == index 47 | ? RealEstateActiveTab( 48 | animation: _animation, 49 | key: Key(text), 50 | text: text, 51 | icon: icon, 52 | ) 53 | : Material( 54 | child: InkWell( 55 | onTap: () { 56 | setState(() { 57 | _currentActiveTab = index; 58 | _controller.reset(); 59 | _controller.forward(); 60 | }); 61 | }, 62 | child: Icon( 63 | icon, 64 | size: 35, 65 | ), 66 | ), 67 | ); 68 | } 69 | 70 | @override 71 | void dispose() { 72 | _controller.dispose(); 73 | super.dispose(); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/pages/templates/smart-home-clone/bottom-bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | Color color = Color(0xffff024a); 4 | 5 | class BottomBar extends StatefulWidget { 6 | BottomBar({Key key}) : super(key: key); 7 | 8 | _BottomBarState createState() => _BottomBarState(); 9 | } 10 | 11 | class _BottomBarState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | double itemWidth = MediaQuery.of(context).size.width / 5; 15 | 16 | return Row( 17 | mainAxisAlignment: MainAxisAlignment.spaceAround, 18 | crossAxisAlignment: CrossAxisAlignment.center, 19 | children: [ 20 | Container( 21 | width: itemWidth, 22 | alignment: Alignment.center, 23 | child: Ink( 24 | child: InkWell( 25 | onTap: () {}, 26 | child: Column( 27 | mainAxisAlignment: MainAxisAlignment.center, 28 | children: [ 29 | Icon( 30 | Icons.home, 31 | color: color, 32 | size: 35, 33 | ), 34 | Text("Home") 35 | ], 36 | ), 37 | ), 38 | ), 39 | ), 40 | Container( 41 | width: itemWidth, 42 | alignment: Alignment.center, 43 | child: Ink( 44 | child: InkWell( 45 | onTap: () { 46 | print("hola!!"); 47 | }, 48 | child: Column( 49 | mainAxisAlignment: MainAxisAlignment.center, 50 | children: [ 51 | Icon( 52 | Icons.forward_5, 53 | color: Colors.grey, 54 | size: 35, 55 | ), 56 | Text("Routines") 57 | ], 58 | ), 59 | ), 60 | ), 61 | ), 62 | Container(width: itemWidth), 63 | Container( 64 | width: itemWidth, 65 | alignment: Alignment.center, 66 | child: Ink( 67 | child: InkWell( 68 | onTap: () {}, 69 | child: Column( 70 | mainAxisAlignment: MainAxisAlignment.center, 71 | children: [ 72 | Icon( 73 | Icons.show_chart, 74 | color: Colors.grey, 75 | size: 35, 76 | ), 77 | Text("Stats") 78 | ], 79 | ), 80 | ), 81 | ), 82 | ), 83 | Container( 84 | width: itemWidth, 85 | alignment: Alignment.center, 86 | child: Ink( 87 | child: InkWell( 88 | onTap: () {}, 89 | child: Column( 90 | mainAxisAlignment: MainAxisAlignment.center, 91 | children: [ 92 | Icon( 93 | Icons.menu, 94 | color: Colors.grey, 95 | size: 35, 96 | ), 97 | Text("More") 98 | ], 99 | ), 100 | ), 101 | ), 102 | ) 103 | ], 104 | ); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /lib/pages/templates/smart-home-clone/curve-clipper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CurveClipper extends CustomClipper { 4 | @override 5 | Path getClip(Size size) { 6 | Path path = Path(); 7 | 8 | path.lineTo(0, size.height); 9 | path.quadraticBezierTo( 10 | size.width / 2, size.height / 2, size.width, size.height); 11 | path.lineTo(size.width, 0); 12 | 13 | path.close(); 14 | return path; 15 | } 16 | 17 | @override 18 | bool shouldReclip(CustomClipper oldClipper) { 19 | return true; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/pages/templates/smart-plant-clone/chart-painter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ChartPainter extends CustomPainter { 4 | Paint backgroundPaint = Paint() 5 | ..color = Color(0xff8ed5aa) 6 | ..style = PaintingStyle.stroke 7 | ..strokeCap = StrokeCap.round 8 | ..strokeWidth = 10; 9 | 10 | Paint valuePaint = Paint() 11 | ..color = Colors.white 12 | ..style = PaintingStyle.stroke 13 | ..strokeCap = StrokeCap.round 14 | ..strokeWidth = 10; 15 | 16 | @override 17 | void paint(Canvas canvas, Size size) { 18 | Path backgroundPath = Path(); 19 | Path valuePath = Path(); 20 | 21 | backgroundPath.moveTo(0, size.height / 2); 22 | backgroundPath.lineTo(size.width, size.height / 2); 23 | 24 | valuePath.moveTo(0, size.height / 2); 25 | valuePath.lineTo(size.width * .5, size.height / 2); 26 | 27 | canvas.drawPath(backgroundPath, backgroundPaint); 28 | canvas.drawPath(valuePath, valuePaint); 29 | } 30 | 31 | @override 32 | bool shouldRepaint(CustomPainter oldDelegate) { 33 | return false; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/pages/templates/stayfit-health-clone/progress_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:math'; 3 | 4 | class ProgressPainter extends CustomPainter { 5 | final Color percentageCompletedCircleColor; 6 | final double completedPercentage; 7 | final double circleWidth; 8 | 9 | ProgressPainter({ 10 | this.percentageCompletedCircleColor, 11 | this.completedPercentage, 12 | this.circleWidth, 13 | }); 14 | 15 | getPaint(Color color) { 16 | return Paint() 17 | ..color = color 18 | ..strokeCap = StrokeCap.round 19 | ..style = PaintingStyle.stroke 20 | ..strokeWidth = circleWidth; 21 | } 22 | 23 | @override 24 | void paint(Canvas canvas, Size size) { 25 | Paint defaultCirclePaint = 26 | getPaint(percentageCompletedCircleColor.withOpacity(0.2)); 27 | Paint progressCirclePaint = getPaint(percentageCompletedCircleColor); 28 | 29 | Offset center = Offset(size.width / 2, size.height / 2); 30 | double radius = min(size.width / 2, size.height / 2); 31 | canvas.drawCircle(center, radius, defaultCirclePaint); 32 | 33 | double arcAngle = 2 * pi * (completedPercentage / 100); 34 | canvas.drawArc(Rect.fromCircle(center: center, radius: radius), -pi / 2, 35 | arcAngle, false, progressCirclePaint); 36 | } 37 | 38 | @override 39 | bool shouldRepaint(CustomPainter painter) { 40 | return true; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/pages/templates/whatsapp-clone/pages/calls_sceen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:playground_flutter/data/calls_data.dart'; 3 | import 'package:playground_flutter/models/call_model.dart'; 4 | import 'package:playground_flutter/pages/templates/whatsapp-clone/pages/call_details.dart'; 5 | 6 | class CallsScreen extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | return new ListView.builder( 10 | itemCount: calls.length, 11 | itemBuilder: (BuildContext context, int index) { 12 | final CallModel call = calls[index]; 13 | 14 | return new Column( 15 | children: [ 16 | new Divider( 17 | height: index == 0 ? 5.0 : 10.0, 18 | ), 19 | new ListTile( 20 | leading: new CircleAvatar( 21 | foregroundColor: Theme.of(context).primaryColor, 22 | backgroundColor: Colors.grey, 23 | backgroundImage: new NetworkImage(call.avatar), 24 | ), 25 | title: new Row( 26 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 27 | children: [ 28 | new Column( 29 | crossAxisAlignment: CrossAxisAlignment.start, 30 | children: [ 31 | new Text( 32 | call.name, 33 | style: new TextStyle(fontWeight: FontWeight.bold), 34 | ), 35 | new Container( 36 | padding: EdgeInsets.only(top: 5.0), 37 | child: new Row( 38 | children: [ 39 | new Icon( 40 | Icons.call_received, 41 | size: 20.0, 42 | color: Theme.of(context).accentColor, 43 | ), 44 | new Text( 45 | call.time, 46 | style: new TextStyle( 47 | color: Colors.grey, fontSize: 15.0), 48 | ) 49 | ], 50 | ), 51 | ) 52 | ], 53 | ), 54 | new Icon( 55 | call.type == CallType.Call ? Icons.call : Icons.videocam, 56 | color: Theme.of(context).primaryColor, 57 | ) 58 | ], 59 | ), 60 | onTap: () { 61 | Navigator.push( 62 | context, 63 | new MaterialPageRoute( 64 | builder: (context) => new CallDetail(call: calls[index]), 65 | ), 66 | ); 67 | }, 68 | ) 69 | ], 70 | ); 71 | }, 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/pages/templates/whatsapp-clone/pages/camera_sceen.dart: -------------------------------------------------------------------------------- 1 | import 'package:camera/camera.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:playground_flutter/plugins/camera_manager.dart'; 4 | 5 | class CameraScreen extends StatefulWidget { 6 | @override 7 | CameraScreenState createState() { 8 | return new CameraScreenState(); 9 | } 10 | } 11 | 12 | class CameraScreenState extends State { 13 | CameraManager cameraManager = new CameraManager(); 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | } 19 | 20 | @override 21 | void dispose() { 22 | super.dispose(); 23 | cameraManager.close(); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return new FutureBuilder( 29 | future: cameraManager.openCamera(), 30 | builder: (BuildContext context, AsyncSnapshot event) { 31 | return event.connectionState == ConnectionState.done 32 | ? new Container(child: new CameraPreview(event.data)) 33 | : new Container(); 34 | }, 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/pages/templates/whatsapp-clone/pages/chats_sceen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:playground_flutter/data/chats_data.dart'; 3 | import 'package:playground_flutter/models/chat_model.dart'; 4 | 5 | class ChatsScreen extends StatefulWidget { 6 | @override 7 | ChatsScreenState createState() { 8 | return new ChatsScreenState(); 9 | } 10 | } 11 | 12 | class ChatsScreenState extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return new ListView.builder( 16 | itemCount: chats.length, 17 | itemBuilder: (BuildContext context, int index) { 18 | final ChatModel msg = chats[index]; 19 | 20 | return new Column( 21 | children: [ 22 | new Divider( 23 | height: index == 0 ? 5.0 : 10.0, 24 | ), 25 | new ListTile( 26 | leading: new CircleAvatar( 27 | foregroundColor: Theme.of(context).primaryColor, 28 | backgroundColor: Colors.grey, 29 | backgroundImage: new NetworkImage(msg.avatar), 30 | ), 31 | title: new Row( 32 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 33 | children: [ 34 | new Text( 35 | msg.name, 36 | style: new TextStyle(fontWeight: FontWeight.bold), 37 | ), 38 | new Text( 39 | msg.time, 40 | style: new TextStyle(color: Colors.grey, fontSize: 14.0), 41 | ), 42 | ], 43 | ), 44 | subtitle: new Container( 45 | padding: EdgeInsets.only(top: 5.0), 46 | child: new Text( 47 | msg.message, 48 | style: new TextStyle(color: Colors.grey, fontSize: 15.0), 49 | ), 50 | ), 51 | ) 52 | ], 53 | ); 54 | }, 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/pages/templates/whatsapp-clone/pages/status_sceen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class StatusScreen extends StatelessWidget { 4 | Widget _buildStatusItem(context) { 5 | return ListTile( 6 | leading: Stack( 7 | children: [ 8 | new CircleAvatar( 9 | foregroundColor: Theme.of(context).primaryColor, 10 | backgroundColor: Colors.grey, 11 | backgroundImage: new NetworkImage( 12 | "http://www.usanetwork.com/sites/usanetwork/files/styles/629x720/public/suits_cast_harvey.jpg?itok=fpTOeeBb"), 13 | ), 14 | Container( 15 | alignment: AlignmentDirectional.bottomEnd, 16 | width: 42, 17 | height: 42, 18 | child: Container( 19 | width: 15.0, 20 | height: 15.0, 21 | child: new RawMaterialButton( 22 | onPressed: () {}, 23 | child: new Icon( 24 | Icons.add, 25 | color: Colors.white, 26 | size: 15.0, 27 | ), 28 | shape: new CircleBorder(), 29 | elevation: 2.0, 30 | fillColor: Theme.of(context).accentColor, 31 | ), 32 | ), 33 | ), 34 | ], 35 | ), 36 | title: Text( 37 | "My Status", 38 | style: TextStyle(fontWeight: FontWeight.bold), 39 | ), 40 | subtitle: Text( 41 | "Add new update", 42 | style: TextStyle(color: Colors.grey, fontSize: 14.0), 43 | ), 44 | ); 45 | } 46 | 47 | Widget _buildSection(String name) { 48 | return Container( 49 | height: 30.0, 50 | alignment: AlignmentDirectional.centerStart, 51 | decoration: BoxDecoration( 52 | color: Colors.grey[200], 53 | border: Border( 54 | top: BorderSide( 55 | color: Colors.grey, 56 | width: 0.1, 57 | ), 58 | ), 59 | ), 60 | child: Padding( 61 | padding: EdgeInsets.only(left: 15.0), 62 | child: Text( 63 | name, 64 | style: TextStyle( 65 | fontSize: 15, 66 | ), 67 | ), 68 | ), 69 | ); 70 | } 71 | 72 | @override 73 | Widget build(BuildContext context) { 74 | return ListView( 75 | children: [ 76 | Divider(height: 5.0), 77 | _buildStatusItem(context), 78 | _buildSection("Recently"), 79 | ListTile( 80 | leading: new CircleAvatar( 81 | foregroundColor: Theme.of(context).primaryColor, 82 | backgroundColor: Colors.grey, 83 | backgroundImage: new NetworkImage( 84 | "https://heavyeditorial.files.wordpress.com/2017/07/jessica-johnson-5.jpg?w=531&quality=65&strip=all&h=531"), 85 | ), 86 | title: Text("Daynelis Cruz", 87 | style: new TextStyle(fontWeight: FontWeight.bold)), 88 | subtitle: Text("Today: 12.55 PM"), 89 | ), 90 | _buildSection("Videos"), 91 | ], 92 | ); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /lib/pages/templates/whatsapp-clone/whatsapp_home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:playground_flutter/bloc/theme.bloc.dart'; 3 | import 'package:playground_flutter/configs/themes.dart'; 4 | import './pages/calls_sceen.dart'; 5 | import './pages/camera_sceen.dart'; 6 | import './pages/chats_sceen.dart'; 7 | import './pages/status_sceen.dart'; 8 | 9 | class WhatsAppHome extends StatefulWidget { 10 | @override 11 | _WhatsAppHomeState createState() => _WhatsAppHomeState(); 12 | } 13 | 14 | class _WhatsAppHomeState extends State 15 | with SingleTickerProviderStateMixin { 16 | TabController _tabController; 17 | 18 | @override 19 | void initState() { 20 | super.initState(); 21 | _tabController = new TabController(vsync: this, initialIndex: 1, length: 4); 22 | _tabController.addListener(_handleTabIndex); 23 | themeBloc.changeTheme(Themes.whapsapp); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Scaffold( 29 | appBar: new AppBar( 30 | title: new Text("WhatsApp"), 31 | elevation: 0.7, 32 | backgroundColor: new Color(0xff075E54), 33 | bottom: new TabBar( 34 | controller: _tabController, 35 | indicatorColor: Colors.white, 36 | tabs: [ 37 | new Tab(icon: new Icon(Icons.camera_alt)), 38 | new Tab(text: "CHATS"), 39 | new Tab(text: "STATUS"), 40 | new Tab(text: "CALLS"), 41 | ], 42 | ), 43 | actions: [ 44 | new Icon(Icons.search), 45 | new Padding( 46 | padding: EdgeInsets.symmetric(horizontal: 5.0), 47 | ), 48 | new Icon(Icons.more_vert), 49 | ], 50 | ), 51 | body: new TabBarView( 52 | controller: _tabController, 53 | children: [ 54 | new CameraScreen(), 55 | new ChatsScreen(), 56 | new StatusScreen(), 57 | new CallsScreen(), 58 | ], 59 | ), 60 | floatingActionButton: _bottomButtons()); 61 | } 62 | 63 | void _handleTabIndex() { 64 | setState(() {}); 65 | } 66 | 67 | Widget _bottomButtons() { 68 | switch (_tabController.index) { 69 | case 1: 70 | { 71 | return new FloatingActionButton( 72 | backgroundColor: new Color(0xff25D366), 73 | child: new Icon(Icons.message, color: Colors.white), 74 | onPressed: () => print('Hola!!'), 75 | ); 76 | } 77 | case 2: 78 | { 79 | return Column( 80 | crossAxisAlignment: CrossAxisAlignment.end, 81 | mainAxisAlignment: MainAxisAlignment.end, 82 | children: [ 83 | Padding( 84 | padding: const EdgeInsets.only(bottom: 10.0), 85 | child: new FloatingActionButton( 86 | backgroundColor: Colors.grey[200], 87 | child: new Icon( 88 | Icons.edit, 89 | color: Colors.black, 90 | ), 91 | onPressed: () => print('Hola!!'), 92 | ), 93 | ), 94 | new FloatingActionButton( 95 | backgroundColor: new Color(0xff25D366), 96 | child: new Icon( 97 | Icons.camera_alt, 98 | color: Colors.white, 99 | ), 100 | onPressed: () => print('Hola!!'), 101 | ), 102 | ], 103 | ); 104 | } 105 | case 3: 106 | { 107 | return new FloatingActionButton( 108 | backgroundColor: new Color(0xff25D366), 109 | child: new Icon(Icons.add_call, color: Colors.white), 110 | onPressed: () => print('Hola!!'), 111 | ); 112 | } 113 | default: 114 | return null; 115 | } 116 | } 117 | 118 | @override 119 | void dispose() { 120 | _tabController.removeListener(_handleTabIndex); 121 | _tabController.dispose(); 122 | themeBloc.changeTheme(Themes.light); 123 | super.dispose(); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /lib/plugins/camera_manager.dart: -------------------------------------------------------------------------------- 1 | import 'package:camera/camera.dart'; 2 | import 'dart:async'; 3 | 4 | class CameraManager { 5 | CameraManager(); 6 | CameraController _cameraCtrl; 7 | 8 | Future openCamera() async { 9 | CameraDescription cameraDescription; 10 | List cameras = await availableCameras(); 11 | 12 | if (_cameraCtrl != null) { 13 | return _cameraCtrl; 14 | } 15 | 16 | for (CameraDescription xx in cameras) { 17 | if (xx.lensDirection == CameraLensDirection.back) { 18 | cameraDescription = xx; 19 | break; 20 | } 21 | } 22 | 23 | if (cameraDescription == null) { 24 | return null; 25 | } 26 | 27 | _cameraCtrl = 28 | new CameraController(cameraDescription, ResolutionPreset.medium); 29 | 30 | try { 31 | await _cameraCtrl.initialize(); 32 | } on CameraException catch (e) { 33 | print(e); 34 | } 35 | 36 | return _cameraCtrl; 37 | } 38 | 39 | close() async { 40 | if (_cameraCtrl != null) { 41 | await _cameraCtrl.dispose(); 42 | } 43 | _cameraCtrl = null; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/services/auth.service.dart: -------------------------------------------------------------------------------- 1 | import 'package:google_sign_in/google_sign_in.dart'; 2 | import 'package:firebase_auth/firebase_auth.dart'; 3 | 4 | class AuthService { 5 | GoogleSignIn _googleSignIn = GoogleSignIn( 6 | scopes: [ 7 | 'email', 8 | 'https://www.googleapis.com/auth/contacts.readonly', 9 | ], 10 | ); 11 | 12 | get onGoogleCurrentUserChanged => _googleSignIn.onCurrentUserChanged; 13 | 14 | Future signInWithGoogle() async { 15 | await _googleSignIn.signIn(); 16 | } 17 | 18 | Future signInFirebase(String email, String password) async { 19 | await FirebaseAuth.instance 20 | .signInWithEmailAndPassword(email: email, password: password); 21 | } 22 | 23 | Future signOutFirebase() async { 24 | await FirebaseAuth.instance.signOut(); 25 | } 26 | 27 | Future signOutGoogle() async { 28 | await _googleSignIn.signOut(); 29 | } 30 | } 31 | 32 | final authService = AuthService(); 33 | -------------------------------------------------------------------------------- /lib/services/database.service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:path/path.dart'; 3 | import 'package:playground_flutter/constants/database.dart'; 4 | import 'package:sqflite/sqflite.dart'; 5 | 6 | class SqliteDatabaseService { 7 | Database db; 8 | 9 | Future initDatabase() async { 10 | var databasesPath = await getDatabasesPath(); 11 | String path = join(databasesPath, 'baseball_teams.db'); 12 | 13 | db = await openDatabase(path, version: 1, 14 | onCreate: (Database db, int version) async { 15 | await db.execute( 16 | 'CREATE TABLE IF NOT EXISTS ${DatabaseContants.TEAMS_TABLE_NAME} (key INTEGER PRIMARY KEY, name TEXT, coach TEXT, players INTEGER)'); 17 | }); 18 | } 19 | 20 | Future count({@required String tableName}) async { 21 | return Sqflite.firstIntValue( 22 | await db.rawQuery("SELECT COUNT(*) FROM $tableName")); 23 | } 24 | 25 | Future getById({@required String tableName, @required int id}) async { 26 | List result = await db.query(tableName, where: "id", whereArgs: [id]); 27 | return result.length > 0 28 | ? result.first 29 | : throw Exception("Element $id in $tableName not exist !!!"); 30 | } 31 | 32 | Future> findAll({@required String tableName}) async { 33 | return await db.query(tableName); 34 | } 35 | 36 | Future batch({@required Function(Batch) operations}) async { 37 | Batch batch = db.batch(); 38 | operations(batch); 39 | await batch.commit(noResult: true); 40 | } 41 | 42 | Future insertBatch({ 43 | @required String tableName, 44 | @required List> inserts, 45 | }) async { 46 | await batch(operations: (Batch batch) { 47 | inserts.forEach((mapValue) => batch.insert(tableName, mapValue)); 48 | }); 49 | } 50 | 51 | Future update({ 52 | @required String tableName, 53 | @required int id, 54 | @required Map model, 55 | String columnId = 'key', 56 | }) async { 57 | return await db 58 | .update(tableName, model, where: '$columnId = ?', whereArgs: [id]); 59 | } 60 | 61 | Future delete({ 62 | @required String tableName, 63 | @required int id, 64 | String columnId = 'key', 65 | }) async { 66 | return await db.delete(tableName, where: '$columnId = ?', whereArgs: [id]); 67 | } 68 | 69 | Future create({ 70 | @required String tableName, 71 | @required Map item, 72 | }) async { 73 | return await db.insert(tableName, item); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/services/firebase_basebal_team.service.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/constants/database.dart'; 2 | import 'package:playground_flutter/models/baseball.model.dart'; 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | 5 | class FirebaseBaseballService { 6 | Firestore _db = Firestore.instance; 7 | 8 | // subscribe in real time 9 | Stream> list() => _db 10 | .collection(DatabaseContants.TEAMS_TABLE_NAME) 11 | .snapshots() 12 | .map((QuerySnapshot q) => q.documents 13 | .map((DocumentSnapshot d) => BaseballModel.fromSnapshot(d)) 14 | .toList()); 15 | 16 | Future delete(BaseballModel item) async { 17 | try { 18 | await _db 19 | .collection(DatabaseContants.TEAMS_TABLE_NAME) 20 | .document(item.key) 21 | .delete(); 22 | return true; 23 | } catch (e) { 24 | return await Future.value(false); 25 | } 26 | } 27 | 28 | Future create(BaseballModel item) async { 29 | try { 30 | await _db 31 | .collection(DatabaseContants.TEAMS_TABLE_NAME) 32 | .add(item.toJson()); 33 | return true; 34 | } catch (e) { 35 | return await Future.value(false); 36 | } 37 | } 38 | 39 | Future update(BaseballModel item) async { 40 | try { 41 | final DocumentSnapshot document = await _db 42 | .collection(DatabaseContants.TEAMS_TABLE_NAME) 43 | .document(item.key) 44 | .snapshots() 45 | .first; 46 | 47 | Map dataToUpdate = item.toJson(); 48 | //remove key or id entity from my json map 49 | dataToUpdate.remove('key'); 50 | 51 | await document.reference.updateData(dataToUpdate); 52 | 53 | return true; 54 | } catch (e) { 55 | return await Future.value(false); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/services/notification.service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flushbar/flushbar.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class NotificationService { 5 | static Flushbar successFactory({ 6 | String title = "Success", 7 | String msg = "Se realizó correctamente la operación", 8 | }) { 9 | return Flushbar( 10 | flushbarPosition: FlushbarPosition.TOP, 11 | titleText: Text(title, style: TextStyle(color: Colors.white)), 12 | messageText: Text(msg, style: TextStyle(color: Colors.white)), 13 | backgroundColor: Colors.green, 14 | duration: const Duration(seconds: 5), 15 | ); 16 | } 17 | 18 | static Flushbar errorFactory({ 19 | String title = "Error", 20 | String msg = "No se realizó correctamente la operación", 21 | }) { 22 | return Flushbar( 23 | flushbarPosition: FlushbarPosition.TOP, 24 | titleText: Text(title, style: TextStyle(color: Colors.white)), 25 | messageText: Text(msg, style: TextStyle(color: Colors.white)), 26 | backgroundColor: Colors.red, 27 | duration: const Duration(seconds: 5), 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/services/sqlite_basebal_team.service.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/configs/ioc.dart'; 2 | import 'package:playground_flutter/constants/database.dart'; 3 | import 'package:playground_flutter/models/baseball.model.dart'; 4 | import 'package:playground_flutter/services/database.service.dart'; 5 | 6 | class SqliteBaseballService { 7 | SqliteDatabaseService _database; 8 | 9 | SqliteBaseballService([SqliteDatabaseService db]) 10 | : _database = db ?? ioc(); 11 | 12 | Stream> list() => Stream.fromFuture( 13 | _database.findAll(tableName: DatabaseContants.TEAMS_TABLE_NAME)) 14 | .map( 15 | (List list) => list.map((m) => BaseballModel.fromJson(m)).toList(), 16 | ) 17 | .take(1); 18 | 19 | Future seedData() async { 20 | int count = 21 | await _database.count(tableName: DatabaseContants.TEAMS_TABLE_NAME); 22 | 23 | if (count == 0) { 24 | await _database.insertBatch( 25 | tableName: DatabaseContants.TEAMS_TABLE_NAME, 26 | inserts: [ 27 | { 28 | 'name': 'NY Mets', 29 | 'coach': 'Javier', 30 | 'players': 60, 31 | }, 32 | { 33 | 'name': 'WhiteSox', 34 | 'coach': 'Javier1', 35 | 'players': 75, 36 | }, 37 | { 38 | 'name': 'Cardinals', 39 | 'coach': 'Javier2', 40 | 'players': 45, 41 | } 42 | ], 43 | ); 44 | } 45 | } 46 | 47 | Future delete(BaseballModel item) async { 48 | await _database.delete( 49 | tableName: DatabaseContants.TEAMS_TABLE_NAME, 50 | id: item.key, 51 | ); 52 | } 53 | 54 | Future create(BaseballModel item) async { 55 | await _database.create( 56 | tableName: DatabaseContants.TEAMS_TABLE_NAME, 57 | item: item.toJson(), 58 | ); 59 | } 60 | 61 | Future update(BaseballModel item) async { 62 | await _database.update( 63 | tableName: DatabaseContants.TEAMS_TABLE_NAME, 64 | model: item.toJson(), 65 | id: item.key, 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/services/stack_overflow.service.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/models/stackoverflow_response.model.dart'; 2 | import 'package:playground_flutter/services/web.client.dart'; 3 | 4 | class StackOverflowService { 5 | Future list([int page = 1]) async { 6 | var query = { 7 | 'order': 'desc', 8 | 'sort': 'activity', 9 | 'site': 'stackoverflow', 10 | 'page': page, 11 | 'pagesize': 5, 12 | }; 13 | 14 | var response = await http.get('', query); 15 | 16 | return StackOverflowResponseModel.fromJson(response); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/services/web.client.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:playground_flutter/environment/environment.dart'; 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | final Dio dio = new Dio() 6 | ..options.baseUrl = Environment.api 7 | ..options.connectTimeout = 5000 8 | ..options.receiveTimeout 9 | ..options.headers = {'Content-Type': 'application/json; charset=utf-8'} 10 | ..interceptors.add( 11 | InterceptorsWrapper( 12 | onRequest: (RequestOptions options) async { 13 | var prefs = await SharedPreferences.getInstance(); 14 | var token = prefs.getString(Environment.tokenKey); 15 | 16 | if (token != null) { 17 | options.headers.putIfAbsent('Authorization', () => token); 18 | } 19 | 20 | return options; 21 | }, 22 | ), 23 | ); 24 | 25 | class WebClient { 26 | const WebClient(); 27 | 28 | dynamic commonBehavior(Response response) { 29 | if (response.statusCode >= 400) { 30 | throw ('An error occurred: ' + response.data); 31 | } 32 | 33 | return response.data; 34 | } 35 | 36 | Future get(String uri, [data]) async { 37 | final Response response = await dio.get(uri, queryParameters: data); 38 | return commonBehavior(response); 39 | } 40 | 41 | Future post(String uri, dynamic data) async { 42 | try { 43 | final Response response = await dio.post(uri, data: data); 44 | return commonBehavior(response); 45 | } catch (e) { 46 | throw ('An error occurred'); 47 | } 48 | } 49 | 50 | Future put(String uri, dynamic data) async { 51 | try { 52 | final Response response = await dio.put(uri, data: data); 53 | return commonBehavior(response); 54 | } catch (e) { 55 | throw ('An error occurred'); 56 | } 57 | } 58 | 59 | Future download( 60 | String url, savePath, ProgressCallback onProgress) async { 61 | try { 62 | await dio.download(url, savePath, onReceiveProgress: onProgress); 63 | } catch (e) { 64 | throw ('An error occurred'); 65 | } 66 | } 67 | } 68 | 69 | final WebClient http = new WebClient(); 70 | -------------------------------------------------------------------------------- /lib/shared/utils/touchid.util.dart: -------------------------------------------------------------------------------- 1 | import 'package:local_auth/local_auth.dart'; 2 | 3 | class TouchIdUtil { 4 | final LocalAuthentication _auth = LocalAuthentication(); 5 | Future isActive() async { 6 | bool canCheckBiometrics = await _auth.canCheckBiometrics; 7 | 8 | if (!canCheckBiometrics) { 9 | return false; 10 | } 11 | 12 | List availableBiometrics = 13 | await _auth.getAvailableBiometrics(); 14 | 15 | return availableBiometrics.contains(BiometricType.fingerprint); 16 | } 17 | 18 | Future auth() async { 19 | try { 20 | return await _auth.authenticateWithBiometrics( 21 | localizedReason: 'Scan Your fingerprint to authenticate', 22 | useErrorDialogs: true, 23 | stickyAuth: false, 24 | ); 25 | } on Exception catch (e) { 26 | return false; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/shared/widgets/crud_demo_list_item.widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:playground_flutter/models/baseball.model.dart'; 3 | 4 | class CrudDemoListItem extends StatelessWidget { 5 | final BaseballModel item; 6 | final Function(BaseballModel) onPressedDelete; 7 | final Function(BaseballModel) onPressedEdit; 8 | 9 | const CrudDemoListItem({ 10 | Key key, 11 | this.item, 12 | this.onPressedDelete, 13 | this.onPressedEdit, 14 | }) : super(key: key); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return ListTile( 19 | title: Text(item.name), 20 | subtitle: Text(item.coach), 21 | trailing: Container( 22 | width: 100, 23 | child: Row( 24 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 25 | children: [ 26 | IconButton( 27 | icon: Icon(Icons.delete), 28 | onPressed: () => onPressedDelete(item), 29 | ), 30 | IconButton( 31 | icon: Icon(Icons.edit), 32 | onPressed: () => onPressedEdit(item), 33 | ), 34 | ], 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/store/actions/stack_overflow.action.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:playground_flutter/models/stackoverflow.model.dart'; 3 | 4 | class LoadQuestionAction { 5 | final bool paginate; 6 | 7 | LoadQuestionAction({this.paginate}); 8 | } 9 | 10 | class LoadQuestionSuccessAction { 11 | final List questions; 12 | final bool paginate; 13 | final bool hasMore; 14 | 15 | LoadQuestionSuccessAction({ 16 | @required this.questions, 17 | this.paginate, 18 | this.hasMore, 19 | }); 20 | } 21 | 22 | class LoadQuestionFailureAction { 23 | final dynamic error; 24 | 25 | LoadQuestionFailureAction({@required this.error}); 26 | } 27 | 28 | class DeleteQuestionAction { 29 | final StackOverflowModel question; 30 | 31 | DeleteQuestionAction({@required this.question}); 32 | } 33 | 34 | class DeleteSuccessQuestionAction { 35 | final StackOverflowModel question; 36 | 37 | DeleteSuccessQuestionAction({@required this.question}); 38 | } 39 | 40 | class ViewQuestionAction { 41 | final StackOverflowModel question; 42 | 43 | ViewQuestionAction({@required this.question}); 44 | } 45 | 46 | class SearchByAction { 47 | final String searchText; 48 | 49 | SearchByAction({this.searchText}); 50 | } 51 | -------------------------------------------------------------------------------- /lib/store/middlewares/stack_overflow.middleware.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/constants/navigation.dart'; 2 | import 'package:playground_flutter/services/stack_overflow.service.dart'; 3 | import 'package:playground_flutter/store/actions/stack_overflow.action.dart'; 4 | import 'package:playground_flutter/store/state/app.state.dart'; 5 | import 'package:redux/redux.dart'; 6 | 7 | List> overflowMiddlewares() { 8 | final StackOverflowService service = new StackOverflowService(); 9 | 10 | final loginRequest = _createLoadQuestionRequest(service); 11 | 12 | return ([ 13 | TypedMiddleware(loginRequest), 14 | TypedMiddleware(_viewQuestion), 15 | TypedMiddleware(_deleteLocalQuestion), 16 | ]); 17 | } 18 | 19 | Middleware _createLoadQuestionRequest(StackOverflowService service) { 20 | return (Store store, action, NextDispatcher next) async { 21 | try { 22 | // Propagate the action first for show loading indicator ( global and pagination ) 23 | next(action); 24 | 25 | var response = await service.list(store.state.stackOverflowState.page); 26 | 27 | // dispatch success loading question ( first load and pagination load ) 28 | store.dispatch( 29 | new LoadQuestionSuccessAction( 30 | questions: response.items, 31 | paginate: action.paginate, 32 | hasMore: response.hasMore, 33 | ), 34 | ); 35 | } catch (error) { 36 | store.dispatch(new LoadQuestionFailureAction(error: error)); 37 | } 38 | }; 39 | } 40 | 41 | _viewQuestion(Store store, action, NextDispatcher next) { 42 | NavigationConstrants.navKey.currentState 43 | .pushNamed(NavigationConstrants.ReduxViewQuestion); 44 | // Make sure to forward actions to the next middleware in the chain! 45 | next(action); 46 | } 47 | 48 | _deleteLocalQuestion(Store store, action, NextDispatcher next) { 49 | // show success msg for delete local question from my store 50 | store.dispatch(new DeleteSuccessQuestionAction(question: action.question)); 51 | 52 | NavigationConstrants.navKey.currentState 53 | .pushNamed(NavigationConstrants.NOTIFICATION_SUCCESS); 54 | // Make sure to forward actions to the next middleware in the chain! 55 | next(action); 56 | } 57 | -------------------------------------------------------------------------------- /lib/store/reducers/reducer.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/store/reducers/stack_overflow.reducer.dart'; 2 | import 'package:playground_flutter/store/state/app.state.dart'; 3 | 4 | AppState rootReducer(AppState state, action) { 5 | return AppState( 6 | stackOverflowState: stackOverflowReducer(state.stackOverflowState, action), 7 | ); 8 | } 9 | -------------------------------------------------------------------------------- /lib/store/reducers/stack_overflow.reducer.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/store/actions/stack_overflow.action.dart'; 2 | import 'package:playground_flutter/store/state/stack_overflow.state.dart'; 3 | import 'package:redux/redux.dart'; 4 | import 'package:uuid/uuid.dart'; 5 | 6 | String uuid() => new Uuid().v1(); 7 | 8 | StackOverflowState loadQuestions( 9 | StackOverflowState state, LoadQuestionAction action) { 10 | return state.copyWith( 11 | // activate global loading only if not pagination active 12 | l: action.paginate ? false : true, 13 | paginate: action.paginate, 14 | uuid: uuid(), 15 | // reset page if use RefreshIndicator or first loadind 16 | page: action.paginate ? state.page : 1, 17 | ); 18 | } 19 | 20 | StackOverflowState loadQuestionsSuccess( 21 | StackOverflowState state, LoadQuestionSuccessAction action) { 22 | return state.copyWith( 23 | l: false, 24 | // if pagination its actived i include the new items to the existing 25 | q: [ 26 | if (action.paginate) ...state.questions, 27 | ...action.questions, 28 | ], 29 | page: action.hasMore ? state.page + 1 : state.page, 30 | // forcing to change the state and execute StoreConector builder function 31 | uuid: uuid(), 32 | has_more: action.hasMore, 33 | paginate: false, 34 | ); 35 | } 36 | 37 | StackOverflowState viewQuestion( 38 | StackOverflowState state, ViewQuestionAction action) { 39 | return state.copyWith( 40 | s: action.question, 41 | uuid: uuid(), 42 | ); 43 | } 44 | 45 | StackOverflowState deleteQuestion( 46 | StackOverflowState state, DeleteSuccessQuestionAction action) { 47 | return state.copyWith( 48 | uuid: uuid(), 49 | q: state.questions 50 | .where((q) => q.questionId != action.question.questionId) 51 | .toList(), 52 | ); 53 | } 54 | 55 | // Update store with the new search text. 56 | StackOverflowState filterByAuthor( 57 | StackOverflowState state, SearchByAction action) { 58 | return state.copyWith( 59 | // forcing to change the state and execute StoreConector builder function 60 | uuid: uuid(), 61 | searchText: action.searchText, 62 | ); 63 | } 64 | 65 | final Reducer stackOverflowReducer = 66 | combineReducers([ 67 | new TypedReducer( 68 | loadQuestionsSuccess), 69 | new TypedReducer(loadQuestions), 70 | new TypedReducer( 71 | deleteQuestion), 72 | new TypedReducer(viewQuestion), 73 | new TypedReducer(filterByAuthor), 74 | ]); 75 | -------------------------------------------------------------------------------- /lib/store/selectors/stack_overflow.selector.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/models/stackoverflow.model.dart'; 2 | import 'package:playground_flutter/store/state/stack_overflow.state.dart'; 3 | import 'package:reselect/reselect.dart'; 4 | 5 | final allQuestionSelector = (StackOverflowState state) => state.questions; 6 | final filterBySelector = (StackOverflowState state) => state.searchText; 7 | 8 | // Create a memoized selector that only emit new value if any of your arguments change 9 | // Selector help you optimize the store 10 | // Selectors can compute derived data, allowing Redux to store the minimal possible state. 11 | final questionsByFilterSelector = createSelector2( 12 | allQuestionSelector, 13 | filterBySelector, 14 | (List questions, String filterBy) => questions.where( 15 | (question) => 16 | filterBy.length == 0 || 17 | question.owner.displayName.contains(filterBy), 18 | )); 19 | -------------------------------------------------------------------------------- /lib/store/state/app.state.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:playground_flutter/store/state/stack_overflow.state.dart'; 3 | 4 | class AppState { 5 | final StackOverflowState stackOverflowState; 6 | 7 | AppState({ 8 | @required this.stackOverflowState, 9 | }); 10 | 11 | AppState.initialState({stackOverflowState}) 12 | : stackOverflowState = 13 | stackOverflowState ?? StackOverflowState.initialState(); 14 | } 15 | -------------------------------------------------------------------------------- /lib/store/state/stack_overflow.state.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/models/stackoverflow.model.dart'; 2 | 3 | class StackOverflowState { 4 | final List questions; 5 | final StackOverflowModel selected; 6 | final bool loading; 7 | 8 | final bool paginate; 9 | final int page; 10 | final bool has_more; 11 | // to force the change of state 12 | final String uuid; 13 | 14 | final String searchText; 15 | 16 | StackOverflowState({ 17 | this.questions, 18 | this.selected, 19 | this.loading, 20 | this.page, 21 | this.paginate, 22 | this.has_more, 23 | this.uuid, 24 | this.searchText, 25 | }); 26 | 27 | StackOverflowState.initialState() 28 | : questions = List.unmodifiable([]), 29 | selected = null, 30 | loading = false, 31 | paginate = false, 32 | page = 1, 33 | has_more = false, 34 | uuid = '', 35 | searchText = ''; 36 | 37 | StackOverflowState copyWith( 38 | {q, s, l, paginate, has_more, uuid, page, searchText}) => 39 | new StackOverflowState( 40 | questions: q ?? this.questions, 41 | selected: s ?? this.selected, 42 | loading: l ?? this.loading, 43 | paginate: paginate ?? this.paginate, 44 | has_more: has_more ?? this.has_more, 45 | uuid: uuid ?? this.uuid, 46 | page: page ?? this.page, 47 | searchText: searchText ?? this.searchText, 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /lib/store/store.dart: -------------------------------------------------------------------------------- 1 | import 'package:playground_flutter/store/state/app.state.dart'; 2 | import 'package:playground_flutter/store/state/stack_overflow.state.dart'; 3 | import 'package:redux/redux.dart'; 4 | import 'package:redux_logging/redux_logging.dart'; 5 | import 'package:shared_preferences/shared_preferences.dart'; 6 | import 'package:playground_flutter/store/reducers/reducer.dart'; 7 | 8 | import 'middlewares/stack_overflow.middleware.dart'; 9 | 10 | Future> createStore() async { 11 | var prefs = await SharedPreferences.getInstance(); 12 | 13 | var midlewares = overflowMiddlewares() 14 | ..addAll([new LoggingMiddleware.printer()]); 15 | 16 | return Store( 17 | rootReducer, 18 | initialState: AppState.initialState( 19 | stackOverflowState: StackOverflowState.initialState(), 20 | ), 21 | middleware: midlewares, 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: playground_flutter 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # Read more about versioning at semver.org. 10 | version: 1.0.0+1 11 | 12 | environment: 13 | sdk: ">=2.2.2 <3.0.0" 14 | 15 | dependencies: 16 | flutter: 17 | sdk: flutter 18 | 19 | # The following adds the Cupertino Icons font to your application. 20 | # Use with the CupertinoIcons class for iOS style icons. 21 | flutter_signin_button: ^0.2.8 22 | cupertino_icons: ^0.1.2 23 | camera: 24 | shared_preferences: ^0.5.1+2 25 | dio: 2.1.7 26 | path_drawing: ^0.4.0 27 | firebase_auth: 28 | rxdart: 29 | google_sign_in: 30 | webview_flutter: 31 | flutter_redux: 32 | redux_logging: 33 | get_it: 34 | flushbar: ^1.7.1+1 35 | mapbox_gl: ^0.0.3 36 | sqflite: ^1.1.0 37 | json_annotation: ^2.4.0 38 | cloud_firestore: 39 | pdf: ^1.3.10 40 | flutter_full_pdf_viewer: ^1.0.4 41 | path_provider: 42 | csv: ^4.0.3 43 | video_player: ^0.10.1+3 44 | uuid: 2.0.0 45 | local_auth: 46 | reselect: 0.4.0 47 | share_extend: ^1.0.9 48 | flare_flutter: ^1.5.4 49 | math_expressions: any 50 | flutter_rating_bar: ^3.0.0 51 | 52 | dev_dependencies: 53 | build_runner: ^1.0.0 54 | json_serializable: ^3.0.0 55 | flutter_test: 56 | sdk: flutter 57 | 58 | # For information on the generic Dart part of this file, see the 59 | # following page: https://www.dartlang.org/tools/pub/pubspec 60 | 61 | # The following section is specific to Flutter. 62 | flutter: 63 | # The following line ensures that the Material Icons font is 64 | # included with your application, so that you can use the icons in 65 | # the material Icons class. 66 | uses-material-design: true 67 | 68 | # To add assets to your application, add an assets section, like this: 69 | assets: 70 | - assets/images/ 71 | - assets/videos/ 72 | - assets/demo.flr 73 | # An image asset can refer to one or more resolution-specific "variants", see 74 | # https://flutter.io/assets-and-images/#resolution-aware. 75 | # For details regarding adding assets from package dependencies, see 76 | # https://flutter.io/assets-and-images/#from-packages 77 | # To add custom fonts to your application, add a fonts section here, 78 | # in this "flutter" section. Each entry in this list should have a 79 | # "family" key with the font family name, and a "fonts" key with a 80 | # list giving the asset and other descriptors for the font. For 81 | # example: 82 | fonts: 83 | - family: Rubik 84 | fonts: 85 | - asset: assets/fonts/rubik/Rubik-Regular.ttf 86 | - asset: assets/fonts/rubik/Rubik-Medium.ttf 87 | - asset: assets/fonts/rubik/Rubik-Bold.ttf 88 | 89 | - family: Iconfont 90 | fonts: 91 | - asset: assets/fonts/icofont/icofont.ttf 92 | 93 | - family: Roboto 94 | fonts: 95 | - asset: assets/fonts/roboto/Roboto-Regular.ttf 96 | 97 | - family: Gotham 98 | fonts: 99 | - asset: assets/fonts/gotham/GothamThin.otf 100 | # 101 | # For details regarding fonts from package dependencies, 102 | # see https://flutter.io/custom-fonts/#from-packages 103 | -------------------------------------------------------------------------------- /screenshots/ss1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss1.png -------------------------------------------------------------------------------- /screenshots/ss10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss10.gif -------------------------------------------------------------------------------- /screenshots/ss10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss10.png -------------------------------------------------------------------------------- /screenshots/ss11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss11.gif -------------------------------------------------------------------------------- /screenshots/ss11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss11.png -------------------------------------------------------------------------------- /screenshots/ss12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss12.gif -------------------------------------------------------------------------------- /screenshots/ss12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss12.png -------------------------------------------------------------------------------- /screenshots/ss13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss13.png -------------------------------------------------------------------------------- /screenshots/ss14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss14.png -------------------------------------------------------------------------------- /screenshots/ss15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss15.png -------------------------------------------------------------------------------- /screenshots/ss16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss16.png -------------------------------------------------------------------------------- /screenshots/ss17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss17.png -------------------------------------------------------------------------------- /screenshots/ss18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss18.png -------------------------------------------------------------------------------- /screenshots/ss19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss19.png -------------------------------------------------------------------------------- /screenshots/ss2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss2.png -------------------------------------------------------------------------------- /screenshots/ss20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss20.png -------------------------------------------------------------------------------- /screenshots/ss21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss21.png -------------------------------------------------------------------------------- /screenshots/ss22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss22.png -------------------------------------------------------------------------------- /screenshots/ss23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss23.png -------------------------------------------------------------------------------- /screenshots/ss24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss24.png -------------------------------------------------------------------------------- /screenshots/ss3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss3.gif -------------------------------------------------------------------------------- /screenshots/ss3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss3.png -------------------------------------------------------------------------------- /screenshots/ss4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss4.png -------------------------------------------------------------------------------- /screenshots/ss5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss5.gif -------------------------------------------------------------------------------- /screenshots/ss5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss5.png -------------------------------------------------------------------------------- /screenshots/ss6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss6.gif -------------------------------------------------------------------------------- /screenshots/ss6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss6.png -------------------------------------------------------------------------------- /screenshots/ss7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss7.gif -------------------------------------------------------------------------------- /screenshots/ss7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss7.png -------------------------------------------------------------------------------- /screenshots/ss8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss8.gif -------------------------------------------------------------------------------- /screenshots/ss8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss8.png -------------------------------------------------------------------------------- /screenshots/ss9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss9.gif -------------------------------------------------------------------------------- /screenshots/ss9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javico2609/flutter-challenges/837d694fccc93df6cc58127500015029e84b9581/screenshots/ss9.png -------------------------------------------------------------------------------- /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:playground_flutter/environment.dart'; 11 | 12 | import 'package:playground_flutter/main.dart'; 13 | import 'package:playground_flutter/store/state/app.state.dart'; 14 | import 'package:redux/redux.dart'; 15 | 16 | void main() { 17 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 18 | final Store store = await Environment.setup(); 19 | 20 | // Build our app and trigger a frame. 21 | await tester.pumpWidget(MyApp(store)); 22 | 23 | // Verify that our counter starts at 0. 24 | expect(find.text('0'), findsOneWidget); 25 | expect(find.text('1'), findsNothing); 26 | 27 | // Tap the '+' icon and trigger a frame. 28 | await tester.tap(find.byIcon(Icons.add)); 29 | await tester.pump(); 30 | 31 | // Verify that our counter has incremented. 32 | expect(find.text('0'), findsNothing); 33 | expect(find.text('1'), findsOneWidget); 34 | }); 35 | } 36 | --------------------------------------------------------------------------------