├── .fvm ├── flutter_sdk └── fvm_config.json ├── network ├── .fvm │ ├── flutter_sdk │ └── fvm_config.json ├── analysis_options.yaml ├── lib │ ├── network.dart │ └── src │ │ ├── utils │ │ ├── exception_message.dart │ │ ├── failures.dart │ │ └── pretty_dio_logger.dart │ │ └── network │ │ ├── api_options.dart │ │ └── rest_client.dart ├── .metadata ├── README.md ├── .gitignore └── pubspec.yaml ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── 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-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ └── project.pbxproj ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist └── .gitignore ├── .gitattributes ├── lib ├── src │ ├── core │ │ ├── router │ │ │ ├── routers.dart │ │ │ └── router_config.dart │ │ ├── network │ │ │ ├── network.dart │ │ │ ├── request_handler.dart │ │ │ └── error_model.dart │ │ └── state │ │ │ └── base_state.dart │ └── feature │ │ ├── category │ │ ├── data │ │ │ ├── models │ │ │ │ └── category_model.dart │ │ │ ├── data_sources │ │ │ │ ├── category_data_source.dart │ │ │ │ └── category_data_source_imp.dart │ │ │ └── repositories │ │ │ │ └── category_repository_imp.dart │ │ ├── domain │ │ │ ├── repositories │ │ │ │ └── category_repository.dart │ │ │ └── use_cases │ │ │ │ └── category_use_case.dart │ │ └── presentation │ │ │ ├── provider │ │ │ └── category_list_provider.dart │ │ │ └── widgets │ │ │ └── category_loading_shimmer.dart │ │ ├── product │ │ ├── root │ │ │ ├── data │ │ │ │ ├── data_sources │ │ │ │ │ ├── product_data_source.dart │ │ │ │ │ └── product_data_source_imp.dart │ │ │ │ ├── repositories │ │ │ │ │ └── product_repository_imp.dart │ │ │ │ └── models │ │ │ │ │ └── product_model.dart │ │ │ └── domain │ │ │ │ └── repositories │ │ │ │ └── product_repository.dart │ │ ├── products │ │ │ ├── presentation │ │ │ │ ├── riverpod │ │ │ │ │ ├── providers.dart │ │ │ │ │ └── products_notifier.dart │ │ │ │ ├── widget │ │ │ │ │ ├── product_card.dart │ │ │ │ │ ├── product_list_builder.dart │ │ │ │ │ ├── category_builder.dart │ │ │ │ │ └── products_loading_shimmer.dart │ │ │ │ └── pages │ │ │ │ │ └── products_list_page.dart │ │ │ └── domain │ │ │ │ └── use_cases │ │ │ │ └── products_use_case.dart │ │ └── details │ │ │ ├── domain │ │ │ └── use_cases │ │ │ │ └── product_details_use_case.dart │ │ │ └── presentation │ │ │ ├── riverpod │ │ │ └── product_details_notifier.dart │ │ │ ├── pages │ │ │ └── product_details_page.dart │ │ │ └── widgets │ │ │ ├── product_details_loading_shimmer.dart │ │ │ └── product_details_builder.dart │ │ └── authentication │ │ └── login │ │ └── presentation │ │ └── view │ │ └── login_page.dart └── main.dart ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── 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 │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── momshaddinury │ │ │ │ │ └── fake_commerce │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle └── build.gradle ├── test └── widget_test.dart ├── .metadata ├── analysis_options.yaml ├── README.md ├── .gitignore └── pubspec.yaml /.fvm/flutter_sdk: -------------------------------------------------------------------------------- 1 | /Users/dinury/fvm/versions/3.10.5 -------------------------------------------------------------------------------- /network/.fvm/flutter_sdk: -------------------------------------------------------------------------------- 1 | /Users/dinury/fvm/versions/3.3.6 -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /.fvm/fvm_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "flutterSdkVersion": "3.10.5", 3 | "flavors": {} 4 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /network/.fvm/fvm_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "flutterSdkVersion": "3.3.6", 3 | "flavors": {} 4 | } -------------------------------------------------------------------------------- /lib/src/core/router/routers.dart: -------------------------------------------------------------------------------- 1 | enum Routes { 2 | productList, 3 | productDetails, 4 | login, 5 | } 6 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/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/momshaddinury/fake_commerce/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /network/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/momshaddinury/fake_commerce/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /network/lib/network.dart: -------------------------------------------------------------------------------- 1 | library network; 2 | 3 | export 'package:network/src/network/rest_client.dart'; 4 | export 'package:network/src/utils/failures.dart'; 5 | export 'package:network/src/utils/pretty_dio_logger.dart'; 6 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/momshaddinury/fake_commerce/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.momshaddinury.fake_commerce 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /network/lib/src/utils/exception_message.dart: -------------------------------------------------------------------------------- 1 | class ExceptionMessage { 2 | static const String defaultError = 3 | 'Something went wrong. Please, try again later.'; 4 | static const String couldNotConnectToServer = 'Couldn\'t connect to server'; 5 | } 6 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /lib/src/feature/category/data/models/category_model.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | List categoryModelFromJson(List item) => 4 | List.from(item.map((x) => x)); 5 | 6 | String categoryModelToJson(List data) => 7 | json.encode(List.from(data.map((x) => x))); 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/src/core/network/network.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | import 'package:network/network.dart'; 3 | 4 | final dioProvider = Provider( 5 | (ref) { 6 | return RestClient( 7 | baseUrl: 'https://fakestoreapi.com/', 8 | token: '', 9 | ); 10 | }, 11 | ); 12 | -------------------------------------------------------------------------------- /ios/Runner.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/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /network/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 6928314d505d2bb4777be05e45d7808a5aa91d2a 8 | channel: stable 9 | 10 | project_type: module 11 | -------------------------------------------------------------------------------- /network/README.md: -------------------------------------------------------------------------------- 1 | # network 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter development, view the online 8 | [documentation](https://flutter.dev/). 9 | 10 | For instructions integrating Flutter modules to your existing applications, 11 | see the [add-to-app documentation](https://flutter.dev/docs/development/add-to-app). 12 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 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 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/src/core/state/base_state.dart: -------------------------------------------------------------------------------- 1 | abstract class BaseState { 2 | const BaseState(); 3 | } 4 | 5 | class InitialState extends BaseState {} 6 | 7 | class LoadingState extends BaseState { 8 | const LoadingState({this.data}); 9 | 10 | final T? data; 11 | } 12 | 13 | class SuccessState extends BaseState { 14 | const SuccessState({this.data}); 15 | 16 | final T? data; 17 | } 18 | 19 | class ErrorState extends BaseState { 20 | const ErrorState({this.data}); 21 | 22 | final T? data; 23 | } 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /lib/src/feature/category/data/data_sources/category_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:fake_commerce/src/core/network/network.dart'; 3 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 4 | 5 | import 'category_data_source_imp.dart'; 6 | 7 | final categoryDataSourceProvider = Provider( 8 | (ref) => CategoryDataSourceImpl( 9 | client: ref.watch(dioProvider), 10 | ), 11 | ); 12 | 13 | abstract class CategoryDataSource { 14 | Future categories(); 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/src/feature/category/data/data_sources/category_data_source_imp.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:network/network.dart'; 3 | 4 | import 'category_data_source.dart'; 5 | 6 | class CategoryDataSourceImpl implements CategoryDataSource { 7 | CategoryDataSourceImpl({ 8 | required this.client, 9 | }); 10 | 11 | final RestClient client; 12 | 13 | @override 14 | Future categories() async { 15 | final response = await client.get( 16 | APIType.public, 17 | 'products/categories', 18 | ); 19 | return response; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/feature/product/root/data/data_sources/product_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:fake_commerce/src/core/network/network.dart'; 3 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 4 | 5 | import 'product_data_source_imp.dart'; 6 | 7 | final productDataSourceProvider = Provider( 8 | (ref) { 9 | return ProductDataSourceImpl( 10 | client: ref.read(dioProvider), 11 | ); 12 | }, 13 | ); 14 | 15 | abstract class ProductDataSource { 16 | Future fetchProductList(); 17 | 18 | Future fetchProduct(int id); 19 | } 20 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | 4 | import 'src/core/router/router_config.dart'; 5 | 6 | void main() { 7 | runApp(const ProviderScope(child: MyApp())); 8 | } 9 | 10 | class MyApp extends ConsumerWidget { 11 | const MyApp({super.key}); 12 | 13 | @override 14 | Widget build(BuildContext context, ref) { 15 | return MaterialApp.router( 16 | title: 'Fake Commerce', 17 | routerConfig: ref.read(goRouterProvider), 18 | theme: ThemeData( 19 | primarySwatch: Colors.blue, 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /network/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | .idea/ 8 | .vagrant/ 9 | .sconsign.dblite 10 | .svn/ 11 | 12 | migrate_working_dir/ 13 | 14 | *.swp 15 | profile 16 | 17 | DerivedData/ 18 | 19 | .generated/ 20 | 21 | *.pbxuser 22 | *.mode1v3 23 | *.mode2v3 24 | *.perspectivev3 25 | 26 | !default.pbxuser 27 | !default.mode1v3 28 | !default.mode2v3 29 | !default.perspectivev3 30 | 31 | xcuserdata 32 | 33 | *.moved-aside 34 | 35 | *.pyc 36 | *sync/ 37 | Icon? 38 | .tags* 39 | 40 | build/ 41 | .android/ 42 | .ios/ 43 | .flutter-plugins 44 | .flutter-plugins-dependencies 45 | 46 | # Symbolication related 47 | app.*.symbols 48 | 49 | # Obfuscation related 50 | app.*.map.json 51 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /lib/src/feature/product/root/data/data_sources/product_data_source_imp.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:network/network.dart'; 3 | 4 | import 'product_data_source.dart'; 5 | 6 | class ProductDataSourceImpl implements ProductDataSource { 7 | ProductDataSourceImpl({ 8 | required this.client, 9 | }); 10 | 11 | final RestClient client; 12 | 13 | @override 14 | Future fetchProductList() async { 15 | return await client.get( 16 | APIType.public, 17 | 'products', 18 | ); 19 | } 20 | 21 | @override 22 | Future fetchProduct(int id) async { 23 | return await client.get( 24 | APIType.public, 25 | 'products/$id', 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/src/feature/category/domain/repositories/category_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:fake_commerce/src/core/network/error_model.dart'; 3 | import 'package:fake_commerce/src/feature/category/data/data_sources/category_data_source.dart'; 4 | import 'package:fake_commerce/src/feature/category/data/repositories/category_repository_imp.dart'; 5 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 6 | 7 | final categoryRepositoryProvider = Provider( 8 | (ref) => CategoryRepositoryImpl( 9 | dataSource: ref.watch(categoryDataSourceProvider), 10 | ), 11 | ); 12 | 13 | abstract class CategoryRepository { 14 | Future>> categories(); 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/feature/category/presentation/provider/category_list_provider.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:fake_commerce/src/feature/category/domain/use_cases/category_use_case.dart'; 4 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 5 | 6 | final selectedCategoryProvider = StateProvider((ref) => ''); 7 | 8 | final categoriesProvider = FutureProvider>( 9 | (ref) async { 10 | final categories = await ref.watch(categoryUseCaseProvider).categories(); 11 | 12 | return categories.fold( 13 | (l) { 14 | log( 15 | 'categoriesProvider', 16 | error: l, 17 | ); 18 | return []; 19 | }, 20 | (r) => r, 21 | ); 22 | }, 23 | ); 24 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.2.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/feature/category/domain/use_cases/category_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:fake_commerce/src/core/network/error_model.dart'; 3 | import 'package:fake_commerce/src/feature/category/domain/repositories/category_repository.dart'; 4 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 5 | 6 | final categoryUseCaseProvider = Provider( 7 | (ref) => CategoryUseCase( 8 | ref.watch(categoryRepositoryProvider), 9 | ), 10 | ); 11 | 12 | class CategoryUseCase { 13 | CategoryUseCase(this._categoryRepository); 14 | 15 | final CategoryRepository _categoryRepository; 16 | 17 | Future>> categories() async { 18 | return await _categoryRepository.categories(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/src/feature/product/products/presentation/riverpod/providers.dart: -------------------------------------------------------------------------------- 1 | import 'package:fake_commerce/src/core/state/base_state.dart'; 2 | import 'package:fake_commerce/src/feature/product/products/domain/use_cases/products_use_case.dart'; 3 | import 'package:fake_commerce/src/feature/product/root/data/models/product_model.dart'; 4 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 5 | 6 | import 'products_notifier.dart'; 7 | 8 | final productsProvider = StateNotifierProvider( 9 | (ref) { 10 | return ProductsNotifier( 11 | ref: ref, 12 | useCase: ref.watch(productsUseCaseProvider), 13 | ); 14 | }, 15 | ); 16 | 17 | final productDataProvider = Provider( 18 | (ref) => throw UnimplementedError(), 19 | ); 20 | -------------------------------------------------------------------------------- /lib/src/core/network/request_handler.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:dartz/dartz.dart'; 4 | import 'package:dio/dio.dart'; 5 | import 'package:fake_commerce/src/core/network/error_model.dart'; 6 | import 'package:network/network.dart'; 7 | 8 | extension FutureResponseExtension on Future { 9 | Future> guard(Function(dynamic) parse) async { 10 | try { 11 | final response = await this; 12 | 13 | return Right(parse(response.data)); 14 | } on Failure catch (e, stacktrace) { 15 | log( 16 | runtimeType.toString(), 17 | error: {}, 18 | stackTrace: stacktrace, 19 | ); 20 | ErrorModel errorModel = ErrorModel.fromJson(e.error); 21 | 22 | return Left(errorModel); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /network/lib/src/network/api_options.dart: -------------------------------------------------------------------------------- 1 | part of 'rest_client.dart'; 2 | 3 | //PUBLIC => Generic API url without access token 4 | //PROTECTED => Generic API url with access token 5 | enum APIType { public, protected } 6 | 7 | abstract class ApiOptions { 8 | Options options = Options(); 9 | } 10 | 11 | class PublicApiOptions extends ApiOptions { 12 | PublicApiOptions() { 13 | super.options.headers = { 14 | 'Accept': 'application/json', 15 | 'Content-type': 'application/json', 16 | }; 17 | } 18 | } 19 | 20 | class ProtectedApiOptions extends ApiOptions { 21 | ProtectedApiOptions(String apiToken) { 22 | super.options.headers = { 23 | 'Accept': 'application/json', 24 | 'Content-Type': 'application/json', 25 | 'Authorization': 'Bearer $apiToken', 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/src/feature/product/products/domain/use_cases/products_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:fake_commerce/src/core/network/error_model.dart'; 3 | import 'package:fake_commerce/src/feature/product/root/data/models/product_model.dart'; 4 | import 'package:fake_commerce/src/feature/product/root/domain/repositories/product_repository.dart'; 5 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 6 | 7 | final productsUseCaseProvider = Provider( 8 | (ref) { 9 | return ProductsUseCase( 10 | ref.read(productRepositoryProvider), 11 | ); 12 | }, 13 | ); 14 | 15 | class ProductsUseCase { 16 | ProductsUseCase(this._repository); 17 | 18 | final ProductRepository _repository; 19 | 20 | Future>> productList() async { 21 | return await _repository.productList(); 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 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/src/feature/product/root/domain/repositories/product_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:fake_commerce/src/core/network/error_model.dart'; 3 | import 'package:fake_commerce/src/feature/product/root/data/data_sources/product_data_source.dart'; 4 | import 'package:fake_commerce/src/feature/product/root/data/models/product_model.dart'; 5 | import 'package:fake_commerce/src/feature/product/root/data/repositories/product_repository_imp.dart'; 6 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 7 | 8 | final productRepositoryProvider = Provider( 9 | (ref) { 10 | return ProductRepositoryImpl( 11 | dataSource: ref.read(productDataSourceProvider), 12 | ); 13 | }, 14 | ); 15 | 16 | abstract class ProductRepository { 17 | Future>> productList(); 18 | 19 | Future> product(int id); 20 | } 21 | -------------------------------------------------------------------------------- /lib/src/feature/product/details/domain/use_cases/product_details_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:fake_commerce/src/core/network/error_model.dart'; 3 | import 'package:fake_commerce/src/feature/product/root/data/models/product_model.dart'; 4 | import 'package:fake_commerce/src/feature/product/root/domain/repositories/product_repository.dart'; 5 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 6 | 7 | final productDetailsUseCaseProvider = Provider( 8 | (ref) { 9 | final repository = ref.watch(productRepositoryProvider); 10 | return ProductDetailsUseCase(repository); 11 | }, 12 | ); 13 | 14 | class ProductDetailsUseCase { 15 | ProductDetailsUseCase(this._repository); 16 | 17 | final ProductRepository _repository; 18 | 19 | Future> product(int id) async { 20 | return await _repository.product(id); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/feature/category/data/repositories/category_repository_imp.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:fake_commerce/src/core/network/error_model.dart'; 3 | import 'package:fake_commerce/src/core/network/request_handler.dart'; 4 | import 'package:fake_commerce/src/feature/category/data/data_sources/category_data_source.dart'; 5 | import 'package:fake_commerce/src/feature/category/data/models/category_model.dart'; 6 | import 'package:fake_commerce/src/feature/category/domain/repositories/category_repository.dart'; 7 | 8 | class CategoryRepositoryImpl implements CategoryRepository { 9 | CategoryRepositoryImpl({ 10 | required this.dataSource, 11 | }); 12 | 13 | final CategoryDataSource dataSource; 14 | 15 | @override 16 | Future>> categories() async { 17 | return await dataSource.categories().guard((data) { 18 | return categoryModelFromJson(data); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/core/network/error_model.dart: -------------------------------------------------------------------------------- 1 | class ErrorResponseModel { 2 | ErrorResponseModel({ 3 | this.error, 4 | }); 5 | 6 | ErrorModel? error; 7 | 8 | factory ErrorResponseModel.fromJson(Map json) { 9 | return ErrorResponseModel( 10 | error: json["error"] == null ? null : ErrorModel.fromJson(json["error"]), 11 | ); 12 | } 13 | } 14 | 15 | class ErrorModel { 16 | ErrorModel({ 17 | this.message = "Something went wrong! Please try again later.", 18 | this.code = "500", 19 | this.stack, 20 | }); 21 | 22 | String? message; 23 | String? code; 24 | String? stack; 25 | 26 | factory ErrorModel.fromJson(Map json) { 27 | return ErrorModel( 28 | message: json["message"], 29 | code: json["code"], 30 | stack: json["stack"], 31 | ); 32 | } 33 | 34 | Map toJson() { 35 | return { 36 | "message": message, 37 | "code": code, 38 | "stack": stack, 39 | }; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/src/feature/product/details/presentation/riverpod/product_details_notifier.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:fake_commerce/src/feature/product/details/domain/use_cases/product_details_use_case.dart'; 4 | import 'package:fake_commerce/src/feature/product/root/data/models/product_model.dart'; 5 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 6 | 7 | final productDetailsProvider = 8 | FutureProvider.autoDispose.family( 9 | (ref, value) async { 10 | try { 11 | final result = 12 | await ref.read(productDetailsUseCaseProvider).product(value); 13 | 14 | return result.fold( 15 | (l) => null, 16 | (r) { 17 | ref.keepAlive(); 18 | return r; 19 | }, 20 | ); 21 | } catch (e, stackTrace) { 22 | log( 23 | 'productDetailsProvider.futureProvider', 24 | error: e, 25 | stackTrace: stackTrace, 26 | ); 27 | } 28 | 29 | return null; 30 | }, 31 | ); 32 | -------------------------------------------------------------------------------- /lib/src/feature/product/products/presentation/widget/product_card.dart: -------------------------------------------------------------------------------- 1 | part of '../pages/products_list_page.dart'; 2 | 3 | class _ProductCard extends ConsumerWidget { 4 | const _ProductCard({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context, ref) { 8 | ProductModel data = ref.read(productDataProvider); 9 | 10 | return ListTile( 11 | onTap: () { 12 | _navigateToProductDetailsPage(context, data.id); 13 | }, 14 | leading: Image.network( 15 | data.image, 16 | fit: BoxFit.contain, 17 | height: 100, 18 | width: 100, 19 | ), 20 | title: Text(data.title), 21 | subtitle: Text("\$${data.price}"), 22 | ); 23 | } 24 | 25 | void _navigateToProductDetailsPage( 26 | BuildContext context, 27 | int id, 28 | ) { 29 | context.goNamed( 30 | Routes.productDetails.name, 31 | queryParameters: { 32 | 'id': id.toString(), 33 | }, 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /lib/src/feature/product/products/presentation/widget/product_list_builder.dart: -------------------------------------------------------------------------------- 1 | part of '../pages/products_list_page.dart'; 2 | 3 | class _ProductListBuilder extends StatelessWidget { 4 | const _ProductListBuilder({ 5 | required this.products, 6 | }); 7 | 8 | final List products; 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return ListView.separated( 13 | itemCount: products.length, 14 | itemBuilder: (context, index) { 15 | /// This might feel redundant to use a provider to pass 16 | /// data to class, when we can just use prop-drilling to 17 | /// pass the data. 18 | /// But, this is recommended way as you can declare the class 19 | /// as const, which will improve performance. 20 | 21 | return ProviderScope( 22 | overrides: [ 23 | productDataProvider.overrideWithValue( 24 | products[index], 25 | ), 26 | ], 27 | child: const _ProductCard(), 28 | ); 29 | }, 30 | separatorBuilder: (context, index) { 31 | return const Divider(); 32 | }, 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:fake_commerce/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 17 | base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 18 | - platform: android 19 | create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 20 | base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 21 | - platform: ios 22 | create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 23 | base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 24 | 25 | # User provided section 26 | 27 | # List of Local paths (relative to this file) that should be 28 | # ignored by the migrate tool. 29 | # 30 | # Files that are not part of the templates will be ignored by default. 31 | unmanaged_files: 32 | - 'lib/main.dart' 33 | - 'ios/Runner.xcodeproj/project.pbxproj' 34 | -------------------------------------------------------------------------------- /lib/src/feature/product/root/data/repositories/product_repository_imp.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:fake_commerce/src/core/network/error_model.dart'; 3 | import 'package:fake_commerce/src/core/network/request_handler.dart'; 4 | import 'package:fake_commerce/src/feature/product/root/data/data_sources/product_data_source.dart'; 5 | import 'package:fake_commerce/src/feature/product/root/data/models/product_model.dart'; 6 | import 'package:fake_commerce/src/feature/product/root/domain/repositories/product_repository.dart'; 7 | 8 | class ProductRepositoryImpl implements ProductRepository { 9 | ProductRepositoryImpl({required this.dataSource}); 10 | 11 | final ProductDataSource dataSource; 12 | 13 | @override 14 | Future>> productList() async { 15 | return await dataSource.fetchProductList().guard( 16 | (data) => (data as List).map((e) { 17 | return ProductModel.fromJson(e); 18 | }).toList(), 19 | ); 20 | } 21 | 22 | @override 23 | Future> product(int id) async { 24 | return await dataSource 25 | .fetchProduct(id) 26 | .guard((data) => ProductModel.fromJson(data)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/src/feature/product/root/data/models/product_model.dart: -------------------------------------------------------------------------------- 1 | class ProductModel { 2 | int id; 3 | String title; 4 | double price; 5 | String description; 6 | String category; 7 | String image; 8 | Rating rating; 9 | 10 | ProductModel({ 11 | required this.id, 12 | required this.title, 13 | required this.price, 14 | required this.description, 15 | required this.category, 16 | required this.image, 17 | required this.rating, 18 | }); 19 | 20 | factory ProductModel.fromJson(Map json) => ProductModel( 21 | id: json["id"], 22 | title: json["title"], 23 | price: json["price"]?.toDouble(), 24 | description: json["description"], 25 | category: json["category"], 26 | image: json["image"], 27 | rating: Rating.fromJson(json["rating"]), 28 | ); 29 | } 30 | 31 | class Rating { 32 | double rate; 33 | int count; 34 | 35 | Rating({ 36 | required this.rate, 37 | required this.count, 38 | }); 39 | 40 | factory Rating.fromJson(Map json) => Rating( 41 | rate: json["rate"]?.toDouble(), 42 | count: json["count"], 43 | ); 44 | 45 | Map toJson() => { 46 | "rate": rate, 47 | "count": count, 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /lib/src/feature/category/presentation/widgets/category_loading_shimmer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CategoryLoadingShimmer extends StatelessWidget { 4 | const CategoryLoadingShimmer({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Container( 9 | height: 50, 10 | margin: const EdgeInsets.symmetric( 11 | vertical: 16, 12 | ).copyWith(left: 16), 13 | child: ListView.separated( 14 | scrollDirection: Axis.horizontal, 15 | itemCount: 5, 16 | itemBuilder: (context, index) { 17 | return Container( 18 | padding: const EdgeInsets.symmetric( 19 | horizontal: 16, 20 | vertical: 10, 21 | ), 22 | decoration: BoxDecoration( 23 | color: Colors.grey[200], 24 | borderRadius: BorderRadius.circular(8), 25 | ), 26 | child: Center( 27 | child: Container( 28 | height: 50, 29 | width: 100, 30 | color: Colors.grey[200], 31 | ), 32 | ), 33 | ); 34 | }, 35 | separatorBuilder: (context, index) { 36 | return const SizedBox(width: 8); 37 | }, 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/src/feature/product/details/presentation/pages/product_details_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:fake_commerce/src/feature/product/details/presentation/riverpod/product_details_notifier.dart'; 2 | import 'package:fake_commerce/src/feature/product/details/presentation/widgets/product_details_loading_shimmer.dart'; 3 | import 'package:fake_commerce/src/feature/product/root/data/models/product_model.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 6 | 7 | part '../widgets/product_details_builder.dart'; 8 | 9 | class ProductDetailsPage extends ConsumerWidget { 10 | const ProductDetailsPage({ 11 | Key? key, 12 | required this.productId, 13 | }) : super(key: key); 14 | 15 | final int productId; 16 | 17 | @override 18 | Widget build(BuildContext context, ref) { 19 | final state = ref.watch(productDetailsProvider(productId)); 20 | 21 | return Scaffold( 22 | appBar: AppBar( 23 | title: const Text('Product Details'), 24 | ), 25 | body: state.when( 26 | data: (product) { 27 | return _ProductDetailsBuilder(product: product!); 28 | }, 29 | loading: () => const ProductDetailsLoadingShimmer(), 30 | error: (error, stackTrace) { 31 | return const Center(child: Text('Error')); 32 | }, 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/src/feature/product/details/presentation/widgets/product_details_loading_shimmer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ProductDetailsLoadingShimmer extends StatelessWidget { 4 | const ProductDetailsLoadingShimmer({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Container( 9 | margin: const EdgeInsets.symmetric( 10 | horizontal: 16, 11 | vertical: 8, 12 | ), 13 | child: Column( 14 | crossAxisAlignment: CrossAxisAlignment.start, 15 | children: [ 16 | Container( 17 | height: 250, 18 | width: double.infinity, 19 | color: Colors.grey[200], 20 | ), 21 | const Divider(), 22 | Expanded( 23 | child: Column( 24 | crossAxisAlignment: CrossAxisAlignment.start, 25 | children: [ 26 | Container( 27 | height: 20, 28 | width: 100, 29 | color: Colors.grey[200], 30 | ), 31 | const SizedBox(height: 8), 32 | Container( 33 | height: 20, 34 | width: 200, 35 | color: Colors.grey[200], 36 | ), 37 | const SizedBox(height: 8), 38 | Container( 39 | height: 20, 40 | width: 100, 41 | color: Colors.grey[200], 42 | ), 43 | ], 44 | ), 45 | ), 46 | ], 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/feature/authentication/login/presentation/view/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:go_router/go_router.dart'; 3 | 4 | class LoginPage extends StatefulWidget { 5 | const LoginPage({super.key}); 6 | 7 | @override 8 | State createState() => _LoginPageState(); 9 | } 10 | 11 | class _LoginPageState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | appBar: AppBar(title: const Text('Login')), 16 | body: SingleChildScrollView( 17 | padding: EdgeInsets.symmetric(horizontal: 20).copyWith( 18 | bottom: MediaQuery.of(context).viewInsets.bottom, 19 | ), 20 | child: Column( 21 | children: [ 22 | SizedBox(height: 200), 23 | const Text('Login Page'), 24 | SizedBox(height: 30), 25 | TextFormField( 26 | decoration: const InputDecoration( 27 | border: OutlineInputBorder(), 28 | labelText: 'Username', 29 | ), 30 | ), 31 | SizedBox(height: 15), 32 | TextFormField( 33 | decoration: const InputDecoration( 34 | border: OutlineInputBorder(), 35 | labelText: 'Password', 36 | ), 37 | ), 38 | SizedBox(height: 30), 39 | ElevatedButton( 40 | onPressed: () { 41 | context.go('/'); 42 | }, 43 | child: const Text('Login'), 44 | ), 45 | ], 46 | ), 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/core/router/router_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:fake_commerce/src/core/router/routers.dart'; 2 | import 'package:fake_commerce/src/feature/authentication/login/presentation/view/login_page.dart'; 3 | import 'package:fake_commerce/src/feature/product/details/presentation/pages/product_details_page.dart'; 4 | import 'package:fake_commerce/src/feature/product/products/presentation/pages/products_list_page.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 7 | import 'package:go_router/go_router.dart'; 8 | 9 | final goRouterProvider = Provider((ref) => _router); 10 | 11 | final GoRouter _router = GoRouter( 12 | routes: [ 13 | GoRoute( 14 | path: '/', 15 | name: Routes.productList.name, 16 | pageBuilder: (context, state) { 17 | return MaterialPage( 18 | key: state.pageKey, 19 | child: const ProductListPage(), 20 | ); 21 | }, 22 | routes: [ 23 | GoRoute( 24 | path: Routes.productList.name, 25 | name: Routes.productDetails.name, 26 | pageBuilder: (context, state) { 27 | return MaterialPage( 28 | key: state.pageKey, 29 | child: ProductDetailsPage( 30 | productId: int.parse(state.queryParameters['id']!), 31 | ), 32 | ); 33 | }, 34 | ), 35 | GoRoute( 36 | path: Routes.login.name, 37 | name: Routes.login.name, 38 | pageBuilder: (context, state) { 39 | return const MaterialPage( 40 | child: LoginPage(), 41 | ); 42 | }, 43 | ), 44 | ], 45 | ), 46 | ], 47 | ); 48 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/src/feature/product/products/presentation/widget/category_builder.dart: -------------------------------------------------------------------------------- 1 | part of '../pages/products_list_page.dart'; 2 | 3 | class _CategoryBuilder extends ConsumerWidget { 4 | const _CategoryBuilder({ 5 | required this.categories, 6 | }); 7 | 8 | final List categories; 9 | 10 | @override 11 | Widget build(BuildContext context, ref) { 12 | return Container( 13 | margin: const EdgeInsets.symmetric( 14 | vertical: 16, 15 | ).copyWith(left: 16), 16 | height: 50, 17 | child: ListView.separated( 18 | scrollDirection: Axis.horizontal, 19 | itemCount: categories.length, 20 | itemBuilder: (context, index) { 21 | return InkWell( 22 | onTap: () { 23 | ref.read(selectedCategoryProvider.notifier).state = 24 | categories[index]; 25 | }, 26 | child: Container( 27 | padding: const EdgeInsets.symmetric( 28 | horizontal: 16, 29 | vertical: 5, 30 | ), 31 | decoration: BoxDecoration( 32 | color: Colors.grey[200], 33 | border: ref.watch(selectedCategoryProvider) == categories[index] 34 | ? Border.all( 35 | color: Colors.blue, 36 | ) 37 | : null, 38 | borderRadius: BorderRadius.circular(8), 39 | ), 40 | child: Center( 41 | child: Text( 42 | categories[index].toUpperCase(), 43 | ), 44 | ), 45 | ), 46 | ); 47 | }, 48 | separatorBuilder: (context, index) { 49 | return const SizedBox(width: 8); 50 | }, 51 | ), 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Fake Commerce 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | fake_commerce 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /lib/src/feature/product/products/presentation/widget/products_loading_shimmer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ProductsLoadingShimmer extends StatelessWidget { 4 | const ProductsLoadingShimmer({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return ListView.separated( 9 | scrollDirection: Axis.vertical, 10 | itemCount: 5, 11 | itemBuilder: (context, index) { 12 | return Container( 13 | margin: const EdgeInsets.symmetric( 14 | horizontal: 16, 15 | vertical: 8, 16 | ), 17 | child: Row( 18 | children: [ 19 | Container( 20 | height: 100, 21 | width: 100, 22 | color: Colors.grey[200], 23 | ), 24 | const SizedBox(width: 16), 25 | Expanded( 26 | child: Column( 27 | crossAxisAlignment: CrossAxisAlignment.start, 28 | children: [ 29 | Container( 30 | height: 20, 31 | width: 100, 32 | color: Colors.grey[200], 33 | ), 34 | const SizedBox(height: 8), 35 | Container( 36 | height: 20, 37 | width: 200, 38 | color: Colors.grey[200], 39 | ), 40 | const SizedBox(height: 8), 41 | Container( 42 | height: 20, 43 | width: 100, 44 | color: Colors.grey[200], 45 | ), 46 | ], 47 | ), 48 | ), 49 | ], 50 | ), 51 | ); 52 | }, 53 | separatorBuilder: (context, index) { 54 | return const SizedBox(width: 8); 55 | }, 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/src/feature/product/details/presentation/widgets/product_details_builder.dart: -------------------------------------------------------------------------------- 1 | part of '../pages/product_details_page.dart'; 2 | 3 | class _ProductDetailsBuilder extends ConsumerWidget { 4 | const _ProductDetailsBuilder({ 5 | required this.product, 6 | }); 7 | 8 | final ProductModel product; 9 | 10 | @override 11 | Widget build(BuildContext context, ref) { 12 | return RefreshIndicator( 13 | onRefresh: () => ref.refresh(productDetailsProvider(product.id).future), 14 | child: ListView( 15 | physics: const AlwaysScrollableScrollPhysics(), 16 | children: [ 17 | const SizedBox(height: 16), 18 | Image.network( 19 | product.image, 20 | fit: BoxFit.contain, 21 | width: double.infinity, 22 | height: 250, 23 | ), 24 | const Divider(), 25 | Padding( 26 | padding: const EdgeInsets.symmetric( 27 | horizontal: 16, 28 | ), 29 | child: Column( 30 | mainAxisSize: MainAxisSize.min, 31 | crossAxisAlignment: CrossAxisAlignment.start, 32 | children: [ 33 | Text( 34 | product.title, 35 | style: Theme.of(context).textTheme.titleLarge, 36 | ), 37 | const SizedBox(height: 8), 38 | Text( 39 | "\$${product.price}", 40 | style: Theme.of(context).textTheme.bodyMedium, 41 | ), 42 | const SizedBox(height: 4), 43 | Text( 44 | "Category: ${product.category.toUpperCase()}", 45 | style: Theme.of(context).textTheme.labelLarge, 46 | ), 47 | const SizedBox(height: 8), 48 | Text( 49 | product.description, 50 | style: Theme.of(context).textTheme.bodyLarge, 51 | ), 52 | const SizedBox(height: 8), 53 | ], 54 | ), 55 | ), 56 | ], 57 | ), 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/src/feature/product/products/presentation/riverpod/products_notifier.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:fake_commerce/src/core/state/base_state.dart'; 4 | import 'package:fake_commerce/src/feature/category/presentation/provider/category_list_provider.dart'; 5 | import 'package:fake_commerce/src/feature/product/products/domain/use_cases/products_use_case.dart'; 6 | import 'package:fake_commerce/src/feature/product/root/data/models/product_model.dart'; 7 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 8 | 9 | class ProductsNotifier extends StateNotifier { 10 | ProductsNotifier({ 11 | required this.ref, 12 | required this.useCase, 13 | }) : super(InitialState()) { 14 | ref.listen(selectedCategoryProvider, (previous, next) { 15 | productList(hasFilter: previous != next); 16 | }); 17 | } 18 | 19 | final Ref ref; 20 | final ProductsUseCase useCase; 21 | 22 | List _products = []; 23 | 24 | Future productList({bool hasFilter = false}) async { 25 | if (hasFilter) { 26 | if (state is SuccessState) { 27 | String category = ref.read(selectedCategoryProvider); 28 | 29 | if (category.isNotEmpty) { 30 | List filteredProducts = _products 31 | .where((element) => element.category == category.toLowerCase()) 32 | .toList(); 33 | 34 | state = const LoadingState(); 35 | await Future.delayed(const Duration(milliseconds: 100)); 36 | 37 | state = SuccessState( 38 | data: filteredProducts.isEmpty ? _products : filteredProducts, 39 | ); 40 | } 41 | 42 | return; 43 | } 44 | } 45 | 46 | state = const LoadingState(); 47 | try { 48 | final result = await useCase.productList(); 49 | result.fold( 50 | (l) { 51 | log( 52 | 'ProductsNotifier.productList', 53 | error: l, 54 | ); 55 | return state = ErrorState(data: l.toString()); 56 | }, 57 | (r) { 58 | _products = r; 59 | return state = SuccessState(data: r); 60 | }, 61 | ); 62 | } catch (e, stacktrace) { 63 | log( 64 | 'ProductsNotifier.productList', 65 | error: e, 66 | stackTrace: stacktrace, 67 | ); 68 | state = ErrorState(data: e.toString()); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.momshaddinury.fake_commerce" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 50 | minSdkVersion flutter.minSdkVersion 51 | targetSdkVersion flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | } 55 | 56 | buildTypes { 57 | release { 58 | // TODO: Add your own signing config for the release build. 59 | // Signing with the debug keys for now, so `flutter run --release` works. 60 | signingConfig signingConfigs.debug 61 | } 62 | } 63 | } 64 | 65 | flutter { 66 | source '../..' 67 | } 68 | 69 | dependencies { 70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 71 | } 72 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | ## Overview 4 | This project is a Flutter application that uses Riverpod for state management and dependency injection, Clean Architecture for the project structure, Fake Store API for data retrieval, and Dio for network communication. 5 | 6 | ## Requirements 7 | To run this project, you need to have the following software installed on your machine: 8 | - Flutter (3.7.12 - Stable) 9 | - Dart ('>=2.19.6 <3.0.0') 10 | 11 | ## Installation 12 | 1. Clone the repository to your local machine. 13 | 2. Open the project in your preferred IDE. 14 | 3. Run `flutter pub get` to install the required dependencies. 15 | 16 | ## Usage 17 | You can run the project on either an emulator or a physical device using the command `flutter run`. 18 | 19 | ## Project Structure 20 | The project uses Clean Architecture, which separates the code into layers: Presentation, Domain, and Data. Each layer has its own responsibility and is independent of the other layers. 21 | 22 | The project structure is as follows: 23 | 24 | ``` 25 | . 26 | └── lib/ 27 | ├── src/ 28 | │ ├── core/ 29 | │ │ ├── base 30 | │ │ └── network 31 | │ └── feature/ 32 | │ └── product/ 33 | │ ├── details/ 34 | │ │ ├── data/ 35 | │ │ │ └── models 36 | │ │ ├── domain/ 37 | │ │ │ └── use_cases 38 | │ │ └── presentation/ 39 | │ │ ├── pages 40 | │ │ └── riverpod 41 | │ ├── products/ 42 | │ │ ├── data/ 43 | │ │ │ └── models 44 | │ │ ├── domain/ 45 | │ │ │ ├── repositories 46 | │ │ │ └── use_cases 47 | │ │ └── presentation/ 48 | │ │ ├── pages 49 | │ │ └── riverpod 50 | │ └── root/ 51 | │ └── data/ 52 | │ ├── data_sources 53 | │ └── repositories 54 | └── main.dart 55 | ``` 56 | ## Dependencies 57 | - flutter_riverpod: 2.3.6 58 | - dio: 5.1.1 59 | - dartz: 0.10.1 60 | 61 | ## Feature 62 | - Fetching all products and categories 63 | - Filtering fetched products by category locally 64 | - Fetching product details and caching the response 65 | - Improving performance of ListView by using *overrideWithValue* and passing const widget 66 | - Navigation using GoRouter 67 | 68 | ## Dependency Injection, State Management & Caching 69 | The project uses Riverpod for both state management and dependency injection. It allows for easy management of dependencies and makes it easier to test the code. By combining ```FutureProvider.autoDispose``` with ```keepAlive``` caching is also acheieved. 70 | 71 | ## Network Communication 72 | The project uses Dio for network communication, which is a powerful HTTP client for Dart. It makes it easy to make network requests and handle responses. 73 | 74 | ## Data Retrieval 75 | The project uses the Fake Store API for data retrieval. This is a fake e-commerce API that provides product data that can be used for testing and demonstration purposes. 76 | 77 | ## Conclusion 78 | This project is an example of how to use Flutter, Riverpod, Clean Architecture, Fake Store API, and Dio together to create a robust and maintainable application. 79 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # Visual Studio Code related 20 | .classpath 21 | .project 22 | .settings/ 23 | .vscode/* 24 | 25 | # Flutter repo-specific 26 | /bin/cache/ 27 | /bin/internal/bootstrap.bat 28 | /bin/internal/bootstrap.sh 29 | /bin/mingit/ 30 | /dev/benchmarks/mega_gallery/ 31 | /dev/bots/.recipe_deps 32 | /dev/bots/android_tools/ 33 | /dev/devicelab/ABresults*.json 34 | /dev/docs/doc/ 35 | /dev/docs/flutter.docs.zip 36 | /dev/docs/lib/ 37 | /dev/docs/pubspec.yaml 38 | /dev/integration_tests/**/xcuserdata 39 | /dev/integration_tests/**/Pods 40 | /packages/flutter/coverage/ 41 | version 42 | analysis_benchmark.json 43 | 44 | # packages file containing multi-root paths 45 | .packages.generated 46 | 47 | # Flutter/Dart/Pub related 48 | **/doc/api/ 49 | .dart_tool/ 50 | .flutter-plugins 51 | .flutter-plugins-dependencies 52 | **/generated_plugin_registrant.dart 53 | .packages 54 | .pub-preload-cache/ 55 | .pub/ 56 | build/ 57 | flutter_*.png 58 | linked_*.ds 59 | unlinked.ds 60 | unlinked_spec.ds 61 | 62 | # Android related 63 | **/android/**/gradle-wrapper.jar 64 | .gradle/ 65 | **/android/captures/ 66 | **/android/gradlew 67 | **/android/gradlew.bat 68 | **/android/local.properties 69 | **/android/**/GeneratedPluginRegistrant.java 70 | **/android/key.properties 71 | *.jks 72 | 73 | # iOS/XCode related 74 | **/ios/**/*.mode1v3 75 | **/ios/**/*.mode2v3 76 | **/ios/**/*.moved-aside 77 | **/ios/**/*.pbxuser 78 | **/ios/**/*.perspectivev3 79 | **/ios/**/*sync/ 80 | **/ios/**/.sconsign.dblite 81 | **/ios/**/.tags* 82 | **/ios/**/.vagrant/ 83 | **/ios/**/DerivedData/ 84 | **/ios/**/Icon? 85 | **/ios/**/Pods/ 86 | **/ios/**/.symlinks/ 87 | **/ios/**/profile 88 | **/ios/**/xcuserdata 89 | **/ios/.generated/ 90 | **/ios/Flutter/.last_build_id 91 | **/ios/Flutter/App.framework 92 | **/ios/Flutter/Flutter.framework 93 | **/ios/Flutter/Flutter.podspec 94 | **/ios/Flutter/Generated.xcconfig 95 | **/ios/Flutter/ephemeral 96 | **/ios/Flutter/app.flx 97 | **/ios/Flutter/app.zip 98 | **/ios/Flutter/flutter_assets/ 99 | **/ios/Flutter/flutter_export_environment.sh 100 | **/ios/ServiceDefinitions.json 101 | **/ios/Runner/GeneratedPluginRegistrant.* 102 | 103 | # macOS 104 | **/Flutter/ephemeral/ 105 | **/Pods/ 106 | **/macos/Flutter/GeneratedPluginRegistrant.swift 107 | **/macos/Flutter/ephemeral 108 | **/xcuserdata/ 109 | 110 | # Windows 111 | **/windows/flutter/generated_plugin_registrant.cc 112 | **/windows/flutter/generated_plugin_registrant.h 113 | **/windows/flutter/generated_plugins.cmake 114 | 115 | # Linux 116 | **/linux/flutter/generated_plugin_registrant.cc 117 | **/linux/flutter/generated_plugin_registrant.h 118 | **/linux/flutter/generated_plugins.cmake 119 | 120 | # Coverage 121 | coverage/ 122 | 123 | # Symbols 124 | app.*.symbols 125 | 126 | # Exceptions to above rules. 127 | !**/ios/**/default.mode1v3 128 | !**/ios/**/default.mode2v3 129 | !**/ios/**/default.pbxuser 130 | !**/ios/**/default.perspectivev3 131 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 132 | !/dev/ci/**/Gemfile.lock 133 | !.vscode/settings.json -------------------------------------------------------------------------------- /lib/src/feature/product/products/presentation/pages/products_list_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:fake_commerce/src/core/router/routers.dart'; 4 | import 'package:fake_commerce/src/core/state/base_state.dart'; 5 | import 'package:fake_commerce/src/feature/category/presentation/provider/category_list_provider.dart'; 6 | import 'package:fake_commerce/src/feature/category/presentation/widgets/category_loading_shimmer.dart'; 7 | import 'package:fake_commerce/src/feature/product/products/presentation/riverpod/providers.dart'; 8 | import 'package:fake_commerce/src/feature/product/products/presentation/widget/products_loading_shimmer.dart'; 9 | import 'package:fake_commerce/src/feature/product/root/data/models/product_model.dart'; 10 | import 'package:flutter/material.dart'; 11 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 12 | import 'package:go_router/go_router.dart'; 13 | 14 | part '../widget/category_builder.dart'; 15 | part '../widget/product_card.dart'; 16 | part '../widget/product_list_builder.dart'; 17 | 18 | class ProductListPage extends ConsumerStatefulWidget { 19 | const ProductListPage({Key? key}) : super(key: key); 20 | 21 | @override 22 | ConsumerState createState() => _ProductListPageState(); 23 | } 24 | 25 | class _ProductListPageState extends ConsumerState { 26 | @override 27 | void initState() { 28 | super.initState(); 29 | Future.microtask(() { 30 | ref.read(productsProvider.notifier).productList(); 31 | }); 32 | } 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | final state = ref.watch(productsProvider); 37 | final categoriesState = ref.watch(categoriesProvider); 38 | 39 | return Scaffold( 40 | appBar: AppBar( 41 | title: const Text('Products'), 42 | actions: [ 43 | IconButton( 44 | onPressed: () { 45 | context.pushNamed(Routes.login.name); 46 | }, 47 | icon: const Icon( 48 | Icons.login, 49 | ), 50 | ) 51 | ], 52 | ), 53 | body: Column( 54 | children: [ 55 | /// Categories 56 | categoriesState.when( 57 | data: (categories) { 58 | return _CategoryBuilder(categories: categories); 59 | }, 60 | loading: () => const CategoryLoadingShimmer(), 61 | error: (error, stackTrace) { 62 | log( 63 | "ProductListPage.categoriesState.when", 64 | error: error.toString(), 65 | stackTrace: stackTrace, 66 | ); 67 | return const Center(child: Text('Error')); 68 | }, 69 | ), 70 | 71 | /// Product List 72 | state is LoadingState 73 | ? const Expanded(child: ProductsLoadingShimmer()) 74 | : state is SuccessState> 75 | ? Expanded( 76 | child: RefreshIndicator( 77 | onRefresh: () async { 78 | ref.invalidate(selectedCategoryProvider); 79 | await ref 80 | .read(productsProvider.notifier) 81 | .productList(); 82 | }, 83 | child: _ProductListBuilder(products: state.data!), 84 | ), 85 | ) 86 | : const Center(child: Text('Error')), 87 | ], 88 | ), 89 | ); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /network/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: network 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | # 15 | # This version is used _only_ for the Runner app, which is used if you just do 16 | # a `flutter run` or a `flutter make-host-app-editable`. It has no impact 17 | # on any other native host app that you embed your Flutter project into. 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: '>=2.18.2 <3.0.0' 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | # Network and Connectivity 27 | dio: 5.1.1 28 | http_parser: 4.0.2 29 | # Logging 30 | pretty_dio_logger: 1.3.1 31 | logger: 1.1.0 32 | # Utils 33 | internet_connection_checker: 1.0.0+1 34 | equatable: 2.0.5 35 | 36 | 37 | 38 | # The following adds the Cupertino Icons font to your application. 39 | # Use with the CupertinoIcons class for iOS style icons. 40 | cupertino_icons: ^1.0.2 41 | 42 | dev_dependencies: 43 | flutter_test: 44 | sdk: flutter 45 | flutter_lints: ^2.0.0 46 | 47 | # For information on the generic Dart part of this file, see the 48 | # following page: https://dart.dev/tools/pub/pubspec 49 | 50 | flutter: 51 | # The following line ensures that the Material Icons font is 52 | # included with your application, so that you can use the icons in 53 | # the material Icons class. 54 | uses-material-design: true 55 | 56 | # To add Flutter specific assets to your application, add an assets section, 57 | # like this: 58 | # assets: 59 | # - images/a_dot_burr.jpeg 60 | # - images/a_dot_ham.jpeg 61 | 62 | # An image asset can refer to one or more resolution-specific "variants", see 63 | # https://flutter.dev/assets-and-images/#resolution-aware 64 | 65 | # For details regarding adding assets from package dependencies, see 66 | # https://flutter.dev/assets-and-images/#from-packages 67 | 68 | # To add Flutter specific custom fonts to your application, add a fonts 69 | # section here, in this "flutter" section. Each entry in this list should 70 | # have a "family" key with the font family name, and a "fonts" key with a 71 | # list giving the asset and other descriptors for the font. For 72 | # example: 73 | # fonts: 74 | # - family: Schyler 75 | # fonts: 76 | # - asset: fonts/Schyler-Regular.ttf 77 | # - asset: fonts/Schyler-Italic.ttf 78 | # style: italic 79 | # - family: Trajan Pro 80 | # fonts: 81 | # - asset: fonts/TrajanPro.ttf 82 | # - asset: fonts/TrajanPro_Bold.ttf 83 | # weight: 700 84 | # 85 | # For details regarding fonts from package dependencies, 86 | # see https://flutter.dev/custom-fonts/#from-packages 87 | 88 | 89 | # This section identifies your Flutter project as a module meant for 90 | # embedding in a native host app. These identifiers should _not_ ordinarily 91 | # be changed after generation - they are used to ensure that the tooling can 92 | # maintain consistency when adding or modifying assets and plugins. 93 | # They also do not have any bearing on your native host application's 94 | # identifiers, which may be completely independent or the same as these. 95 | module: 96 | androidX: true 97 | androidPackage: com.brainstation23.network 98 | iosBundleIdentifier: com.brainstation23.network 99 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: fake_commerce 2 | description: A new Flutter project. 3 | # The following line prevents the package from being accidentally published to 4 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 6 | 7 | # The following defines the version and build number for your application. 8 | # A version number is three numbers separated by dots, like 1.2.43 9 | # followed by an optional build number separated by a +. 10 | # Both the version and the builder number may be overridden in flutter 11 | # build by specifying --build-name and --build-number, respectively. 12 | # In Android, build-name is used as versionName while build-number used as versionCode. 13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 15 | # Read more about iOS versioning at 16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 17 | # In Windows, build-name is used as the major, minor, and patch parts 18 | # of the product and file versions while build-number is used as the build suffix. 19 | version: 1.0.0+1 20 | 21 | environment: 22 | sdk: '>=2.19.6 <3.0.0' 23 | 24 | # Dependencies specify other packages that your package needs in order to work. 25 | # To automatically upgrade your package dependencies to the latest versions 26 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 27 | # dependencies can be manually updated by changing the version numbers below to 28 | # the latest version available on pub.dev. To see which dependencies have newer 29 | # versions available, run `flutter pub outdated`. 30 | dependencies: 31 | flutter: 32 | sdk: flutter 33 | flutter_riverpod: 2.3.6 34 | dio: 5.1.1 35 | dartz: 0.10.1 36 | shimmer: 2.0.0 37 | go_router: 7.0.0 38 | # The following adds the Cupertino Icons font to your application. 39 | # Use with the CupertinoIcons class for iOS style icons. 40 | cupertino_icons: ^1.0.2 41 | network: 42 | path: network 43 | 44 | dev_dependencies: 45 | flutter_test: 46 | sdk: flutter 47 | 48 | # The "flutter_lints" package below contains a set of recommended lints to 49 | # encourage good coding practices. The lint set provided by the package is 50 | # activated in the `analysis_options.yaml` file located at the root of your 51 | # package. See that file for information about deactivating specific lint 52 | # rules and activating additional ones. 53 | flutter_lints: ^2.0.0 54 | 55 | # For information on the generic Dart part of this file, see the 56 | # following page: https://dart.dev/tools/pub/pubspec 57 | 58 | # The following section is specific to Flutter packages. 59 | flutter: 60 | 61 | # The following line ensures that the Material Icons font is 62 | # included with your application, so that you can use the icons in 63 | # the material Icons class. 64 | uses-material-design: true 65 | 66 | # To add assets to your application, add an assets section, like this: 67 | # assets: 68 | # - images/a_dot_burr.jpeg 69 | # - images/a_dot_ham.jpeg 70 | 71 | # An image asset can refer to one or more resolution-specific "variants", see 72 | # https://flutter.dev/assets-and-images/#resolution-aware 73 | 74 | # For details regarding adding assets from package dependencies, see 75 | # https://flutter.dev/assets-and-images/#from-packages 76 | 77 | # To add custom fonts to your application, add a fonts section here, 78 | # in this "flutter" section. Each entry in this list should have a 79 | # "family" key with the font family name, and a "fonts" key with a 80 | # list giving the asset and other descriptors for the font. For 81 | # example: 82 | # fonts: 83 | # - family: Schyler 84 | # fonts: 85 | # - asset: fonts/Schyler-Regular.ttf 86 | # - asset: fonts/Schyler-Italic.ttf 87 | # style: italic 88 | # - family: Trajan Pro 89 | # fonts: 90 | # - asset: fonts/TrajanPro.ttf 91 | # - asset: fonts/TrajanPro_Bold.ttf 92 | # weight: 700 93 | # 94 | # For details regarding fonts from package dependencies, 95 | # see https://flutter.dev/custom-fonts/#from-packages 96 | -------------------------------------------------------------------------------- /network/lib/src/utils/failures.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | abstract class Failure extends Equatable { 4 | const Failure( 5 | this.name, 6 | this.code, 7 | this.error, 8 | ); 9 | 10 | final String? name; 11 | final String? code; 12 | final dynamic error; 13 | 14 | @override 15 | List get props => [name, code, error]; 16 | 17 | @override 18 | String toString() { 19 | return { 20 | 'name': name, 21 | 'code': code, 22 | 'error': error, 23 | }.toString(); 24 | } 25 | } 26 | 27 | /// Client Error Responses 28 | class BadRequest extends Failure { 29 | const BadRequest( 30 | dynamic error, 31 | ) : super('Bad Request', '400', error); 32 | } 33 | 34 | class Unauthorized extends Failure { 35 | const Unauthorized( 36 | dynamic error, 37 | ) : super('Unauthorized', '401', error); 38 | } 39 | 40 | class Forbidden extends Failure { 41 | const Forbidden( 42 | dynamic error, 43 | ) : super('Forbidden', '403', error); 44 | } 45 | 46 | class NotFound extends Failure { 47 | const NotFound( 48 | dynamic error, 49 | ) : super('Not Found', '404', error); 50 | } 51 | 52 | class MethodNotAllowed extends Failure { 53 | const MethodNotAllowed( 54 | dynamic error, 55 | ) : super('Method Not Allowed', '405', error); 56 | } 57 | 58 | class NotAcceptable extends Failure { 59 | const NotAcceptable( 60 | dynamic error, 61 | ) : super('Not Acceptable', '406', error); 62 | } 63 | 64 | class RequestTimeout extends Failure { 65 | const RequestTimeout( 66 | dynamic error, 67 | ) : super('Request Timeout', '408', error); 68 | } 69 | 70 | class Conflict extends Failure { 71 | const Conflict( 72 | dynamic error, 73 | ) : super('Conflict', '409', error); 74 | } 75 | 76 | class Gone extends Failure { 77 | const Gone( 78 | dynamic error, 79 | ) : super('Gone', '410', error); 80 | } 81 | 82 | class LengthRequired extends Failure { 83 | const LengthRequired( 84 | dynamic error, 85 | ) : super('Length Required', '411', error); 86 | } 87 | 88 | class PreconditionFailed extends Failure { 89 | const PreconditionFailed( 90 | dynamic error, 91 | ) : super('Precondition Failed', '412', error); 92 | } 93 | 94 | class PayloadTooLarge extends Failure { 95 | const PayloadTooLarge( 96 | dynamic error, 97 | ) : super('Payload Too Large', '413', error); 98 | } 99 | 100 | class URITooLong extends Failure { 101 | const URITooLong( 102 | dynamic error, 103 | ) : super('URI Too Long', '414', error); 104 | } 105 | 106 | class UnsupportedMediaType extends Failure { 107 | const UnsupportedMediaType( 108 | dynamic error, 109 | ) : super('Unsupported Media Type', '415', error); 110 | } 111 | 112 | class RangeNotSatisfiable extends Failure { 113 | const RangeNotSatisfiable( 114 | dynamic error, 115 | ) : super('Range Not Satisfiable', '416', error); 116 | } 117 | 118 | class ExpectationFailed extends Failure { 119 | const ExpectationFailed( 120 | dynamic error, 121 | ) : super('Expectation Failed', '417', error); 122 | } 123 | 124 | class UnprocessableEntity extends Failure { 125 | const UnprocessableEntity( 126 | dynamic error, 127 | ) : super('Unprocessable Entity', '422', error); 128 | } 129 | 130 | class TooManyRequests extends Failure { 131 | const TooManyRequests( 132 | dynamic error, 133 | ) : super('Too Many Requests', '429', error); 134 | } 135 | 136 | /// Server Error Responses 137 | class InternalServerError extends Failure { 138 | const InternalServerError( 139 | dynamic error, 140 | ) : super('Internal Server Error', '500', error); 141 | } 142 | 143 | class NotImplemented extends Failure { 144 | const NotImplemented( 145 | dynamic error, 146 | ) : super('Not Implemented', '501', error); 147 | } 148 | 149 | class BadGateway extends Failure { 150 | const BadGateway( 151 | dynamic error, 152 | ) : super('Bad Gateway', '502', error); 153 | } 154 | 155 | class ServiceUnavailable extends Failure { 156 | const ServiceUnavailable( 157 | dynamic error, 158 | ) : super('Service Unavailable', '503', error); 159 | } 160 | 161 | class GatewayTimeout extends Failure { 162 | const GatewayTimeout( 163 | dynamic error, 164 | ) : super('Gateway Timeout', '504', error); 165 | } 166 | 167 | class Unexpected extends Failure { 168 | const Unexpected( 169 | dynamic error, 170 | ) : super('Unknown Error', '500', error); 171 | } 172 | -------------------------------------------------------------------------------- /network/lib/src/network/rest_client.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:network/src/utils/failures.dart'; 6 | 7 | import '../utils/pretty_dio_logger.dart'; 8 | 9 | part 'api_options.dart'; 10 | 11 | class RestClient { 12 | static final RestClient _instance = RestClient._internal(); 13 | 14 | RestClient._internal(); 15 | 16 | factory RestClient({ 17 | required String baseUrl, 18 | required String token, 19 | int connectionTimeout = 30000, 20 | int receiveTimeout = 30000, 21 | }) { 22 | _instance.baseUrl = baseUrl; 23 | _instance.token = token; 24 | _instance.connectionTimeout = connectionTimeout; 25 | _instance.receiveTimeout = receiveTimeout; 26 | 27 | BaseOptions options = BaseOptions( 28 | baseUrl: baseUrl, 29 | connectTimeout: Duration(milliseconds: connectionTimeout), 30 | receiveTimeout: Duration(milliseconds: receiveTimeout), 31 | ); 32 | 33 | _instance._dio = Dio(options); 34 | return _instance; 35 | } 36 | 37 | late Dio _dio; 38 | late int connectionTimeout; 39 | late int receiveTimeout; 40 | late String baseUrl; 41 | late String token; 42 | 43 | Future> get( 44 | APIType apiType, 45 | String path, { 46 | Map? query, 47 | Map? headers, 48 | }) async { 49 | _setDioInterceptorList(); 50 | 51 | final standardHeaders = await _getOptions(apiType); 52 | 53 | return _dio 54 | .get(path, queryParameters: query, options: standardHeaders) 55 | .then((value) => value) 56 | .catchError(_handleException); 57 | } 58 | 59 | Future> post( 60 | APIType apiType, 61 | String path, 62 | Map data, { 63 | Map? headers, 64 | Map? query, 65 | }) async { 66 | _setDioInterceptorList(); 67 | 68 | final standardHeaders = await _getOptions(apiType); 69 | if (headers != null) { 70 | standardHeaders.headers?.addAll(headers); 71 | } 72 | 73 | return _dio 74 | .post( 75 | path, 76 | data: data, 77 | options: standardHeaders, 78 | queryParameters: query, 79 | ) 80 | .then((value) => value) 81 | .catchError(_handleException); 82 | } 83 | 84 | /// Supports media upload 85 | Future> postFormData( 86 | APIType apiType, 87 | String path, 88 | Map data, { 89 | Map? headers, 90 | Map? query, 91 | }) async { 92 | _setDioInterceptorList(); 93 | 94 | final standardHeaders = await _getOptions(apiType); 95 | standardHeaders.headers?.addAll({ 96 | 'Content-Type': 'multipart/form-data', 97 | }); 98 | 99 | return _dio 100 | .post( 101 | path, 102 | data: FormData.fromMap(data), 103 | options: standardHeaders, 104 | queryParameters: query, 105 | ) 106 | .then((value) => value) 107 | .catchError(_handleException); 108 | } 109 | 110 | Future> patch( 111 | APIType api, 112 | String path, 113 | Map data, { 114 | Map? headers, 115 | Map? query, 116 | }) async { 117 | _setDioInterceptorList(); 118 | 119 | final standardHeaders = await _getOptions(api); 120 | if (headers != null) { 121 | standardHeaders.headers?.addAll(headers); 122 | } 123 | 124 | return _dio 125 | .patch( 126 | path, 127 | data: data, 128 | options: standardHeaders, 129 | queryParameters: query, 130 | ) 131 | .then((value) => value) 132 | .catchError(_handleException); 133 | } 134 | 135 | Future> put( 136 | APIType apiType, 137 | String path, 138 | Map data, { 139 | Map? headers, 140 | Map? query, 141 | }) async { 142 | _setDioInterceptorList(); 143 | 144 | final standardHeaders = await _getOptions(apiType); 145 | if (headers != null) { 146 | standardHeaders.headers?.addAll(headers); 147 | } 148 | 149 | return _dio 150 | .put( 151 | path, 152 | data: data, 153 | options: standardHeaders, 154 | ) 155 | .then((value) => value) 156 | .catchError(_handleException); 157 | } 158 | 159 | Future> delete( 160 | APIType apiType, 161 | String path, { 162 | Map? data, 163 | Map? headers, 164 | Map? query, 165 | }) async { 166 | _setDioInterceptorList(); 167 | 168 | final standardHeaders = await _getOptions(apiType); 169 | if (headers != null) { 170 | standardHeaders.headers?.addAll(headers); 171 | } 172 | 173 | return _dio 174 | .delete( 175 | path, 176 | data: data, 177 | queryParameters: query, 178 | options: standardHeaders, 179 | ) 180 | .then((value) => value) 181 | .catchError(_handleException); 182 | } 183 | 184 | /// Supports media upload 185 | Future> putFormData( 186 | APIType apiType, 187 | String path, 188 | Map data, { 189 | Map? headers, 190 | Map? query, 191 | }) async { 192 | _setDioInterceptorList(); 193 | 194 | final standardHeaders = await _getOptions(apiType); 195 | if (headers != null) { 196 | standardHeaders.headers?.addAll({ 197 | 'Content-Type': 'multipart/form-data', 198 | }); 199 | } 200 | data.addAll({ 201 | '_method': 'PUT', 202 | }); 203 | 204 | return _dio 205 | .post( 206 | path, 207 | data: FormData.fromMap(data), 208 | queryParameters: query, 209 | options: standardHeaders, 210 | ) 211 | .then((value) => value) 212 | .catchError(_handleException); 213 | } 214 | 215 | /// Upload file in s3bucket 216 | Future fileUploadInS3Bucket({ 217 | required String preAssignedUrl, 218 | required File file, 219 | }) async { 220 | return _dio.put( 221 | preAssignedUrl, 222 | data: file.openRead(), 223 | options: Options( 224 | headers: { 225 | Headers.contentLengthHeader: await file.length(), 226 | }, 227 | ), 228 | ); 229 | } 230 | 231 | dynamic _handleException(error) { 232 | dynamic errorData = error.response!.data; 233 | 234 | switch (error.response?.statusCode) { 235 | case 400: 236 | throw BadRequest(errorData); 237 | case 401: 238 | throw Unauthorized(errorData); 239 | case 403: 240 | throw Forbidden(errorData); 241 | case 404: 242 | throw NotFound(errorData); 243 | case 405: 244 | throw MethodNotAllowed(errorData); 245 | case 406: 246 | throw NotAcceptable(errorData); 247 | case 408: 248 | throw RequestTimeout(errorData); 249 | case 409: 250 | throw Conflict(errorData); 251 | case 410: 252 | throw Gone(errorData); 253 | case 411: 254 | throw LengthRequired(errorData); 255 | case 412: 256 | throw PreconditionFailed(errorData); 257 | case 413: 258 | throw PayloadTooLarge(errorData); 259 | case 414: 260 | throw URITooLong(errorData); 261 | case 415: 262 | throw UnsupportedMediaType(errorData); 263 | case 416: 264 | throw RangeNotSatisfiable(errorData); 265 | case 417: 266 | throw ExpectationFailed(errorData); 267 | case 422: 268 | throw UnprocessableEntity(errorData); 269 | case 429: 270 | throw TooManyRequests(errorData); 271 | case 500: 272 | throw InternalServerError(errorData); 273 | case 501: 274 | throw NotImplemented(errorData); 275 | case 502: 276 | throw BadGateway(errorData); 277 | case 503: 278 | throw ServiceUnavailable(errorData); 279 | case 504: 280 | throw GatewayTimeout(errorData); 281 | default: 282 | throw Unexpected(errorData); 283 | } 284 | } 285 | 286 | void _setDioInterceptorList() { 287 | List interceptorList = []; 288 | _dio.interceptors.clear(); 289 | 290 | if (kDebugMode) { 291 | interceptorList.add(PrettyDioLogger()); 292 | } 293 | _dio.interceptors.addAll(interceptorList); 294 | } 295 | 296 | Future _getOptions(APIType api) async { 297 | switch (api) { 298 | case APIType.public: 299 | return PublicApiOptions().options; 300 | 301 | case APIType.protected: 302 | return ProtectedApiOptions(token).options; 303 | 304 | default: 305 | return PublicApiOptions().options; 306 | } 307 | } 308 | } 309 | -------------------------------------------------------------------------------- /network/lib/src/utils/pretty_dio_logger.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as math; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | 6 | /// code copied from https://pub.dev/packages/pretty_dio_logger 7 | class PrettyDioLogger extends Interceptor { 8 | /// Print request [Options] 9 | final bool request; 10 | 11 | /// Print request header [Options.headers] 12 | final bool requestHeader; 13 | 14 | /// Print request data [Options.tribeCollectionData] 15 | final bool requestBody; 16 | 17 | /// Print [Response.data] 18 | final bool responseBody; 19 | 20 | /// Print [Response.headers] 21 | final bool responseHeader; 22 | 23 | /// Print error message 24 | final bool error; 25 | 26 | /// InitialTab count to logPrint json response 27 | static const int initialTab = 1; 28 | 29 | /// 1 tab length 30 | static const String tabStep = ' '; 31 | 32 | /// Print compact json response 33 | final bool compact; 34 | 35 | /// Width size per logPrint 36 | final int maxWidth; 37 | 38 | /// Log printer; defaults logPrint log to console. 39 | /// In flutter, you'd better use debugPrint. 40 | /// you can also write log in a file. 41 | void Function(Object object) logPrint; 42 | 43 | static const int defaultMaxWidth = 90; 44 | 45 | static const bool isDebugMode = kDebugMode; 46 | 47 | PrettyDioLogger({ 48 | this.request = isDebugMode, 49 | this.requestHeader = isDebugMode, 50 | this.requestBody = isDebugMode, 51 | this.responseHeader = isDebugMode, 52 | this.responseBody = isDebugMode, 53 | this.error = isDebugMode, 54 | this.maxWidth = defaultMaxWidth, 55 | this.compact = isDebugMode, 56 | this.logPrint = print, 57 | }); 58 | 59 | @override 60 | void onRequest(RequestOptions options, RequestInterceptorHandler handler) { 61 | if (request) { 62 | _printRequestHeader(options); 63 | } 64 | if (requestHeader) { 65 | _printMapAsTable(options.queryParameters, header: 'Query Parameters'); 66 | final requestHeaders = {}; 67 | requestHeaders.addAll(options.headers); 68 | requestHeaders['contentType'] = options.contentType?.toString(); 69 | requestHeaders['responseType'] = options.responseType.toString(); 70 | requestHeaders['followRedirects'] = options.followRedirects; 71 | requestHeaders['connectTimeout'] = options.connectTimeout; 72 | requestHeaders['receiveTimeout'] = options.receiveTimeout; 73 | _printMapAsTable(requestHeaders, header: 'Headers'); 74 | _printMapAsTable(options.extra, header: 'Extras'); 75 | } 76 | if (requestBody && options.method != 'GET') { 77 | final dynamic data = options.data; 78 | if (data != null) { 79 | // ignore: always_put_control_body_on_new_line 80 | if (data is Map) _printMapAsTable(options.data as Map, header: 'Body'); 81 | if (data is FormData) { 82 | final formDataMap = {} 83 | ..addEntries(data.fields) 84 | ..addEntries(data.files); 85 | _printMapAsTable(formDataMap, header: 'Form data | ${data.boundary}'); 86 | } else { 87 | _printBlock(data.toString()); 88 | } 89 | } 90 | } 91 | super.onRequest(options, handler); 92 | } 93 | 94 | @override 95 | void onError(DioError err, ErrorInterceptorHandler handler) { 96 | if (error) { 97 | if (err.type == DioErrorType.badResponse) { 98 | final uri = err.response?.requestOptions.uri; 99 | _printBoxed( 100 | header: 101 | 'DioError ║ Status: ${err.response?.statusCode} ${err.response?.statusMessage}', 102 | text: uri.toString()); 103 | if (err.response != null && err.response?.data != null) { 104 | logPrint('╔ ${err.type.toString()}'); 105 | _printResponse(err.response!); 106 | } 107 | _printLine('╚'); 108 | logPrint(''); 109 | } else { 110 | _printBoxed(header: 'DioError ║ ${err.type}', text: err.message); 111 | } 112 | } 113 | super.onError(err, handler); 114 | } 115 | 116 | @override 117 | void onResponse(Response response, ResponseInterceptorHandler handler) { 118 | _printResponseHeader(response); 119 | if (responseHeader) { 120 | final responseHeaders = {}; 121 | response.headers 122 | .forEach((k, list) => responseHeaders[k] = list.toString()); 123 | _printMapAsTable(responseHeaders, header: 'Headers'); 124 | } 125 | 126 | if (responseBody) { 127 | logPrint('╔ Body'); 128 | logPrint('║'); 129 | _printResponse(response); 130 | logPrint('║'); 131 | _printLine('╚'); 132 | } 133 | super.onResponse(response, handler); 134 | } 135 | 136 | void _printBoxed({String? header, String? text}) { 137 | logPrint(''); 138 | logPrint('╔╣ $header'); 139 | logPrint('║ $text'); 140 | _printLine('╚'); 141 | } 142 | 143 | void _printResponse(Response response) { 144 | if (response.data != null) { 145 | if (response.data is Map) { 146 | _printPrettyMap(response.data as Map); 147 | } else if (response.data is List) { 148 | logPrint('║${_indent()}['); 149 | _printList(response.data as List); 150 | logPrint('║${_indent()}['); 151 | } else { 152 | _printBlock(response.data.toString()); 153 | } 154 | } 155 | } 156 | 157 | void _printResponseHeader(Response response) { 158 | final uri = response.requestOptions.uri; 159 | final method = response.requestOptions.method; 160 | _printBoxed( 161 | header: 162 | 'Response ║ $method ║ Status: ${response.statusCode} ${response.statusMessage}', 163 | text: uri.toString()); 164 | } 165 | 166 | void _printRequestHeader(RequestOptions options) { 167 | final uri = options.uri; 168 | final method = options.method; 169 | _printBoxed(header: 'Request ║ $method ', text: uri.toString()); 170 | } 171 | 172 | void _printLine([String pre = '', String suf = '╝']) => 173 | logPrint('$pre${'═' * maxWidth}$suf'); 174 | 175 | void _printKV(String key, Object v) { 176 | final pre = '╟ "$key": '; 177 | final msg = v.toString(); 178 | 179 | if (pre.length + msg.length > maxWidth) { 180 | logPrint(pre); 181 | _printBlock(msg); 182 | } else { 183 | logPrint('$pre$msg'); 184 | } 185 | } 186 | 187 | void _printBlock(String msg) { 188 | final lines = (msg.length / maxWidth).ceil(); 189 | for (var i = 0; i < lines; ++i) { 190 | logPrint((i >= 0 ? '║ ' : '') + 191 | msg.substring(i * maxWidth, 192 | math.min(i * maxWidth + maxWidth, msg.length))); 193 | } 194 | } 195 | 196 | String _indent([int tabCount = initialTab]) => tabStep * tabCount; 197 | 198 | void _printPrettyMap( 199 | Map data, { 200 | int tabs = initialTab, 201 | bool isListItem = false, 202 | bool isLast = false, 203 | }) { 204 | var tabCount = tabs; 205 | final isRoot = tabCount == initialTab; 206 | final initialIndent = _indent(tabCount); 207 | tabCount++; 208 | 209 | // ignore: always_put_control_body_on_new_line 210 | if (isRoot || isListItem) logPrint('║$initialIndent{'); 211 | 212 | data.keys.toList().asMap().forEach((index, dynamic key) { 213 | final isLast = index == data.length - 1; 214 | dynamic value = data[key]; 215 | if (value is String) { 216 | value = '"${value.toString().replaceAll(RegExp(r'(\r|\n)+'), " ")}"'; 217 | } 218 | if (value is Map) { 219 | if (compact && _canFlattenMap(value)) { 220 | logPrint('║${_indent(tabCount)} "$key": $value${!isLast ? ',' : ''}'); 221 | } else { 222 | logPrint('║${_indent(tabCount)} "$key": {'); 223 | _printPrettyMap(value, tabs: tabCount); 224 | } 225 | } else if (value is List) { 226 | if (compact && _canFlattenList(value)) { 227 | logPrint('║${_indent(tabCount)} "$key": ${value.toString()}'); 228 | } else { 229 | logPrint('║${_indent(tabCount)} "$key": ['); 230 | _printList(value, tabs: tabCount); 231 | logPrint('║${_indent(tabCount)} ]${isLast ? '' : ','}'); 232 | } 233 | } else { 234 | final msg = value.toString().replaceAll('\n', ''); 235 | final indent = _indent(tabCount); 236 | final linWidth = maxWidth - indent.length; 237 | if (msg.length + indent.length > linWidth) { 238 | final lines = (msg.length / linWidth).ceil(); 239 | for (var i = 0; i < lines; ++i) { 240 | logPrint( 241 | '║${_indent(tabCount)} ${msg.substring(i * linWidth, math.min(i * linWidth + linWidth, msg.length))}'); 242 | } 243 | } else { 244 | logPrint('║${_indent(tabCount)} "$key": $msg${!isLast ? ',' : ''}'); 245 | } 246 | } 247 | }); 248 | 249 | logPrint('║$initialIndent}${isListItem && !isLast ? ',' : ''}'); 250 | } 251 | 252 | void _printList(List list, {int tabs = initialTab}) { 253 | int tabsCount = 2; 254 | list.asMap().forEach((i, dynamic e) { 255 | final isLast = i == list.length - 1; 256 | if (e is Map) { 257 | if (compact && _canFlattenMap(e)) { 258 | logPrint('║${_indent(tabs)} $e${!isLast ? ',' : ''}'); 259 | } else { 260 | _printPrettyMap(e, tabs: tabs + 1, isListItem: true, isLast: isLast); 261 | } 262 | } else { 263 | logPrint('║${_indent(tabs + tabsCount)} $e${isLast ? '' : ','}'); 264 | } 265 | }); 266 | } 267 | 268 | bool _canFlattenMap(Map map) { 269 | return map.values 270 | .where((dynamic val) => val is Map || val is List) 271 | .isEmpty && 272 | map.toString().length < maxWidth; 273 | } 274 | 275 | bool _canFlattenList(List list) { 276 | int maxListLength = 10; 277 | 278 | return list.length < maxListLength && list.toString().length < maxWidth; 279 | } 280 | 281 | void _printMapAsTable(Map map, {String? header}) { 282 | // ignore: always_put_control_body_on_new_line 283 | if (map.isEmpty) return; 284 | logPrint('╔ $header '); 285 | map.forEach( 286 | (dynamic key, dynamic value) => _printKV(key.toString(), value)); 287 | _printLine('╚'); 288 | } 289 | } 290 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 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 = 1300; 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 | alwaysOutOfDate = 1; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | ); 178 | inputPaths = ( 179 | "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", 180 | ); 181 | name = "Thin Binary"; 182 | outputPaths = ( 183 | ); 184 | runOnlyForDeploymentPostprocessing = 0; 185 | shellPath = /bin/sh; 186 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 187 | }; 188 | 9740EEB61CF901F6004384FC /* Run Script */ = { 189 | isa = PBXShellScriptBuildPhase; 190 | alwaysOutOfDate = 1; 191 | buildActionMask = 2147483647; 192 | files = ( 193 | ); 194 | inputPaths = ( 195 | ); 196 | name = "Run Script"; 197 | outputPaths = ( 198 | ); 199 | runOnlyForDeploymentPostprocessing = 0; 200 | shellPath = /bin/sh; 201 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 202 | }; 203 | /* End PBXShellScriptBuildPhase section */ 204 | 205 | /* Begin PBXSourcesBuildPhase section */ 206 | 97C146EA1CF9000F007C117D /* Sources */ = { 207 | isa = PBXSourcesBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 211 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXSourcesBuildPhase section */ 216 | 217 | /* Begin PBXVariantGroup section */ 218 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 219 | isa = PBXVariantGroup; 220 | children = ( 221 | 97C146FB1CF9000F007C117D /* Base */, 222 | ); 223 | name = Main.storyboard; 224 | sourceTree = ""; 225 | }; 226 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 227 | isa = PBXVariantGroup; 228 | children = ( 229 | 97C147001CF9000F007C117D /* Base */, 230 | ); 231 | name = LaunchScreen.storyboard; 232 | sourceTree = ""; 233 | }; 234 | /* End PBXVariantGroup section */ 235 | 236 | /* Begin XCBuildConfiguration section */ 237 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 238 | isa = XCBuildConfiguration; 239 | buildSettings = { 240 | ALWAYS_SEARCH_USER_PATHS = NO; 241 | CLANG_ANALYZER_NONNULL = YES; 242 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 243 | CLANG_CXX_LIBRARY = "libc++"; 244 | CLANG_ENABLE_MODULES = YES; 245 | CLANG_ENABLE_OBJC_ARC = YES; 246 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 247 | CLANG_WARN_BOOL_CONVERSION = YES; 248 | CLANG_WARN_COMMA = YES; 249 | CLANG_WARN_CONSTANT_CONVERSION = YES; 250 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 251 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 252 | CLANG_WARN_EMPTY_BODY = YES; 253 | CLANG_WARN_ENUM_CONVERSION = YES; 254 | CLANG_WARN_INFINITE_RECURSION = YES; 255 | CLANG_WARN_INT_CONVERSION = YES; 256 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 257 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 258 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 259 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 260 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 261 | CLANG_WARN_STRICT_PROTOTYPES = YES; 262 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 263 | CLANG_WARN_UNREACHABLE_CODE = YES; 264 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 265 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 266 | COPY_PHASE_STRIP = NO; 267 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 268 | ENABLE_NS_ASSERTIONS = NO; 269 | ENABLE_STRICT_OBJC_MSGSEND = YES; 270 | GCC_C_LANGUAGE_STANDARD = gnu99; 271 | GCC_NO_COMMON_BLOCKS = YES; 272 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 273 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 274 | GCC_WARN_UNDECLARED_SELECTOR = YES; 275 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 276 | GCC_WARN_UNUSED_FUNCTION = YES; 277 | GCC_WARN_UNUSED_VARIABLE = YES; 278 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 279 | MTL_ENABLE_DEBUG_INFO = NO; 280 | SDKROOT = iphoneos; 281 | SUPPORTED_PLATFORMS = iphoneos; 282 | TARGETED_DEVICE_FAMILY = "1,2"; 283 | VALIDATE_PRODUCT = YES; 284 | }; 285 | name = Profile; 286 | }; 287 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 288 | isa = XCBuildConfiguration; 289 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 290 | buildSettings = { 291 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 292 | CLANG_ENABLE_MODULES = YES; 293 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 294 | DEVELOPMENT_TEAM = DXD6P23455; 295 | ENABLE_BITCODE = NO; 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = ( 298 | "$(inherited)", 299 | "@executable_path/Frameworks", 300 | ); 301 | PRODUCT_BUNDLE_IDENTIFIER = com.momshaddinury.fakeCommerce; 302 | PRODUCT_NAME = "$(TARGET_NAME)"; 303 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 304 | SWIFT_VERSION = 5.0; 305 | VERSIONING_SYSTEM = "apple-generic"; 306 | }; 307 | name = Profile; 308 | }; 309 | 97C147031CF9000F007C117D /* Debug */ = { 310 | isa = XCBuildConfiguration; 311 | buildSettings = { 312 | ALWAYS_SEARCH_USER_PATHS = NO; 313 | CLANG_ANALYZER_NONNULL = YES; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 319 | CLANG_WARN_BOOL_CONVERSION = YES; 320 | CLANG_WARN_COMMA = YES; 321 | CLANG_WARN_CONSTANT_CONVERSION = YES; 322 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 323 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 324 | CLANG_WARN_EMPTY_BODY = YES; 325 | CLANG_WARN_ENUM_CONVERSION = YES; 326 | CLANG_WARN_INFINITE_RECURSION = YES; 327 | CLANG_WARN_INT_CONVERSION = YES; 328 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 329 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 330 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 331 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 332 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 333 | CLANG_WARN_STRICT_PROTOTYPES = YES; 334 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 335 | CLANG_WARN_UNREACHABLE_CODE = YES; 336 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 337 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 338 | COPY_PHASE_STRIP = NO; 339 | DEBUG_INFORMATION_FORMAT = dwarf; 340 | ENABLE_STRICT_OBJC_MSGSEND = YES; 341 | ENABLE_TESTABILITY = YES; 342 | GCC_C_LANGUAGE_STANDARD = gnu99; 343 | GCC_DYNAMIC_NO_PIC = NO; 344 | GCC_NO_COMMON_BLOCKS = YES; 345 | GCC_OPTIMIZATION_LEVEL = 0; 346 | GCC_PREPROCESSOR_DEFINITIONS = ( 347 | "DEBUG=1", 348 | "$(inherited)", 349 | ); 350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 351 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 352 | GCC_WARN_UNDECLARED_SELECTOR = YES; 353 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 354 | GCC_WARN_UNUSED_FUNCTION = YES; 355 | GCC_WARN_UNUSED_VARIABLE = YES; 356 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 357 | MTL_ENABLE_DEBUG_INFO = YES; 358 | ONLY_ACTIVE_ARCH = YES; 359 | SDKROOT = iphoneos; 360 | TARGETED_DEVICE_FAMILY = "1,2"; 361 | }; 362 | name = Debug; 363 | }; 364 | 97C147041CF9000F007C117D /* Release */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | ALWAYS_SEARCH_USER_PATHS = NO; 368 | CLANG_ANALYZER_NONNULL = YES; 369 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 370 | CLANG_CXX_LIBRARY = "libc++"; 371 | CLANG_ENABLE_MODULES = YES; 372 | CLANG_ENABLE_OBJC_ARC = YES; 373 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 374 | CLANG_WARN_BOOL_CONVERSION = YES; 375 | CLANG_WARN_COMMA = YES; 376 | CLANG_WARN_CONSTANT_CONVERSION = YES; 377 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 378 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 379 | CLANG_WARN_EMPTY_BODY = YES; 380 | CLANG_WARN_ENUM_CONVERSION = YES; 381 | CLANG_WARN_INFINITE_RECURSION = YES; 382 | CLANG_WARN_INT_CONVERSION = YES; 383 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 384 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 385 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 386 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 387 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 388 | CLANG_WARN_STRICT_PROTOTYPES = YES; 389 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 390 | CLANG_WARN_UNREACHABLE_CODE = YES; 391 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 392 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 393 | COPY_PHASE_STRIP = NO; 394 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 395 | ENABLE_NS_ASSERTIONS = NO; 396 | ENABLE_STRICT_OBJC_MSGSEND = YES; 397 | GCC_C_LANGUAGE_STANDARD = gnu99; 398 | GCC_NO_COMMON_BLOCKS = YES; 399 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 400 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 401 | GCC_WARN_UNDECLARED_SELECTOR = YES; 402 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 403 | GCC_WARN_UNUSED_FUNCTION = YES; 404 | GCC_WARN_UNUSED_VARIABLE = YES; 405 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 406 | MTL_ENABLE_DEBUG_INFO = NO; 407 | SDKROOT = iphoneos; 408 | SUPPORTED_PLATFORMS = iphoneos; 409 | SWIFT_COMPILATION_MODE = wholemodule; 410 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | VALIDATE_PRODUCT = YES; 413 | }; 414 | name = Release; 415 | }; 416 | 97C147061CF9000F007C117D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 423 | DEVELOPMENT_TEAM = DXD6P23455; 424 | ENABLE_BITCODE = NO; 425 | INFOPLIST_FILE = Runner/Info.plist; 426 | LD_RUNPATH_SEARCH_PATHS = ( 427 | "$(inherited)", 428 | "@executable_path/Frameworks", 429 | ); 430 | PRODUCT_BUNDLE_IDENTIFIER = com.momshaddinury.fakeCommerce; 431 | PRODUCT_NAME = "$(TARGET_NAME)"; 432 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 433 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 434 | SWIFT_VERSION = 5.0; 435 | VERSIONING_SYSTEM = "apple-generic"; 436 | }; 437 | name = Debug; 438 | }; 439 | 97C147071CF9000F007C117D /* Release */ = { 440 | isa = XCBuildConfiguration; 441 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | CLANG_ENABLE_MODULES = YES; 445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 446 | DEVELOPMENT_TEAM = DXD6P23455; 447 | ENABLE_BITCODE = NO; 448 | INFOPLIST_FILE = Runner/Info.plist; 449 | LD_RUNPATH_SEARCH_PATHS = ( 450 | "$(inherited)", 451 | "@executable_path/Frameworks", 452 | ); 453 | PRODUCT_BUNDLE_IDENTIFIER = com.momshaddinury.fakeCommerce; 454 | PRODUCT_NAME = "$(TARGET_NAME)"; 455 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 456 | SWIFT_VERSION = 5.0; 457 | VERSIONING_SYSTEM = "apple-generic"; 458 | }; 459 | name = Release; 460 | }; 461 | /* End XCBuildConfiguration section */ 462 | 463 | /* Begin XCConfigurationList section */ 464 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 465 | isa = XCConfigurationList; 466 | buildConfigurations = ( 467 | 97C147031CF9000F007C117D /* Debug */, 468 | 97C147041CF9000F007C117D /* Release */, 469 | 249021D3217E4FDB00AE95B9 /* Profile */, 470 | ); 471 | defaultConfigurationIsVisible = 0; 472 | defaultConfigurationName = Release; 473 | }; 474 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 475 | isa = XCConfigurationList; 476 | buildConfigurations = ( 477 | 97C147061CF9000F007C117D /* Debug */, 478 | 97C147071CF9000F007C117D /* Release */, 479 | 249021D4217E4FDB00AE95B9 /* Profile */, 480 | ); 481 | defaultConfigurationIsVisible = 0; 482 | defaultConfigurationName = Release; 483 | }; 484 | /* End XCConfigurationList section */ 485 | }; 486 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 487 | } 488 | --------------------------------------------------------------------------------