├── README.md
├── analysis_options.yaml
├── android
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── demo
│ │ │ │ └── getx
│ │ │ │ └── flutter_getx_example
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── 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-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── flutter_getx_example_android.iml
├── gradle.properties
└── settings.gradle
├── assets
├── icons
│ └── ic_empty_cart.png
└── products.json
├── flutter_getx_example.iml
├── ios
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── controllers
│ └── app_controller.dart
├── data
│ ├── bindings
│ │ └── user_binding.dart
│ └── common
│ │ ├── constants.dart
│ │ └── params_args.dart
├── init_app.dart
├── main.dart
├── models
│ ├── product_model.dart
│ └── rating_model.dart
├── res
│ ├── app_color.dart
│ ├── images.dart
│ └── strings.dart
├── src
│ ├── favourite_products.dart
│ ├── home_page.dart
│ ├── my_cart.dart
│ └── widgets
│ │ ├── item_my_cart.dart
│ │ └── item_product.dart
├── utils
│ ├── log_util.dart
│ ├── my_application.dart
│ ├── sliver_grid_delegate_with_fixed_cross_axis_count_and_fixed_height.dart
│ ├── theme_util.dart
│ └── widget_util.dart
└── widgets
│ └── custom_appbar.dart
└── pubspec.yaml
/README.md:
--------------------------------------------------------------------------------
1 | # flutter_getx_example
2 |
3 | 🚀 A State Management with GetX.
4 |
5 | - GetX Package: https://pub.dev/packages/get
6 |
7 | **Screenshots**
8 |
9 |
10 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 30
29 |
30 | compileOptions {
31 | sourceCompatibility JavaVersion.VERSION_1_8
32 | targetCompatibility JavaVersion.VERSION_1_8
33 | }
34 |
35 | defaultConfig {
36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
37 | applicationId "com.demo.getx.flutter_getx_example"
38 | minSdkVersion 16
39 | targetSdkVersion 30
40 | versionCode flutterVersionCode.toInteger()
41 | versionName flutterVersionName
42 | }
43 |
44 | buildTypes {
45 | release {
46 | // TODO: Add your own signing config for the release build.
47 | // Signing with the debug keys for now, so `flutter run --release` works.
48 | signingConfig signingConfigs.debug
49 | }
50 | }
51 | }
52 |
53 | flutter {
54 | source '../..'
55 | }
56 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
13 |
17 |
21 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
37 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/demo/getx/flutter_getx_example/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.demo.getx.flutter_getx_example;
2 |
3 | import io.flutter.embedding.android.FlutterActivity;
4 |
5 | public class MainActivity extends FlutterActivity {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:4.1.0'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | mavenCentral()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | project.evaluationDependsOn(':app')
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/android/flutter_getx_example_android.iml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/assets/icons/ic_empty_cart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/assets/icons/ic_empty_cart.png
--------------------------------------------------------------------------------
/assets/products.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 1,
4 | "title": "Fjallraven - Foldsack No. 1 Backpack, Fits 15 Laptops",
5 | "price": 109.95,
6 | "description": "Your perfect pack for everyday use and walks in the forest. Stash your laptop (up to 15 inches) in the padded sleeve, your everyday",
7 | "category": "men's clothing",
8 | "image": "https://fakestoreapi.com/img/81fPKd-2AYL._AC_SL1500_.jpg",
9 | "rating": {
10 | "rate": 3.9,
11 | "count": 120
12 | }
13 | },
14 | {
15 | "id": 2,
16 | "title": "Mens Casual Premium Slim Fit T-Shirts ",
17 | "price": 22.3,
18 | "description": "Slim-fitting style, contrast raglan long sleeve, three-button henley placket, light weight & soft fabric for breathable and comfortable wearing. And Solid stitched shirts with round neck made for durability and a great fit for casual fashion wear and diehard baseball fans. The Henley style round neckline includes a three-button placket.",
19 | "category": "men's clothing",
20 | "image": "https://fakestoreapi.com/img/71-3HjGNDUL._AC_SY879._SX._UX._SY._UY_.jpg",
21 | "rating": {
22 | "rate": 4.1,
23 | "count": 259
24 | }
25 | },
26 | {
27 | "id": 3,
28 | "title": "Mens Cotton Jacket",
29 | "price": 55.99,
30 | "description": "great outerwear jackets for Spring/Autumn/Winter, suitable for many occasions, such as working, hiking, camping, mountain/rock climbing, cycling, traveling or other outdoors. Good gift choice for you or your family member. A warm hearted love to Father, husband or son in this thanksgiving or Christmas Day.",
31 | "category": "men's clothing",
32 | "image": "https://fakestoreapi.com/img/71li-ujtlUL._AC_UX679_.jpg",
33 | "rating": {
34 | "rate": 4.7,
35 | "count": 500
36 | }
37 | },
38 | {
39 | "id": 4,
40 | "title": "Mens Casual Slim Fit",
41 | "price": 15.99,
42 | "description": "The color could be slightly different between on the screen and in practice. / Please note that body builds vary by person, therefore, detailed size information should be reviewed below on the product description.",
43 | "category": "men's clothing",
44 | "image": "https://fakestoreapi.com/img/71YXzeOuslL._AC_UY879_.jpg",
45 | "rating": {
46 | "rate": 2.1,
47 | "count": 430
48 | }
49 | },
50 | {
51 | "id": 5,
52 | "title": "John Hardy Women's Legends Naga Gold & Silver Dragon Station Chain Bracelet",
53 | "price": 695,
54 | "description": "From our Legends Collection, the Naga was inspired by the mythical water dragon that protects the ocean's pearl. Wear facing inward to be bestowed with love and abundance, or outward for protection.",
55 | "category": "jewelery",
56 | "image": "https://fakestoreapi.com/img/71pWzhdJNwL._AC_UL640_QL65_ML3_.jpg",
57 | "rating": {
58 | "rate": 4.6,
59 | "count": 400
60 | }
61 | },
62 | {
63 | "id": 6,
64 | "title": "Solid Gold Petite Micropave ",
65 | "price": 168,
66 | "description": "Satisfaction Guaranteed. Return or exchange any order within 30 days.Designed and sold by Hafeez Center in the United States. Satisfaction Guaranteed. Return or exchange any order within 30 days.",
67 | "category": "jewelery",
68 | "image": "https://fakestoreapi.com/img/61sbMiUnoGL._AC_UL640_QL65_ML3_.jpg",
69 | "rating": {
70 | "rate": 3.9,
71 | "count": 70
72 | }
73 | },
74 | {
75 | "id": 7,
76 | "title": "White Gold Plated Princess",
77 | "price": 9.99,
78 | "description": "Classic Created Wedding Engagement Solitaire Diamond Promise Ring for Her. Gifts to spoil your love more for Engagement, Wedding, Anniversary, Valentine's Day...",
79 | "category": "jewelery",
80 | "image": "https://fakestoreapi.com/img/71YAIFU48IL._AC_UL640_QL65_ML3_.jpg",
81 | "rating": {
82 | "rate": 3,
83 | "count": 400
84 | }
85 | },
86 | {
87 | "id": 8,
88 | "title": "Pierced Owl Rose Gold Plated Stainless Steel Double",
89 | "price": 10.99,
90 | "description": "Rose Gold Plated Double Flared Tunnel Plug Earrings. Made of 316L Stainless Steel",
91 | "category": "jewelery",
92 | "image": "https://fakestoreapi.com/img/51UDEzMJVpL._AC_UL640_QL65_ML3_.jpg",
93 | "rating": {
94 | "rate": 1.9,
95 | "count": 100
96 | }
97 | },
98 | {
99 | "id": 9,
100 | "title": "WD 2TB Elements Portable External Hard Drive - USB 3.0 ",
101 | "price": 64,
102 | "description": "USB 3.0 and USB 2.0 Compatibility Fast data transfers Improve PC Performance High Capacity; Compatibility Formatted NTFS for Windows 10, Windows 8.1, Windows 7; Reformatting may be required for other operating systems; Compatibility may vary depending on user’s hardware configuration and operating system",
103 | "category": "electronics",
104 | "image": "https://fakestoreapi.com/img/61IBBVJvSDL._AC_SY879_.jpg",
105 | "rating": {
106 | "rate": 3.3,
107 | "count": 203
108 | }
109 | },
110 | {
111 | "id": 10,
112 | "title": "SanDisk SSD PLUS 1TB Internal SSD - SATA III 6 Gb/s",
113 | "price": 109,
114 | "description": "Easy upgrade for faster boot up, shutdown, application load and response (As compared to 5400 RPM SATA 2.5” hard drive; Based on published specifications and internal benchmarking tests using PCMark vantage scores) Boosts burst write performance, making it ideal for typical PC workloads The perfect balance of performance and reliability Read/write speeds of up to 535MB/s/450MB/s (Based on internal testing; Performance may vary depending upon drive capacity, host device, OS and application.)",
115 | "category": "electronics",
116 | "image": "https://fakestoreapi.com/img/61U7T1koQqL._AC_SX679_.jpg",
117 | "rating": {
118 | "rate": 2.9,
119 | "count": 470
120 | }
121 | },
122 | {
123 | "id": 11,
124 | "title": "Silicon Power 256GB SSD 3D NAND A55 SLC Cache Performance Boost SATA III 2.5",
125 | "price": 109,
126 | "description": "3D NAND flash are applied to deliver high transfer speeds Remarkable transfer speeds that enable faster bootup and improved overall system performance. The advanced SLC Cache Technology allows performance boost and longer lifespan 7mm slim design suitable for Ultrabooks and Ultra-slim notebooks. Supports TRIM command, Garbage Collection technology, RAID, and ECC (Error Checking & Correction) to provide the optimized performance and enhanced reliability.",
127 | "category": "electronics",
128 | "image": "https://fakestoreapi.com/img/71kWymZ+c+L._AC_SX679_.jpg",
129 | "rating": {
130 | "rate": 4.8,
131 | "count": 319
132 | }
133 | },
134 | {
135 | "id": 12,
136 | "title": "WD 4TB Gaming Drive Works with Playstation 4 Portable External Hard Drive",
137 | "price": 114,
138 | "description": "Expand your PS4 gaming experience, Play anywhere Fast and easy, setup Sleek design with high capacity, 3-year manufacturer's limited warranty",
139 | "category": "electronics",
140 | "image": "https://fakestoreapi.com/img/61mtL65D4cL._AC_SX679_.jpg",
141 | "rating": {
142 | "rate": 4.8,
143 | "count": 400
144 | }
145 | },
146 | {
147 | "id": 13,
148 | "title": "Acer SB220Q bi 21.5 inches Full HD (1920 x 1080) IPS Ultra-Thin",
149 | "price": 599,
150 | "description": "21. 5 inches Full HD (1920 x 1080) widescreen IPS display And Radeon free Sync technology. No compatibility for VESA Mount Refresh Rate: 75Hz - Using HDMI port Zero-frame design | ultra-thin | 4ms response time | IPS panel Aspect ratio - 16: 9. Color Supported - 16. 7 million colors. Brightness - 250 nit Tilt angle -5 degree to 15 degree. Horizontal viewing angle-178 degree. Vertical viewing angle-178 degree 75 hertz",
151 | "category": "electronics",
152 | "image": "https://fakestoreapi.com/img/81QpkIctqPL._AC_SX679_.jpg",
153 | "rating": {
154 | "rate": 2.9,
155 | "count": 250
156 | }
157 | },
158 | {
159 | "id": 14,
160 | "title": "Samsung 49-Inch CHG90 144Hz Curved Gaming Monitor (LC49HG90DMNXZA) – Super Ultrawide Screen QLED ",
161 | "price": 999.99,
162 | "description": "49 INCH SUPER ULTRAWIDE 32:9 CURVED GAMING MONITOR with dual 27 inch screen side by side QUANTUM DOT (QLED) TECHNOLOGY, HDR support and factory calibration provides stunningly realistic and accurate color and contrast 144HZ HIGH REFRESH RATE and 1ms ultra fast response time work to eliminate motion blur, ghosting, and reduce input lag",
163 | "category": "electronics",
164 | "image": "https://fakestoreapi.com/img/81Zt42ioCgL._AC_SX679_.jpg",
165 | "rating": {
166 | "rate": 2.2,
167 | "count": 140
168 | }
169 | },
170 | {
171 | "id": 15,
172 | "title": "BIYLACLESEN Women's 3-in-1 Snowboard Jacket Winter Coats",
173 | "price": 56.99,
174 | "description": "Note:The Jackets is US standard size, Please choose size as your usual wear Material: 100% Polyester; Detachable Liner Fabric: Warm Fleece. Detachable Functional Liner: Skin Friendly, Lightweigt and Warm.Stand Collar Liner jacket, keep you warm in cold weather. Zippered Pockets: 2 Zippered Hand Pockets, 2 Zippered Pockets on Chest (enough to keep cards or keys)and 1 Hidden Pocket Inside.Zippered Hand Pockets and Hidden Pocket keep your things secure. Humanized Design: Adjustable and Detachable Hood and Adjustable cuff to prevent the wind and water,for a comfortable fit. 3 in 1 Detachable Design provide more convenience, you can separate the coat and inner as needed, or wear it together. It is suitable for different season and help you adapt to different climates",
175 | "category": "women's clothing",
176 | "image": "https://fakestoreapi.com/img/51Y5NI-I5jL._AC_UX679_.jpg",
177 | "rating": {
178 | "rate": 2.6,
179 | "count": 235
180 | }
181 | },
182 | {
183 | "id": 16,
184 | "title": "Lock and Love Women's Removable Hooded Faux Leather Moto Biker Jacket",
185 | "price": 29.95,
186 | "description": "100% POLYURETHANE(shell) 100% POLYESTER(lining) 75% POLYESTER 25% COTTON (SWEATER), Faux leather material for style and comfort / 2 pockets of front, 2-For-One Hooded denim style faux leather jacket, Button detail on waist / Detail stitching at sides, HAND WASH ONLY / DO NOT BLEACH / LINE DRY / DO NOT IRON",
187 | "category": "women's clothing",
188 | "image": "https://fakestoreapi.com/img/81XH0e8fefL._AC_UY879_.jpg",
189 | "rating": {
190 | "rate": 2.9,
191 | "count": 340
192 | }
193 | },
194 | {
195 | "id": 17,
196 | "title": "Rain Jacket Women Windbreaker Striped Climbing Raincoats",
197 | "price": 39.99,
198 | "description": "Lightweight perfet for trip or casual wear---Long sleeve with hooded, adjustable drawstring waist design. Button and zipper front closure raincoat, fully stripes Lined and The Raincoat has 2 side pockets are a good size to hold all kinds of things, it covers the hips, and the hood is generous but doesn't overdo it.Attached Cotton Lined Hood with Adjustable Drawstrings give it a real styled look.",
199 | "category": "women's clothing",
200 | "image": "https://fakestoreapi.com/img/71HblAHs5xL._AC_UY879_-2.jpg",
201 | "rating": {
202 | "rate": 3.8,
203 | "count": 679
204 | }
205 | },
206 | {
207 | "id": 18,
208 | "title": "MBJ Women's Solid Short Sleeve Boat Neck V ",
209 | "price": 9.85,
210 | "description": "95% RAYON 5% SPANDEX, Made in USA or Imported, Do Not Bleach, Lightweight fabric with great stretch for comfort, Ribbed on sleeves and neckline / Double stitching on bottom hem",
211 | "category": "women's clothing",
212 | "image": "https://fakestoreapi.com/img/71z3kpMAYsL._AC_UY879_.jpg",
213 | "rating": {
214 | "rate": 4.7,
215 | "count": 130
216 | }
217 | },
218 | {
219 | "id": 19,
220 | "title": "Opna Women's Short Sleeve Moisture",
221 | "price": 7.95,
222 | "description": "100% Polyester, Machine wash, 100% cationic polyester interlock, Machine Wash & Pre Shrunk for a Great Fit, Lightweight, roomy and highly breathable with moisture wicking fabric which helps to keep moisture away, Soft Lightweight Fabric with comfortable V-neck collar and a slimmer fit, delivers a sleek, more feminine silhouette and Added Comfort",
223 | "category": "women's clothing",
224 | "image": "https://fakestoreapi.com/img/51eg55uWmdL._AC_UX679_.jpg",
225 | "rating": {
226 | "rate": 4.5,
227 | "count": 146
228 | }
229 | },
230 | {
231 | "id": 20,
232 | "title": "DANVOUY Womens T Shirt Casual Cotton Short",
233 | "price": 12.99,
234 | "description": "95%Cotton,5%Spandex, Features: Casual, Short Sleeve, Letter Print,V-Neck,Fashion Tees, The fabric is soft and has some stretch., Occasion: Casual/Office/Beach/School/Home/Street. Season: Spring,Summer,Autumn,Winter.",
235 | "category": "women's clothing",
236 | "image": "https://fakestoreapi.com/img/61pHAEJ4NML._AC_UX679_.jpg",
237 | "rating": {
238 | "rate": 3.6,
239 | "count": 145
240 | }
241 | }
242 | ]
--------------------------------------------------------------------------------
/flutter_getx_example.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "";
23 | dstSubfolderSpec = 10;
24 | files = (
25 | );
26 | name = "Embed Frameworks";
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXFrameworksBuildPhase section */
56 |
57 | /* Begin PBXGroup section */
58 | 9740EEB11CF90186004384FC /* Flutter */ = {
59 | isa = PBXGroup;
60 | children = (
61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
65 | );
66 | name = Flutter;
67 | sourceTree = "";
68 | };
69 | 97C146E51CF9000F007C117D = {
70 | isa = PBXGroup;
71 | children = (
72 | 9740EEB11CF90186004384FC /* Flutter */,
73 | 97C146F01CF9000F007C117D /* Runner */,
74 | 97C146EF1CF9000F007C117D /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | 97C146EF1CF9000F007C117D /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 97C146EE1CF9000F007C117D /* Runner.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | 97C146F01CF9000F007C117D /* Runner */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
92 | 97C147021CF9000F007C117D /* Info.plist */,
93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
97 | );
98 | path = Runner;
99 | sourceTree = "";
100 | };
101 | /* End PBXGroup section */
102 |
103 | /* Begin PBXNativeTarget section */
104 | 97C146ED1CF9000F007C117D /* Runner */ = {
105 | isa = PBXNativeTarget;
106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107 | buildPhases = (
108 | 9740EEB61CF901F6004384FC /* Run Script */,
109 | 97C146EA1CF9000F007C117D /* Sources */,
110 | 97C146EB1CF9000F007C117D /* Frameworks */,
111 | 97C146EC1CF9000F007C117D /* Resources */,
112 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
114 | );
115 | buildRules = (
116 | );
117 | dependencies = (
118 | );
119 | name = Runner;
120 | productName = Runner;
121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
122 | productType = "com.apple.product-type.application";
123 | };
124 | /* End PBXNativeTarget section */
125 |
126 | /* Begin PBXProject section */
127 | 97C146E61CF9000F007C117D /* Project object */ = {
128 | isa = PBXProject;
129 | attributes = {
130 | LastUpgradeCheck = 1020;
131 | ORGANIZATIONNAME = "";
132 | TargetAttributes = {
133 | 97C146ED1CF9000F007C117D = {
134 | CreatedOnToolsVersion = 7.3.1;
135 | LastSwiftMigration = 1100;
136 | };
137 | };
138 | };
139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
140 | compatibilityVersion = "Xcode 9.3";
141 | developmentRegion = en;
142 | hasScannedForEncodings = 0;
143 | knownRegions = (
144 | en,
145 | Base,
146 | );
147 | mainGroup = 97C146E51CF9000F007C117D;
148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
149 | projectDirPath = "";
150 | projectRoot = "";
151 | targets = (
152 | 97C146ED1CF9000F007C117D /* Runner */,
153 | );
154 | };
155 | /* End PBXProject section */
156 |
157 | /* Begin PBXResourcesBuildPhase section */
158 | 97C146EC1CF9000F007C117D /* Resources */ = {
159 | isa = PBXResourcesBuildPhase;
160 | buildActionMask = 2147483647;
161 | files = (
162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
166 | );
167 | runOnlyForDeploymentPostprocessing = 0;
168 | };
169 | /* End PBXResourcesBuildPhase section */
170 |
171 | /* Begin PBXShellScriptBuildPhase section */
172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173 | isa = PBXShellScriptBuildPhase;
174 | buildActionMask = 2147483647;
175 | files = (
176 | );
177 | inputPaths = (
178 | );
179 | name = "Thin Binary";
180 | outputPaths = (
181 | );
182 | runOnlyForDeploymentPostprocessing = 0;
183 | shellPath = /bin/sh;
184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
185 | };
186 | 9740EEB61CF901F6004384FC /* Run Script */ = {
187 | isa = PBXShellScriptBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | );
191 | inputPaths = (
192 | );
193 | name = "Run Script";
194 | outputPaths = (
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | shellPath = /bin/sh;
198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
199 | };
200 | /* End PBXShellScriptBuildPhase section */
201 |
202 | /* Begin PBXSourcesBuildPhase section */
203 | 97C146EA1CF9000F007C117D /* Sources */ = {
204 | isa = PBXSourcesBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | };
212 | /* End PBXSourcesBuildPhase section */
213 |
214 | /* Begin PBXVariantGroup section */
215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
216 | isa = PBXVariantGroup;
217 | children = (
218 | 97C146FB1CF9000F007C117D /* Base */,
219 | );
220 | name = Main.storyboard;
221 | sourceTree = "";
222 | };
223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
224 | isa = PBXVariantGroup;
225 | children = (
226 | 97C147001CF9000F007C117D /* Base */,
227 | );
228 | name = LaunchScreen.storyboard;
229 | sourceTree = "";
230 | };
231 | /* End PBXVariantGroup section */
232 |
233 | /* Begin XCBuildConfiguration section */
234 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
235 | isa = XCBuildConfiguration;
236 | buildSettings = {
237 | ALWAYS_SEARCH_USER_PATHS = NO;
238 | CLANG_ANALYZER_NONNULL = YES;
239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
240 | CLANG_CXX_LIBRARY = "libc++";
241 | CLANG_ENABLE_MODULES = YES;
242 | CLANG_ENABLE_OBJC_ARC = YES;
243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
244 | CLANG_WARN_BOOL_CONVERSION = YES;
245 | CLANG_WARN_COMMA = YES;
246 | CLANG_WARN_CONSTANT_CONVERSION = YES;
247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
249 | CLANG_WARN_EMPTY_BODY = YES;
250 | CLANG_WARN_ENUM_CONVERSION = YES;
251 | CLANG_WARN_INFINITE_RECURSION = YES;
252 | CLANG_WARN_INT_CONVERSION = YES;
253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
258 | CLANG_WARN_STRICT_PROTOTYPES = YES;
259 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
260 | CLANG_WARN_UNREACHABLE_CODE = YES;
261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
263 | COPY_PHASE_STRIP = NO;
264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
265 | ENABLE_NS_ASSERTIONS = NO;
266 | ENABLE_STRICT_OBJC_MSGSEND = YES;
267 | GCC_C_LANGUAGE_STANDARD = gnu99;
268 | GCC_NO_COMMON_BLOCKS = YES;
269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
271 | GCC_WARN_UNDECLARED_SELECTOR = YES;
272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
273 | GCC_WARN_UNUSED_FUNCTION = YES;
274 | GCC_WARN_UNUSED_VARIABLE = YES;
275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
276 | MTL_ENABLE_DEBUG_INFO = NO;
277 | SDKROOT = iphoneos;
278 | SUPPORTED_PLATFORMS = iphoneos;
279 | TARGETED_DEVICE_FAMILY = "1,2";
280 | VALIDATE_PRODUCT = YES;
281 | };
282 | name = Profile;
283 | };
284 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
285 | isa = XCBuildConfiguration;
286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
287 | buildSettings = {
288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
289 | CLANG_ENABLE_MODULES = YES;
290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
291 | ENABLE_BITCODE = NO;
292 | INFOPLIST_FILE = Runner/Info.plist;
293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
294 | PRODUCT_BUNDLE_IDENTIFIER = com.demo.getx.flutterGetxExample;
295 | PRODUCT_NAME = "$(TARGET_NAME)";
296 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
297 | SWIFT_VERSION = 5.0;
298 | VERSIONING_SYSTEM = "apple-generic";
299 | };
300 | name = Profile;
301 | };
302 | 97C147031CF9000F007C117D /* Debug */ = {
303 | isa = XCBuildConfiguration;
304 | buildSettings = {
305 | ALWAYS_SEARCH_USER_PATHS = NO;
306 | CLANG_ANALYZER_NONNULL = YES;
307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
308 | CLANG_CXX_LIBRARY = "libc++";
309 | CLANG_ENABLE_MODULES = YES;
310 | CLANG_ENABLE_OBJC_ARC = YES;
311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
312 | CLANG_WARN_BOOL_CONVERSION = YES;
313 | CLANG_WARN_COMMA = YES;
314 | CLANG_WARN_CONSTANT_CONVERSION = YES;
315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
317 | CLANG_WARN_EMPTY_BODY = YES;
318 | CLANG_WARN_ENUM_CONVERSION = YES;
319 | CLANG_WARN_INFINITE_RECURSION = YES;
320 | CLANG_WARN_INT_CONVERSION = YES;
321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
326 | CLANG_WARN_STRICT_PROTOTYPES = YES;
327 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
328 | CLANG_WARN_UNREACHABLE_CODE = YES;
329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
331 | COPY_PHASE_STRIP = NO;
332 | DEBUG_INFORMATION_FORMAT = dwarf;
333 | ENABLE_STRICT_OBJC_MSGSEND = YES;
334 | ENABLE_TESTABILITY = YES;
335 | GCC_C_LANGUAGE_STANDARD = gnu99;
336 | GCC_DYNAMIC_NO_PIC = NO;
337 | GCC_NO_COMMON_BLOCKS = YES;
338 | GCC_OPTIMIZATION_LEVEL = 0;
339 | GCC_PREPROCESSOR_DEFINITIONS = (
340 | "DEBUG=1",
341 | "$(inherited)",
342 | );
343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
345 | GCC_WARN_UNDECLARED_SELECTOR = YES;
346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
347 | GCC_WARN_UNUSED_FUNCTION = YES;
348 | GCC_WARN_UNUSED_VARIABLE = YES;
349 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
350 | MTL_ENABLE_DEBUG_INFO = YES;
351 | ONLY_ACTIVE_ARCH = YES;
352 | SDKROOT = iphoneos;
353 | TARGETED_DEVICE_FAMILY = "1,2";
354 | };
355 | name = Debug;
356 | };
357 | 97C147041CF9000F007C117D /* Release */ = {
358 | isa = XCBuildConfiguration;
359 | buildSettings = {
360 | ALWAYS_SEARCH_USER_PATHS = NO;
361 | CLANG_ANALYZER_NONNULL = YES;
362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
363 | CLANG_CXX_LIBRARY = "libc++";
364 | CLANG_ENABLE_MODULES = YES;
365 | CLANG_ENABLE_OBJC_ARC = YES;
366 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
367 | CLANG_WARN_BOOL_CONVERSION = YES;
368 | CLANG_WARN_COMMA = YES;
369 | CLANG_WARN_CONSTANT_CONVERSION = YES;
370 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
372 | CLANG_WARN_EMPTY_BODY = YES;
373 | CLANG_WARN_ENUM_CONVERSION = YES;
374 | CLANG_WARN_INFINITE_RECURSION = YES;
375 | CLANG_WARN_INT_CONVERSION = YES;
376 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
377 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
378 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
379 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
380 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
381 | CLANG_WARN_STRICT_PROTOTYPES = YES;
382 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
383 | CLANG_WARN_UNREACHABLE_CODE = YES;
384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
386 | COPY_PHASE_STRIP = NO;
387 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
388 | ENABLE_NS_ASSERTIONS = NO;
389 | ENABLE_STRICT_OBJC_MSGSEND = YES;
390 | GCC_C_LANGUAGE_STANDARD = gnu99;
391 | GCC_NO_COMMON_BLOCKS = YES;
392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
394 | GCC_WARN_UNDECLARED_SELECTOR = YES;
395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
396 | GCC_WARN_UNUSED_FUNCTION = YES;
397 | GCC_WARN_UNUSED_VARIABLE = YES;
398 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
399 | MTL_ENABLE_DEBUG_INFO = NO;
400 | SDKROOT = iphoneos;
401 | SUPPORTED_PLATFORMS = iphoneos;
402 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
403 | TARGETED_DEVICE_FAMILY = "1,2";
404 | VALIDATE_PRODUCT = YES;
405 | };
406 | name = Release;
407 | };
408 | 97C147061CF9000F007C117D /* Debug */ = {
409 | isa = XCBuildConfiguration;
410 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
411 | buildSettings = {
412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
413 | CLANG_ENABLE_MODULES = YES;
414 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
415 | ENABLE_BITCODE = NO;
416 | INFOPLIST_FILE = Runner/Info.plist;
417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
418 | PRODUCT_BUNDLE_IDENTIFIER = com.demo.getx.flutterGetxExample;
419 | PRODUCT_NAME = "$(TARGET_NAME)";
420 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
421 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
422 | SWIFT_VERSION = 5.0;
423 | VERSIONING_SYSTEM = "apple-generic";
424 | };
425 | name = Debug;
426 | };
427 | 97C147071CF9000F007C117D /* Release */ = {
428 | isa = XCBuildConfiguration;
429 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
430 | buildSettings = {
431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
432 | CLANG_ENABLE_MODULES = YES;
433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
434 | ENABLE_BITCODE = NO;
435 | INFOPLIST_FILE = Runner/Info.plist;
436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
437 | PRODUCT_BUNDLE_IDENTIFIER = com.demo.getx.flutterGetxExample;
438 | PRODUCT_NAME = "$(TARGET_NAME)";
439 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
440 | SWIFT_VERSION = 5.0;
441 | VERSIONING_SYSTEM = "apple-generic";
442 | };
443 | name = Release;
444 | };
445 | /* End XCBuildConfiguration section */
446 |
447 | /* Begin XCConfigurationList section */
448 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
449 | isa = XCConfigurationList;
450 | buildConfigurations = (
451 | 97C147031CF9000F007C117D /* Debug */,
452 | 97C147041CF9000F007C117D /* Release */,
453 | 249021D3217E4FDB00AE95B9 /* Profile */,
454 | );
455 | defaultConfigurationIsVisible = 0;
456 | defaultConfigurationName = Release;
457 | };
458 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
459 | isa = XCConfigurationList;
460 | buildConfigurations = (
461 | 97C147061CF9000F007C117D /* Debug */,
462 | 97C147071CF9000F007C117D /* Release */,
463 | 249021D4217E4FDB00AE95B9 /* Profile */,
464 | );
465 | defaultConfigurationIsVisible = 0;
466 | defaultConfigurationName = Release;
467 | };
468 | /* End XCConfigurationList section */
469 | };
470 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
471 | }
472 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/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/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhola-hardik/flutter_getx_example/45f5ee39ff26bedb9fb6c3ed8ea4a5bb4f6f6d0e/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_getx_example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/controllers/app_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_getx_example/data/common/params_args.dart';
2 | import 'package:flutter_getx_example/models/product_model.dart';
3 | import 'package:flutter_getx_example/utils/log_util.dart';
4 | import 'package:get/get.dart';
5 |
6 | final title = "AppController";
7 |
8 | class AppController extends GetxController {
9 | /// made this if you need cancel you worker
10 | late Worker _ever;
11 |
12 | var _cartDetailsMap = Map().obs;
13 | var _productsList = [].obs;
14 | var _cartList = [].obs;
15 | var _favouriteList = [].obs;
16 | var _favCount = 0.obs;
17 |
18 | List get productsList => _productsList.value;
19 |
20 | List get cartList => _cartList.value;
21 |
22 | List get favouriteList => _favouriteList.value;
23 |
24 | int get favCount => _favCount.value;
25 |
26 | Map get cartDetailsMap => _cartDetailsMap.value;
27 |
28 | @override
29 | void onInit() {
30 | Log.loga(title, "onInit:: >>>>>>> ");
31 | _initProducts();
32 | super.onInit();
33 |
34 | /*
35 | /// Called every time the variable $_ is changed
36 | _ever = ever(_cartList, (_) => {Log.loga(title, "onInit:: _cartList >>>>> ")});
37 | everAll([count1, count2], (_) => print("$_ has been changed (everAll)"));
38 |
39 | /// Called first time the variable $_ is changed
40 | once(count1, (_) => print("$_ was changed once (once)"));
41 |
42 | /// Anti DDos - Called every time the user stops typing for 1 second, for example.
43 | debounce(count1, (_) => print("debouce$_ (debounce)"),
44 | time: Duration(seconds: 1));
45 |
46 | /// Ignore all changes within 1 second.
47 | interval(count1, (_) => print("interval $_ (interval)"),
48 | time: Duration(seconds: 1));*/
49 | }
50 |
51 | void _initProducts() async {
52 | List products = await ProductModel.getProducts();
53 | _productsList.addAll(products);
54 | Log.loga(
55 | title, "_initProducts:: _productsList >>>>>>> ${_productsList.length}");
56 | }
57 |
58 | disposeWorker() {
59 | _ever.dispose();
60 | // or _ever();
61 | }
62 |
63 | void updateQty({
64 | required ProductModel product,
65 | bool isAdd = true,
66 | }) {
67 | int index = _productsList.indexOf(product);
68 | if (isAdd) {
69 | product.qty++;
70 | _productsList[index] = product;
71 |
72 | addItemToCart(product: product);
73 | } else {
74 | product.qty--;
75 | _productsList[index] = product;
76 |
77 | removeItemFromCart(product: product);
78 | }
79 | }
80 |
81 | // cart
82 | void addItemToCart({required ProductModel product}) {
83 | if (product.qty > 1) {
84 | _cartList.indexOf(product);
85 | // OR
86 | // _cartList[_cartList.indexOf(product)] = product;
87 | } else {
88 | _cartList.add(product);
89 | }
90 |
91 | _updateCart();
92 | }
93 |
94 | void removeItemFromCart({required ProductModel product}) {
95 | if (product.qty < 1) {
96 | _cartList.remove(product);
97 | } else {
98 | _cartList.indexOf(product);
99 | // OR
100 | // _cartList[_cartList.indexOf(product)] = product;
101 | }
102 |
103 | _updateCart();
104 | }
105 |
106 | void deleteProductFromCart({required ProductModel product}) {
107 | int index = _productsList.indexOf(product);
108 | product.qty = 0;
109 | _productsList[index] = product;
110 |
111 | removeItemFromCart(product: product);
112 | }
113 |
114 | void _updateCart() {
115 | _cartDetailsMap.update(
116 | ParamsArgus.KEY_CART_ITEMS, (dynamic val) => _cartList.length,
117 | ifAbsent: () => _cartList.length);
118 |
119 | double total = 0;
120 | _cartList.forEach((product) {
121 | total += (product.price ?? 0) * product.qty;
122 | });
123 |
124 | _cartDetailsMap.update(
125 | ParamsArgus.KEY_CART_TOTAL, (dynamic val) => total.toStringAsFixed(2),
126 | ifAbsent: () => total.toStringAsFixed(2));
127 | }
128 |
129 | void clearCart() {
130 | _cartList.clear();
131 | _cartDetailsMap.update(ParamsArgus.KEY_CART_ITEMS, (dynamic val) => 0,
132 | ifAbsent: () => 0);
133 | _cartDetailsMap.update(ParamsArgus.KEY_CART_TOTAL, (dynamic val) => 0,
134 | ifAbsent: () => 0);
135 | }
136 |
137 | // fav-unfav products
138 | void setFavourite({
139 | required ProductModel product,
140 | required bool fav,
141 | }) {
142 | product.isFav = fav;
143 | _productsList[_productsList.indexOf(product)] = product;
144 | Log.loga(title, "setFavourite:: >>>>> ${product.toJson()}");
145 |
146 | if (fav) {
147 | _favouriteList.add(product);
148 | // _favCount++;
149 | } else {
150 | _favouriteList.remove(product);
151 | // _favCount--;
152 | }
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/lib/data/bindings/user_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_getx_example/controllers/app_controller.dart';
2 | import 'package:flutter_getx_example/data/common/params_args.dart';
3 | import 'package:get/get.dart';
4 |
5 | class UsersBinding extends Bindings {
6 | @override
7 | void dependencies() {
8 | Get.lazyPut(() => AppController(), tag: ParamsArgus.APP, fenix: true);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/lib/data/common/constants.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:get/get.dart';
4 |
5 | Constants constants = Constants();
6 |
7 | final title = "Constants";
8 |
9 | class Constants {
10 | static final Constants _constants = Constants._i();
11 |
12 | factory Constants() {
13 | return _constants;
14 | }
15 |
16 | Constants._i();
17 |
18 | bool isKeyboardOpened() {
19 | return MediaQuery.of(Get.context!).viewInsets.bottom != 0;
20 | }
21 |
22 | void hideKeyboard(BuildContext context) {
23 | FocusScope.of(context).requestFocus(new FocusNode());
24 | }
25 |
26 | void dismissKeyboard(BuildContext context) {
27 | FocusScopeNode currentFocus = FocusScope.of(context);
28 | if (!currentFocus.hasPrimaryFocus) {
29 | currentFocus.unfocus();
30 | }
31 | }
32 |
33 | void dismissSnakbar() {
34 | ScaffoldMessenger.of(Get.context!).hideCurrentSnackBar();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib/data/common/params_args.dart:
--------------------------------------------------------------------------------
1 | class ParamsArgus {
2 | static const String APP = "app";
3 | static const String KEY_CART_LIST = "cart_list";
4 | static const String KEY_CART_TOTAL = "cart_total";
5 | static const String KEY_CART_ITEMS = "cart_items";
6 | }
7 |
--------------------------------------------------------------------------------
/lib/init_app.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter/services.dart';
5 | import 'data/bindings/user_binding.dart';
6 | import 'utils/my_application.dart';
7 |
8 | Future initApp() async {
9 | final WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized();
10 |
11 | if (Platform.isAndroid) {
12 | binding.renderView.automaticSystemUiAdjustment = false;
13 | }
14 |
15 | await SystemChrome.setPreferredOrientations(
16 | [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
17 |
18 | UsersBinding().dependencies();
19 |
20 | MyApplication myApplication = MyApplication();
21 | }
22 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 | import 'package:get/get.dart';
4 |
5 | import 'init_app.dart';
6 | import 'res/strings.dart';
7 | import 'src/home_page.dart';
8 | import 'utils/theme_util.dart';
9 |
10 | void main() async {
11 | await initApp();
12 | runApp(MyApp());
13 | }
14 |
15 | class MyApp extends StatelessWidget {
16 | @override
17 | Widget build(BuildContext context) {
18 | return ScreenUtilInit(
19 | designSize: Size(1080, 1920),
20 | builder: () {
21 | return GetMaterialApp(
22 | debugShowCheckedModeBanner: false,
23 | title: strings.app_name,
24 | theme: appTheme,
25 | defaultTransition: Transition.cupertino,
26 | home: HomePage(),
27 | );
28 | },
29 | );
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lib/models/product_model.dart:
--------------------------------------------------------------------------------
1 | // final productModel = productModelFromJson(jsonString);
2 |
3 | import 'dart:convert';
4 |
5 | import 'package:flutter/services.dart';
6 | import 'package:flutter_getx_example/models/rating_model.dart';
7 |
8 | class ProductModel {
9 | ProductModel({
10 | this.id,
11 | this.title,
12 | this.price,
13 | this.description,
14 | this.category,
15 | this.image,
16 | this.rating,
17 | this.qty = 0,
18 | this.isFav = false,
19 | });
20 |
21 | int? id;
22 | String? title;
23 | double? price;
24 | String? description;
25 | String? category;
26 | String? image;
27 | RatingModel? rating;
28 | int qty;
29 | bool isFav;
30 |
31 | factory ProductModel.fromRawJson(String str) =>
32 | ProductModel.fromJson(json.decode(str));
33 |
34 | String toRawJson() => json.encode(toJson());
35 |
36 | factory ProductModel.fromJson(Map json) => ProductModel(
37 | id: json["id"] == null ? null : json["id"],
38 | title: json["title"] == null ? null : json["title"],
39 | price: json["price"] == null ? null : json["price"].toDouble(),
40 | description: json["description"] == null ? null : json["description"],
41 | category: json["category"] == null ? null : json["category"],
42 | image: json["image"] == null ? null : json["image"],
43 | qty: json["qty"] == null ? 0 : json["qty"],
44 | isFav: json["isFav"] == null ? false : json["isFav"],
45 | rating: json["rating"] == null
46 | ? null
47 | : RatingModel.fromJson(json["rating"]),
48 | );
49 |
50 | Map toJson() => {
51 | "id": id == null ? null : id,
52 | "title": title == null ? null : title,
53 | "price": price == null ? null : price,
54 | "description": description == null ? null : description,
55 | "category": category == null ? null : category,
56 | "image": image == null ? null : image,
57 | "qty": qty == null ? 0 : qty,
58 | "rating": rating == null ? null : rating!.toJson(),
59 | "isFav": isFav == null ? null : isFav,
60 | };
61 |
62 | static Future> getProducts() async {
63 | final String response = await rootBundle.loadString('assets/products.json');
64 | final jsonStr = await json.decode(response);
65 | return List.from(
66 | jsonStr.map((x) => ProductModel.fromJson(x)));
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/lib/models/rating_model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | class RatingModel {
4 | RatingModel({
5 | this.rate = 0,
6 | this.count = 0,
7 | });
8 |
9 | double rate;
10 | int count;
11 |
12 | factory RatingModel.fromRawJson(String str) =>
13 | RatingModel.fromJson(json.decode(str));
14 |
15 | String toRawJson() => json.encode(toJson());
16 |
17 | factory RatingModel.fromJson(Map json) => RatingModel(
18 | rate: json["rate"] == null ? null : json["rate"].toDouble(),
19 | count: json["count"] == null ? null : json["count"],
20 | );
21 |
22 | Map toJson() => {
23 | "rate": rate == null ? null : rate,
24 | "count": count == null ? null : count,
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/lib/res/app_color.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | AppColor appColor = AppColor();
6 |
7 | class AppColor {
8 | static final AppColor _appColor = AppColor._i();
9 |
10 | factory AppColor() {
11 | return _appColor;
12 | }
13 |
14 | AppColor._i();
15 |
16 | final Color main = Color(0xFF7868E6);
17 | final Color primaryColor = Color(0xFF7868E6);
18 | final Color primaryDarkColor = Color(0xFF7868E6);
19 | final Color primaryLightColor = Color(0xFF7868E6);
20 | final Color primaryLight = Color(0xFF7868E6);
21 | final Color accentColor = Color(0xff39446F);
22 |
23 | final Color bgColor = Color(0xFFF4F4FD);
24 |
25 | final Color white = Colors.white;
26 | final Color black = Colors.black;
27 | final Color transparent = Colors.transparent;
28 |
29 | final Color grey = Color(0xff898989);
30 | final Color greyDark = Color(0xFF424242);
31 | final Color greyLight = Color(0xff898989);
32 |
33 | final Color notWhite = Color(0xFFEDF0F2);
34 | final Color notWhite2 = Color(0xFFF6F6F6);
35 | final Color nearlyWhite = Color(0xFFFEFEFE);
36 |
37 | Color hexToColor(String code) {
38 | return new Color(int.parse(code.substring(1, 7), radix: 16) + 0xFF000000);
39 | }
40 |
41 | Color generateRandomColor() {
42 | return Colors.primaries[Random().nextInt(Colors.primaries.length)];
43 |
44 | Random random = new Random();
45 | return Color.fromARGB(
46 | 255, random.nextInt(255), random.nextInt(255), random.nextInt(255));
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/res/images.dart:
--------------------------------------------------------------------------------
1 | Images images = Images();
2 |
3 | class Images {
4 | static final Images _images = Images._i();
5 |
6 | factory Images() {
7 | return _images;
8 | }
9 |
10 | Images._i();
11 |
12 | static const String _iconDir = "assets/icons";
13 |
14 | final String ic_empty_cart = "$_iconDir/ic_empty_cart.png";
15 | }
16 |
--------------------------------------------------------------------------------
/lib/res/strings.dart:
--------------------------------------------------------------------------------
1 | Strings strings = Strings();
2 |
3 | final title = "Strings";
4 |
5 | class Strings {
6 | static final Strings _strings = Strings._i();
7 |
8 | factory Strings() {
9 | return _strings;
10 | }
11 |
12 | Strings._i();
13 |
14 | final String app_name = 'Flutter GetX Example';
15 | final String welcome = 'Welcome';
16 | final String total = 'Total';
17 | final String checkout = 'CHECKOUT';
18 | final String continue_ = 'CONTINUE';
19 | final String my_cart = 'My Cart';
20 | final String wishlist = 'Wishlist';
21 | }
22 |
--------------------------------------------------------------------------------
/lib/src/favourite_products.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_getx_example/res/images.dart';
3 | import 'package:flutter_getx_example/res/strings.dart';
4 | import 'package:flutter_getx_example/utils/my_application.dart';
5 | import 'package:flutter_getx_example/widgets/custom_appbar.dart';
6 | import 'package:flutter_screenutil/flutter_screenutil.dart';
7 | import 'package:get/get.dart';
8 |
9 | import 'widgets/item_product.dart';
10 |
11 | class FavouriteProducts extends StatefulWidget {
12 | @override
13 | _FavouriteProductsState createState() => _FavouriteProductsState();
14 | }
15 |
16 | class _FavouriteProductsState extends State {
17 | @override
18 | Widget build(BuildContext context) {
19 | return Scaffold(
20 | appBar: CustomAppBar(title: strings.wishlist),
21 | body: _buildBody(),
22 | );
23 | }
24 |
25 | Widget _buildBody() {
26 | return Obx(() {
27 | if (MyApplication.appController.favouriteList.isEmpty) {
28 | return Center(
29 | child: Image.asset(images.ic_empty_cart, height: 200),
30 | );
31 | }
32 |
33 | return ListView.builder(
34 | shrinkWrap: true,
35 | padding: EdgeInsets.symmetric(vertical: 20.w),
36 | itemCount: MyApplication.appController.favouriteList.length,
37 | itemBuilder: (context, index) {
38 | final data = MyApplication.appController.favouriteList[index];
39 | return ItemProduct(data: data, fromFav: true);
40 | },
41 | );
42 | });
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/lib/src/home_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:badges/badges.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_getx_example/controllers/app_controller.dart';
4 | import 'package:flutter_getx_example/data/common/params_args.dart';
5 | import 'package:flutter_getx_example/models/product_model.dart';
6 | import 'package:flutter_getx_example/res/app_color.dart';
7 | import 'package:flutter_getx_example/res/strings.dart';
8 | import 'package:flutter_getx_example/src/my_cart.dart';
9 | import 'package:flutter_getx_example/utils/log_util.dart';
10 | import 'package:flutter_getx_example/utils/my_application.dart';
11 | import 'package:flutter_getx_example/utils/widget_util.dart';
12 | import 'package:flutter_getx_example/widgets/custom_appbar.dart';
13 | import 'package:flutter_screenutil/flutter_screenutil.dart';
14 | import 'package:get/get.dart';
15 |
16 | import 'favourite_products.dart';
17 | import 'widgets/item_product.dart';
18 |
19 | final title = "HomePage";
20 |
21 | class HomePage extends StatefulWidget {
22 | @override
23 | _HomePageState createState() => _HomePageState();
24 | }
25 |
26 | class _HomePageState extends State {
27 | @override
28 | Widget build(BuildContext context) {
29 | return Scaffold(
30 | appBar: _buildAppBar(),
31 | body: _buildBody(),
32 | );
33 | }
34 |
35 | _buildAppBar() {
36 | return CustomAppBar(
37 | showLeadingArrow: false,
38 | centerTitle: false,
39 | showTitleSpacing: true,
40 | title: strings.welcome,
41 | actionsWidget: [
42 | Obx(() {
43 | return Badge(
44 | position: BadgePosition.topEnd(top: 10.w, end: 10.w),
45 | animationType: BadgeAnimationType.scale,
46 | animationDuration: Duration(milliseconds: 300),
47 | badgeColor: Colors.white,
48 | showBadge: MyApplication.appController.favouriteList.length > 0,
49 | badgeContent: Text(
50 | "${MyApplication.appController.favouriteList.length}",
51 | style: TextStyle(
52 | fontSize: 32.sp,
53 | color: appColor.main,
54 | fontWeight: FontWeight.w700)),
55 | child: IconButton(
56 | icon: Icon(Icons.favorite_border_rounded),
57 | onPressed: () {
58 | Get.to(FavouriteProducts());
59 | },
60 | ),
61 | );
62 | }),
63 | Obx(() {
64 | return Badge(
65 | position: BadgePosition.topEnd(top: 3, end: 3),
66 | animationType: BadgeAnimationType.scale,
67 | animationDuration: Duration(milliseconds: 300),
68 | badgeColor: Colors.white,
69 | badgeContent: Text("${MyApplication.appController.cartList.length}",
70 | style: TextStyle(
71 | fontSize: 32.sp,
72 | color: appColor.main,
73 | fontWeight: FontWeight.w700)),
74 | child: IconButton(
75 | icon: Icon(Icons.shopping_cart_rounded),
76 | onPressed: () {
77 | Get.to(MyCart());
78 | },
79 | ),
80 | );
81 | }),
82 | WidgetUtil.spaceHorizontal(20),
83 | ],
84 | );
85 | }
86 |
87 | Widget _buildBody() {
88 | return Obx(() {
89 | return Column(
90 | children: [
91 | Expanded(
92 | child: ListView.builder(
93 | shrinkWrap: true,
94 | padding: EdgeInsets.symmetric(vertical: 20.w),
95 | itemCount: MyApplication.appController.productsList.length,
96 | itemBuilder: (context, index) {
97 | final data = MyApplication.appController.productsList[index];
98 | return ItemProduct(
99 | data: data,
100 | onQtyAdd: () {
101 | MyApplication.appController.updateQty(product: data);
102 | },
103 | onQtyMin: () {
104 | if (data.qty > 0) {
105 | MyApplication.appController
106 | .updateQty(product: data, isAdd: false);
107 | }
108 | },
109 | );
110 | },
111 | ),
112 | ),
113 | if (MyApplication.appController.cartList.isNotEmpty)
114 | _buildCartTotal(),
115 | ],
116 | );
117 | });
118 | }
119 |
120 | Widget _buildCartTotal() {
121 | return Container(
122 | decoration: BoxDecoration(
123 | borderRadius: BorderRadius.only(
124 | topRight: Radius.circular(30), topLeft: Radius.circular(30)),
125 | color: appColor.main.withOpacity(0.8),
126 | boxShadow: [
127 | BoxShadow(
128 | color: appColor.main.withOpacity(0.5),
129 | spreadRadius: 10,
130 | blurRadius: 10,
131 | offset: Offset(0, 7),
132 | )
133 | ],
134 | ),
135 | padding: EdgeInsets.symmetric(vertical: 40.w, horizontal: 70.w),
136 | child: Column(
137 | children: [
138 | WidgetUtil.spaceVertical(10),
139 | Row(
140 | children: [
141 | Expanded(
142 | child: Text(strings.total,
143 | style: TextStyle(
144 | color: appColor.white,
145 | fontWeight: FontWeight.w600,
146 | fontSize: 50.sp)),
147 | ),
148 | Text(
149 | "\$${MyApplication.appController.cartDetailsMap[ParamsArgus.KEY_CART_TOTAL]}",
150 | style: TextStyle(
151 | color: appColor.white,
152 | fontWeight: FontWeight.w700,
153 | fontSize: 50.sp)),
154 | ],
155 | ),
156 | WidgetUtil.spaceVertical(40),
157 | ElevatedButton.icon(
158 | onPressed: () {
159 | Get.to(MyCart());
160 | },
161 | style: ElevatedButton.styleFrom(
162 | primary: Colors.white,
163 | padding:
164 | EdgeInsets.symmetric(horizontal: 100.w, vertical: 25.w)),
165 | icon: Icon(Icons.shopping_cart_rounded, color: appColor.main),
166 | label: Text(strings.continue_,
167 | style: TextStyle(
168 | color: appColor.main,
169 | fontWeight: FontWeight.w600,
170 | fontSize: 40.sp)),
171 | ),
172 | ],
173 | ),
174 | );
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/lib/src/my_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_getx_example/data/common/params_args.dart';
3 | import 'package:flutter_getx_example/res/app_color.dart';
4 | import 'package:flutter_getx_example/res/images.dart';
5 | import 'package:flutter_getx_example/res/strings.dart';
6 | import 'package:flutter_getx_example/utils/my_application.dart';
7 | import 'package:flutter_getx_example/utils/widget_util.dart';
8 | import 'package:flutter_getx_example/widgets/custom_appbar.dart';
9 | import 'package:flutter_screenutil/flutter_screenutil.dart';
10 | import 'package:get/get.dart';
11 |
12 | import 'widgets/item_my_cart.dart';
13 |
14 | class MyCart extends StatefulWidget {
15 | @override
16 | _MyCartState createState() => _MyCartState();
17 | }
18 |
19 | class _MyCartState extends State {
20 | @override
21 | Widget build(BuildContext context) {
22 | return Scaffold(
23 | appBar: CustomAppBar(title: strings.my_cart),
24 | body: _buildBody(),
25 | );
26 | }
27 |
28 | Widget _buildBody() {
29 | return Obx(() {
30 | if (MyApplication.appController.cartList.isEmpty) {
31 | return Center(
32 | child: Image.asset(images.ic_empty_cart, height: 200),
33 | );
34 | }
35 |
36 | return Column(
37 | children: [
38 | Expanded(
39 | child: ListView.builder(
40 | shrinkWrap: true,
41 | padding: EdgeInsets.symmetric(vertical: 20.w),
42 | itemCount: MyApplication.appController.cartList.length,
43 | itemBuilder: (context, index) {
44 | final data = MyApplication.appController.cartList[index];
45 | return ItemMyCart(
46 | data: data,
47 | onQtyAdd: () {
48 | MyApplication.appController.updateQty(product: data);
49 | },
50 | onQtyMin: () {
51 | if (data.qty > 0) {
52 | MyApplication.appController
53 | .updateQty(product: data, isAdd: false);
54 | }
55 | },
56 | );
57 | },
58 | ),
59 | ),
60 | if (MyApplication.appController.cartList.isNotEmpty)
61 | _buildCartTotal(),
62 | ],
63 | );
64 | });
65 | }
66 |
67 | Widget _buildCartTotal() {
68 | return Container(
69 | decoration: BoxDecoration(
70 | borderRadius: BorderRadius.only(
71 | topRight: Radius.circular(30), topLeft: Radius.circular(30)),
72 | color: appColor.main.withOpacity(0.8),
73 | boxShadow: [
74 | BoxShadow(
75 | color: appColor.main.withOpacity(0.5),
76 | spreadRadius: 10,
77 | blurRadius: 10,
78 | offset: Offset(0, 7),
79 | )
80 | ],
81 | ),
82 | padding: EdgeInsets.symmetric(vertical: 40.w, horizontal: 70.w),
83 | child: Column(
84 | children: [
85 | WidgetUtil.spaceVertical(10),
86 | Row(
87 | children: [
88 | Expanded(
89 | child: Text(strings.total,
90 | style: TextStyle(
91 | color: appColor.white,
92 | fontWeight: FontWeight.w600,
93 | fontSize: 50.sp)),
94 | ),
95 | Text(
96 | "\$${MyApplication.appController.cartDetailsMap[ParamsArgus.KEY_CART_TOTAL]}",
97 | style: TextStyle(
98 | color: appColor.white,
99 | fontWeight: FontWeight.w700,
100 | fontSize: 50.sp)),
101 | ],
102 | ),
103 | WidgetUtil.spaceVertical(40),
104 | ElevatedButton.icon(
105 | onPressed: () {},
106 | style: ElevatedButton.styleFrom(
107 | primary: Colors.white,
108 | padding:
109 | EdgeInsets.symmetric(horizontal: 100.w, vertical: 25.w)),
110 | icon: Icon(Icons.shopping_cart_rounded, color: appColor.main),
111 | label: Text(strings.checkout,
112 | style: TextStyle(
113 | color: appColor.main,
114 | fontWeight: FontWeight.w600,
115 | fontSize: 40.sp)),
116 | ),
117 | ],
118 | ),
119 | );
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/lib/src/widgets/item_my_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:extended_image/extended_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_getx_example/models/product_model.dart';
4 | import 'package:flutter_getx_example/res/app_color.dart';
5 | import 'package:flutter_getx_example/utils/my_application.dart';
6 | import 'package:flutter_getx_example/utils/widget_util.dart';
7 | import 'package:flutter_screenutil/flutter_screenutil.dart';
8 | import 'package:get/get.dart';
9 |
10 | class ItemMyCart extends StatelessWidget {
11 | final ProductModel data;
12 | final VoidCallback? onQtyAdd;
13 | final VoidCallback? onQtyMin;
14 |
15 | ItemMyCart({
16 | required this.data,
17 | this.onQtyAdd,
18 | this.onQtyMin,
19 | });
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | return Container(
24 | margin: EdgeInsets.symmetric(vertical: 20.w, horizontal: 60.w),
25 | child: Card(
26 | color: Colors.white,
27 | elevation: 7,
28 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
29 | child: Container(
30 | padding: EdgeInsets.symmetric(vertical: 30.w, horizontal: 30.w),
31 | child: Row(
32 | children: [
33 | ExtendedImage.network(
34 | data.image ?? "",
35 | width: 200.w,
36 | height: 200.w,
37 | cache: true,
38 | ),
39 | WidgetUtil.spaceHorizontal(30),
40 | Expanded(
41 | child: Column(
42 | crossAxisAlignment: CrossAxisAlignment.start,
43 | children: [
44 | Row(
45 | children: [
46 | Expanded(
47 | child: Text(data.title ?? "",
48 | maxLines: 2,
49 | overflow: TextOverflow.ellipsis,
50 | style: TextStyle(
51 | color: Colors.grey[700],
52 | fontSize: 38.sp,
53 | fontWeight: FontWeight.w600)),
54 | ),
55 | MaterialButton(
56 | onPressed: () {
57 | MyApplication.appController.deleteProductFromCart(product: data);
58 | },
59 | minWidth: 0,
60 | padding: EdgeInsets.all(10),
61 | materialTapTargetSize:
62 | MaterialTapTargetSize.shrinkWrap,
63 | shape: CircleBorder(),
64 | child: Icon(
65 | Icons.cancel_rounded,
66 | color: Colors.red,
67 | ),
68 | ),
69 | ],
70 | ),
71 | Row(
72 | children: [
73 | Container(
74 | decoration: BoxDecoration(
75 | color: appColor.main,
76 | borderRadius: BorderRadius.circular(5)),
77 | padding: EdgeInsets.symmetric(
78 | horizontal: 15.w, vertical: 10.w),
79 | child: Row(
80 | children: [
81 | Text("${data.rating!.rate}",
82 | style: TextStyle(
83 | color: Colors.white,
84 | fontSize: 30.sp,
85 | fontWeight: FontWeight.w400)),
86 | WidgetUtil.spaceHorizontal(5),
87 | Icon(Icons.star_rate_rounded,
88 | color: appColor.white, size: 30.w),
89 | ],
90 | ),
91 | ),
92 | WidgetUtil.spaceHorizontal(20),
93 | Text("(${data.rating!.count})",
94 | style: TextStyle(
95 | color: Colors.grey[600],
96 | fontSize: 30.sp,
97 | fontWeight: FontWeight.w400)),
98 | ],
99 | ),
100 | WidgetUtil.spaceVertical(20),
101 | Row(
102 | children: [
103 | Expanded(
104 | child: Text("\$${data.price}",
105 | style: TextStyle(
106 | color: Colors.black,
107 | fontSize: 48.sp,
108 | fontWeight: FontWeight.w700)),
109 | ),
110 | Row(
111 | children: [
112 | MaterialButton(
113 | onPressed: onQtyMin,
114 | shape: CircleBorder(),
115 | minWidth: 0,
116 | padding: EdgeInsets.all(5),
117 | materialTapTargetSize:
118 | MaterialTapTargetSize.shrinkWrap,
119 | child: Icon(
120 | Icons.indeterminate_check_box_rounded,
121 | size: 75.w,
122 | color: appColor.main)),
123 | Container(
124 | constraints: BoxConstraints(minWidth: 50.w),
125 | child: Text("${data.qty}",
126 | textAlign: TextAlign.center,
127 | style: TextStyle(
128 | fontSize: 42.sp,
129 | color: appColor.main,
130 | fontWeight: FontWeight.w500)),
131 | ),
132 | MaterialButton(
133 | onPressed: onQtyAdd,
134 | shape: CircleBorder(),
135 | minWidth: 0,
136 | padding: EdgeInsets.all(5),
137 | materialTapTargetSize:
138 | MaterialTapTargetSize.shrinkWrap,
139 | child: Icon(Icons.add_box_rounded,
140 | size: 75.w, color: appColor.main)),
141 | ],
142 | ),
143 | ],
144 | ),
145 | ],
146 | ),
147 | ),
148 | ],
149 | ),
150 | ),
151 | ),
152 | );
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/lib/src/widgets/item_product.dart:
--------------------------------------------------------------------------------
1 | import 'package:extended_image/extended_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_getx_example/models/product_model.dart';
4 | import 'package:flutter_getx_example/res/app_color.dart';
5 | import 'package:flutter_getx_example/utils/my_application.dart';
6 | import 'package:flutter_getx_example/utils/widget_util.dart';
7 | import 'package:flutter_screenutil/flutter_screenutil.dart';
8 | import 'package:get/get.dart';
9 |
10 | class ItemProduct extends StatelessWidget {
11 | final ProductModel data;
12 | final bool fromFav;
13 | final VoidCallback? onQtyAdd;
14 | final VoidCallback? onQtyMin;
15 |
16 | ItemProduct({
17 | required this.data,
18 | this.onQtyAdd,
19 | this.onQtyMin,
20 | this.fromFav = false,
21 | });
22 |
23 | @override
24 | Widget build(BuildContext context) {
25 | return Container(
26 | margin: EdgeInsets.symmetric(vertical: 20.w, horizontal: 60.w),
27 | child: Card(
28 | color: Colors.white,
29 | elevation: 7,
30 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
31 | child: Container(
32 | padding: EdgeInsets.symmetric(vertical: 30.w, horizontal: 30.w),
33 | child: Row(
34 | children: [
35 | ExtendedImage.network(
36 | data.image ?? "",
37 | width: 200.w,
38 | height: 200.w,
39 | cache: true,
40 | ),
41 | WidgetUtil.spaceHorizontal(30),
42 | Expanded(
43 | child: Column(
44 | crossAxisAlignment: CrossAxisAlignment.start,
45 | children: [
46 | Row(
47 | children: [
48 | Expanded(
49 | child: Text(data.title ?? "",
50 | maxLines: 2,
51 | overflow: TextOverflow.ellipsis,
52 | style: TextStyle(
53 | color: Colors.grey[700],
54 | fontSize: 38.sp,
55 | fontWeight: FontWeight.w600)),
56 | ),
57 | MaterialButton(
58 | onPressed: () {
59 | MyApplication.appController
60 | .setFavourite(product: data, fav: !data.isFav);
61 | },
62 | minWidth: 0,
63 | padding: EdgeInsets.all(10),
64 | materialTapTargetSize:
65 | MaterialTapTargetSize.shrinkWrap,
66 | shape: CircleBorder(),
67 | child: Icon(
68 | Icons.favorite_rounded,
69 | color: data.isFav ? Colors.pink : Colors.grey[400],
70 | ),
71 | ),
72 | ],
73 | ),
74 | Row(
75 | children: [
76 | Container(
77 | decoration: BoxDecoration(
78 | color: appColor.main,
79 | borderRadius: BorderRadius.circular(5)),
80 | padding: EdgeInsets.symmetric(
81 | horizontal: 15.w, vertical: 10.w),
82 | child: Row(
83 | children: [
84 | Text("${data.rating!.rate}",
85 | style: TextStyle(
86 | color: Colors.white,
87 | fontSize: 30.sp,
88 | fontWeight: FontWeight.w400)),
89 | WidgetUtil.spaceHorizontal(5),
90 | Icon(Icons.star_rate_rounded,
91 | color: appColor.white, size: 30.w),
92 | ],
93 | ),
94 | ),
95 | WidgetUtil.spaceHorizontal(20),
96 | Text("(${data.rating!.count})",
97 | style: TextStyle(
98 | color: Colors.grey[600],
99 | fontSize: 30.sp,
100 | fontWeight: FontWeight.w400)),
101 | ],
102 | ),
103 | WidgetUtil.spaceVertical(20),
104 | Row(
105 | children: [
106 | Expanded(
107 | child: Text("\$${data.price}",
108 | style: TextStyle(
109 | color: Colors.black,
110 | fontSize: 48.sp,
111 | fontWeight: FontWeight.w700)),
112 | ),
113 | if (!fromFav)
114 | Row(
115 | children: [
116 | MaterialButton(
117 | onPressed: onQtyMin,
118 | shape: CircleBorder(),
119 | minWidth: 0,
120 | padding: EdgeInsets.all(5),
121 | materialTapTargetSize:
122 | MaterialTapTargetSize.shrinkWrap,
123 | child: Icon(
124 | Icons.indeterminate_check_box_rounded,
125 | size: 75.w,
126 | color: appColor.main)),
127 | Container(
128 | constraints: BoxConstraints(minWidth: 50.w),
129 | child: Text("${data.qty}",
130 | textAlign: TextAlign.center,
131 | style: TextStyle(
132 | fontSize: 42.sp,
133 | color: appColor.main,
134 | fontWeight: FontWeight.w500)),
135 | ),
136 | MaterialButton(
137 | onPressed: onQtyAdd,
138 | shape: CircleBorder(),
139 | minWidth: 0,
140 | padding: EdgeInsets.all(5),
141 | materialTapTargetSize:
142 | MaterialTapTargetSize.shrinkWrap,
143 | child: Icon(Icons.add_box_rounded,
144 | size: 75.w, color: appColor.main)),
145 | ],
146 | ),
147 | ],
148 | ),
149 | ],
150 | ),
151 | ),
152 | ],
153 | ),
154 | ),
155 | ),
156 | );
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/lib/utils/log_util.dart:
--------------------------------------------------------------------------------
1 | import 'dart:collection';
2 | import 'dart:convert';
3 |
4 | class Log {
5 | static void logs(String title, String msg) {
6 | print('TAG:: $title :: $msg');
7 | }
8 |
9 | static void loga(String title, var msg) {
10 | //print('TAG:: $title :: $msg');
11 | // OR
12 | final pattern = new RegExp('.{1,800}'); // 800 is the size of each chunk
13 | pattern
14 | .allMatches(msg)
15 | .forEach((match) => print('TAG:: $title :: ' + match.group(0)!));
16 | }
17 |
18 | static void logi(String title, int msg) {
19 | print('TAG:: $title :: $msg');
20 | }
21 |
22 | static printWrapped(String text) {
23 | final pattern = new RegExp('.{1,800}'); // 800 is the size of each chunk
24 | pattern.allMatches(text).forEach((match) => print(match.group(0)));
25 | }
26 |
27 | static String printPrettyMap(Map mapData) {
28 | JsonEncoder encoder = JsonEncoder.withIndent(' ');
29 |
30 | // display map in alphabetic order
31 | final sortedData = new SplayTreeMap.from(
32 | mapData, (a, b) => a.compareTo(b));
33 | String prettyPrint = encoder.convert(sortedData);
34 |
35 | return prettyPrint;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/utils/my_application.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_getx_example/controllers/app_controller.dart';
3 | import 'package:flutter_getx_example/data/common/params_args.dart';
4 | import 'package:get/get.dart';
5 |
6 | class MyApplication {
7 | static GlobalKey? _navigatorKey;
8 | static AppController _appController = Get.find(tag: ParamsArgus.APP);
9 |
10 | MyApplication() {
11 | if (navigatorKey != null) {
12 | _navigatorKey = navigatorKey;
13 | } else {
14 | _navigatorKey = GlobalKey();
15 | }
16 | if (_appController == null) {
17 | _appController = Get.find(tag: ParamsArgus.APP);
18 | }
19 | }
20 |
21 | static GlobalKey? get navigatorKey {
22 | return _navigatorKey;
23 | }
24 |
25 | static AppController get appController {
26 | return _appController;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/utils/sliver_grid_delegate_with_fixed_cross_axis_count_and_fixed_height.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/rendering.dart';
3 |
4 | class SliverGridDelegateWithFixedCrossAxisCountAndFixedHeight
5 | extends SliverGridDelegate {
6 | /// Creates a delegate that makes grid layouts with a fixed number of tiles in
7 | /// the cross axis.
8 | ///
9 | /// All of the arguments must not be null. The `mainAxisSpacing` and
10 | /// `crossAxisSpacing` arguments must not be negative. The `crossAxisCount`
11 | /// and `childAspectRatio` arguments must be greater than zero.
12 | const SliverGridDelegateWithFixedCrossAxisCountAndFixedHeight({
13 | required this.crossAxisCount,
14 | this.mainAxisSpacing = 0.0,
15 | this.crossAxisSpacing = 0.0,
16 | this.height = 56.0,
17 | }) : assert(crossAxisCount != null && crossAxisCount > 0),
18 | assert(mainAxisSpacing != null && mainAxisSpacing >= 0),
19 | assert(crossAxisSpacing != null && crossAxisSpacing >= 0),
20 | assert(height != null && height > 0);
21 |
22 | /// The number of children in the cross axis.
23 | final int crossAxisCount;
24 |
25 | /// The number of logical pixels between each child along the main axis.
26 | final double mainAxisSpacing;
27 |
28 | /// The number of logical pixels between each child along the cross axis.
29 | final double crossAxisSpacing;
30 |
31 | /// The height of the crossAxis.
32 | final double height;
33 |
34 | bool _debugAssertIsValid() {
35 | assert(crossAxisCount > 0);
36 | assert(mainAxisSpacing >= 0.0);
37 | assert(crossAxisSpacing >= 0.0);
38 | assert(height > 0.0);
39 | return true;
40 | }
41 |
42 | @override
43 | SliverGridLayout getLayout(SliverConstraints constraints) {
44 | assert(_debugAssertIsValid());
45 | final double usableCrossAxisExtent =
46 | constraints.crossAxisExtent - crossAxisSpacing * (crossAxisCount - 1);
47 | final double childCrossAxisExtent = usableCrossAxisExtent / crossAxisCount;
48 | final double childMainAxisExtent = height;
49 | return SliverGridRegularTileLayout(
50 | crossAxisCount: crossAxisCount,
51 | mainAxisStride: childMainAxisExtent + mainAxisSpacing,
52 | crossAxisStride: childCrossAxisExtent + crossAxisSpacing,
53 | childMainAxisExtent: childMainAxisExtent,
54 | childCrossAxisExtent: childCrossAxisExtent,
55 | reverseCrossAxis: axisDirectionIsReversed(constraints.crossAxisDirection),
56 | );
57 | }
58 |
59 | @override
60 | bool shouldRelayout(
61 | SliverGridDelegateWithFixedCrossAxisCountAndFixedHeight oldDelegate) {
62 | return oldDelegate.crossAxisCount != crossAxisCount ||
63 | oldDelegate.mainAxisSpacing != mainAxisSpacing ||
64 | oldDelegate.crossAxisSpacing != crossAxisSpacing ||
65 | oldDelegate.height != height;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/utils/theme_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_getx_example/res/app_color.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 |
5 | TextStyle titleStyle = TextStyle(
6 | color: Colors.black, fontSize: 48.sp, fontWeight: FontWeight.w600);
7 |
8 | ThemeData appTheme = ThemeData(
9 | backgroundColor: appColor.bgColor,
10 | scaffoldBackgroundColor: appColor.bgColor,
11 | appBarTheme: AppBarTheme(
12 | color: appColor.main, iconTheme: IconThemeData(color: appColor.white)),
13 | primaryTextTheme: TextTheme(bodyText2: TextStyle(color: appColor.white)),
14 | textTheme: TextTheme(bodyText2: TextStyle(color: appColor.black)),
15 | primaryColor: appColor.primaryColor,
16 | primaryColorDark: appColor.primaryDarkColor,
17 | primaryColorLight: appColor.primaryLight,
18 | brightness: Brightness.dark,
19 | visualDensity: VisualDensity.adaptivePlatformDensity,
20 | buttonTheme: ButtonThemeData(buttonColor: appColor.black),
21 | );
22 |
--------------------------------------------------------------------------------
/lib/utils/widget_util.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 |
4 | class WidgetUtil {
5 | static WidgetUtil? _instance;
6 |
7 | WidgetUtil._() {}
8 |
9 | factory WidgetUtil() {
10 | if (_instance == null) {
11 | _instance = new WidgetUtil._();
12 | }
13 | // since you are sure you will return non-null value, add '!' operator
14 | return _instance!;
15 | }
16 |
17 | static int rotateH() {
18 | return 1;
19 | }
20 |
21 | static Widget spaceHorizontal(double width) {
22 | return SizedBox(width: width.w);
23 | }
24 |
25 | static Widget spaceHorizontal2(double width) {
26 | return SizedBox(width: width);
27 | }
28 |
29 | static Widget spaceVertical(double height) {
30 | return SizedBox(height: height.h);
31 | }
32 |
33 | static Widget spaceVertical2(double height) {
34 | return SizedBox(height: height);
35 | }
36 |
37 | static Widget horizontalLine1() {
38 | return Container(color: Colors.black.withOpacity(0.2), height: 0.5);
39 | }
40 |
41 | static Widget verticalLine1() {
42 | return Container(color: Colors.black.withOpacity(0.2), width: 0.5);
43 | }
44 |
45 | static Widget verticalGreyLine1() {
46 | return Container(color: Colors.grey, width: 0.5);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/widgets/custom_appbar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_getx_example/res/app_color.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 |
5 | class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
6 | final String title;
7 | final bool showBackArrow;
8 | final bool showLeadingArrow;
9 | final bool showTitleSpacing;
10 | final bool centerTitle;
11 | final double elevation;
12 | final Color? backgroundColor;
13 | final Color? backIconColor;
14 | final Widget? leading;
15 | final List? actionsWidget;
16 | final TextStyle? titleStyle;
17 |
18 | @override
19 | Size get preferredSize => AppBar()
20 | .preferredSize; // Size.fromHeight(kToolbarHeight); // Size.fromHeight(34);
21 |
22 | const CustomAppBar({
23 | Key? key,
24 | this.title = "",
25 | this.showBackArrow = false,
26 | this.showLeadingArrow = true,
27 | this.showTitleSpacing = false,
28 | this.centerTitle = false,
29 | this.elevation = 0,
30 | this.leading,
31 | this.backgroundColor,
32 | this.actionsWidget,
33 | this.titleStyle,
34 | this.backIconColor,
35 | }) : super(key: key);
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return AppBar(
40 | automaticallyImplyLeading: showBackArrow,
41 | //iconTheme: IconThemeData(color: Colors.black),
42 | backgroundColor: backgroundColor ?? appColor.main,
43 | elevation: elevation,
44 | centerTitle: centerTitle,
45 | title: Text(title,
46 | style: titleStyle ??
47 | TextStyle(
48 | color: Colors.white,
49 | fontWeight: FontWeight.w600,
50 | fontSize: 48.sp)),
51 | titleSpacing: showTitleSpacing ? 20 : 5,
52 | leading: showLeadingArrow
53 | ? IconButton(
54 | icon: Icon(Icons.arrow_back),
55 | onPressed: () {
56 | Navigator.pop(context);
57 | },
58 | )
59 | : leading,
60 | actions: actionsWidget,
61 | );
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_getx_example
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.12.0 <3.0.0"
22 |
23 | # Dependencies specify other packages that your package needs in order to work.
24 | # To automatically upgrade your package dependencies to the latest versions
25 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
26 | # dependencies can be manually updated by changing the version numbers below to
27 | # the latest version available on pub.dev. To see which dependencies have newer
28 | # versions available, run `flutter pub outdated`.
29 | dependencies:
30 | flutter:
31 | sdk: flutter
32 |
33 |
34 | # The following adds the Cupertino Icons font to your application.
35 | # Use with the CupertinoIcons class for iOS style icons.
36 | cupertino_icons: ^1.0.2
37 | get: ^4.6.1
38 | flutter_screenutil: ^5.2.0
39 | badges: ^2.0.2
40 | extended_image: ^5.1.0
41 |
42 | dev_dependencies:
43 | flutter_test:
44 | sdk: flutter
45 |
46 | # The "flutter_lints" package below contains a set of recommended lints to
47 | # encourage good coding practices. The lint set provided by the package is
48 | # activated in the `analysis_options.yaml` file located at the root of your
49 | # package. See that file for information about deactivating specific lint
50 | # rules and activating additional ones.
51 | flutter_lints: ^1.0.0
52 |
53 | # For information on the generic Dart part of this file, see the
54 | # following page: https://dart.dev/tools/pub/pubspec
55 |
56 | # The following section is specific to Flutter.
57 | flutter:
58 |
59 | # The following line ensures that the Material Icons font is
60 | # included with your application, so that you can use the icons in
61 | # the material Icons class.
62 | uses-material-design: true
63 |
64 | # To add assets to your application, add an assets section, like this:
65 | assets:
66 | - assets/
67 | - assets/icons/
68 |
69 | # - images/a_dot_burr.jpeg
70 | # - images/a_dot_ham.jpeg
71 |
72 | # An image asset can refer to one or more resolution-specific "variants", see
73 | # https://flutter.dev/assets-and-images/#resolution-aware.
74 |
75 | # For details regarding adding assets from package dependencies, see
76 | # https://flutter.dev/assets-and-images/#from-packages
77 |
78 | # To add custom fonts to your application, add a fonts section here,
79 | # in this "flutter" section. Each entry in this list should have a
80 | # "family" key with the font family name, and a "fonts" key with a
81 | # list giving the asset and other descriptors for the font. For
82 | # example:
83 | # fonts:
84 | # - family: Schyler
85 | # fonts:
86 | # - asset: fonts/Schyler-Regular.ttf
87 | # - asset: fonts/Schyler-Italic.ttf
88 | # style: italic
89 | # - family: Trajan Pro
90 | # fonts:
91 | # - asset: fonts/TrajanPro.ttf
92 | # - asset: fonts/TrajanPro_Bold.ttf
93 | # weight: 700
94 | #
95 | # For details regarding fonts from package dependencies,
96 | # see https://flutter.dev/custom-fonts/#from-packages
97 |
--------------------------------------------------------------------------------