├── .gitignore ├── .metadata ├── LICENSE ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── getx_navigation │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── data │ ├── categories.json │ └── products.json └── images │ ├── apple.png │ ├── banana.png │ ├── broccoli.png │ ├── carrot.png │ ├── kiwi.png │ ├── orange.png │ ├── peppers.png │ ├── strawberry.png │ └── watermelon.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── controller.dart ├── main.dart ├── models │ ├── cart_item.model.dart │ ├── category.model.dart │ └── product.model.dart ├── pages │ ├── cart │ │ ├── controller.dart │ │ ├── index.dart │ │ └── widgets │ │ │ ├── cart_item.dart │ │ │ ├── cart_item_button.dart │ │ │ ├── cart_list.dart │ │ │ └── cart_total.dart │ ├── home │ │ ├── controller.dart │ │ ├── index.dart │ │ └── widgets │ │ │ ├── item_categories.dart │ │ │ ├── item_products.dart │ │ │ ├── item_products_add.dart │ │ │ ├── item_products_like.dart │ │ │ ├── list_categories.dart │ │ │ └── list_products.dart │ └── product │ │ ├── controller.dart │ │ ├── index.dart │ │ └── widgets │ │ └── product_details.dart ├── routes.dart ├── utils │ ├── colors.dart │ └── json.dart └── widgets │ ├── appbar_action.dart │ ├── custom_appbar.dart │ ├── organic_button.dart │ └── product_image.dart ├── pubspec.lock └── pubspec.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Exceptions to above rules. 43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 44 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 1ad9baa8b99a2897c20f9e6e54d3b9b359ade314 8 | channel: unknown 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 André Ciornavei 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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter GetX Concepts 2 | 3 | 🚀 A Flutter project application that make use of the state manager GetX. 4 | 5 | ![](https://github.com/andreciornavei/images/blob/master/flutter_getx_concept/flutter_getx_concept_presentation.gif?raw=true) 6 | 7 | --- 8 | 9 | ## Overview 10 | 11 | This project was created with the purpose to apply most of concepts implementeds by the state manager [GetX][getx_package]. Using a small flux of screens to simulate a shopping cart, this project implements a folder architeture that make sense for placing all the widgets tree from a screen to have secure access of its parent controllers. 12 | 13 | In general, this project is part of a studies to understand the best architecture pattern to implement in flutter projects that works for me and i hope to works for you too. 14 | 15 | --- 16 | 17 | ## Resources 18 | 19 | I made use of some approaches to make this project simple and objective to fulfill your proposal, one of these approaches is the use of internal data as a json file and images in `assets` folder to simulate an fetch api, so you can fork this project and have no worriy about outside resources. 20 | 21 | - Page with list of produts; 22 | - Switch between categories; 23 | - List products for a selected category; 24 | - Like in products _`(i tried to make this project uncomplicated, so the state of likes is lost when switch between categories)`_; 25 | - Page of product to see more information; 26 | - Add selected product to cart; 27 | - Counter of products in cart; 28 | - Page of products in cart; 29 | - Increase/Decrese quantity for each product; 30 | - Increse a max of 10 unities per product; 31 | - Delete product from cart; 32 | - A totalizer of products prices in cart; 33 | - Purchase (It clears the cart and returns to home); 34 | 35 | --- 36 | 37 | ## The project structure 38 | 39 | For this project, i focused to solve the problem using only the GetX resources and following the below structure i feel good about the results, the simplicity to understand the project and its rules. 40 | 41 | ```yaml 42 | - /models 43 | # This folder was used to place all the possible entities 44 | # who has the responsability to keep data making use of 45 | # Rx (An observer for variable in GetX). Even having other 46 | # options, i decided tu use Rx for every variable as a pattern. 47 | 48 | - /pages 49 | # This is the folder who we have to get more attention and 50 | # careful to manage the structure becaouse GetX can be used in 51 | # many different ways, and a wrong way maybe can broken you app 52 | # in the future, so because that, i defined some rules: 53 | - /page_name 54 | # RULE 1: For all pages, we have to create a folder 55 | # named with our page name where we can create the 56 | # appropriate files. 57 | - index.dart 58 | # RULE 2: Every page must to have an index.dart as a 59 | # unique point of access responsible for initialize this 60 | # page; also, this file must start with a GetBuilder 61 | # component, who will initialize our controller and 62 | # provide it for all the widget childrens on the tree 63 | # of page. 64 | - controller.dart 65 | # RULE 3: Every page, in most of cases, will need to 66 | # implement a controller to take care about some 67 | # particular data and functions for this page. How this 68 | # controller is initialized in a GetBuilder on index. 69 | # dart, it only will be available and alive while this 70 | # page is in use, for any other case, this controller 71 | # will not be available. 72 | - /widgets 73 | # RULE 4: How our controller only will be available 74 | # while page is instanciated, any widget placed in this 75 | # folder can make use of Get.find(PageNameController) 76 | # and access its data and functions. Because that, all 77 | # the widgets placed here must to have a direct 78 | # relationship with the page and cannot be moved to 79 | # other folders in any circunstances, if it happens, the 80 | # code will not break for IDE or compilations, but 81 | # probably you will have problems in runtime because it 82 | # widget will try to use a controllar that could be 83 | # unavailable. 84 | 85 | - /utils 86 | # Used for generic purposes the utils implements functions 87 | # to be used in the most parts of our project without 88 | # dependencies of other files. 89 | 90 | - /widgets 91 | # Called for many peoples of `shared` or `common`, i decided 92 | # to call this folder of `widgets` because only shared widgets 93 | # is placed here, and also, this widgets cannot depend of other 94 | # files to keep working anywhere. 95 | 96 | - controller.dart 97 | # This file is a global controller who take care about some 98 | # global data and functions, can be used by any widget on the 99 | # project just making use of Get.find(AppController) in any 100 | # widget who needs to access this data or functions. It is 101 | # possible because this controller is initialized on main.dart 102 | # and teorycally, never should be disposed because main.dart 103 | # represents our instanced application. 104 | 105 | - main.dart 106 | # This file is the point of start of application, it means that 107 | # if it dispose, the app should closes too. This file has the 108 | # responsability to initialize the GetX context, start our 109 | # AppController for global purposes and implement all 110 | # the route screens to allow navigations. Also, to initialize 111 | # the AppController in this file, i make use of 112 | # Get.put(AppController()) because the use of named_routes in 113 | # the GetMaterialApp does not instance any Widget direcly, 114 | # therefore, it cannot be used with GetBuild. 115 | 116 | - routes.dart 117 | # For this project, i decided to make use of named routed 118 | # because GetX implements some intersting things with it, and 119 | # the most interting resource is the possibility to pass 120 | # arguments over the route like is made with web projects. In 121 | # general this is very good for a clear understood of the pages 122 | # structure and any page who implements this arguments can 123 | # access it making use of Get.parameters["argument_name"]. Well 124 | # this file has the only responsability to map all the pages of 125 | # our application and return an Array for out main.dart. 126 | ``` 127 | 128 | --- 129 | 130 | [![License: MIT](https://img.shields.io/badge/license-MIT-purple.svg)](https://github.com/andreciornavei/flutter-getx-concept/blob/master/LICENSE) 131 | 132 | Copyright (c) 2020 André Ciornavei 133 | 134 | Permission is hereby granted, free of charge, to any person obtaining a copy 135 | of this software and associated documentation files (the "Software"), to deal 136 | in the Software without restriction, including without limitation the rights 137 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 138 | copies of the Software, and to permit persons to whom the Software is 139 | furnished to do so, subject to the following conditions: 140 | 141 | The above copyright notice and this permission notice shall be included in all 142 | copies or substantial portions of the Software. 143 | 144 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 145 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 146 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 147 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 148 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 149 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 150 | SOFTWARE. 151 | 152 | [getx_package]: https://pub.dev/packages/get 153 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.getx_navigation" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/getx_navigation/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.getx_navigation 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | include ':app' 6 | 7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 8 | def properties = new Properties() 9 | 10 | assert localPropertiesFile.exists() 11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 12 | 13 | def flutterSdkPath = properties.getProperty("flutter.sdk") 14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 16 | -------------------------------------------------------------------------------- /assets/data/categories.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key": "fruits", 4 | "name": "Fruits", 5 | "color": "#3AB54A" 6 | }, 7 | { 8 | "key": "vegetables", 9 | "name": "Vegetables", 10 | "color": "#febf75" 11 | } 12 | ] -------------------------------------------------------------------------------- /assets/data/products.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "name": "Orange", 5 | "category": "fruits", 6 | "price": 3.84, 7 | "image": "assets/images/orange.png", 8 | "description": "Fresh oranges are low in calories and a source of fiber, potassium, vitamin C and folate. They help to prevent cancer and cardiovascular diseases." 9 | }, 10 | { 11 | "id": 2, 12 | "name": "Watermelon", 13 | "category": "fruits", 14 | "price": 18.57, 15 | "image": "assets/images/watermelon.png", 16 | "description": "The watermelon has various healing properties for which the pulp, the rind or the seeds are used. It is suitable to treat sunstroke, hypertension or pharyngitis, among other diseases. It is widely used in several American countries for its healing properties." 17 | }, 18 | { 19 | "id": 3, 20 | "name": "Kiwi", 21 | "category": "fruits", 22 | "price": 16.67, 23 | "image": "assets/images/kiwi.png", 24 | "description": "Diverse scientific investigations indicate that the kiwi is an outstanding source of vitamins, minerals, fibre and phytochemicals. The kiwi fruit has an exceptionally high concentration of vitamin C. A medium-sized fruit provides approximately with 90 mg of vitamin C, which fully surpasses the recommended daily consumption recommended of approximately 60 mg." 25 | }, 26 | { 27 | "id": 4, 28 | "name": "Apple", 29 | "category": "fruits", 30 | "price": 9.36, 31 | "image": "assets/images/apple.png", 32 | "description": "Apples supply a great amount of vitamins and other nutrients to the human being, having multiple beneficial effects for health.\nTheir fibre content acts as a regulator in multiple intestinal disorders. If consumed raw, they are an excellent natural toothpaste that cleans and whitens the teeth, favouring the gums." 33 | }, 34 | { 35 | "id": 5, 36 | "name": "Banana", 37 | "category": "fruits", 38 | "price": 6.24, 39 | "image": "assets/images/banana.png", 40 | "description": "The banana is rich in fibre, potassium and some beneficial vitamins for health. It is a good fruit for everybody except for diabetic and obese people, due to its high starch and sugar contents." 41 | }, 42 | { 43 | "id": 6, 44 | "name": "Strawberry", 45 | "category": "fruits", 46 | "price": 18.90, 47 | "image": "assets/images/strawberry.png", 48 | "description": "Strawberries are highly appreciated for their pleasant aroma and as an appetite stimulator. They are easily digested and they have a great laxative effect, due to their fibre content, pigments, acids and enzymes. It is rich in basic minerals, which confers it the property to stimulate the metabolism." 49 | }, 50 | { 51 | "id": 7, 52 | "name": "Pepper", 53 | "category": "vegetables", 54 | "price": 13.80, 55 | "image": "assets/images/peppers.png", 56 | "description": "The main vitamin supply in peppers is vitamin C, that protects against cancer. It is also a good source of vitamin A, so it is good for sight." 57 | }, 58 | { 59 | "id": 8, 60 | "name": "Broccoli", 61 | "category": "vegetables", 62 | "price": 3.20, 63 | "image": "assets/images/broccoli.png", 64 | "description": "Broccoli consumption can help people who suffer stress or nerves. It is an important iron source for women during menstruation and helps to lower blood pressure." 65 | }, 66 | { 67 | "id": 9, 68 | "name": "Carrot", 69 | "category": "vegetables", 70 | "price": 1.50, 71 | "image": "assets/images/carrot.png", 72 | "description": "The carrot is rich in carotene, precursor of vitamin A, necessary for growth, bones development, sight, tissues maintenance, reproduction and in the hormonal system. Moreover, it is thought that it prevents cancer, apart from being rich in fiber and low in calories." 73 | } 74 | ] -------------------------------------------------------------------------------- /assets/images/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/assets/images/apple.png -------------------------------------------------------------------------------- /assets/images/banana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/assets/images/banana.png -------------------------------------------------------------------------------- /assets/images/broccoli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/assets/images/broccoli.png -------------------------------------------------------------------------------- /assets/images/carrot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/assets/images/carrot.png -------------------------------------------------------------------------------- /assets/images/kiwi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/assets/images/kiwi.png -------------------------------------------------------------------------------- /assets/images/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/assets/images/orange.png -------------------------------------------------------------------------------- /assets/images/peppers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/assets/images/peppers.png -------------------------------------------------------------------------------- /assets/images/strawberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/assets/images/strawberry.png -------------------------------------------------------------------------------- /assets/images/watermelon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/assets/images/watermelon.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | generated_key_values = {} 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) do |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | generated_key_values[podname] = podpath 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | end 32 | generated_key_values 33 | end 34 | 35 | target 'Runner' do 36 | use_frameworks! 37 | use_modular_headers! 38 | 39 | # Flutter Pod 40 | 41 | copied_flutter_dir = File.join(__dir__, 'Flutter') 42 | copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') 43 | copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') 44 | unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) 45 | # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. 46 | # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. 47 | # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. 48 | 49 | generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') 50 | unless File.exist?(generated_xcode_build_settings_path) 51 | raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" 52 | end 53 | generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) 54 | cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; 55 | 56 | unless File.exist?(copied_framework_path) 57 | FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) 58 | end 59 | unless File.exist?(copied_podspec_path) 60 | FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) 61 | end 62 | end 63 | 64 | # Keep pod path relative so it can be checked into Podfile.lock. 65 | pod 'Flutter', :path => 'Flutter' 66 | 67 | # Plugin Pods 68 | 69 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 70 | # referring to absolute paths on developers' machines. 71 | system('rm -rf .symlinks') 72 | system('mkdir -p .symlinks/plugins') 73 | plugin_pods = parse_KV_file('../.flutter-plugins') 74 | plugin_pods.each do |name, path| 75 | symlink = File.join('.symlinks', 'plugins', name) 76 | File.symlink(path, symlink) 77 | pod name, :path => File.join(symlink, 'ios') 78 | end 79 | end 80 | 81 | post_install do |installer| 82 | installer.pods_project.targets.each do |target| 83 | target.build_configurations.each do |config| 84 | config.build_settings['ENABLE_BITCODE'] = 'NO' 85 | end 86 | end 87 | end 88 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - Flutter (from `Flutter`) 6 | 7 | EXTERNAL SOURCES: 8 | Flutter: 9 | :path: Flutter 10 | 11 | SPEC CHECKSUMS: 12 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec 13 | 14 | PODFILE CHECKSUM: c34e2287a9ccaa606aeceab922830efb9a6ff69a 15 | 16 | COCOAPODS: 1.9.3 17 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 1EBCC5D32864FED1449FBF2A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42940BEB25D57CC20172A034 /* Pods_Runner.framework */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 34 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 35 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 36 | 42940BEB25D57CC20172A034 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 38 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 40 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 41 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 42 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 45 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 46 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 98190848995895D643620EFB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 48 | A13231FF0C713294B3570B67 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 49 | A3F4E9897611EF950E7065FA /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 1EBCC5D32864FED1449FBF2A /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 44764B89C2CAA0A36E33E003 /* Pods */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | A3F4E9897611EF950E7065FA /* Pods-Runner.debug.xcconfig */, 68 | A13231FF0C713294B3570B67 /* Pods-Runner.release.xcconfig */, 69 | 98190848995895D643620EFB /* Pods-Runner.profile.xcconfig */, 70 | ); 71 | name = Pods; 72 | path = Pods; 73 | sourceTree = ""; 74 | }; 75 | 51FD177E3ADBB4A628B733B4 /* Frameworks */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 42940BEB25D57CC20172A034 /* Pods_Runner.framework */, 79 | ); 80 | name = Frameworks; 81 | sourceTree = ""; 82 | }; 83 | 9740EEB11CF90186004384FC /* Flutter */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 87 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 88 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 89 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 90 | ); 91 | name = Flutter; 92 | sourceTree = ""; 93 | }; 94 | 97C146E51CF9000F007C117D = { 95 | isa = PBXGroup; 96 | children = ( 97 | 9740EEB11CF90186004384FC /* Flutter */, 98 | 97C146F01CF9000F007C117D /* Runner */, 99 | 97C146EF1CF9000F007C117D /* Products */, 100 | 44764B89C2CAA0A36E33E003 /* Pods */, 101 | 51FD177E3ADBB4A628B733B4 /* Frameworks */, 102 | ); 103 | sourceTree = ""; 104 | }; 105 | 97C146EF1CF9000F007C117D /* Products */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 97C146EE1CF9000F007C117D /* Runner.app */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 97C146F01CF9000F007C117D /* Runner */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 117 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 118 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 119 | 97C147021CF9000F007C117D /* Info.plist */, 120 | 97C146F11CF9000F007C117D /* Supporting Files */, 121 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 122 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 123 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 124 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 125 | ); 126 | path = Runner; 127 | sourceTree = ""; 128 | }; 129 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | ); 133 | name = "Supporting Files"; 134 | sourceTree = ""; 135 | }; 136 | /* End PBXGroup section */ 137 | 138 | /* Begin PBXNativeTarget section */ 139 | 97C146ED1CF9000F007C117D /* Runner */ = { 140 | isa = PBXNativeTarget; 141 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 142 | buildPhases = ( 143 | 12EB484AF364473E2DE2DBC6 /* [CP] Check Pods Manifest.lock */, 144 | 9740EEB61CF901F6004384FC /* Run Script */, 145 | 97C146EA1CF9000F007C117D /* Sources */, 146 | 97C146EB1CF9000F007C117D /* Frameworks */, 147 | 97C146EC1CF9000F007C117D /* Resources */, 148 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 149 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 150 | EA38F9BF38EC483E14A0AEE1 /* [CP] Embed Pods Frameworks */, 151 | ); 152 | buildRules = ( 153 | ); 154 | dependencies = ( 155 | ); 156 | name = Runner; 157 | productName = Runner; 158 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 159 | productType = "com.apple.product-type.application"; 160 | }; 161 | /* End PBXNativeTarget section */ 162 | 163 | /* Begin PBXProject section */ 164 | 97C146E61CF9000F007C117D /* Project object */ = { 165 | isa = PBXProject; 166 | attributes = { 167 | LastUpgradeCheck = 1020; 168 | ORGANIZATIONNAME = ""; 169 | TargetAttributes = { 170 | 97C146ED1CF9000F007C117D = { 171 | CreatedOnToolsVersion = 7.3.1; 172 | LastSwiftMigration = 1100; 173 | }; 174 | }; 175 | }; 176 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 177 | compatibilityVersion = "Xcode 9.3"; 178 | developmentRegion = en; 179 | hasScannedForEncodings = 0; 180 | knownRegions = ( 181 | en, 182 | Base, 183 | ); 184 | mainGroup = 97C146E51CF9000F007C117D; 185 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 186 | projectDirPath = ""; 187 | projectRoot = ""; 188 | targets = ( 189 | 97C146ED1CF9000F007C117D /* Runner */, 190 | ); 191 | }; 192 | /* End PBXProject section */ 193 | 194 | /* Begin PBXResourcesBuildPhase section */ 195 | 97C146EC1CF9000F007C117D /* Resources */ = { 196 | isa = PBXResourcesBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 200 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 201 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 202 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | }; 206 | /* End PBXResourcesBuildPhase section */ 207 | 208 | /* Begin PBXShellScriptBuildPhase section */ 209 | 12EB484AF364473E2DE2DBC6 /* [CP] Check Pods Manifest.lock */ = { 210 | isa = PBXShellScriptBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | ); 214 | inputFileListPaths = ( 215 | ); 216 | inputPaths = ( 217 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 218 | "${PODS_ROOT}/Manifest.lock", 219 | ); 220 | name = "[CP] Check Pods Manifest.lock"; 221 | outputFileListPaths = ( 222 | ); 223 | outputPaths = ( 224 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | shellPath = /bin/sh; 228 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 229 | showEnvVarsInLog = 0; 230 | }; 231 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 232 | isa = PBXShellScriptBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | ); 236 | inputPaths = ( 237 | ); 238 | name = "Thin Binary"; 239 | outputPaths = ( 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | shellPath = /bin/sh; 243 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 244 | }; 245 | 9740EEB61CF901F6004384FC /* Run Script */ = { 246 | isa = PBXShellScriptBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | ); 250 | inputPaths = ( 251 | ); 252 | name = "Run Script"; 253 | outputPaths = ( 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | shellPath = /bin/sh; 257 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 258 | }; 259 | EA38F9BF38EC483E14A0AEE1 /* [CP] Embed Pods Frameworks */ = { 260 | isa = PBXShellScriptBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | ); 264 | inputPaths = ( 265 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 266 | "${PODS_ROOT}/../Flutter/Flutter.framework", 267 | ); 268 | name = "[CP] Embed Pods Frameworks"; 269 | outputPaths = ( 270 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | shellPath = /bin/sh; 274 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 275 | showEnvVarsInLog = 0; 276 | }; 277 | /* End PBXShellScriptBuildPhase section */ 278 | 279 | /* Begin PBXSourcesBuildPhase section */ 280 | 97C146EA1CF9000F007C117D /* Sources */ = { 281 | isa = PBXSourcesBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 285 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | /* End PBXSourcesBuildPhase section */ 290 | 291 | /* Begin PBXVariantGroup section */ 292 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 293 | isa = PBXVariantGroup; 294 | children = ( 295 | 97C146FB1CF9000F007C117D /* Base */, 296 | ); 297 | name = Main.storyboard; 298 | sourceTree = ""; 299 | }; 300 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 301 | isa = PBXVariantGroup; 302 | children = ( 303 | 97C147001CF9000F007C117D /* Base */, 304 | ); 305 | name = LaunchScreen.storyboard; 306 | sourceTree = ""; 307 | }; 308 | /* End PBXVariantGroup section */ 309 | 310 | /* Begin XCBuildConfiguration section */ 311 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 312 | isa = XCBuildConfiguration; 313 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 314 | buildSettings = { 315 | ALWAYS_SEARCH_USER_PATHS = NO; 316 | CLANG_ANALYZER_NONNULL = YES; 317 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 318 | CLANG_CXX_LIBRARY = "libc++"; 319 | CLANG_ENABLE_MODULES = YES; 320 | CLANG_ENABLE_OBJC_ARC = YES; 321 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 322 | CLANG_WARN_BOOL_CONVERSION = YES; 323 | CLANG_WARN_COMMA = YES; 324 | CLANG_WARN_CONSTANT_CONVERSION = YES; 325 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 326 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 327 | CLANG_WARN_EMPTY_BODY = YES; 328 | CLANG_WARN_ENUM_CONVERSION = YES; 329 | CLANG_WARN_INFINITE_RECURSION = YES; 330 | CLANG_WARN_INT_CONVERSION = YES; 331 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 333 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 334 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 335 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 336 | CLANG_WARN_STRICT_PROTOTYPES = YES; 337 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 338 | CLANG_WARN_UNREACHABLE_CODE = YES; 339 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 340 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 341 | COPY_PHASE_STRIP = NO; 342 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 343 | ENABLE_NS_ASSERTIONS = NO; 344 | ENABLE_STRICT_OBJC_MSGSEND = YES; 345 | GCC_C_LANGUAGE_STANDARD = gnu99; 346 | GCC_NO_COMMON_BLOCKS = YES; 347 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 348 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 349 | GCC_WARN_UNDECLARED_SELECTOR = YES; 350 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 351 | GCC_WARN_UNUSED_FUNCTION = YES; 352 | GCC_WARN_UNUSED_VARIABLE = YES; 353 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 354 | MTL_ENABLE_DEBUG_INFO = NO; 355 | SDKROOT = iphoneos; 356 | SUPPORTED_PLATFORMS = iphoneos; 357 | TARGETED_DEVICE_FAMILY = "1,2"; 358 | VALIDATE_PRODUCT = YES; 359 | }; 360 | name = Profile; 361 | }; 362 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 363 | isa = XCBuildConfiguration; 364 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 365 | buildSettings = { 366 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 367 | CLANG_ENABLE_MODULES = YES; 368 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 369 | ENABLE_BITCODE = NO; 370 | FRAMEWORK_SEARCH_PATHS = ( 371 | "$(inherited)", 372 | "$(PROJECT_DIR)/Flutter", 373 | ); 374 | INFOPLIST_FILE = Runner/Info.plist; 375 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 376 | LIBRARY_SEARCH_PATHS = ( 377 | "$(inherited)", 378 | "$(PROJECT_DIR)/Flutter", 379 | ); 380 | PRODUCT_BUNDLE_IDENTIFIER = com.example.getxNavigation; 381 | PRODUCT_NAME = "$(TARGET_NAME)"; 382 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 383 | SWIFT_VERSION = 5.0; 384 | VERSIONING_SYSTEM = "apple-generic"; 385 | }; 386 | name = Profile; 387 | }; 388 | 97C147031CF9000F007C117D /* Debug */ = { 389 | isa = XCBuildConfiguration; 390 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 391 | buildSettings = { 392 | ALWAYS_SEARCH_USER_PATHS = NO; 393 | CLANG_ANALYZER_NONNULL = YES; 394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 395 | CLANG_CXX_LIBRARY = "libc++"; 396 | CLANG_ENABLE_MODULES = YES; 397 | CLANG_ENABLE_OBJC_ARC = YES; 398 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 399 | CLANG_WARN_BOOL_CONVERSION = YES; 400 | CLANG_WARN_COMMA = YES; 401 | CLANG_WARN_CONSTANT_CONVERSION = YES; 402 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INFINITE_RECURSION = YES; 407 | CLANG_WARN_INT_CONVERSION = YES; 408 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 409 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 413 | CLANG_WARN_STRICT_PROTOTYPES = YES; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNREACHABLE_CODE = YES; 416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 418 | COPY_PHASE_STRIP = NO; 419 | DEBUG_INFORMATION_FORMAT = dwarf; 420 | ENABLE_STRICT_OBJC_MSGSEND = YES; 421 | ENABLE_TESTABILITY = YES; 422 | GCC_C_LANGUAGE_STANDARD = gnu99; 423 | GCC_DYNAMIC_NO_PIC = NO; 424 | GCC_NO_COMMON_BLOCKS = YES; 425 | GCC_OPTIMIZATION_LEVEL = 0; 426 | GCC_PREPROCESSOR_DEFINITIONS = ( 427 | "DEBUG=1", 428 | "$(inherited)", 429 | ); 430 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 431 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 432 | GCC_WARN_UNDECLARED_SELECTOR = YES; 433 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 434 | GCC_WARN_UNUSED_FUNCTION = YES; 435 | GCC_WARN_UNUSED_VARIABLE = YES; 436 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 437 | MTL_ENABLE_DEBUG_INFO = YES; 438 | ONLY_ACTIVE_ARCH = YES; 439 | SDKROOT = iphoneos; 440 | TARGETED_DEVICE_FAMILY = "1,2"; 441 | }; 442 | name = Debug; 443 | }; 444 | 97C147041CF9000F007C117D /* Release */ = { 445 | isa = XCBuildConfiguration; 446 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 447 | buildSettings = { 448 | ALWAYS_SEARCH_USER_PATHS = NO; 449 | CLANG_ANALYZER_NONNULL = YES; 450 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 451 | CLANG_CXX_LIBRARY = "libc++"; 452 | CLANG_ENABLE_MODULES = YES; 453 | CLANG_ENABLE_OBJC_ARC = YES; 454 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 455 | CLANG_WARN_BOOL_CONVERSION = YES; 456 | CLANG_WARN_COMMA = YES; 457 | CLANG_WARN_CONSTANT_CONVERSION = YES; 458 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 459 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 460 | CLANG_WARN_EMPTY_BODY = YES; 461 | CLANG_WARN_ENUM_CONVERSION = YES; 462 | CLANG_WARN_INFINITE_RECURSION = YES; 463 | CLANG_WARN_INT_CONVERSION = YES; 464 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 465 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 466 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 467 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 468 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 469 | CLANG_WARN_STRICT_PROTOTYPES = YES; 470 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 471 | CLANG_WARN_UNREACHABLE_CODE = YES; 472 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 473 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 474 | COPY_PHASE_STRIP = NO; 475 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 476 | ENABLE_NS_ASSERTIONS = NO; 477 | ENABLE_STRICT_OBJC_MSGSEND = YES; 478 | GCC_C_LANGUAGE_STANDARD = gnu99; 479 | GCC_NO_COMMON_BLOCKS = YES; 480 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 481 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 482 | GCC_WARN_UNDECLARED_SELECTOR = YES; 483 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 484 | GCC_WARN_UNUSED_FUNCTION = YES; 485 | GCC_WARN_UNUSED_VARIABLE = YES; 486 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 487 | MTL_ENABLE_DEBUG_INFO = NO; 488 | SDKROOT = iphoneos; 489 | SUPPORTED_PLATFORMS = iphoneos; 490 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 491 | TARGETED_DEVICE_FAMILY = "1,2"; 492 | VALIDATE_PRODUCT = YES; 493 | }; 494 | name = Release; 495 | }; 496 | 97C147061CF9000F007C117D /* Debug */ = { 497 | isa = XCBuildConfiguration; 498 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 499 | buildSettings = { 500 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 501 | CLANG_ENABLE_MODULES = YES; 502 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 503 | ENABLE_BITCODE = NO; 504 | FRAMEWORK_SEARCH_PATHS = ( 505 | "$(inherited)", 506 | "$(PROJECT_DIR)/Flutter", 507 | ); 508 | INFOPLIST_FILE = Runner/Info.plist; 509 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 510 | LIBRARY_SEARCH_PATHS = ( 511 | "$(inherited)", 512 | "$(PROJECT_DIR)/Flutter", 513 | ); 514 | PRODUCT_BUNDLE_IDENTIFIER = com.example.getxNavigation; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 517 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 518 | SWIFT_VERSION = 5.0; 519 | VERSIONING_SYSTEM = "apple-generic"; 520 | }; 521 | name = Debug; 522 | }; 523 | 97C147071CF9000F007C117D /* Release */ = { 524 | isa = XCBuildConfiguration; 525 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 526 | buildSettings = { 527 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 528 | CLANG_ENABLE_MODULES = YES; 529 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 530 | ENABLE_BITCODE = NO; 531 | FRAMEWORK_SEARCH_PATHS = ( 532 | "$(inherited)", 533 | "$(PROJECT_DIR)/Flutter", 534 | ); 535 | INFOPLIST_FILE = Runner/Info.plist; 536 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 537 | LIBRARY_SEARCH_PATHS = ( 538 | "$(inherited)", 539 | "$(PROJECT_DIR)/Flutter", 540 | ); 541 | PRODUCT_BUNDLE_IDENTIFIER = com.example.getxNavigation; 542 | PRODUCT_NAME = "$(TARGET_NAME)"; 543 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 544 | SWIFT_VERSION = 5.0; 545 | VERSIONING_SYSTEM = "apple-generic"; 546 | }; 547 | name = Release; 548 | }; 549 | /* End XCBuildConfiguration section */ 550 | 551 | /* Begin XCConfigurationList section */ 552 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 553 | isa = XCConfigurationList; 554 | buildConfigurations = ( 555 | 97C147031CF9000F007C117D /* Debug */, 556 | 97C147041CF9000F007C117D /* Release */, 557 | 249021D3217E4FDB00AE95B9 /* Profile */, 558 | ); 559 | defaultConfigurationIsVisible = 0; 560 | defaultConfigurationName = Release; 561 | }; 562 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 563 | isa = XCConfigurationList; 564 | buildConfigurations = ( 565 | 97C147061CF9000F007C117D /* Debug */, 566 | 97C147071CF9000F007C117D /* Release */, 567 | 249021D4217E4FDB00AE95B9 /* Profile */, 568 | ); 569 | defaultConfigurationIsVisible = 0; 570 | defaultConfigurationName = Release; 571 | }; 572 | /* End XCConfigurationList section */ 573 | }; 574 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 575 | } 576 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/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/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreciornavei/flutter-getx-concept/0eb089a466e3dcaaf01c566bdb5ff2c92232e522/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | getx_navigation 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/state_manager.dart'; 2 | import 'package:flutter_getx_concept/models/cart_item.model.dart'; 3 | 4 | class AppController extends GetxController{ 5 | 6 | RxList cartItems = RxList([]); 7 | 8 | } -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'controller.dart'; 4 | import 'routes.dart'; 5 | import 'utils/colors.dart'; 6 | 7 | void main() { 8 | runApp(MyApp()); 9 | } 10 | 11 | class MyApp extends StatelessWidget { 12 | @override 13 | Widget build(BuildContext context) { 14 | 15 | Get.put(AppController()); 16 | 17 | return GetMaterialApp( 18 | title: 'Flutter Demo', 19 | theme: ThemeData( 20 | primarySwatch: AppColors.WHITE, 21 | visualDensity: VisualDensity.adaptivePlatformDensity, 22 | ), 23 | initialRoute: "/", 24 | getPages: routes(), 25 | ); 26 | } 27 | } -------------------------------------------------------------------------------- /lib/models/cart_item.model.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import './product.model.dart'; 3 | 4 | class CartItemModel { 5 | CartItemModel({ 6 | ProductModel product, 7 | int quantity, 8 | }) { 9 | this.product = product; 10 | this.quantity = quantity; 11 | } 12 | Rx _product = Rx(); 13 | set product(ProductModel value) => _product.value = value; 14 | ProductModel get product => _product.value; 15 | 16 | RxInt _quantity = RxInt(); 17 | set quantity(int value) => _quantity.value = value; 18 | int get quantity => _quantity.value; 19 | 20 | incrementQuantity() { 21 | if (this.quantity >= 10) { 22 | this.quantity = 10; 23 | } else { 24 | this.quantity += 1; 25 | } 26 | } 27 | 28 | decrementQuantity() { 29 | if (this.quantity <= 1) { 30 | this.quantity = 1; 31 | } else { 32 | this.quantity -= 1; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/models/category.model.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class CategoryModel { 4 | CategoryModel({ 5 | String key, 6 | String name, 7 | String color, 8 | }) { 9 | this.key = key; 10 | this.name = name; 11 | this.color = color; 12 | } 13 | 14 | RxString _key = RxString(); 15 | set key(String value) => _key.value = value; 16 | String get key => _key.value; 17 | 18 | RxString _name = RxString(); 19 | set name(String value) => _name.value = value; 20 | String get name => _name.value; 21 | 22 | RxString _color = RxString(); 23 | set color(String value) => _color.value = value; 24 | String get color => _color.value; 25 | } 26 | -------------------------------------------------------------------------------- /lib/models/product.model.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | 3 | class ProductModel { 4 | ProductModel({ 5 | int id, 6 | String name, 7 | String category, 8 | double price, 9 | String image, 10 | String description, 11 | }) { 12 | this.id = id; 13 | this.name = name; 14 | this.category = category; 15 | this.price = price; 16 | this.image = image; 17 | this.description = description; 18 | this.like = false; 19 | } 20 | 21 | RxInt _id = RxInt(); 22 | set id(int value) => _id.value = value; 23 | int get id => _id.value; 24 | 25 | RxString _name = RxString(); 26 | set name(String value) => _name.value = value; 27 | String get name => _name.value; 28 | 29 | RxString _category = RxString(); 30 | set category(String value) => _category.value = value; 31 | String get category => _category.value; 32 | 33 | RxDouble _price = RxDouble(); 34 | set price(double value) => _price.value = value; 35 | double get price => _price.value; 36 | 37 | RxString _image = RxString(); 38 | set image(String value) => _image.value = value; 39 | String get image => _image.value; 40 | 41 | RxString _description = RxString(); 42 | set description(String value) => _description.value = value; 43 | String get description => _description.value; 44 | 45 | RxBool _like = RxBool(); 46 | set like(bool value) => _like.value = value; 47 | bool get like => _like.value; 48 | 49 | String get dollar { 50 | return "U\$ " + this.price.toStringAsFixed(2); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /lib/pages/cart/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/utils/colors.dart'; 3 | import 'package:flutter_icons/flutter_icons.dart'; 4 | import 'package:get/get.dart'; 5 | import 'package:get/state_manager.dart'; 6 | import 'package:flutter_getx_concept/controller.dart'; 7 | import 'package:flutter_getx_concept/models/cart_item.model.dart'; 8 | 9 | class CartController extends GetxController { 10 | AppController appController = Get.find(); 11 | 12 | String get total { 13 | double fold = appController.cartItems.value.fold(0, (subtotal, cartItem) { 14 | return subtotal + cartItem.product.price * cartItem.quantity; 15 | }); 16 | return "U\$" + fold.toStringAsFixed(2); 17 | } 18 | 19 | deleteItem(CartItemModel cartItemModel) { 20 | appController.cartItems.removeWhere((cartItem) { 21 | return cartItem.product.id == cartItemModel.product.id; 22 | }); 23 | } 24 | 25 | placeOrder() { 26 | appController.cartItems.clear(); 27 | Get.back(); 28 | Get.snackbar( 29 | "Placed", 30 | "Order placed with success!", 31 | backgroundColor: AppColors.DARK, 32 | colorText: AppColors.WHITE, 33 | padding: EdgeInsets.all(15), 34 | snackPosition: SnackPosition.BOTTOM, 35 | margin: EdgeInsets.all(25), 36 | icon: Icon(Feather.check, color: AppColors.LIGHT_GREEN, size: 21), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/pages/cart/index.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/widgets/appbar_action.dart'; 3 | import 'package:flutter_getx_concept/widgets/custom_appbar.dart'; 4 | import 'package:flutter_icons/flutter_icons.dart'; 5 | import 'package:get/get.dart'; 6 | import 'package:get/state_manager.dart'; 7 | import 'package:flutter_getx_concept/pages/cart/controller.dart'; 8 | import 'package:flutter_getx_concept/utils/colors.dart'; 9 | import 'widgets/cart_list.dart'; 10 | import 'widgets/cart_total.dart'; 11 | 12 | class Cart extends StatelessWidget { 13 | @override 14 | Widget build(BuildContext context) { 15 | return GetBuilder( 16 | init: CartController(), 17 | builder: (controller) { 18 | return Scaffold( 19 | backgroundColor: AppColors.LIGHT, 20 | appBar: CustomAppBar( 21 | "Cart", 22 | leadings: [ 23 | CustomAppBarAction( 24 | () => Get.back(), 25 | Feather.arrow_left, 26 | ) 27 | ], 28 | ), 29 | body: CartList(), 30 | bottomNavigationBar: CartTotal(), 31 | ); 32 | }, 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/pages/cart/widgets/cart_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_icons/flutter_icons.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:flutter_getx_concept/models/cart_item.model.dart'; 5 | import 'package:flutter_getx_concept/pages/cart/controller.dart'; 6 | import 'package:flutter_getx_concept/utils/colors.dart'; 7 | import 'package:flutter_getx_concept/widgets/product_image.dart'; 8 | 9 | import 'cart_item_button.dart'; 10 | 11 | class CartItem extends StatelessWidget { 12 | final CartController cartController = Get.find(); 13 | final CartItemModel cartItem; 14 | CartItem(this.cartItem); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return Row( 19 | crossAxisAlignment: CrossAxisAlignment.center, 20 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 21 | children: [ 22 | ProductImage( 23 | this.cartItem.product.image, 24 | height: 80, 25 | width: 80, 26 | ), 27 | SizedBox(width: 15), 28 | Expanded( 29 | child: Column( 30 | crossAxisAlignment: CrossAxisAlignment.start, 31 | mainAxisAlignment: MainAxisAlignment.start, 32 | mainAxisSize: MainAxisSize.min, 33 | children: [ 34 | Text( 35 | this.cartItem.product.name, 36 | style: TextStyle( 37 | fontSize: 19, 38 | color: AppColors.DARK, 39 | fontWeight: FontWeight.bold, 40 | ), 41 | ), 42 | SizedBox(height: 5), 43 | Row( 44 | children: [ 45 | Obx( 46 | () => Text( 47 | "${this.cartItem.quantity.toString()}x ", 48 | style: TextStyle( 49 | fontSize: 14, 50 | color: AppColors.DARK, 51 | fontWeight: FontWeight.bold, 52 | ), 53 | ), 54 | ), 55 | Text( 56 | this.cartItem.product.dollar, 57 | style: TextStyle( 58 | fontSize: 16, 59 | color: AppColors.GREEN, 60 | fontWeight: FontWeight.bold, 61 | ), 62 | ), 63 | ], 64 | ) 65 | ], 66 | ), 67 | ), 68 | Row( 69 | children: [ 70 | CartItemButton(Feather.minus, this.cartItem.decrementQuantity), 71 | SizedBox(width: 10), 72 | CartItemButton(Feather.plus, this.cartItem.incrementQuantity), 73 | SizedBox(width: 10), 74 | CartItemButton(Feather.trash, () => cartController.deleteItem(this.cartItem)), 75 | ], 76 | ) 77 | ], 78 | ); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /lib/pages/cart/widgets/cart_item_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/utils/colors.dart'; 3 | 4 | class CartItemButton extends StatelessWidget { 5 | final IconData icon; 6 | final Function action; 7 | CartItemButton(this.icon, this.action); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return SizedBox( 12 | width: 32, 13 | height: 32, 14 | child: FlatButton( 15 | onPressed: action, 16 | color: AppColors.WHITE, 17 | padding: EdgeInsets.zero, 18 | shape: RoundedRectangleBorder( 19 | borderRadius: BorderRadius.circular(32), 20 | ), 21 | child: Icon( 22 | icon, 23 | color: AppColors.GREEN, 24 | size: 16, 25 | ), 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/pages/cart/widgets/cart_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:flutter_getx_concept/pages/cart/controller.dart'; 4 | 5 | import 'cart_item.dart'; 6 | 7 | class CartList extends StatelessWidget { 8 | final CartController controller = Get.find(); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Obx( 13 | () => ListView.separated( 14 | padding: EdgeInsets.all(25), 15 | itemCount: controller.appController.cartItems.length, 16 | separatorBuilder: (context, index) => Divider(height: 25), 17 | itemBuilder: (context, index) { 18 | return CartItem(controller.appController.cartItems.value[index]); 19 | }, 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/pages/cart/widgets/cart_total.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_icons/flutter_icons.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:flutter_getx_concept/pages/cart/controller.dart'; 5 | import 'package:flutter_getx_concept/utils/colors.dart'; 6 | import 'package:flutter_getx_concept/widgets/organic_button.dart'; 7 | 8 | class CartTotal extends StatelessWidget { 9 | final CartController controller = Get.find(); 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | padding: EdgeInsets.all(25), 14 | decoration: BoxDecoration( 15 | color: AppColors.WHITE, 16 | border: Border( 17 | top: BorderSide( 18 | color: AppColors.LIGHT, 19 | width: 1, 20 | style: BorderStyle.solid, 21 | ), 22 | ), 23 | ), 24 | child: SafeArea( 25 | child: Row( 26 | children: [ 27 | Expanded( 28 | child: Column( 29 | mainAxisSize: MainAxisSize.min, 30 | crossAxisAlignment: CrossAxisAlignment.start, 31 | children: [ 32 | Text( 33 | "TOTAL", 34 | style: TextStyle( 35 | fontSize: 12, 36 | color: AppColors.DARK, 37 | fontWeight: FontWeight.bold, 38 | ), 39 | ), 40 | Obx( 41 | () => Text( 42 | controller.total, 43 | style: TextStyle( 44 | fontSize: 26, 45 | color: AppColors.LIGHT_GREEN, 46 | fontWeight: FontWeight.bold, 47 | ), 48 | ), 49 | ) 50 | ], 51 | ), 52 | ), 53 | Expanded( 54 | child: OrganicButton( 55 | controller.placeOrder, 56 | "PURCHASE", 57 | Feather.chevron_right, 58 | ), 59 | ), 60 | ], 61 | ), 62 | ), 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /lib/pages/home/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_getx_concept/models/category.model.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:get/state_manager.dart'; 4 | import 'package:flutter_getx_concept/controller.dart'; 5 | import 'package:flutter_getx_concept/models/product.model.dart'; 6 | import 'package:flutter_getx_concept/utils/json.dart'; 7 | 8 | class HomeController extends GetxController { 9 | AppController appController = Get.find(); 10 | RxList categories = RxList([]); 11 | RxList products = RxList([]); 12 | Rx _selectedCategory = Rx(); 13 | CategoryModel get selectedCategory => _selectedCategory.value; 14 | 15 | int get cartQuantity { 16 | return appController.cartItems.length; 17 | } 18 | 19 | HomeController() { 20 | loadCategories(); 21 | } 22 | 23 | loadCategories() async { 24 | //Load categories 25 | List dataCategories = await loadJson( 26 | "assets/data/categories.json", 27 | ); 28 | categories.addAll(dataCategories 29 | .map((category) => CategoryModel( 30 | key: category["key"], 31 | name: category["name"], 32 | color: category["color"], 33 | )) 34 | .toList()); 35 | selectCategory(categories.first); 36 | } 37 | 38 | selectCategory(CategoryModel category) async { 39 | _selectedCategory.value = category; 40 | List dataProducts = await loadJson( 41 | "assets/data/products.json", 42 | ); 43 | products.value = dataProducts 44 | .where((item) => item["category"] == category.key) 45 | .map((product) => ProductModel( 46 | id: product["id"], 47 | name: product["name"], 48 | category: product["category"], 49 | price: product["price"], 50 | image: product["image"], 51 | )) 52 | .toList(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/pages/home/index.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/widgets/custom_appbar.dart'; 3 | import 'package:flutter_icons/flutter_icons.dart'; 4 | import 'package:get/get.dart'; 5 | import 'package:flutter_getx_concept/pages/home/controller.dart'; 6 | import 'package:flutter_getx_concept/utils/colors.dart'; 7 | import 'package:flutter_getx_concept/widgets/appbar_action.dart'; 8 | import 'widgets/list_products.dart'; 9 | import 'widgets/list_categories.dart'; 10 | 11 | class Home extends StatelessWidget { 12 | @override 13 | Widget build(BuildContext context) { 14 | return GetBuilder( 15 | init: HomeController(), 16 | builder: (controller) { 17 | return Scaffold( 18 | backgroundColor: AppColors.LIGHT, 19 | appBar: CustomAppBar( 20 | "GetX Concepts", 21 | actions: [ 22 | Obx( 23 | () => CustomAppBarAction( 24 | () => Get.toNamed("/cart"), 25 | Feather.shopping_cart, 26 | quantity: controller.cartQuantity, 27 | ), 28 | ), 29 | ], 30 | ), 31 | body: CustomScrollView( 32 | slivers: [ 33 | SliverToBoxAdapter( 34 | child: ListCategories(), 35 | ), 36 | SliverPadding( 37 | padding: EdgeInsets.only( 38 | left: 25, 39 | right: 25, 40 | bottom: 25, 41 | ), 42 | sliver: HomeList(), 43 | ), 44 | ], 45 | ), 46 | ); 47 | }, 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/pages/home/widgets/item_categories.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/models/category.model.dart'; 3 | import 'package:flutter_getx_concept/pages/home/controller.dart'; 4 | import 'package:flutter_getx_concept/utils/colors.dart'; 5 | import 'package:get/get.dart'; 6 | 7 | class ItemCategories extends StatelessWidget { 8 | final HomeController controller = Get.find(); 9 | final CategoryModel category; 10 | final bool selected; 11 | 12 | ItemCategories(this.category, this.selected); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return GestureDetector( 17 | onTap: () => controller.selectCategory(category), 18 | child: Container( 19 | child: Column( 20 | crossAxisAlignment: CrossAxisAlignment.start, 21 | children: [ 22 | Text( 23 | this.category.name, 24 | style: TextStyle( 25 | fontSize: 26, 26 | fontWeight: FontWeight.bold, 27 | color: AppColors.DARK.withOpacity(selected ? 1 : 0.3), 28 | ), 29 | ), 30 | Visibility( 31 | visible: selected, 32 | child: Container( 33 | margin: EdgeInsets.only(top: 3), 34 | width: 50, 35 | height: 3, 36 | decoration: BoxDecoration( 37 | color: AppColors.hex(category.color), 38 | borderRadius: BorderRadius.circular(3), 39 | ), 40 | ), 41 | ), 42 | ], 43 | ), 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/pages/home/widgets/item_products.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/models/product.model.dart'; 3 | import 'package:flutter_getx_concept/utils/colors.dart'; 4 | import 'package:flutter_getx_concept/widgets/product_image.dart'; 5 | 6 | import 'item_products_add.dart'; 7 | import 'item_products_like.dart'; 8 | 9 | class ListItem extends StatelessWidget { 10 | final ProductModel product; 11 | ListItem(this.product); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Container( 16 | decoration: BoxDecoration( 17 | color: AppColors.WHITE, 18 | boxShadow: [ 19 | BoxShadow( 20 | blurRadius: 15, 21 | color: AppColors.SHADOW, 22 | offset: Offset(6, 10), 23 | ), 24 | ], 25 | borderRadius: BorderRadius.all( 26 | Radius.circular(8), 27 | ), 28 | ), 29 | child: Stack( 30 | overflow: Overflow.visible, 31 | children: [ 32 | Padding( 33 | padding: EdgeInsets.only( 34 | top: 25, 35 | bottom: 15, 36 | left: 25, 37 | right: 15, 38 | ), 39 | child: Column( 40 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 41 | crossAxisAlignment: CrossAxisAlignment.start, 42 | children: [ 43 | ProductImage( 44 | this.product.image, 45 | width: 115, 46 | height: 115, 47 | ), 48 | Column( 49 | crossAxisAlignment: CrossAxisAlignment.start, 50 | children: [ 51 | Text( 52 | this.product.name, 53 | style: TextStyle( 54 | fontSize: 16, 55 | color: AppColors.DARK, 56 | fontWeight: FontWeight.bold, 57 | ), 58 | maxLines: 1, 59 | overflow: TextOverflow.ellipsis, 60 | ), 61 | SizedBox(height: 5), 62 | Text( 63 | this.product.dollar, 64 | style: TextStyle( 65 | fontSize: 21, 66 | color: AppColors.LIGHT_GREEN, 67 | fontWeight: FontWeight.bold, 68 | ), 69 | ), 70 | ], 71 | ), 72 | ], 73 | ), 74 | ), 75 | ItemAdd(product), 76 | ItemLike(product), 77 | ], 78 | ), 79 | ); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lib/pages/home/widgets/item_products_add.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_icons/flutter_icons.dart'; 3 | import 'package:flutter_getx_concept/models/product.model.dart'; 4 | import 'package:flutter_getx_concept/utils/colors.dart'; 5 | import 'package:get/get.dart'; 6 | 7 | class ItemAdd extends StatelessWidget { 8 | final ProductModel product; 9 | ItemAdd(this.product); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Positioned( 14 | bottom: 0, 15 | right: 0, 16 | child: SizedBox( 17 | width: 40, 18 | height: 40, 19 | child: FlatButton( 20 | padding: EdgeInsets.zero, 21 | color: AppColors.LIGHT_GREEN, 22 | shape: RoundedRectangleBorder( 23 | borderRadius: BorderRadius.only( 24 | topLeft: Radius.circular(8), 25 | bottomRight: Radius.circular(8), 26 | ), 27 | ), 28 | child: Icon( 29 | Feather.shopping_bag, 30 | size: 21, 31 | color: AppColors.WHITE, 32 | ), 33 | onPressed: () => 34 | Get.toNamed("/products/${this.product.id.toString()}"), 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/pages/home/widgets/item_products_like.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_icons/flutter_icons.dart'; 3 | import 'package:get/get.dart'; 4 | import 'package:flutter_getx_concept/models/product.model.dart'; 5 | import 'package:flutter_getx_concept/utils/colors.dart'; 6 | 7 | class ItemLike extends StatelessWidget { 8 | final ProductModel product; 9 | ItemLike(this.product); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Positioned( 14 | top: 0, 15 | right: 0, 16 | child: SizedBox( 17 | width: 40, 18 | height: 40, 19 | child: FlatButton( 20 | padding: EdgeInsets.zero, 21 | shape: RoundedRectangleBorder( 22 | borderRadius: BorderRadius.only( 23 | topRight: Radius.circular(8), 24 | bottomLeft: Radius.circular(8), 25 | ), 26 | ), 27 | child: Obx(() { 28 | return Icon( 29 | Feather.heart, 30 | size: 21, 31 | color: product.like ? AppColors.GREEN : AppColors.LIGHT_GREY, 32 | ); 33 | }), 34 | onPressed: () => product.like = !product.like, 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/pages/home/widgets/list_categories.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/models/category.model.dart'; 3 | import 'package:get/get.dart'; 4 | 5 | import '../controller.dart'; 6 | import 'item_categories.dart'; 7 | 8 | class ListCategories extends StatelessWidget { 9 | final HomeController controller = Get.find(); 10 | 11 | ListCategories(); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Obx(() { 16 | return SizedBox( 17 | height: 100, 18 | child: ListView.separated( 19 | scrollDirection: Axis.horizontal, 20 | padding: EdgeInsets.symmetric(horizontal: 25, vertical: 25), 21 | separatorBuilder: (BuildContext context, int index) => SizedBox(width: 50), 22 | itemCount: controller.categories.length, 23 | itemBuilder: (_, index) { 24 | CategoryModel category = controller.categories.elementAt(index); 25 | return Obx(() { 26 | return ItemCategories( 27 | category, 28 | category == controller.selectedCategory, 29 | ); 30 | }); 31 | }, 32 | ), 33 | ); 34 | }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/pages/home/widgets/list_products.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:get/get.dart'; 3 | import 'package:flutter_getx_concept/pages/home/controller.dart'; 4 | 5 | import 'item_products.dart'; 6 | 7 | class HomeList extends StatelessWidget { 8 | final HomeController controller = Get.find(); 9 | final double itemHeight = 130; 10 | final double itemWidth = Get.width / 2 - 100; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Obx( 15 | () { 16 | return SliverGrid( 17 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 18 | crossAxisCount: 2, 19 | mainAxisSpacing: 25.0, 20 | crossAxisSpacing: 25.0, 21 | childAspectRatio: itemWidth / itemHeight), 22 | delegate: SliverChildBuilderDelegate( 23 | (BuildContext context, int index) { 24 | return ListItem(controller.products.elementAt(index)); 25 | }, 26 | childCount: controller.products.length ?? 0, 27 | ), 28 | ); 29 | }, 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/pages/product/controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/get.dart'; 2 | import 'package:get/state_manager.dart'; 3 | import 'package:flutter_getx_concept/models/cart_item.model.dart'; 4 | import 'package:flutter_getx_concept/models/product.model.dart'; 5 | import 'package:flutter_getx_concept/utils/json.dart'; 6 | 7 | import '../../controller.dart'; 8 | 9 | class ProductController extends GetxController { 10 | AppController appController = Get.find(); 11 | Rx _product = Rx(); 12 | setProduct(ProductModel value) => _product.value = value; 13 | ProductModel get product { 14 | return _product.value; 15 | } 16 | 17 | ProductController() { 18 | loadProduct(); 19 | } 20 | 21 | loadProduct() async { 22 | try { 23 | List data = await loadJson("assets/data/products.json"); 24 | dynamic item = data.firstWhere((item) { 25 | return item["id"].toString() == Get.parameters["id"].toString(); 26 | }); 27 | setProduct(ProductModel( 28 | id: item["id"], 29 | name: item["name"], 30 | category: item["category"], 31 | price: item["price"], 32 | image: item["image"], 33 | description: item["description"], 34 | )); 35 | } catch (error) { 36 | print(error.toString()); 37 | } 38 | } 39 | 40 | addProduct() { 41 | try { 42 | CartItemModel cartItem = 43 | appController.cartItems.value.firstWhere((cartItem) { 44 | return cartItem.product.id == this.product.id; 45 | }); 46 | cartItem.incrementQuantity(); 47 | } catch (error) { 48 | appController.cartItems.add(CartItemModel( 49 | product: this.product, 50 | quantity: 1, 51 | )); 52 | } 53 | Get.back(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/pages/product/index.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/widgets/appbar_action.dart'; 3 | import 'package:flutter_getx_concept/widgets/custom_appbar.dart'; 4 | import 'package:flutter_icons/flutter_icons.dart'; 5 | import 'package:get/get.dart'; 6 | import 'package:flutter_getx_concept/pages/product/controller.dart'; 7 | import 'package:flutter_getx_concept/utils/colors.dart'; 8 | import 'package:flutter_getx_concept/widgets/product_image.dart'; 9 | import 'widgets/product_details.dart'; 10 | 11 | class Product extends StatelessWidget { 12 | @override 13 | Widget build(BuildContext context) { 14 | return GetBuilder( 15 | init: ProductController(), 16 | builder: (controller) { 17 | return Scaffold( 18 | backgroundColor: AppColors.LIGHT, 19 | appBar: CustomAppBar( 20 | "Product", 21 | leadings: [ 22 | CustomAppBarAction( 23 | () => Get.back(), 24 | Feather.arrow_left, 25 | ) 26 | ], 27 | ), 28 | body: SingleChildScrollView( 29 | child: Column( 30 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 31 | mainAxisSize: MainAxisSize.max, 32 | children: [ 33 | Obx( 34 | () => ProductImage( 35 | controller?.product?.image, 36 | height: Get.width - 50, 37 | padding: 25, 38 | ), 39 | ), 40 | ], 41 | ), 42 | ), 43 | bottomNavigationBar: Obx(() => ProductDetails(controller.product)), 44 | ); 45 | }, 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/pages/product/widgets/product_details.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/models/product.model.dart'; 3 | import 'package:flutter_icons/flutter_icons.dart'; 4 | import 'package:get/get.dart'; 5 | import 'package:flutter_getx_concept/pages/product/controller.dart'; 6 | import 'package:flutter_getx_concept/utils/colors.dart'; 7 | import 'package:flutter_getx_concept/widgets/organic_button.dart'; 8 | 9 | class ProductDetails extends StatelessWidget { 10 | final ProductController controller = Get.find(); 11 | final ProductModel product; 12 | 13 | ProductDetails(this.product); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Container( 18 | padding: EdgeInsets.all(25), 19 | decoration: BoxDecoration( 20 | color: AppColors.WHITE, 21 | borderRadius: BorderRadius.only( 22 | topLeft: Radius.circular(25), 23 | topRight: Radius.circular(25), 24 | ), 25 | ), 26 | child: SafeArea( 27 | child: Column( 28 | mainAxisSize: MainAxisSize.min, 29 | children: [ 30 | Container( 31 | padding: EdgeInsets.only(bottom: 25), 32 | margin: EdgeInsets.only(bottom: 25), 33 | decoration: BoxDecoration( 34 | border: Border( 35 | bottom: BorderSide( 36 | color: AppColors.LIGHT, 37 | width: 1, 38 | style: BorderStyle.solid, 39 | ), 40 | ), 41 | ), 42 | child: Column( 43 | crossAxisAlignment: CrossAxisAlignment.start, 44 | children: [ 45 | Obx( 46 | () => Text( 47 | controller.product?.name ?? "", 48 | style: TextStyle( 49 | fontSize: 32, 50 | color: AppColors.DARK, 51 | fontWeight: FontWeight.bold, 52 | ), 53 | ), 54 | ), 55 | SizedBox(height: 15), 56 | Obx( 57 | () => Text( 58 | controller.product?.description ?? "", 59 | style: TextStyle( 60 | fontSize: 14, 61 | color: AppColors.DARK, 62 | fontWeight: FontWeight.normal, 63 | ), 64 | ), 65 | ), 66 | ], 67 | ), 68 | ), 69 | Row( 70 | children: [ 71 | Expanded( 72 | child: Text( 73 | this.product?.dollar ?? "0", 74 | style: TextStyle( 75 | fontSize: 32, 76 | color: AppColors.LIGHT_GREEN, 77 | fontWeight: FontWeight.bold, 78 | ), 79 | ), 80 | ), 81 | Expanded( 82 | child: OrganicButton( 83 | controller.addProduct, 84 | "ADD TO CART", 85 | Feather.shopping_cart, 86 | ), 87 | ), 88 | ], 89 | ), 90 | ], 91 | ), 92 | ), 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/routes.dart: -------------------------------------------------------------------------------- 1 | import 'package:get/route_manager.dart'; 2 | 3 | import 'pages/cart/index.dart'; 4 | import 'pages/home/index.dart'; 5 | import 'pages/product/index.dart'; 6 | 7 | routes() => [ 8 | GetPage(name: "/", page: () => Home()), 9 | GetPage(name: "products/:id", page: () => Product()), 10 | GetPage(name: "/cart", page: () => Cart()), 11 | ]; -------------------------------------------------------------------------------- /lib/utils/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppColors { 4 | // ignore: non_constant_identifier_names 5 | static final MaterialColor PRIMARY_COLOR = _factoryColor(0xff2B3340); 6 | 7 | // ignore: non_constant_identifier_names 8 | static final MaterialColor LIGHT = _factoryColor(0xfff4f4f8); 9 | 10 | // ignore: non_constant_identifier_names 11 | static final MaterialColor LIGHT_GREY = _factoryColor(0xffd8d8d8); 12 | 13 | // ignore: non_constant_identifier_names 14 | static final MaterialColor DARK = _factoryColor(0xff3a3a3a); 15 | 16 | // ignore: non_constant_identifier_names 17 | static final MaterialColor WHITE = _factoryColor(0xffffffff); 18 | 19 | // ignore: non_constant_identifier_names 20 | static final MaterialColor GREEN = _factoryColor(0xff349e40); 21 | 22 | // ignore: non_constant_identifier_names 23 | static final MaterialColor LIGHT_GREEN = _factoryColor(0xff3AB54A); 24 | 25 | // ignore: non_constant_identifier_names 26 | static final MaterialColor SHADOW = _factoryColor(0xffE7EAF0); 27 | 28 | static MaterialColor hex(String hex) => AppColors._factoryColor(AppColors._getColorHexFromStr(hex)); 29 | 30 | static MaterialColor _factoryColor(int color) { 31 | return MaterialColor(color, { 32 | 50: Color(color), 33 | 100: Color(color), 34 | 200: Color(color), 35 | 300: Color(color), 36 | 400: Color(color), 37 | 500: Color(color), 38 | 600: Color(color), 39 | 700: Color(color), 40 | 800: Color(color), 41 | 900: Color(color), 42 | }); 43 | } 44 | 45 | static int _getColorHexFromStr(String colorStr) { 46 | colorStr = "FF" + colorStr; 47 | colorStr = colorStr.replaceAll("#", ""); 48 | int val = 0; 49 | int len = colorStr.length; 50 | for (int i = 0; i < len; i++) { 51 | int hexDigit = colorStr.codeUnitAt(i); 52 | if (hexDigit >= 48 && hexDigit <= 57) { 53 | val += (hexDigit - 48) * (1 << (4 * (len - 1 - i))); 54 | } else if (hexDigit >= 65 && hexDigit <= 70) { 55 | // A..F 56 | val += (hexDigit - 55) * (1 << (4 * (len - 1 - i))); 57 | } else if (hexDigit >= 97 && hexDigit <= 102) { 58 | // a..f 59 | val += (hexDigit - 87) * (1 << (4 * (len - 1 - i))); 60 | } else { 61 | val = 0xFFFFFFFF; 62 | } 63 | } 64 | return val; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/utils/json.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/services.dart'; 4 | 5 | loadJson(String asset) async { 6 | String data = await rootBundle.loadString(asset); 7 | return json.decode(data); 8 | } -------------------------------------------------------------------------------- /lib/widgets/appbar_action.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/utils/colors.dart'; 3 | 4 | class CustomAppBarAction extends StatelessWidget { 5 | final Function action; 6 | final IconData icon; 7 | final int quantity; 8 | 9 | CustomAppBarAction(this.action, this.icon, {this.quantity}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Padding( 14 | padding: EdgeInsets.zero, 15 | child: SizedBox( 16 | width: 50, 17 | height: 50, 18 | child: FlatButton( 19 | onPressed: action, 20 | padding: EdgeInsets.zero, 21 | color: AppColors.WHITE, 22 | shape: RoundedRectangleBorder( 23 | borderRadius: BorderRadius.circular(8), 24 | ), 25 | child: Stack( 26 | overflow: Overflow.visible, 27 | children: [ 28 | Icon( 29 | icon, 30 | size: 21, 31 | color: AppColors.GREEN, 32 | ), 33 | Visibility( 34 | visible: quantity != null, 35 | child: Positioned( 36 | top: -5, 37 | right: -10, 38 | child: Container( 39 | width: 15, 40 | height: 15, 41 | alignment: Alignment.center, 42 | decoration: BoxDecoration( 43 | color: AppColors.DARK, 44 | borderRadius: BorderRadius.circular(15)), 45 | child: Text( 46 | quantity.toString() ?? "", 47 | style: TextStyle( 48 | fontSize: 11, 49 | color: AppColors.WHITE, 50 | fontWeight: FontWeight.bold, 51 | ), 52 | ), 53 | ), 54 | ), 55 | ), 56 | ], 57 | ), 58 | ), 59 | ), 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/widgets/custom_appbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | import 'package:flutter_getx_concept/utils/colors.dart'; 4 | 5 | class CustomAppBar extends PreferredSize { 6 | final String title; 7 | final double height; 8 | final List leadings; 9 | final List actions; 10 | 11 | CustomAppBar( 12 | this.title, { 13 | this.leadings = const [], 14 | this.actions = const [], 15 | this.height = 120, 16 | }); 17 | 18 | @override 19 | Size get preferredSize => Size.fromHeight(height); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Container( 24 | height: preferredSize.height, 25 | color: Colors.transparent, 26 | alignment: Alignment.center, 27 | child: SafeArea( 28 | child: Row( 29 | mainAxisAlignment: MainAxisAlignment.center, 30 | crossAxisAlignment: CrossAxisAlignment.center, 31 | children: [ 32 | Expanded( 33 | child: Stack( 34 | children: [ 35 | Positioned( 36 | left: 25, 37 | top: 5, 38 | bottom: 5, 39 | child: Row( 40 | children: leadings, 41 | ), 42 | ), 43 | Center( 44 | child: Text( 45 | this.title, 46 | style: TextStyle( 47 | color: AppColors.DARK, 48 | fontSize: 21, 49 | fontWeight: FontWeight.bold, 50 | ), 51 | ), 52 | ), 53 | Positioned( 54 | right: 25, 55 | top: 5, 56 | bottom: 5, 57 | child: Row( 58 | children: actions, 59 | ), 60 | ), 61 | ], 62 | ), 63 | ), 64 | ], 65 | ), 66 | ), 67 | ); 68 | } 69 | } -------------------------------------------------------------------------------- /lib/widgets/organic_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_getx_concept/utils/colors.dart'; 3 | 4 | class OrganicButton extends StatelessWidget { 5 | 6 | final Function action; 7 | final String label; 8 | final IconData icon; 9 | OrganicButton(this.action, this.label, this.icon); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return FlatButton( 14 | onPressed: action, 15 | color: AppColors.WHITE, 16 | shape: RoundedRectangleBorder( 17 | borderRadius: BorderRadius.circular(100), 18 | ), 19 | padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10), 20 | child: Row( 21 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 22 | children: [ 23 | Expanded( 24 | child: Text( 25 | this.label, 26 | textAlign: TextAlign.center, 27 | style: TextStyle( 28 | fontSize: 16, 29 | color: AppColors.DARK, 30 | fontWeight: FontWeight.bold, 31 | ), 32 | ), 33 | ), 34 | Container( 35 | height: 40, 36 | width: 40, 37 | decoration: BoxDecoration( 38 | color: AppColors.LIGHT_GREEN, 39 | borderRadius: BorderRadius.circular(40), 40 | ), 41 | child: Icon( 42 | this.icon, 43 | color: AppColors.WHITE, 44 | size: 16, 45 | ), 46 | ), 47 | ], 48 | ), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/widgets/product_image.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ProductImage extends StatelessWidget { 4 | final String image; 5 | final double width; 6 | final double height; 7 | final double padding; 8 | ProductImage( 9 | this.image, { 10 | this.padding, 11 | this.width, 12 | this.height, 13 | }); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return this.image == null 18 | ? SizedBox.shrink() 19 | : Padding( 20 | padding: EdgeInsets.all(this.padding ?? 0), 21 | child: Image.asset( 22 | this.image, 23 | height: this.height, 24 | width: this.width, 25 | fit: BoxFit.contain, 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.13" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.6.0" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.4.1" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.0.0" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.3" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.12" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.4" 60 | cupertino_icons: 61 | dependency: "direct main" 62 | description: 63 | name: cupertino_icons 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "0.1.3" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_icons: 73 | dependency: "direct main" 74 | description: 75 | name: flutter_icons 76 | url: "https://pub.dartlang.org" 77 | source: hosted 78 | version: "1.1.0" 79 | flutter_test: 80 | dependency: "direct dev" 81 | description: flutter 82 | source: sdk 83 | version: "0.0.0" 84 | get: 85 | dependency: "direct main" 86 | description: 87 | name: get 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "3.3.0" 91 | image: 92 | dependency: transitive 93 | description: 94 | name: image 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "2.1.12" 98 | matcher: 99 | dependency: transitive 100 | description: 101 | name: matcher 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "0.12.6" 105 | meta: 106 | dependency: transitive 107 | description: 108 | name: meta 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.1.8" 112 | path: 113 | dependency: transitive 114 | description: 115 | name: path 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "1.6.4" 119 | petitparser: 120 | dependency: transitive 121 | description: 122 | name: petitparser 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "2.4.0" 126 | quiver: 127 | dependency: transitive 128 | description: 129 | name: quiver 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "2.1.3" 133 | sky_engine: 134 | dependency: transitive 135 | description: flutter 136 | source: sdk 137 | version: "0.0.99" 138 | source_span: 139 | dependency: transitive 140 | description: 141 | name: source_span 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.7.0" 145 | stack_trace: 146 | dependency: transitive 147 | description: 148 | name: stack_trace 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.9.3" 152 | stream_channel: 153 | dependency: transitive 154 | description: 155 | name: stream_channel 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "2.0.0" 159 | string_scanner: 160 | dependency: transitive 161 | description: 162 | name: string_scanner 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.0.5" 166 | term_glyph: 167 | dependency: transitive 168 | description: 169 | name: term_glyph 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.1.0" 173 | test_api: 174 | dependency: transitive 175 | description: 176 | name: test_api 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "0.2.15" 180 | typed_data: 181 | dependency: transitive 182 | description: 183 | name: typed_data 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "1.1.6" 187 | vector_math: 188 | dependency: transitive 189 | description: 190 | name: vector_math 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "2.0.8" 194 | xml: 195 | dependency: transitive 196 | description: 197 | name: xml 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "3.6.1" 201 | sdks: 202 | dart: ">=2.7.0 <3.0.0" 203 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_getx_concept 2 | description: A new Flutter project. 3 | 4 | publish_to: 'none' 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.7.0 <3.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | cupertino_icons: ^0.1.3 15 | flutter_icons: 16 | get: 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | 22 | flutter: 23 | uses-material-design: true 24 | assets: 25 | - assets/data/products.json 26 | - assets/data/categories.json 27 | - assets/images/banana.png 28 | - assets/images/kiwi.png 29 | - assets/images/orange.png 30 | - assets/images/apple.png 31 | - assets/images/watermelon.png 32 | - assets/images/strawberry.png 33 | - assets/images/peppers.png 34 | - assets/images/broccoli.png 35 | - assets/images/carrot.png --------------------------------------------------------------------------------