├── 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.xcworkspace │ └── contents.xcworkspacedata ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ └── project.pbxproj └── .gitignore ├── assets ├── icon.png └── categories │ ├── dark │ ├── tv.png │ ├── all.png │ ├── moda.png │ ├── decor.png │ ├── games.png │ ├── telefonia.png │ ├── automotivo.png │ ├── brinquedos.png │ ├── informatica.png │ └── eletrodomesticos.png │ ├── light │ ├── all.png │ ├── tv.png │ ├── decor.png │ ├── games.png │ ├── moda.png │ ├── automotivo.png │ ├── brinquedos.png │ ├── informatica.png │ ├── telefonia.png │ └── eletrodomesticos.png │ └── dark-yellow │ ├── tv.png │ ├── all.png │ ├── decor.png │ ├── games.png │ ├── moda.png │ ├── automotivo.png │ ├── brinquedos.png │ ├── telefonia.png │ ├── informatica.png │ └── eletrodomesticos.png ├── lib ├── main.dart └── app │ ├── app_bloc.dart │ ├── ui │ ├── ios │ │ ├── pages │ │ │ └── home │ │ │ │ ├── home_bloc.dart │ │ │ │ └── home_page.dart │ │ ├── components │ │ │ └── tabs │ │ │ │ ├── tabs_bloc.dart │ │ │ │ └── tabs_widget.dart │ │ └── ios_module.dart │ ├── android │ │ ├── pages │ │ │ ├── cart │ │ │ │ ├── cart_bloc.dart │ │ │ │ └── cart_page.dart │ │ │ ├── home │ │ │ │ ├── home_bloc.dart │ │ │ │ └── home_page.dart │ │ │ ├── login │ │ │ │ ├── login_bloc.dart │ │ │ │ └── login_page.dart │ │ │ ├── signup │ │ │ │ ├── signup_bloc.dart │ │ │ │ └── signup_page.dart │ │ │ ├── account │ │ │ │ ├── account_bloc.dart │ │ │ │ └── account_page.dart │ │ │ ├── settings │ │ │ │ ├── settings_bloc.dart │ │ │ │ └── settings_page.dart │ │ │ └── product │ │ │ │ ├── product_bloc.dart │ │ │ │ └── product_page.dart │ │ ├── components │ │ │ ├── tabs │ │ │ │ ├── tabs_bloc.dart │ │ │ │ └── tabs_widget.dart │ │ │ └── cart_item │ │ │ │ ├── cart_item_bloc.dart │ │ │ │ └── cart_item_widget.dart │ │ └── android_module.dart │ ├── shared │ │ ├── components │ │ │ ├── loader │ │ │ │ ├── loader_bloc.dart │ │ │ │ └── loader_widget.dart │ │ │ ├── product │ │ │ │ └── product_list │ │ │ │ │ ├── product_list_bloc.dart │ │ │ │ │ ├── product_card │ │ │ │ │ ├── product_card_bloc.dart │ │ │ │ │ ├── add_to_cart │ │ │ │ │ │ ├── add_to_cart_bloc.dart │ │ │ │ │ │ └── add_to_cart_widget.dart │ │ │ │ │ └── product_card_widget.dart │ │ │ │ │ └── product_list_widget.dart │ │ │ ├── category │ │ │ │ └── category_list │ │ │ │ │ ├── category_list_bloc.dart │ │ │ │ │ ├── category_card │ │ │ │ │ ├── category_card_bloc.dart │ │ │ │ │ └── category_card_widget.dart │ │ │ │ │ └── category_list_widget.dart │ │ │ └── progress_indicator │ │ │ │ ├── progress_indicator_bloc.dart │ │ │ │ └── progress_indicator_widget.dart │ │ ├── account │ │ │ ├── authenticated_user_card │ │ │ │ ├── authenticated_user_card_bloc.dart │ │ │ │ └── authenticated_user_card_widget.dart │ │ │ └── unauthenticated_user_card │ │ │ │ ├── unauthenticated_user_card_bloc.dart │ │ │ │ └── unauthenticated_user_card_widget.dart │ │ └── blocs │ │ │ ├── cart_bloc.dart │ │ │ └── home_bloc.dart │ └── ui_module.dart │ ├── shared │ ├── settings.dart │ ├── validators │ │ └── custom.validator.dart │ ├── utils.dart │ ├── custom_dio │ │ ├── custom_dio.dart │ │ ├── cache_interceptor.dart │ │ └── interceptor.dart │ └── blocs │ │ ├── theme_bloc.dart │ │ └── user_bloc.dart │ ├── models │ ├── category.model.dart │ ├── authenticate-user.model.dart │ ├── category-list-item.model.dart │ ├── create-user-model.dart │ ├── cart-item.model.dart │ ├── product-list-item.model.dart │ ├── user.model.dart │ └── product-details.model.dart │ ├── repositories │ ├── category_repository.dart │ ├── account_repository.dart │ └── product_repository.dart │ ├── app_widget.dart │ ├── app_module.dart │ └── themes │ ├── dark.theme.dart │ ├── dark-yellow.theme.dart │ └── light.theme.dart ├── android ├── gradle.properties ├── .gitignore ├── 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 │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── shopping │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── build.gradle ├── .metadata ├── README.md ├── .gitignore ├── pubspec.yaml └── pubspec.lock /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" -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/icon.png -------------------------------------------------------------------------------- /assets/categories/dark/tv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark/tv.png -------------------------------------------------------------------------------- /assets/categories/dark/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark/all.png -------------------------------------------------------------------------------- /assets/categories/dark/moda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark/moda.png -------------------------------------------------------------------------------- /assets/categories/light/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/light/all.png -------------------------------------------------------------------------------- /assets/categories/light/tv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/light/tv.png -------------------------------------------------------------------------------- /assets/categories/dark/decor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark/decor.png -------------------------------------------------------------------------------- /assets/categories/dark/games.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark/games.png -------------------------------------------------------------------------------- /assets/categories/light/decor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/light/decor.png -------------------------------------------------------------------------------- /assets/categories/light/games.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/light/games.png -------------------------------------------------------------------------------- /assets/categories/light/moda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/light/moda.png -------------------------------------------------------------------------------- /assets/categories/dark-yellow/tv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark-yellow/tv.png -------------------------------------------------------------------------------- /assets/categories/dark/telefonia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark/telefonia.png -------------------------------------------------------------------------------- /assets/categories/dark-yellow/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark-yellow/all.png -------------------------------------------------------------------------------- /assets/categories/dark-yellow/decor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark-yellow/decor.png -------------------------------------------------------------------------------- /assets/categories/dark-yellow/games.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark-yellow/games.png -------------------------------------------------------------------------------- /assets/categories/dark-yellow/moda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark-yellow/moda.png -------------------------------------------------------------------------------- /assets/categories/dark/automotivo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark/automotivo.png -------------------------------------------------------------------------------- /assets/categories/dark/brinquedos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark/brinquedos.png -------------------------------------------------------------------------------- /assets/categories/dark/informatica.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark/informatica.png -------------------------------------------------------------------------------- /assets/categories/light/automotivo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/light/automotivo.png -------------------------------------------------------------------------------- /assets/categories/light/brinquedos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/light/brinquedos.png -------------------------------------------------------------------------------- /assets/categories/light/informatica.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/light/informatica.png -------------------------------------------------------------------------------- /assets/categories/light/telefonia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/light/telefonia.png -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'app/app_module.dart'; 4 | 5 | void main() => runApp(AppModule()); 6 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /assets/categories/dark-yellow/automotivo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark-yellow/automotivo.png -------------------------------------------------------------------------------- /assets/categories/dark-yellow/brinquedos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark-yellow/brinquedos.png -------------------------------------------------------------------------------- /assets/categories/dark-yellow/telefonia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark-yellow/telefonia.png -------------------------------------------------------------------------------- /assets/categories/dark/eletrodomesticos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark/eletrodomesticos.png -------------------------------------------------------------------------------- /assets/categories/light/eletrodomesticos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/light/eletrodomesticos.png -------------------------------------------------------------------------------- /assets/categories/dark-yellow/informatica.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark-yellow/informatica.png -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /assets/categories/dark-yellow/eletrodomesticos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/assets/categories/dark-yellow/eletrodomesticos.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/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/toshiossada/FluttereShop/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FluttereShop/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/toshiossada/FluttereShop/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/app/app_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class AppBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/ios/pages/home/home_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class HomeBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/cart/cart_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class CartBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/home/home_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class HomeBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/ios/components/tabs/tabs_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class TabsBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/android/components/tabs/tabs_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class TabsBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/login/login_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class LoginBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/signup/signup_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class SignupBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/account/account_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class AccountBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/settings/settings_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class SettingsBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/loader/loader_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class LoaderBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/android/components/cart_item/cart_item_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class CartItemBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/product/product_list/product_list_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class ProductListBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/category/category_list/category_list_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class CategoryListBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/shared/settings.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:shopping/app/models/user.model.dart'; 4 | 5 | class Settings { 6 | static const String apiUrl = "https://balta-eshop.azurewebsites.net/"; 7 | static String token; 8 | static String apiVersion = 'v1'; 9 | static String theme = "light"; 10 | static UserModel user; 11 | } -------------------------------------------------------------------------------- /lib/app/ui/shared/components/progress_indicator/progress_indicator_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class ProgressIndicatorBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/product/product_list/product_card/product_card_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class ProductCardBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/shared/account/authenticated_user_card/authenticated_user_card_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class AuthenticatedUserCardBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/category/category_list/category_card/category_card_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class CategoryCardBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/product/product_list/product_card/add_to_cart/add_to_cart_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class AddToCartBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/ui/shared/account/unauthenticated_user_card/unauthenticated_user_card_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class UnauthenticatedUserCardBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.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: cc3ca9a916cb1da851a1f36432154a534787da99 8 | channel: dev 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/app/shared/validators/custom.validator.dart: -------------------------------------------------------------------------------- 1 | class CustomValidators { 2 | static isEmail(String value) { 3 | RegExp regex = 4 | new RegExp(r"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"); 5 | if (!regex.hasMatch(value)) return 'E-mail inválido'; 6 | if (value.isEmpty) { 7 | return 'E-mail inválido'; 8 | } 9 | return null; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /lib/app/shared/utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Utils { 4 | static void showAlert( 5 | {BuildContext context, String title, String body, List actions}) { 6 | showDialog( 7 | context: context, 8 | builder: (BuildContext context) { 9 | return AlertDialog( 10 | title: Text(title), content: Text(body), actions: actions); 11 | }, 12 | ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/progress_indicator/progress_indicator_widget.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class GenericProgressIndicator extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | return Platform.isIOS 10 | ? CupertinoActivityIndicator() 11 | : CircularProgressIndicator(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/shopping/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.shopping 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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/main/res/drawable/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/app/models/category.model.dart: -------------------------------------------------------------------------------- 1 | class CategoryModel { 2 | String id; 3 | String title; 4 | String tag; 5 | 6 | CategoryModel({this.id, this.title, this.tag}); 7 | 8 | CategoryModel.fromJson(Map json) { 9 | id = json['id']; 10 | title = json['title']; 11 | tag = json['tag']; 12 | } 13 | 14 | Map toJson() { 15 | final data = Map(); 16 | data['id'] = this.id; 17 | data['title'] = this.title; 18 | data['tag'] = this.tag; 19 | 20 | return data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /lib/app/models/authenticate-user.model.dart: -------------------------------------------------------------------------------- 1 | class AuthenticateUserModel { 2 | String username; 3 | String password; 4 | 5 | AuthenticateUserModel({ 6 | this.username, 7 | this.password, 8 | }); 9 | 10 | AuthenticateUserModel.fromJson(Map json) { 11 | username = json['username']; 12 | password = json['password']; 13 | } 14 | 15 | Map toJson() { 16 | final Map data = new Map(); 17 | data['username'] = this.username; 18 | data['password'] = this.password; 19 | return data; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/app/models/category-list-item.model.dart: -------------------------------------------------------------------------------- 1 | class CategoryListItemModel { 2 | String id; 3 | String title; 4 | String tag; 5 | 6 | CategoryListItemModel({this.id, this.title, this.tag}); 7 | 8 | CategoryListItemModel.fromJson(Map json) { 9 | id = json['id']; 10 | title = json['title']; 11 | tag = json['tag']; 12 | } 13 | 14 | Map toJson() { 15 | final Map data = new Map(); 16 | data['id'] = this.id; 17 | data['title'] = this.title; 18 | data['tag'] = this.tag; 19 | return data; 20 | } 21 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # shopping 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | "# FluttereShop" 18 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Generated.xcconfig 20 | Flutter/app.flx 21 | Flutter/app.zip 22 | Flutter/flutter_assets/ 23 | Flutter/flutter_export_environment.sh 24 | ServiceDefinitions.json 25 | Runner/GeneratedPluginRegistrant.* 26 | 27 | # Exceptions to above rules. 28 | !default.mode1v3 29 | !default.mode2v3 30 | !default.pbxuser 31 | !default.perspectivev3 32 | -------------------------------------------------------------------------------- /lib/app/shared/custom_dio/custom_dio.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:shopping/app/shared/custom_dio/cache_interceptor.dart'; 3 | import 'package:shopping/app/shared/custom_dio/interceptor.dart'; 4 | import 'package:shopping/app/shared/settings.dart'; 5 | 6 | 7 | 8 | class CustomDio { 9 | final Dio client; 10 | 11 | CustomDio(this.client){ 12 | client.options = BaseOptions(); 13 | client.options.baseUrl = '${Settings.apiUrl}${Settings.apiVersion}/'; 14 | 15 | client.interceptors.add(CustomInterceptors()); 16 | 17 | client.interceptors.add(CacheInterceptor()); 18 | 19 | client.options.connectTimeout = 5000; 20 | } 21 | } -------------------------------------------------------------------------------- /lib/app/ui/ios/ios_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:shopping/app/ui/ios/components/tabs/tabs_widget.dart'; 2 | import 'package:shopping/app/ui/ios/pages/home/home_bloc.dart'; 3 | import 'package:shopping/app/ui/ios/components/tabs/tabs_bloc.dart'; 4 | import 'package:bloc_pattern/bloc_pattern.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class IosModule extends ModuleWidget { 8 | @override 9 | List get blocs => [ 10 | Bloc((i) => HomeBloc()), 11 | Bloc((i) => TabsBloc()), 12 | ]; 13 | 14 | @override 15 | List get dependencies => []; 16 | 17 | @override 18 | Widget get view => TabsWidget(); 19 | 20 | static Inject get to => Inject.of(); 21 | } 22 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/loader/loader_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/ui/shared/components/progress_indicator/progress_indicator_widget.dart'; 3 | 4 | class LoaderWidget extends StatelessWidget { 5 | final object; 6 | final Function callback; 7 | 8 | LoaderWidget({@required this.object, @required this.callback}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | if (object == null) 13 | return Center( 14 | child: GenericProgressIndicator(), 15 | ); 16 | else if (object.length == 0) 17 | return Center( 18 | child: Text('Nenhum item encontrado!'), 19 | ); 20 | else 21 | return callback(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | /build/ 31 | 32 | # Web related 33 | lib/generated_plugin_registrant.dart 34 | 35 | # Exceptions to above rules. 36 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 37 | -------------------------------------------------------------------------------- /lib/app/models/create-user-model.dart: -------------------------------------------------------------------------------- 1 | class CreateUserModel { 2 | String name; 3 | String email; 4 | String username; 5 | String password; 6 | 7 | CreateUserModel({ 8 | this.name, 9 | this.email, 10 | this.username, 11 | this.password, 12 | }); 13 | 14 | CreateUserModel.fromJson(Map json) { 15 | name = json['name']; 16 | email = json['email']; 17 | username = json['username']; 18 | password = json['password']; 19 | } 20 | 21 | Map toJson() { 22 | final Map data = new Map(); 23 | data['name'] = this.name; 24 | data['email'] = this.email; 25 | data['username'] = this.username; 26 | data['password'] = this.password; 27 | return data; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/app/models/cart-item.model.dart: -------------------------------------------------------------------------------- 1 | class CartItemModel { 2 | String id; 3 | String title; 4 | int quantity; 5 | double price; 6 | String image; 7 | 8 | CartItemModel({this.id, this.title, this.quantity, this.price, this.image}); 9 | 10 | CartItemModel.fromJson(Map json) { 11 | id = json['id']; 12 | title = json['title']; 13 | quantity = json['quantity']; 14 | price = json['price']; 15 | image = json['image']; 16 | } 17 | 18 | Map toJson() { 19 | final Map data = new Map(); 20 | data['id'] = this.id; 21 | data['title'] = this.title; 22 | data['quantity'] = this.quantity; 23 | data['price'] = this.price; 24 | data['image'] = this.image; 25 | return data; 26 | } 27 | } -------------------------------------------------------------------------------- /lib/app/repositories/category_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:dio/dio.dart'; 3 | import 'package:shopping/app/models/category-list-item.model.dart'; 4 | import 'package:shopping/app/shared/custom_dio/custom_dio.dart'; 5 | 6 | class CategoryRepository extends Disposable { 7 | final CustomDio dio; 8 | 9 | CategoryRepository(this.dio); 10 | 11 | Future> getAll() async { 12 | var url = '/categories'; 13 | 14 | var response = 15 | await dio.client.get(url, options: Options(extra: {'refresh': false})); 16 | 17 | return (response.data as List) 18 | .map((c) => CategoryListItemModel.fromJson(c)) 19 | .toList(); 20 | } 21 | 22 | //dispose will be called automatically by closing its streams 23 | @override 24 | void dispose() {} 25 | } 26 | -------------------------------------------------------------------------------- /lib/app/app_widget.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | import 'package:shopping/app/app_module.dart'; 4 | import 'package:shopping/app/shared/blocs/theme_bloc.dart'; 5 | import 'package:shopping/app/themes/light.theme.dart'; 6 | import 'package:shopping/app/ui/ui_module.dart'; 7 | 8 | class AppWidget extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | final bloc = AppModule.to.getBloc(); 12 | return StreamBuilder( 13 | stream: bloc.outTheme, 14 | initialData: lightTheme(), 15 | builder: (context, snapshot) { 16 | return MaterialApp( 17 | title: 'Flutter Slidy', 18 | debugShowCheckedModeBanner: false, 19 | theme: snapshot.data, 20 | home: UiModule(), 21 | ); 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/app/models/product-list-item.model.dart: -------------------------------------------------------------------------------- 1 | class ProductListItemModel { 2 | String id; 3 | String title; 4 | String brand; 5 | String tag; 6 | double price; 7 | String image; 8 | 9 | ProductListItemModel( 10 | {this.id, this.title, this.brand, this.tag, this.price, this.image}); 11 | 12 | ProductListItemModel.fromJson(Map json) { 13 | id = json['id']; 14 | title = json['title']; 15 | brand = json['brand']; 16 | tag = json['tag']; 17 | price = json['price']; 18 | image = json['image']; 19 | } 20 | 21 | Map toJson() { 22 | final data = Map(); 23 | data['id'] = this.id; 24 | data['title'] = this.title; 25 | data['brand'] = this.brand; 26 | data['tag'] = this.tag; 27 | data['price'] = this.price; 28 | data['image'] = this.image; 29 | 30 | return data; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/product/product_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:rxdart/subjects.dart'; 3 | import 'package:shopping/app/app_module.dart'; 4 | import 'package:shopping/app/models/product-details.model.dart'; 5 | import 'package:shopping/app/repositories/product_repository.dart'; 6 | 7 | class ProductBloc extends BlocBase { 8 | final productRepository = AppModule.to.getDependency(); 9 | 10 | final _productController = BehaviorSubject>(); 11 | 12 | Stream> get outProduct => 13 | _productController.stream; 14 | 15 | 16 | 17 | Future get(String tag) async { 18 | var p = productRepository.get(tag); 19 | _productController.add(p); 20 | return p; 21 | } 22 | 23 | //dispose will be called automatically by closing its streams 24 | @override 25 | void dispose() { 26 | super.dispose(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/app/repositories/account_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:shopping/app/models/authenticate-user.model.dart'; 3 | import 'package:shopping/app/models/create-user-model.dart'; 4 | import 'package:shopping/app/models/user.model.dart'; 5 | import 'package:shopping/app/shared/custom_dio/custom_dio.dart'; 6 | 7 | class AccountRepository extends Disposable { 8 | final CustomDio dio; 9 | 10 | AccountRepository(this.dio); 11 | Future authenticate(AuthenticateUserModel model) async { 12 | var url = '/account/login'; 13 | var response = await dio.client.post(url, data: model); 14 | 15 | return UserModel.fromJson(response.data); 16 | } 17 | 18 | Future create(CreateUserModel model) async { 19 | var url = '/account'; 20 | var response = await dio.client.post(url, data: model); 21 | 22 | return (response.data as UserModel); 23 | } 24 | 25 | //dispose will be called automatically by closing its streams 26 | @override 27 | void dispose() {} 28 | } 29 | -------------------------------------------------------------------------------- /lib/app/ui/shared/account/unauthenticated_user_card/unauthenticated_user_card_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/ui/android/pages/login/login_page.dart'; 3 | import 'package:shopping/app/ui/android/pages/signup/signup_page.dart'; 4 | 5 | class UnauthenticatedUserCardWidget extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | 9 | return Column( 10 | crossAxisAlignment: CrossAxisAlignment.stretch, 11 | children: [ 12 | SizedBox( 13 | height: 60, 14 | ), 15 | FlatButton( 16 | child: Text('Autentique-se'), 17 | onPressed: () { 18 | Navigator.push( 19 | context, MaterialPageRoute(builder: (context) => LoginPage())); 20 | }, 21 | ), 22 | FlatButton( 23 | child: Text('Ainda não sou cadastrado'), 24 | onPressed: (){ 25 | Navigator.push( 26 | context, MaterialPageRoute(builder: (context) => SignupPage())); 27 | }, 28 | ), 29 | ], 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/product/product_list/product_list_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/models/product-list-item.model.dart'; 3 | import 'package:shopping/app/ui/shared/components/loader/loader_widget.dart'; 4 | 5 | import 'product_card/product_card_widget.dart'; 6 | 7 | class ProductListWidget extends StatelessWidget { 8 | final List products; 9 | 10 | ProductListWidget({@required this.products}); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Container( 15 | height: 410, 16 | child: LoaderWidget( 17 | object: products, 18 | callback: list, 19 | ), 20 | ); 21 | } 22 | 23 | Widget list(){ 24 | return ListView.builder( 25 | scrollDirection: Axis.horizontal, 26 | itemCount: products.length, 27 | itemBuilder: (context, index){ 28 | return Padding( 29 | padding: EdgeInsets.all(5), 30 | child: ProductCardWidget( 31 | item: products[index], 32 | ), 33 | ); 34 | }, 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/app/models/user.model.dart: -------------------------------------------------------------------------------- 1 | class UserModel { 2 | String id; 3 | String name; 4 | String email; 5 | String image; 6 | String username; 7 | String password; 8 | String role; 9 | String token; 10 | 11 | UserModel({ 12 | this.id, 13 | this.name, 14 | this.email, 15 | this.image, 16 | this.username, 17 | this.password, 18 | this.role, 19 | this.token, 20 | }); 21 | 22 | UserModel.fromJson(Map json) { 23 | id = json['id']; 24 | name = json['name']; 25 | email = json['email']; 26 | image = json['image']; 27 | username = json['username']; 28 | password = json['password']; 29 | role = json['role']; 30 | token = json['token']; 31 | } 32 | 33 | Map toJson() { 34 | final Map data = new Map(); 35 | data['id'] = this.id; 36 | data['name'] = this.name; 37 | data['email'] = this.email; 38 | data['image'] = this.image; 39 | data['username'] = this.username; 40 | data['password'] = this.password; 41 | data['role'] = this.role; 42 | data['token'] = this.token; 43 | return data; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/category/category_list/category_list_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/models/category-list-item.model.dart'; 3 | import 'package:shopping/app/ui/shared/components/loader/loader_widget.dart'; 4 | 5 | import 'category_card/category_card_widget.dart'; 6 | 7 | class CategoryListWidget extends StatelessWidget { 8 | final List categories; 9 | 10 | CategoryListWidget({@required this.categories}); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Container( 15 | height: 90, 16 | child: LoaderWidget( 17 | object: categories, 18 | callback: list, 19 | ), 20 | ); 21 | } 22 | 23 | Widget list(){ 24 | return ListView.builder( 25 | scrollDirection: Axis.horizontal, 26 | itemCount: categories.length, 27 | itemBuilder: (context, index){ 28 | var item = categories[index]; 29 | 30 | return Padding( 31 | padding: EdgeInsets.all(5), 32 | child: CategoryCardWidget( 33 | item: item, 34 | ), 35 | ); 36 | }, 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/app/models/product-details.model.dart: -------------------------------------------------------------------------------- 1 | import 'category.model.dart'; 2 | 3 | class ProductDetailsModel { 4 | String id; 5 | String title; 6 | String tag; 7 | double price; 8 | String description; 9 | String brand; 10 | List images; 11 | CategoryModel category; 12 | 13 | ProductDetailsModel( 14 | {this.id, 15 | this.title, 16 | this.tag, 17 | this.price, 18 | this.description, 19 | this.brand, 20 | this.images, 21 | this.category}); 22 | 23 | ProductDetailsModel.fromJson(Map json) { 24 | id = json['id']; 25 | title = json['title']; 26 | tag = json['tag']; 27 | price = json['price']; 28 | description = json['description']; 29 | brand = json['brand']; 30 | images = json['images'].cast(); 31 | category = json['category'] != null 32 | ? new CategoryModel.fromJson(json['category']) 33 | : null; 34 | } 35 | 36 | Map toJson() { 37 | final Map data = new Map(); 38 | data['id'] = this.id; 39 | data['title'] = this.title; 40 | data['tag'] = this.tag; 41 | data['price'] = this.price; 42 | data['description'] = this.description; 43 | data['brand'] = this.brand; 44 | data['images'] = this.images; 45 | if (this.category != null) { 46 | data['category'] = this.category.toJson(); 47 | } 48 | return data; 49 | } 50 | } -------------------------------------------------------------------------------- /lib/app/app_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:shopping/app/repositories/product_repository.dart'; 3 | import 'package:shopping/app/repositories/category_repository.dart'; 4 | import 'package:shopping/app/repositories/account_repository.dart'; 5 | import 'package:shopping/app/shared/blocs/theme_bloc.dart'; 6 | import 'package:shopping/app/shared/blocs/user_bloc.dart'; 7 | import 'package:bloc_pattern/bloc_pattern.dart'; 8 | import 'package:flutter/material.dart'; 9 | import 'package:shopping/app/app_widget.dart'; 10 | import 'package:shopping/app/app_bloc.dart'; 11 | import 'package:shopping/app/shared/custom_dio/custom_dio.dart'; 12 | 13 | class AppModule extends ModuleWidget { 14 | @override 15 | List get blocs => [ 16 | Bloc((i) => ThemeBloc()), 17 | Bloc((i) => UserBloc()), 18 | Bloc((i) => AppBloc()), 19 | ]; 20 | 21 | @override 22 | List get dependencies => [ 23 | Dependency((i) => Dio()), 24 | Dependency((i) => CustomDio(i.getDependency())), 25 | Dependency( 26 | (i) => ProductRepository(AppModule.to.getDependency())), 27 | Dependency( 28 | (i) => CategoryRepository(AppModule.to.getDependency())), 29 | Dependency( 30 | (i) => AccountRepository(AppModule.to.getDependency())), 31 | ]; 32 | 33 | @override 34 | Widget get view => AppWidget(); 35 | 36 | static Inject get to => Inject.of(); 37 | } 38 | -------------------------------------------------------------------------------- /lib/app/themes/dark.theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const brightness = Brightness.dark; 4 | const primaryColor = const Color(0xFF00C569); 5 | const lightColor = const Color(0xFFFFFFFF); 6 | const backgroundColor = const Color(0xFFF5F5F5); 7 | 8 | ThemeData darkTheme() { 9 | return ThemeData( 10 | // primarySwatch: primaryColor, 11 | brightness: brightness, 12 | // textTheme: new TextTheme( 13 | // body1: new TextStyle(color: Colors.red), 14 | // display4: new TextStyle(fontSize: 78), 15 | // button: new TextStyle(color: Colors.green), 16 | // ), 17 | // tabBarTheme: 18 | // accentIconTheme: 19 | // accentTextTheme: 20 | // appBarTheme: 21 | // bottomAppBarTheme: 22 | // buttonTheme: new ButtonThemeData( 23 | // buttonColor: Colors.orange, 24 | // textTheme: ButtonTextTheme.primary, 25 | // ), 26 | // cardTheme: CardTheme( 27 | // elevation: 5, 28 | // color: Colors.indigo, 29 | // ), 30 | // chipTheme: 31 | // dialogTheme: 32 | // floatingActionButtonTheme: 33 | // iconTheme: 34 | // inputDecorationTheme: 35 | // pageTransitionsTheme: 36 | // primaryIconTheme: 37 | // primaryTextTheme: 38 | // sliderTheme: 39 | primaryColor: primaryColor, 40 | accentColor: Colors.black26, 41 | // fontFamily: 'Montserrat', 42 | // buttonColor: Color(0xFF00C569), 43 | // // scaffoldBackgroundColor: backgroundColor, 44 | // cardColor: Colors.white, 45 | ); 46 | } -------------------------------------------------------------------------------- /lib/app/themes/dark-yellow.theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const brightness = Brightness.dark; 4 | const primaryColor = const Color(0xFFFFCC00); 5 | const lightColor = const Color(0xFFFFFFFF); 6 | const backgroundColor = const Color(0xFFF5F5F5); 7 | 8 | ThemeData darkYellowTheme() { 9 | return ThemeData( 10 | // primarySwatch: primaryColor, 11 | brightness: brightness, 12 | // textTheme: new TextTheme( 13 | // body1: new TextStyle(color: Colors.red), 14 | // display4: new TextStyle(fontSize: 78), 15 | // button: new TextStyle(color: Colors.green), 16 | // ), 17 | // tabBarTheme: 18 | // accentIconTheme: 19 | // accentTextTheme: 20 | // appBarTheme: 21 | // bottomAppBarTheme: 22 | // buttonTheme: new ButtonThemeData( 23 | // buttonColor: Colors.orange, 24 | // textTheme: ButtonTextTheme.primary, 25 | // ), 26 | // cardTheme: CardTheme( 27 | // elevation: 5, 28 | // color: Colors.indigo, 29 | // ), 30 | // chipTheme: 31 | // dialogTheme: 32 | // floatingActionButtonTheme: 33 | // iconTheme: 34 | // inputDecorationTheme: 35 | // pageTransitionsTheme: 36 | // primaryIconTheme: 37 | // primaryTextTheme: 38 | // sliderTheme: 39 | primaryColor: primaryColor, 40 | accentColor: Colors.black26, 41 | // fontFamily: 'Montserrat', 42 | // buttonColor: Color(0xFF00C569), 43 | // // scaffoldBackgroundColor: backgroundColor, 44 | // cardColor: Colors.white, 45 | ); 46 | } -------------------------------------------------------------------------------- /lib/app/ui/ios/components/tabs/tabs_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:shopping/app/ui/android/pages/account/account_page.dart'; 4 | import 'package:shopping/app/ui/android/pages/cart/cart_page.dart'; 5 | import 'package:shopping/app/ui/ios/pages/home/home_page.dart'; 6 | 7 | class TabsWidget extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | return CupertinoTabScaffold( 11 | tabBar: CupertinoTabBar( 12 | backgroundColor: CupertinoColors.lightBackgroundGray, 13 | items: [ 14 | BottomNavigationBarItem( 15 | icon: Icon(CupertinoIcons.home), 16 | title: Text('Home'), 17 | ), 18 | BottomNavigationBarItem( 19 | icon: Icon(CupertinoIcons.shopping_cart), 20 | title: Text('Carrinho'), 21 | ), 22 | BottomNavigationBarItem( 23 | icon: Icon(CupertinoIcons.add), 24 | title: Text('Login'), 25 | ), 26 | ], 27 | ), 28 | tabBuilder: (context, index) { 29 | return CupertinoTabView( 30 | builder: (context) { 31 | switch (index) { 32 | case 0: 33 | return HomePage(); 34 | case 1: 35 | return CartPage(); 36 | default: 37 | return AccountPage(); 38 | } 39 | }, 40 | ); 41 | }, 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/app/themes/light.theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const brightness = Brightness.light; 4 | const primaryColor = const Color(0xFF00C569); 5 | const lightColor = const Color(0xFFFFFFFF); 6 | const backgroundColor = const Color(0xFFF5F5F5); 7 | 8 | ThemeData lightTheme() { 9 | return ThemeData( 10 | // primarySwatch: primaryColor, 11 | brightness: brightness, 12 | // textTheme: new TextTheme( 13 | // body1: new TextStyle(color: Colors.red), 14 | // display4: new TextStyle(fontSize: 78), 15 | // button: new TextStyle(color: Colors.green), 16 | // headline: new TextStyle(color: Colors.deepPurple) 17 | // ), 18 | // tabBarTheme: 19 | // accentIconTheme: 20 | // accentTextTheme: 21 | // appBarTheme: 22 | // bottomAppBarTheme: 23 | // buttonTheme: new ButtonThemeData( 24 | // buttonColor: Colors.orange, 25 | // textTheme: ButtonTextTheme.primary, 26 | // ), 27 | // cardTheme: CardTheme( 28 | // elevation: 5, 29 | // color: Colors.indigo, 30 | // ), 31 | // chipTheme: 32 | // dialogTheme: 33 | // floatingActionButtonTheme: 34 | // iconTheme: 35 | // inputDecorationTheme: 36 | // pageTransitionsTheme: 37 | // primaryIconTheme: 38 | // primaryTextTheme: 39 | // sliderTheme: 40 | primaryColor: primaryColor, 41 | accentColor: Colors.white, 42 | // fontFamily: 'Montserrat', 43 | // buttonColor: Color(0xFF00C569), 44 | // // scaffoldBackgroundColor: backgroundColor, 45 | // cardColor: Colors.white, 46 | ); 47 | } -------------------------------------------------------------------------------- /lib/app/repositories/product_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:dio/dio.dart'; 3 | import 'package:shopping/app/models/product-details.model.dart'; 4 | import 'package:shopping/app/models/product-list-item.model.dart'; 5 | import 'package:shopping/app/shared/custom_dio/custom_dio.dart'; 6 | 7 | class ProductRepository extends Disposable { 8 | final CustomDio dio; 9 | 10 | ProductRepository(this.dio); 11 | 12 | Future> getAll() async { 13 | var url = "/products"; 14 | 15 | var response = await dio.client.get(url, 16 | options: Options(extra: {'refresh': false})); 17 | return (response.data as List) 18 | .map((c) => ProductListItemModel.fromJson(c)) 19 | .toList(); 20 | } 21 | 22 | Future get(String tag) async { 23 | var url = "/products/$tag"; 24 | 25 | var response = await dio.client.get(url, 26 | options: Options(extra: {'refresh': false})); 27 | return ProductDetailsModel.fromJson(response.data); 28 | } 29 | 30 | Future> getByCategory(String category) async { 31 | var url = 32 | "/categories/$category/products"; 33 | 34 | var response = await dio.client.get(url, 35 | options: Options(extra: {'refresh': false})); 36 | return (response.data as List) 37 | .map((c) => ProductListItemModel.fromJson(c)) 38 | .toList(); 39 | } 40 | 41 | //dispose will be called automatically by closing its streams 42 | @override 43 | void dispose() {} 44 | } 45 | -------------------------------------------------------------------------------- /lib/app/ui/android/android_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:shopping/app/ui/android/components/tabs/tabs_bloc.dart'; 2 | import 'package:shopping/app/ui/android/pages/home/home_bloc.dart'; 3 | import 'package:shopping/app/ui/android/pages/signup/signup_bloc.dart'; 4 | import 'package:shopping/app/ui/android/pages/settings/settings_bloc.dart'; 5 | import 'package:shopping/app/ui/android/pages/product/product_bloc.dart'; 6 | import 'package:shopping/app/ui/android/pages/login/login_bloc.dart'; 7 | import 'package:shopping/app/ui/android/pages/account/account_bloc.dart'; 8 | import 'package:shopping/app/ui/android/pages/cart/cart_bloc.dart'; 9 | import 'package:shopping/app/ui/android/components/cart_item/cart_item_bloc.dart'; 10 | import 'package:bloc_pattern/bloc_pattern.dart'; 11 | import 'package:flutter/material.dart'; 12 | import 'package:shopping/app/ui/android/components/tabs/tabs_widget.dart' 13 | as android; 14 | 15 | class AndroidModule extends ModuleWidget { 16 | @override 17 | List get blocs => [ 18 | Bloc((i) => HomeBloc()), 19 | Bloc((i) => TabsBloc()), 20 | Bloc((i) => SignupBloc()), 21 | Bloc((i) => SettingsBloc()), 22 | Bloc((i) => ProductBloc()), 23 | Bloc((i) => LoginBloc()), 24 | Bloc((i) => AccountBloc()), 25 | Bloc((i) => CartBloc()), 26 | Bloc((i) => CartItemBloc()), 27 | ]; 28 | 29 | @override 30 | List get dependencies => []; 31 | 32 | @override 33 | Widget get view => DefaultTabController( 34 | length: 3, 35 | child: android.TabsWidget(), 36 | ); 37 | 38 | static Inject get to => Inject.of(); 39 | } 40 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/settings/settings_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/app_module.dart'; 3 | import 'package:shopping/app/shared/blocs/theme_bloc.dart'; 4 | import 'package:shopping/app/shared/settings.dart'; 5 | 6 | class SettingsPage extends StatefulWidget { 7 | @override 8 | _SettingsPageState createState() => _SettingsPageState(); 9 | } 10 | 11 | class _SettingsPageState extends State { 12 | final _bloc = AppModule.to.getBloc(); 13 | @override 14 | Widget build(BuildContext context) { 15 | return Scaffold( 16 | appBar: AppBar(), 17 | body: ListView( 18 | children: [ 19 | SizedBox( 20 | height: 50, 21 | ), 22 | StreamBuilder( 23 | stream: _bloc.outStringTheme, 24 | initialData: Settings.theme, 25 | builder: (context, snapshot) { 26 | return Text( 27 | 'Teme Atual: ${snapshot.data}', 28 | textAlign: TextAlign.center, 29 | ); 30 | }), 31 | FlatButton( 32 | child: Text('Light'), 33 | onPressed: () { 34 | _bloc.change('light'); 35 | }, 36 | ), 37 | FlatButton( 38 | child: Text('Dark'), 39 | onPressed: () { 40 | _bloc.change('dark'); 41 | }, 42 | ), 43 | FlatButton( 44 | child: Text('Dark Yellow'), 45 | onPressed: () { 46 | _bloc.change('dark-yellow'); 47 | }, 48 | ), 49 | ], 50 | ), 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | shopping 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/account/account_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/app_module.dart'; 3 | import 'package:shopping/app/shared/blocs/user_bloc.dart' as Shared; 4 | import 'package:shopping/app/models/user.model.dart'; 5 | import 'package:shopping/app/ui/android/pages/settings/settings_page.dart'; 6 | import 'package:shopping/app/ui/shared/account/authenticated_user_card/authenticated_user_card_widget.dart'; 7 | import 'package:shopping/app/ui/shared/account/unauthenticated_user_card/unauthenticated_user_card_widget.dart'; 8 | 9 | class AccountPage extends StatefulWidget { 10 | @override 11 | _AccountPageState createState() => _AccountPageState(); 12 | } 13 | 14 | class _AccountPageState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | var _bloc = AppModule.to.getBloc(); 18 | 19 | return StreamBuilder( 20 | stream: _bloc.outUser, 21 | builder: (context, snapshot) { 22 | return Scaffold( 23 | appBar: AppBar( 24 | actions: [ 25 | FlatButton( 26 | child: Icon(Icons.settings), 27 | onPressed: () { 28 | Navigator.push( 29 | context, 30 | MaterialPageRoute( 31 | builder: (context) => SettingsPage())); 32 | }, 33 | ), 34 | ], 35 | ), 36 | body: snapshot.data != null 37 | ? AuthenticatedUserCardWidget() 38 | : UnauthenticatedUserCardWidget(), 39 | ); 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /lib/app/shared/custom_dio/cache_interceptor.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:shared_preferences/shared_preferences.dart'; 5 | 6 | class CacheInterceptor extends InterceptorsWrapper { 7 | @override 8 | Future onRequest(RequestOptions options) async { 9 | print('Request[${options.method}] => PATH: ${options.path}'); 10 | 11 | var prefs = await SharedPreferences.getInstance(); 12 | var uri = options.uri; 13 | 14 | 15 | if (options.extra.containsKey('refresh')) { 16 | if (options.extra['refresh'] || !prefs.containsKey('$uri')) { 17 | return super.onRequest(options); 18 | } else { 19 | return getCache(uri); 20 | } 21 | } 22 | 23 | // TODO: implement onRequest 24 | return super.onRequest(options); 25 | } 26 | 27 | @override 28 | Future onResponse(Response response) async { 29 | print('Response[${response.statusCode}] => PATH: ${response.request.path}'); 30 | var prefs = await SharedPreferences.getInstance(); 31 | prefs.setString('${response.request.uri}', jsonEncode(response.data)); 32 | 33 | return super.onResponse(response); 34 | } 35 | 36 | @override 37 | Future onError(DioError e) async { 38 | print('Response[${e.response.statusCode}] => PATH: ${e.request.path}'); 39 | if (e.type == DioErrorType.CONNECT_TIMEOUT || 40 | e.type == DioErrorType.DEFAULT) { 41 | return getCache(e.request.uri); 42 | } else { 43 | return e; 44 | } 45 | } 46 | 47 | getCache(Uri uri) async { 48 | var prefs = await SharedPreferences.getInstance(); 49 | if (prefs.containsKey('$uri')) { 50 | var res = jsonDecode(prefs.getString('$uri')); 51 | 52 | return Response(data: res, statusCode: 200); 53 | } else { 54 | return Response(data: null, statusCode: 500); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/category/category_list/category_card/category_card_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/app_module.dart'; 3 | import 'package:shopping/app/models/category-list-item.model.dart'; 4 | import 'package:shopping/app/shared/blocs/theme_bloc.dart'; 5 | import 'package:shopping/app/shared/settings.dart'; 6 | import 'package:shopping/app/ui/shared/blocs/home_bloc.dart'; 7 | import 'package:shopping/app/ui/ui_module.dart'; 8 | 9 | class CategoryCardWidget extends StatelessWidget { 10 | final CategoryListItemModel item; 11 | final _bloc = UiModule.to.getBloc(); 12 | final _blocTheme = AppModule.to.getBloc(); 13 | CategoryCardWidget({@required this.item}); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return StreamBuilder( 18 | stream: _bloc.outSelectedCategory, 19 | builder: (context, snapshot) { 20 | return Container( 21 | width: 70, 22 | height: 70, 23 | margin: EdgeInsets.all(8), 24 | padding: EdgeInsets.all(8), 25 | decoration: BoxDecoration( 26 | color: item.tag == snapshot.data 27 | ? Theme.of(context).primaryColor.withOpacity(0.3) 28 | : Theme.of(context).primaryColor, 29 | borderRadius: BorderRadius.all( 30 | Radius.circular(70), 31 | ), 32 | ), 33 | child: StreamBuilder( 34 | stream: _blocTheme.outStringTheme, 35 | initialData: Settings.theme, 36 | builder: (context, snapshot) { 37 | return FlatButton( 38 | child: 39 | Image.asset('assets/categories/${Settings.theme}/${item.tag}.png'), 40 | onPressed: () { 41 | _bloc.changeCategory(item.tag); 42 | }, 43 | ); 44 | } 45 | ), 46 | ); 47 | } 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/app/ui/shared/blocs/cart_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:rxdart/subjects.dart'; 3 | import 'package:shopping/app/models/cart-item.model.dart'; 4 | 5 | class CartBloc extends BlocBase { 6 | var _cart = List(); 7 | final _cartController = BehaviorSubject>(); 8 | final _itemInCartController= BehaviorSubject(); 9 | 10 | Stream> get outCart => _cartController.stream; 11 | Stream get outItemInCart => _itemInCartController.stream; 12 | 13 | final _totalController = BehaviorSubject(); 14 | 15 | List get() { 16 | return _cart; 17 | } 18 | 19 | Stream get outTotal => _totalController.stream; 20 | 21 | add(CartItemModel item) { 22 | _cart.add(item); 23 | calcularTotal(); 24 | _cartController.add(_cart); 25 | _itemInCartController.add(itemInCart(item)); 26 | } 27 | 28 | remove(CartItemModel item) { 29 | _cart.removeWhere((x) => x.id == item.id); 30 | calcularTotal(); 31 | _cartController.add(_cart); 32 | _itemInCartController.add(itemInCart(item)); 33 | } 34 | 35 | itemInCart(CartItemModel item) { 36 | var i = _cart.where((x) => x.id == item.id); 37 | _cartController.add(_cart); 38 | return i != null && i.length > 0; 39 | } 40 | 41 | increase(CartItemModel item) { 42 | if (item.quantity < 10) { 43 | item.quantity++; 44 | calcularTotal(); 45 | } 46 | } 47 | 48 | decrease(CartItemModel item) { 49 | if (item.quantity > 1) { 50 | item.quantity--; 51 | calcularTotal(); 52 | } 53 | } 54 | 55 | calcularTotal() { 56 | double total = 0; 57 | _cart.forEach((x) => total += (x.price * x.quantity)); 58 | 59 | _totalController.add(total); 60 | 61 | _cartController.add(_cart); 62 | } 63 | 64 | //dispose will be called automatically by closing its streams 65 | @override 66 | void dispose() { 67 | super.dispose(); 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /lib/app/ui/ui_module.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:bloc_pattern/bloc_pattern.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:shopping/app/ui/android/android_module.dart'; 6 | import 'package:shopping/app/ui/ios/ios_module.dart'; 7 | 8 | import 'package:shopping/app/ui/shared/account/authenticated_user_card/authenticated_user_card_bloc.dart'; 9 | import 'package:shopping/app/ui/shared/account/unauthenticated_user_card/unauthenticated_user_card_bloc.dart'; 10 | import 'package:shopping/app/ui/shared/blocs/cart_bloc.dart'; 11 | import 'package:shopping/app/ui/shared/blocs/home_bloc.dart'; 12 | import 'package:shopping/app/ui/shared/components/category/category_list/category_card/category_card_bloc.dart'; 13 | import 'package:shopping/app/ui/shared/components/product/product_list/product_card/add_to_cart/add_to_cart_bloc.dart'; 14 | import 'package:shopping/app/ui/shared/components/product/product_list/product_card/product_card_bloc.dart'; 15 | import 'package:shopping/app/ui/shared/components/progress_indicator/progress_indicator_bloc.dart'; 16 | import 'package:shopping/app/ui/shared/components/loader/loader_bloc.dart'; 17 | import 'package:shopping/app/ui/shared/components/product/product_list/product_list_bloc.dart'; 18 | import 'package:shopping/app/ui/shared/components/category/category_list/category_list_bloc.dart'; 19 | 20 | class UiModule extends ModuleWidget { 21 | @override 22 | List get blocs => [ 23 | Bloc((i) => CartBloc()), 24 | Bloc((i) => HomeBloc()), 25 | Bloc((i) => ProgressIndicatorBloc()), 26 | Bloc((i) => LoaderBloc()), 27 | Bloc((i) => AddToCartBloc()), 28 | Bloc((i) => ProductListBloc()), 29 | Bloc((i) => ProductCardBloc()), 30 | Bloc((i) => CategoryListBloc()), 31 | Bloc((i) => CategoryCardBloc()), 32 | Bloc((i) => UnauthenticatedUserCardBloc()), 33 | Bloc((i) => AuthenticatedUserCardBloc()), 34 | ]; 35 | 36 | @override 37 | List get dependencies => []; 38 | 39 | @override 40 | Widget get view => Platform.isIOS ? IosModule() : AndroidModule(); 41 | 42 | static Inject get to => Inject.of(); 43 | } 44 | -------------------------------------------------------------------------------- /lib/app/shared/blocs/theme_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:rxdart/subjects.dart'; 4 | import 'package:shared_preferences/shared_preferences.dart'; 5 | import 'package:shopping/app/shared/settings.dart'; 6 | import 'package:shopping/app/themes/dark-yellow.theme.dart'; 7 | import 'package:shopping/app/themes/dark.theme.dart'; 8 | import 'package:shopping/app/themes/light.theme.dart'; 9 | 10 | class ThemeBloc extends BlocBase { 11 | var theme = lightTheme(); 12 | final _themeController = BehaviorSubject(); 13 | final _stringThemeController = BehaviorSubject(); 14 | 15 | Stream get outTheme => _themeController.stream; 16 | Stream get outStringTheme => 17 | _stringThemeController.stream; 18 | ThemeBloc() { 19 | load(); 20 | } 21 | 22 | change(String color) { 23 | switch (color) { 24 | case 'light': 25 | { 26 | theme = lightTheme(); 27 | Settings.theme = 'light'; 28 | break; 29 | } 30 | case 'dark': 31 | { 32 | theme = darkTheme(); 33 | Settings.theme = 'dark'; 34 | break; 35 | } 36 | case 'dark-yellow': 37 | { 38 | theme = darkYellowTheme(); 39 | Settings.theme = 'dark-yellow'; 40 | break; 41 | } 42 | default: 43 | } 44 | _themeController.add(theme); 45 | _stringThemeController.add(Settings.theme); 46 | save(color); 47 | } 48 | 49 | save(String theme) async { 50 | var prefs = await SharedPreferences.getInstance(); 51 | await prefs.setString('theme', theme); 52 | } 53 | 54 | Future load() async { 55 | var prefs = await SharedPreferences.getInstance(); 56 | var theme = prefs.getString('theme'); 57 | Settings.theme = theme == null || theme.isEmpty ? 'light' : theme; 58 | change(Settings.theme); 59 | _themeController.add(this.theme); 60 | _stringThemeController.add(Settings.theme); 61 | } 62 | 63 | //dispose will be called automatically by closing its streams 64 | @override 65 | void dispose() { 66 | super.dispose(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.shopping" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'androidx.test:runner:1.1.1' 66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 67 | } 68 | -------------------------------------------------------------------------------- /lib/app/ui/ios/pages/home/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:shopping/app/models/category-list-item.model.dart'; 4 | import 'package:shopping/app/models/product-list-item.model.dart'; 5 | import 'package:shopping/app/ui/shared/blocs/home_bloc.dart'; 6 | import 'package:shopping/app/ui/shared/components/category/category_list/category_list_widget.dart'; 7 | import 'package:shopping/app/ui/shared/components/product/product_list/product_list_widget.dart'; 8 | import 'package:shopping/app/ui/ui_module.dart'; 9 | 10 | class HomePage extends StatefulWidget { 11 | @override 12 | _HomePageState createState() => _HomePageState(); 13 | } 14 | 15 | class _HomePageState extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | final bloc = UiModule.to.getBloc(); 19 | 20 | return CupertinoPageScaffold( 21 | child: Padding( 22 | padding: EdgeInsets.all(10), 23 | child: ListView( 24 | children: [ 25 | SizedBox( 26 | height: 60, 27 | ), 28 | Text( 29 | "Categorias", 30 | style: Theme.of(context).textTheme.headline, 31 | ), 32 | SizedBox( 33 | height: 10, 34 | ), 35 | StreamBuilder>( 36 | stream: bloc.outCategories, 37 | builder: (context, snapshot) { 38 | return CategoryListWidget( 39 | categories: snapshot.data, 40 | ); 41 | }), 42 | SizedBox( 43 | height: 20, 44 | ), 45 | Text( 46 | "Mais Vendidos", 47 | style: Theme.of(context).textTheme.headline, 48 | ), 49 | SizedBox( 50 | height: 10, 51 | ), 52 | StreamBuilder>( 53 | stream: bloc.outProducts, 54 | builder: (context, snapshot) { 55 | return ProductListWidget( 56 | products: snapshot.data, 57 | ); 58 | }), 59 | ], 60 | ), 61 | ), 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/app/ui/shared/account/authenticated_user_card/authenticated_user_card_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/app_module.dart'; 3 | import 'package:shopping/app/shared/blocs/user_bloc.dart'; 4 | import 'package:shopping/app/models/user.model.dart'; 5 | 6 | class AuthenticatedUserCardWidget extends StatelessWidget { 7 | var bloc = AppModule.to.getBloc(); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return StreamBuilder( 12 | stream: bloc.outUser, 13 | builder: (context, snapshot) { 14 | if (!snapshot.hasData) 15 | return Container( 16 | child: Center( 17 | child: CircularProgressIndicator( 18 | valueColor: AlwaysStoppedAnimation(Colors.black), 19 | ), 20 | ), 21 | ); 22 | 23 | var user = snapshot.data; 24 | return Container( 25 | child: Center( 26 | child: Column( 27 | children: [ 28 | SizedBox( 29 | height: 20, 30 | ), 31 | Container( 32 | width: 200, 33 | height: 200, 34 | decoration: BoxDecoration( 35 | image: DecorationImage( 36 | fit: BoxFit.fill, 37 | image: NetworkImage(user?.image ?? ''), 38 | ), 39 | color: Theme.of(context).primaryColor, 40 | border: Border.all( 41 | width: 4, 42 | color: const Color(0xFFFFFFFF), 43 | ), 44 | borderRadius: BorderRadius.all(Radius.circular(200))), 45 | ), 46 | Text('Bem-vindo, ${user?.name}'), 47 | SizedBox( 48 | height: 20, 49 | ), 50 | FlatButton( 51 | child: Text('sair'), 52 | onPressed: () { 53 | bloc.logout(); 54 | }, 55 | ), 56 | ], 57 | ), 58 | ), 59 | ); 60 | }); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/app/shared/blocs/user_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:bloc_pattern/bloc_pattern.dart'; 4 | import 'package:rxdart/subjects.dart'; 5 | import 'package:shared_preferences/shared_preferences.dart'; 6 | import 'package:shopping/app/app_module.dart'; 7 | import 'package:shopping/app/models/authenticate-user.model.dart'; 8 | import 'package:shopping/app/models/create-user-model.dart'; 9 | import 'package:shopping/app/models/user.model.dart'; 10 | import 'package:shopping/app/repositories/account_repository.dart'; 11 | import 'package:shopping/app/shared/settings.dart'; 12 | 13 | class UserBloc extends BlocBase { 14 | var _user = UserModel(); 15 | var _accountRepository = AppModule.to.getDependency(); 16 | final _userController = BehaviorSubject(); 17 | String token; 18 | 19 | Stream get outUser => _userController.stream; 20 | 21 | UserBloc() { 22 | _user = null; 23 | 24 | var _ = loadUser(); 25 | } 26 | 27 | Future authenticate(AuthenticateUserModel model) async { 28 | try { 29 | var prefs = await SharedPreferences.getInstance(); 30 | 31 | var res = await _accountRepository.authenticate(model); 32 | 33 | _user = res; 34 | await prefs.setString('user', jsonEncode(res)); 35 | 36 | _userController.add(_user); 37 | return res; 38 | } catch (ex) { 39 | _user = null; 40 | return null; 41 | } 42 | } 43 | 44 | Future create(CreateUserModel model) async { 45 | try { 46 | var res = await _accountRepository.create(model); 47 | 48 | return res; 49 | } catch (ex) { 50 | print(ex); 51 | _user = null; 52 | return null; 53 | } 54 | } 55 | 56 | logout() async { 57 | var prefs = await SharedPreferences.getInstance(); 58 | await prefs.setString('user', null); 59 | 60 | _user = null; 61 | _userController.add(_user); 62 | } 63 | 64 | Future loadUser() async { 65 | var prefs = await SharedPreferences.getInstance(); 66 | var userData = prefs.getString('user'); 67 | if (userData != null) { 68 | var res = UserModel.fromJson(jsonDecode(userData)); 69 | Settings.user = res; 70 | _user = res; 71 | _userController.add(_user); 72 | 73 | return _user; 74 | } 75 | 76 | return null; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/home/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/ui/shared/blocs/home_bloc.dart' as Shared; 3 | import 'package:shopping/app/models/category-list-item.model.dart'; 4 | import 'package:shopping/app/models/product-list-item.model.dart'; 5 | import 'package:shopping/app/ui/shared/components/category/category_list/category_list_widget.dart'; 6 | import 'package:shopping/app/ui/shared/components/product/product_list/product_list_widget.dart'; 7 | import 'package:shopping/app/ui/ui_module.dart'; 8 | 9 | class HomePage extends StatefulWidget { 10 | @override 11 | _HomePageState createState() => _HomePageState(); 12 | } 13 | 14 | class _HomePageState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | final bloc = UiModule.to.getBloc(); 18 | return Padding( 19 | padding: EdgeInsets.all(10), 20 | child: ListView( 21 | children: [ 22 | SizedBox( 23 | height: 60, 24 | ), 25 | Text( 26 | 'Categorias', 27 | style: Theme.of(context).textTheme.headline, 28 | ), 29 | SizedBox( 30 | height: 10, 31 | ), 32 | StreamBuilder>( 33 | stream: bloc.outCategories, 34 | builder: (context, snapshot) { 35 | if(!snapshot.hasData) return Center(child: CircularProgressIndicator(valueColor: AlwaysStoppedAnimation(Colors.grey),)); 36 | return CategoryListWidget( 37 | categories: snapshot.data, 38 | ); 39 | } 40 | ), 41 | SizedBox( 42 | height: 20, 43 | ), 44 | Text( 45 | 'Mais Vendidos', 46 | style: Theme.of(context).textTheme.headline, 47 | ), 48 | SizedBox( 49 | height: 10, 50 | ), 51 | StreamBuilder>( 52 | stream: bloc.outProducts, 53 | builder: (context, snapshot) { 54 | if(!snapshot.hasData) return Center(child: CircularProgressIndicator(valueColor: AlwaysStoppedAnimation(Colors.grey),)); 55 | return ProductListWidget( 56 | products: snapshot.data, 57 | ); 58 | } 59 | ), 60 | ], 61 | ), 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/product/product_list/product_card/add_to_cart/add_to_cart_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/models/cart-item.model.dart'; 3 | import 'package:shopping/app/models/product-list-item.model.dart'; 4 | import 'package:shopping/app/ui/shared/blocs/cart_bloc.dart'; 5 | import 'package:shopping/app/ui/ui_module.dart'; 6 | 7 | class AddToCartWidget extends StatelessWidget { 8 | final ProductListItemModel item; 9 | bool _itemInCart = false; 10 | CartItemModel _cartItem; 11 | final _bloc = UiModule.to.getBloc(); 12 | 13 | AddToCartWidget({@required this.item}) { 14 | _cartItem = CartItemModel( 15 | id: item.id, 16 | price: item.price, 17 | image: item.image, 18 | quantity: 1, 19 | title: item.title, 20 | ); 21 | } 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return StreamBuilder( 26 | stream: _bloc.outItemInCart, 27 | initialData: false, 28 | builder: (context, snapshot) { 29 | _itemInCart = _bloc.itemInCart(_cartItem); 30 | var params = _getFlatButtonParams(_itemInCart, context); 31 | 32 | return FlatButton( 33 | color: params['color'], 34 | child: Icon(params['icon']), 35 | textColor: Colors.white, 36 | onPressed: () { 37 | params['callback'](); 38 | final snackbar = 39 | SnackBar(content: Text('${item.title} ${params['label']}!')); 40 | Scaffold.of(context).showSnackBar(snackbar); 41 | }, 42 | ); 43 | }); 44 | } 45 | 46 | Map _getFlatButtonParams(bool inCart, BuildContext context) { 47 | var result = { 48 | 'color': null, 49 | 'icon': null, 50 | 'label': '', 51 | 'callback': () { 52 | } 53 | }; 54 | if (!inCart) { 55 | result['color'] = Theme.of(context).primaryColor; 56 | result['icon'] = Icons.add_shopping_cart; 57 | result['label'] = 'adiconado'; 58 | result['callback'] = () { 59 | _bloc.add(_cartItem); 60 | }; 61 | } else { 62 | result = { 63 | 'color': Colors.red, 64 | 'icon': Icons.remove_shopping_cart, 65 | 'label': 'removido', 66 | 'callback': () { 67 | _bloc.remove(_cartItem); 68 | } 69 | }; 70 | } 71 | 72 | return result; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/app/ui/shared/blocs/home_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:rxdart/subjects.dart'; 3 | import 'package:shopping/app/app_module.dart'; 4 | import 'package:shopping/app/models/category-list-item.model.dart'; 5 | import 'package:shopping/app/models/product-list-item.model.dart'; 6 | import 'package:shopping/app/repositories/category_repository.dart'; 7 | import 'package:shopping/app/repositories/product_repository.dart'; 8 | 9 | class HomeBloc extends BlocBase { 10 | final categoryRepository = AppModule.to.getDependency(); 11 | final productRepository = AppModule.to.getDependency(); 12 | 13 | List _products; 14 | List _categories; 15 | var _selectedCategory = 'todos'; 16 | 17 | final _productsController = BehaviorSubject>(); 18 | final _categoriesController = BehaviorSubject>(); 19 | final _selectedCategoryController = BehaviorSubject(); 20 | 21 | Stream> get outProducts => 22 | _productsController.stream; 23 | Stream> get outCategories => 24 | _categoriesController.stream; 25 | Stream get outSelectedCategory => _selectedCategoryController.stream; 26 | 27 | HomeBloc() { 28 | _selectedCategoryController.add(_selectedCategory); 29 | getCategories(); 30 | getProducts(); 31 | } 32 | 33 | getCategories() { 34 | _selectedCategoryController.add(_selectedCategory); 35 | categoryRepository.getAll().then((data) { 36 | data.add(CategoryListItemModel(id: 'all', title: 'Todos', tag: 'all')); 37 | this._categories = data; 38 | _categoriesController.add(this._categories); 39 | }); 40 | } 41 | 42 | getProducts() { 43 | productRepository.getAll().then((data) { 44 | this._products = data; 45 | _productsController.add(this._products); 46 | }); 47 | } 48 | 49 | getProductsByCategory() { 50 | if (_selectedCategory == 'all') 51 | getProducts(); 52 | else 53 | productRepository.getByCategory(_selectedCategory).then((data) { 54 | this._products = data; 55 | _productsController.add(this._products); 56 | }); 57 | } 58 | 59 | changeCategory(tag) { 60 | _selectedCategory = tag; 61 | notifyListeners(); 62 | _selectedCategoryController.add(_selectedCategory); 63 | _products = null; 64 | getProductsByCategory(); 65 | } 66 | 67 | //dispose will be called automatically by closing its streams 68 | @override 69 | void dispose() { 70 | super.dispose(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/app/ui/android/components/tabs/tabs_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/models/cart-item.model.dart'; 3 | import 'package:shopping/app/ui/android/pages/account/account_page.dart'; 4 | import 'package:shopping/app/ui/android/pages/cart/cart_page.dart'; 5 | import 'package:shopping/app/ui/android/pages/home/home_page.dart'; 6 | import 'package:shopping/app/ui/shared/blocs/cart_bloc.dart'; 7 | import 'package:shopping/app/ui/ui_module.dart'; 8 | 9 | class TabsWidget extends StatelessWidget { 10 | final _bloc = UiModule.to.getBloc(); 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | body: TabBarView( 15 | children: [ 16 | HomePage(), 17 | CartPage(), 18 | AccountPage(), 19 | ], 20 | ), 21 | bottomNavigationBar: TabBar( 22 | tabs: [ 23 | Tab( 24 | icon: Icon(Icons.home), 25 | ), 26 | Tab( 27 | icon: Row( 28 | mainAxisAlignment: MainAxisAlignment.center, 29 | children: [ 30 | Icon(Icons.shopping_cart), 31 | Container( 32 | width: 18, 33 | height: 18, 34 | decoration: BoxDecoration( 35 | color: Colors.red, 36 | borderRadius: BorderRadius.all(Radius.circular(5)), 37 | ), 38 | child: Center( 39 | child: StreamBuilder>( 40 | stream: _bloc.outCart, 41 | builder: (context, snapshot) { 42 | return Text( 43 | !snapshot.hasData 44 | ? '0' 45 | : snapshot.data.length.toString(), 46 | style: TextStyle( 47 | color: Colors.white, 48 | fontWeight: FontWeight.bold, 49 | ), 50 | ); 51 | }), 52 | ), 53 | ) 54 | ], 55 | ), 56 | ), 57 | Tab( 58 | icon: Icon(Icons.perm_identity), 59 | ), 60 | ], 61 | labelColor: Theme.of(context).primaryColor, 62 | unselectedLabelColor: Colors.black38, 63 | indicatorSize: TabBarIndicatorSize.label, 64 | indicatorPadding: EdgeInsets.all(5), 65 | indicatorColor: Theme.of(context).primaryColor, 66 | ), 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/app/shared/custom_dio/interceptor.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:shopping/app/app_module.dart'; 3 | import 'package:shopping/app/models/authenticate-user.model.dart'; 4 | import 'package:shopping/app/shared/blocs/user_bloc.dart'; 5 | import 'package:shopping/app/shared/custom_dio/custom_dio.dart'; 6 | 7 | class CustomInterceptors extends InterceptorsWrapper { 8 | @override 9 | Future onRequest(RequestOptions options) async { 10 | print('Request[${options.method}] => PATH: ${options.path}'); 11 | 12 | var auth = AppModule.to.getBloc(); 13 | var dio = AppModule.to.getDependency(); 14 | var user = await auth.loadUser(); 15 | if (user != null) { 16 | if (auth.token == null) { 17 | dio.client.lock(); 18 | auth.token = user.token; 19 | 20 | options.headers.addAll({"Authorization": auth.token}); 21 | 22 | dio.client.unlock(); 23 | } 24 | } 25 | 26 | print('Authorization: ${options.headers['Authorization']}'); 27 | 28 | // TODO: implement onRequest 29 | return super.onRequest(options); 30 | } 31 | 32 | @override 33 | Future onResponse(Response response) { 34 | print('Response[${response.statusCode}] => PATH: ${response.request.path}'); 35 | 36 | // TODO: implement onResponse 37 | return super.onResponse(response); 38 | } 39 | 40 | @override 41 | Future onError(DioError e) async { 42 | print('Response[${e.response.statusCode}] => PATH: ${e.request.path}'); 43 | var auth = AppModule.to.getBloc(); 44 | var user = await auth.loadUser(); 45 | 46 | if (user != null && e.response.statusCode == 401) { 47 | var dio = AppModule.to.getDependency(); 48 | 49 | var options = e.response.request; 50 | 51 | if (user.token != options.headers['Authorization']) { 52 | options.headers['Authorization'] = user.token; 53 | return dio.client.request(options.path, options: options); 54 | } 55 | dio.client.lock(); 56 | dio.client.interceptors.responseLock.lock(); 57 | dio.client.interceptors.errorLock.lock(); 58 | 59 | return auth 60 | .authenticate(AuthenticateUserModel( 61 | username: user.username, password: user.password)) 62 | .then((d) { 63 | options.headers['Authorization'] = d.token; 64 | }).whenComplete(() { 65 | dio.client.unlock(); 66 | dio.client.interceptors.responseLock.unlock(); 67 | dio.client.interceptors.errorLock.unlock(); 68 | }).then((e) => dio.client.request(options.path, options: options)); 69 | } 70 | 71 | // TODO: implement onError 72 | return super.onError(e); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/product/product_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/models/product-details.model.dart'; 3 | import 'package:shopping/app/models/product-list-item.model.dart'; 4 | import 'package:shopping/app/ui/shared/components/product/product_list/product_card/add_to_cart/add_to_cart_widget.dart'; 5 | import 'package:shopping/app/ui/shared/components/progress_indicator/progress_indicator_widget.dart'; 6 | import 'package:shopping/app/ui/android/android_module.dart'; 7 | 8 | import 'product_bloc.dart'; 9 | 10 | class ProductPage extends StatefulWidget { 11 | final String tag; 12 | 13 | ProductPage({@required this.tag}); 14 | 15 | @override 16 | _ProductPageState createState() => _ProductPageState(tag: tag); 17 | } 18 | 19 | class _ProductPageState extends State { 20 | final String tag; 21 | final _bloc = AndroidModule.to.getBloc(); 22 | 23 | _ProductPageState({@required this.tag}); 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | var _ = _bloc.get(tag); 28 | return StreamBuilder>( 29 | stream: _bloc.outProduct, 30 | builder: (context, snapshot) { 31 | return FutureBuilder( 32 | future: snapshot.data, 33 | builder: (context, snapshot) { 34 | var product = snapshot.data; 35 | 36 | switch (snapshot.connectionState) { 37 | case ConnectionState.none: 38 | return Text('Aguardando...'); 39 | case ConnectionState.active: 40 | case ConnectionState.waiting: 41 | return Center( 42 | child: GenericProgressIndicator(), 43 | ); 44 | case ConnectionState.done: 45 | if (snapshot.hasError) 46 | return Center( 47 | child: Text(snapshot.error), 48 | ); 49 | else 50 | return content(product); 51 | 52 | break; 53 | default: 54 | return null; 55 | } 56 | }, 57 | ); 58 | }); 59 | } 60 | 61 | Widget content(ProductDetailsModel product) { 62 | var item = ProductListItemModel(); 63 | 64 | item.id = product.id; 65 | item.title = product.title; 66 | item.brand = product.brand; 67 | item.tag = product.tag; 68 | item.price = product.price; 69 | item.image = product.images[0]; 70 | 71 | return Scaffold( 72 | appBar: AppBar( 73 | title: Text(product.title), 74 | actions: [AddToCartWidget(item: item)], 75 | ), 76 | body: ListView.builder( 77 | scrollDirection: Axis.horizontal, 78 | itemCount: product.images.length, 79 | itemBuilder: (context, index) { 80 | return Container( 81 | width: 200, 82 | child: Image.network(product.images[index]), 83 | ); 84 | }, 85 | ), 86 | ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/cart/cart_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:intl/intl.dart'; 3 | import 'package:shopping/app/ui/shared/blocs/cart_bloc.dart' as Shared; 4 | import 'package:shopping/app/models/cart-item.model.dart'; 5 | import 'package:shopping/app/ui/shared/components/loader/loader_widget.dart'; 6 | import 'package:shopping/app/ui/android/components/cart_item/cart_item_widget.dart'; 7 | import 'package:shopping/app/ui/ui_module.dart'; 8 | 9 | class CartPage extends StatefulWidget { 10 | @override 11 | _CartPageState createState() => _CartPageState(); 12 | } 13 | 14 | class _CartPageState extends State { 15 | final price = new NumberFormat('#,##00.00', 'pt_BR'); 16 | var items = List(); 17 | var _bloc= UiModule.to.getBloc(); 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | items = _bloc.get(); 22 | return StreamBuilder>( 23 | stream: _bloc.outCart, 24 | builder: (context, snapshot) { 25 | return Scaffold( 26 | body: Container( 27 | padding: EdgeInsets.only(top: 60), 28 | child: Column( 29 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 30 | children: [ 31 | Expanded( 32 | child: LoaderWidget( 33 | object: snapshot.data, 34 | callback: list, 35 | ), 36 | ), 37 | Container( 38 | height: 80, 39 | padding: EdgeInsets.all(20), 40 | child: StreamBuilder( 41 | stream: _bloc.outTotal, 42 | initialData: 0, 43 | builder: (context, snapshot) { 44 | return Row( 45 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 46 | children: [ 47 | Text( 48 | 'R\$ ${price.format(snapshot.data)}', 49 | style: TextStyle(fontSize: 30), 50 | ), 51 | FlatButton( 52 | child: Text('Checkout'), 53 | color: Theme.of(context).primaryColor, 54 | onPressed: () {}, 55 | ), 56 | ], 57 | ); 58 | } 59 | ), 60 | ), 61 | ], 62 | ), 63 | ), 64 | ); 65 | } 66 | ); 67 | } 68 | 69 | Widget list(){ 70 | return ListView.builder( 71 | scrollDirection: Axis.vertical, 72 | itemCount: items.length, 73 | itemBuilder: (context, index){ 74 | return Dismissible( 75 | child: CartItemWidget( 76 | item: items[index] 77 | ), 78 | key: Key(items[index].id), 79 | onDismissed: (direction){ 80 | _bloc.remove(items[index]); 81 | }, 82 | background: Container( 83 | color: Colors.red.withOpacity(0.1), 84 | ), 85 | ); 86 | }, 87 | ); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /lib/app/ui/android/components/cart_item/cart_item_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:intl/intl.dart'; 3 | import 'package:shopping/app/models/cart-item.model.dart'; 4 | import 'package:shopping/app/ui/shared/blocs/cart_bloc.dart'; 5 | import 'package:shopping/app/ui/ui_module.dart'; 6 | 7 | 8 | class CartItemWidget extends StatelessWidget { 9 | final CartItemModel item; 10 | final bloc = UiModule.to.getBloc(); 11 | 12 | CartItemWidget({this.item}); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | 17 | final price = NumberFormat('#,##0.00', 'pt_BR'); 18 | 19 | return Container( 20 | height: 120, 21 | margin: EdgeInsets.all(5), 22 | child: Row( 23 | children: [ 24 | Container( 25 | width: 100, 26 | height: 100, 27 | margin: EdgeInsets.all(10), 28 | child: Image.network( 29 | item.image, 30 | fit: BoxFit.fitWidth, 31 | ), 32 | ), 33 | Padding( 34 | padding: EdgeInsets.only(top: 20, left: 10), 35 | child: Column( 36 | crossAxisAlignment: CrossAxisAlignment.start, 37 | children: [ 38 | Text(item.title), 39 | Text( 40 | 'R\$ ${price.format(item.price)}', 41 | style: TextStyle(color: Theme.of(context).primaryColor), 42 | ), 43 | SizedBox( 44 | height: 10, 45 | ), 46 | Text('R\$ ${price.format(item.price * item.quantity)}'), 47 | Container( 48 | height: 30, 49 | width: 120, 50 | decoration: BoxDecoration( 51 | color: Colors.black12, 52 | borderRadius: BorderRadius.all(Radius.circular(5)), 53 | ), 54 | child: Row( 55 | children: [ 56 | Container( 57 | width: 40, 58 | alignment: Alignment.center, 59 | child: FlatButton( 60 | child: Text('-'), 61 | onPressed: () { 62 | bloc.decrease(item); 63 | }, 64 | 65 | ), 66 | ), 67 | Container( 68 | width: 40, 69 | alignment: Alignment.center, 70 | child: Text(item.quantity.toString()), 71 | ), 72 | Container( 73 | width: 40, 74 | alignment: Alignment.center, 75 | child: FlatButton( 76 | child: Text('+'), 77 | onPressed: () { 78 | bloc.increase(item); 79 | }, 80 | ), 81 | ), 82 | ], 83 | ), 84 | ) 85 | ], 86 | ), 87 | ) 88 | ], 89 | ), 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/app/ui/shared/components/product/product_list/product_card/product_card_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:intl/intl.dart'; 3 | import 'package:shopping/app/models/product-list-item.model.dart'; 4 | import 'package:shopping/app/ui/android/pages/product/product_page.dart'; 5 | 6 | import 'add_to_cart/add_to_cart_widget.dart'; 7 | 8 | class ProductCardWidget extends StatelessWidget { 9 | final ProductListItemModel item; 10 | 11 | ProductCardWidget({@required this.item}); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | final price = new NumberFormat('#,##0.00', 'pt_BR'); 16 | 17 | return Container( 18 | margin: EdgeInsets.all(5), 19 | width: 240, 20 | decoration: BoxDecoration( 21 | color: Colors.black.withOpacity(0.03), 22 | borderRadius: BorderRadius.all( 23 | Radius.circular(8), 24 | ), 25 | ), 26 | child: Column( 27 | crossAxisAlignment: CrossAxisAlignment.start, 28 | children: [ 29 | GestureDetector( 30 | onTap: () { 31 | Navigator.push( 32 | context, 33 | MaterialPageRoute( 34 | builder: (context) => ProductPage( 35 | tag: item.tag, 36 | ))); 37 | }, 38 | child: Container( 39 | width: 240, 40 | height: 240, 41 | decoration: BoxDecoration( 42 | color: Colors.black.withOpacity(0.05), 43 | borderRadius: BorderRadius.only( 44 | topLeft: Radius.circular(5), 45 | topRight: Radius.circular(5), 46 | ), 47 | image: DecorationImage(image: NetworkImage(item.image)), 48 | ), 49 | ), 50 | ), 51 | SizedBox( 52 | height: 10, 53 | ), 54 | Container( 55 | padding: EdgeInsets.symmetric(horizontal: 10), 56 | height: 60, 57 | child: Text( 58 | item.title, 59 | style: TextStyle( 60 | fontSize: 18, 61 | fontWeight: FontWeight.w800, 62 | ), 63 | ), 64 | ), 65 | SizedBox( 66 | height: 5, 67 | ), 68 | Container( 69 | padding: EdgeInsets.symmetric(horizontal: 10), 70 | child: Text( 71 | item.brand, 72 | style: TextStyle( 73 | fontSize: 14, 74 | fontWeight: FontWeight.w300, 75 | ), 76 | ), 77 | ), 78 | SizedBox( 79 | height: 5, 80 | ), 81 | Padding( 82 | padding: EdgeInsets.symmetric(horizontal: 10), 83 | child: Row( 84 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 85 | children: [ 86 | Container( 87 | width: 120, 88 | child: Text( 89 | 'R\$ ${price.format(item.price)}', 90 | style: TextStyle( 91 | fontSize: 18, 92 | fontWeight: FontWeight.bold, 93 | color: Theme.of(context).primaryColor), 94 | )), 95 | AddToCartWidget(item: item), 96 | ], 97 | ), 98 | ), 99 | ], 100 | ), 101 | ); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/login/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/app_module.dart'; 3 | import 'package:shopping/app/shared/blocs/user_bloc.dart'; 4 | import 'package:shopping/app/models/authenticate-user.model.dart'; 5 | 6 | class LoginPage extends StatefulWidget { 7 | @override 8 | _LoginPageState createState() => _LoginPageState(); 9 | } 10 | 11 | class _LoginPageState extends State { 12 | final _formKey = GlobalKey(); 13 | final _scaffoldKey = GlobalKey(); 14 | var username = ''; 15 | var password = ''; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | key: _scaffoldKey, 21 | appBar: AppBar(), 22 | body: Padding( 23 | padding: EdgeInsets.all(20), 24 | child: Form( 25 | key: _formKey, 26 | child: ListView( 27 | children: [ 28 | TextFormField( 29 | keyboardType: TextInputType.text, 30 | decoration: InputDecoration( 31 | labelText: 'Usuário', 32 | labelStyle: TextStyle( 33 | color: Theme.of(context).primaryColor, 34 | fontWeight: FontWeight.w400, 35 | fontSize: 16, 36 | ), 37 | ), 38 | style: TextStyle( 39 | fontSize: 20, 40 | color: Theme.of(context).primaryColor, 41 | ), 42 | validator: (value) { 43 | if (value.isEmpty) 44 | return 'Usuário Inválido'; 45 | else 46 | return null; 47 | }, 48 | onSaved: (v) => username = v, 49 | ), 50 | SizedBox( 51 | height: 10, 52 | ), 53 | TextFormField( 54 | keyboardType: TextInputType.text, 55 | obscureText: true, 56 | decoration: InputDecoration( 57 | labelText: 'Senha', 58 | labelStyle: TextStyle( 59 | color: Theme.of(context).primaryColor, 60 | fontWeight: FontWeight.w400, 61 | fontSize: 16, 62 | ), 63 | ), 64 | style: TextStyle( 65 | fontSize: 20, 66 | color: Theme.of(context).primaryColor, 67 | ), 68 | validator: (value) { 69 | if (value.isEmpty) 70 | return 'Senha Inválido'; 71 | else 72 | return null; 73 | }, 74 | onSaved: (v) => password = v, 75 | ), 76 | FlatButton( 77 | child: Text('Entrar'), 78 | onPressed: () { 79 | if (_formKey.currentState.validate()) { 80 | _formKey.currentState.save(); 81 | authenticate(context); 82 | } 83 | }, 84 | ) 85 | ], 86 | ), 87 | ), 88 | ), 89 | ); 90 | } 91 | 92 | authenticate(BuildContext context) async { 93 | var bloc = AppModule.to.getBloc(); 94 | 95 | var user = await bloc.authenticate( 96 | AuthenticateUserModel(username: username, password: password), 97 | ); 98 | 99 | if (user != null) { 100 | Navigator.pop(context); 101 | return; 102 | } else { 103 | final snackBar = SnackBar( 104 | content: Text('Usuário ou senha invalidos'), 105 | ); 106 | _scaffoldKey.currentState.showSnackBar(snackBar); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: shopping 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 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | 21 | flutter: 22 | sdk: flutter 23 | 24 | # The following adds the Cupertino Icons font to your application. 25 | # Use with the CupertinoIcons class for iOS style icons. 26 | cupertino_icons: ^0.1.2 27 | provider: ^3.1.0 28 | dio: ^3.0.3 29 | intl: ^0.16.0 30 | shared_preferences: ^0.5.3+4 31 | rxdart: ^0.22.3 32 | bloc_pattern: ^2.4.0+2 33 | flutter_launcher_icons: ^0.7.3 34 | 35 | dev_dependencies: 36 | flutter_test: 37 | sdk: flutter 38 | 39 | 40 | # For information on the generic Dart part of this file, see the 41 | # following page: https://dart.dev/tools/pub/pubspec 42 | 43 | # The following section is specific to Flutter. 44 | flutter: 45 | 46 | # The following line ensures that the Material Icons font is 47 | # included with your application, so that you can use the icons in 48 | # the material Icons class. 49 | uses-material-design: true 50 | 51 | # To add assets to your application, add an assets section, like this: 52 | # assets: 53 | # - images/a_dot_burr.jpeg 54 | # - images/a_dot_ham.jpeg 55 | 56 | # An image asset can refer to one or more resolution-specific "variants", see 57 | # https://flutter.dev/assets-and-images/#resolution-aware. 58 | 59 | # For details regarding adding assets from package dependencies, see 60 | # https://flutter.dev/assets-and-images/#from-packages 61 | 62 | # To add custom fonts to your application, add a fonts section here, 63 | # in this "flutter" section. Each entry in this list should have a 64 | # "family" key with the font family name, and a "fonts" key with a 65 | # list giving the asset and other descriptors for the font. For 66 | # example: 67 | # fonts: 68 | # - family: Schyler 69 | # fonts: 70 | # - asset: fonts/Schyler-Regular.ttf 71 | # - asset: fonts/Schyler-Italic.ttf 72 | # style: italic 73 | # - family: Trajan Pro 74 | # fonts: 75 | # - asset: fonts/TrajanPro.ttf 76 | # - asset: fonts/TrajanPro_Bold.ttf 77 | # weight: 700 78 | # 79 | # For details regarding fonts from package dependencies, 80 | # see https://flutter.dev/custom-fonts/#from-packages 81 | assets: 82 | - assets/categories/light/automotivo.png 83 | - assets/categories/light/brinquedos.png 84 | - assets/categories/light/decor.png 85 | - assets/categories/light/eletrodomesticos.png 86 | - assets/categories/light/games.png 87 | - assets/categories/light/informatica.png 88 | - assets/categories/light/moda.png 89 | - assets/categories/light/telefonia.png 90 | - assets/categories/light/tv.png 91 | - assets/categories/light/all.png 92 | - assets/categories/dark/automotivo.png 93 | - assets/categories/dark/brinquedos.png 94 | - assets/categories/dark/decor.png 95 | - assets/categories/dark/eletrodomesticos.png 96 | - assets/categories/dark/games.png 97 | - assets/categories/dark/informatica.png 98 | - assets/categories/dark/moda.png 99 | - assets/categories/dark/telefonia.png 100 | - assets/categories/dark/tv.png 101 | - assets/categories/dark/all.png 102 | - assets/categories/dark-yellow/automotivo.png 103 | - assets/categories/dark-yellow/brinquedos.png 104 | - assets/categories/dark-yellow/decor.png 105 | - assets/categories/dark-yellow/eletrodomesticos.png 106 | - assets/categories/dark-yellow/games.png 107 | - assets/categories/dark-yellow/informatica.png 108 | - assets/categories/dark-yellow/moda.png 109 | - assets/categories/dark-yellow/telefonia.png 110 | - assets/categories/dark-yellow/tv.png 111 | - assets/categories/dark-yellow/all.png 112 | - assets/icon.png 113 | 114 | 115 | flutter_icons: 116 | android: true 117 | ios: true 118 | image_path: "assets/icon.png" 119 | -------------------------------------------------------------------------------- /lib/app/ui/android/pages/signup/signup_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopping/app/app_module.dart'; 3 | import 'package:shopping/app/shared/blocs/user_bloc.dart'; 4 | import 'package:shopping/app/models/create-user-model.dart'; 5 | import 'package:shopping/app/shared/validators/custom.validator.dart'; 6 | 7 | class SignupPage extends StatefulWidget { 8 | @override 9 | _SignupPageState createState() => _SignupPageState(); 10 | } 11 | 12 | class _SignupPageState extends State { 13 | final _formKey = GlobalKey(); 14 | final _scaffoldKey = GlobalKey(); 15 | var user = CreateUserModel(); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | key: _scaffoldKey, 21 | appBar: AppBar(), 22 | body: Padding( 23 | padding: EdgeInsets.all(20), 24 | child: Form( 25 | key: _formKey, 26 | child: ListView( 27 | children: [ 28 | TextFormField( 29 | keyboardType: TextInputType.text, 30 | decoration: InputDecoration( 31 | labelText: "Nome", 32 | labelStyle: TextStyle( 33 | color: Theme.of(context).primaryColor, 34 | fontWeight: FontWeight.w400, 35 | fontSize: 16, 36 | ), 37 | ), 38 | style: TextStyle( 39 | fontSize: 20, 40 | color: Theme.of(context).primaryColor, 41 | ), 42 | validator: (value) { 43 | if (value.isEmpty) { 44 | return 'Nome Inválido'; 45 | } 46 | return null; 47 | }, 48 | onSaved: (val) { 49 | user.name = val; 50 | }, 51 | ), 52 | SizedBox( 53 | height: 10, 54 | ), 55 | TextFormField( 56 | keyboardType: TextInputType.emailAddress, 57 | decoration: InputDecoration( 58 | labelText: "E-mail", 59 | labelStyle: TextStyle( 60 | color: Theme.of(context).primaryColor, 61 | fontWeight: FontWeight.w400, 62 | fontSize: 16, 63 | ), 64 | ), 65 | style: TextStyle( 66 | fontSize: 20, 67 | color: Theme.of(context).primaryColor, 68 | ), 69 | validator: (value) => CustomValidators.isEmail(value), 70 | onSaved: (val) { 71 | user.email = val; 72 | }, 73 | ), 74 | SizedBox( 75 | height: 10, 76 | ), 77 | TextFormField( 78 | keyboardType: TextInputType.text, 79 | decoration: InputDecoration( 80 | labelText: "Usuário", 81 | labelStyle: TextStyle( 82 | color: Theme.of(context).primaryColor, 83 | fontWeight: FontWeight.w400, 84 | fontSize: 16, 85 | ), 86 | ), 87 | style: TextStyle( 88 | fontSize: 20, 89 | color: Theme.of(context).primaryColor, 90 | ), 91 | validator: (value) { 92 | if (value.isEmpty) { 93 | return 'Usuário Inválido'; 94 | } 95 | return null; 96 | }, 97 | onSaved: (val) { 98 | user.username = val; 99 | }, 100 | ), 101 | SizedBox( 102 | height: 10, 103 | ), 104 | TextFormField( 105 | keyboardType: TextInputType.text, 106 | obscureText: true, 107 | decoration: InputDecoration( 108 | labelText: "Senha", 109 | labelStyle: TextStyle( 110 | color: Theme.of(context).primaryColor, 111 | fontWeight: FontWeight.w400, 112 | fontSize: 16, 113 | ), 114 | ), 115 | style: TextStyle( 116 | fontSize: 20, 117 | color: Theme.of(context).primaryColor, 118 | ), 119 | validator: (value) { 120 | if (value.isEmpty) { 121 | return 'Senha Inválida'; 122 | } 123 | return null; 124 | }, 125 | onSaved: (val) { 126 | user.password = val; 127 | }, 128 | ), 129 | FlatButton( 130 | child: Text("Cadastrar"), 131 | onPressed: () { 132 | if (_formKey.currentState.validate()) { 133 | _formKey.currentState.save(); 134 | create(context); 135 | } 136 | }, 137 | ), 138 | ], 139 | ), 140 | ), 141 | ), 142 | ); 143 | } 144 | 145 | create(BuildContext context) async { 146 | var bloc = AppModule.to.getBloc(); 147 | var res = await bloc.create(user); 148 | 149 | if (res == null) { 150 | final snackBar = SnackBar( 151 | content: Text('Não foi possível realizar seu cadastro'), 152 | ); 153 | _scaffoldKey.currentState.showSnackBar(snackBar); 154 | } else { 155 | Navigator.pop(context); 156 | final snackBar = SnackBar( 157 | content: Text('Bem-Vindo! Autentique-se'), 158 | ); 159 | _scaffoldKey.currentState.showSnackBar(snackBar); 160 | } 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.10" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.3.0" 25 | bloc_pattern: 26 | dependency: "direct main" 27 | description: 28 | name: bloc_pattern 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.4.0+2" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.0.5" 39 | charcode: 40 | dependency: transitive 41 | description: 42 | name: charcode 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.2" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.14.11" 53 | convert: 54 | dependency: transitive 55 | description: 56 | name: convert 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.1" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.3" 67 | cupertino_icons: 68 | dependency: "direct main" 69 | description: 70 | name: cupertino_icons 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "0.1.2" 74 | dio: 75 | dependency: "direct main" 76 | description: 77 | name: dio 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "3.0.3" 81 | flutter: 82 | dependency: "direct main" 83 | description: flutter 84 | source: sdk 85 | version: "0.0.0" 86 | flutter_launcher_icons: 87 | dependency: "direct main" 88 | description: 89 | name: flutter_launcher_icons 90 | url: "https://pub.dartlang.org" 91 | source: hosted 92 | version: "0.7.3" 93 | flutter_test: 94 | dependency: "direct dev" 95 | description: flutter 96 | source: sdk 97 | version: "0.0.0" 98 | http_parser: 99 | dependency: transitive 100 | description: 101 | name: http_parser 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "3.1.3" 105 | image: 106 | dependency: transitive 107 | description: 108 | name: image 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "2.1.4" 112 | intl: 113 | dependency: "direct main" 114 | description: 115 | name: intl 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "0.16.0" 119 | matcher: 120 | dependency: transitive 121 | description: 122 | name: matcher 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "0.12.5" 126 | meta: 127 | dependency: transitive 128 | description: 129 | name: meta 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "1.1.7" 133 | path: 134 | dependency: transitive 135 | description: 136 | name: path 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "1.6.4" 140 | pedantic: 141 | dependency: transitive 142 | description: 143 | name: pedantic 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "1.8.0+1" 147 | petitparser: 148 | dependency: transitive 149 | description: 150 | name: petitparser 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "2.4.0" 154 | provider: 155 | dependency: "direct main" 156 | description: 157 | name: provider 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "3.1.0" 161 | quiver: 162 | dependency: transitive 163 | description: 164 | name: quiver 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "2.0.5" 168 | rxdart: 169 | dependency: "direct main" 170 | description: 171 | name: rxdart 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "0.22.3" 175 | shared_preferences: 176 | dependency: "direct main" 177 | description: 178 | name: shared_preferences 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "0.5.3+4" 182 | sky_engine: 183 | dependency: transitive 184 | description: flutter 185 | source: sdk 186 | version: "0.0.99" 187 | source_span: 188 | dependency: transitive 189 | description: 190 | name: source_span 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "1.5.5" 194 | stack_trace: 195 | dependency: transitive 196 | description: 197 | name: stack_trace 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "1.9.3" 201 | stream_channel: 202 | dependency: transitive 203 | description: 204 | name: stream_channel 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "2.0.0" 208 | string_scanner: 209 | dependency: transitive 210 | description: 211 | name: string_scanner 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "1.0.5" 215 | term_glyph: 216 | dependency: transitive 217 | description: 218 | name: term_glyph 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.1.0" 222 | test_api: 223 | dependency: transitive 224 | description: 225 | name: test_api 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "0.2.5" 229 | typed_data: 230 | dependency: transitive 231 | description: 232 | name: typed_data 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "1.1.6" 236 | vector_math: 237 | dependency: transitive 238 | description: 239 | name: vector_math 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "2.0.8" 243 | xml: 244 | dependency: transitive 245 | description: 246 | name: xml 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "3.5.0" 250 | yaml: 251 | dependency: transitive 252 | description: 253 | name: yaml 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "2.2.0" 257 | sdks: 258 | dart: ">2.4.0 <3.0.0" 259 | flutter: ">=1.5.0 <2.0.0" 260 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 18 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 19 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXCopyFilesBuildPhase section */ 23 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 24 | isa = PBXCopyFilesBuildPhase; 25 | buildActionMask = 2147483647; 26 | dstPath = ""; 27 | dstSubfolderSpec = 10; 28 | files = ( 29 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 30 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 31 | ); 32 | name = "Embed Frameworks"; 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXCopyFilesBuildPhase section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 39 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 40 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 41 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 42 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 43 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 46 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 47 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 48 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 51 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 52 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 61 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 9740EEB11CF90186004384FC /* Flutter */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 3B80C3931E831B6300D905FE /* App.framework */, 72 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 73 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 74 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 75 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 76 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 77 | ); 78 | name = Flutter; 79 | sourceTree = ""; 80 | }; 81 | 97C146E51CF9000F007C117D = { 82 | isa = PBXGroup; 83 | children = ( 84 | 9740EEB11CF90186004384FC /* Flutter */, 85 | 97C146F01CF9000F007C117D /* Runner */, 86 | 97C146EF1CF9000F007C117D /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 97C146EF1CF9000F007C117D /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 97C146EE1CF9000F007C117D /* Runner.app */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | 97C146F01CF9000F007C117D /* Runner */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 102 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 103 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 104 | 97C147021CF9000F007C117D /* Info.plist */, 105 | 97C146F11CF9000F007C117D /* Supporting Files */, 106 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 107 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 108 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 109 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 110 | ); 111 | path = Runner; 112 | sourceTree = ""; 113 | }; 114 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | ); 118 | name = "Supporting Files"; 119 | sourceTree = ""; 120 | }; 121 | /* End PBXGroup section */ 122 | 123 | /* Begin PBXNativeTarget section */ 124 | 97C146ED1CF9000F007C117D /* Runner */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 127 | buildPhases = ( 128 | 9740EEB61CF901F6004384FC /* Run Script */, 129 | 97C146EA1CF9000F007C117D /* Sources */, 130 | 97C146EB1CF9000F007C117D /* Frameworks */, 131 | 97C146EC1CF9000F007C117D /* Resources */, 132 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 133 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 134 | ); 135 | buildRules = ( 136 | ); 137 | dependencies = ( 138 | ); 139 | name = Runner; 140 | productName = Runner; 141 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 142 | productType = "com.apple.product-type.application"; 143 | }; 144 | /* End PBXNativeTarget section */ 145 | 146 | /* Begin PBXProject section */ 147 | 97C146E61CF9000F007C117D /* Project object */ = { 148 | isa = PBXProject; 149 | attributes = { 150 | LastUpgradeCheck = 1020; 151 | ORGANIZATIONNAME = "The Chromium Authors"; 152 | TargetAttributes = { 153 | 97C146ED1CF9000F007C117D = { 154 | CreatedOnToolsVersion = 7.3.1; 155 | LastSwiftMigration = 0910; 156 | }; 157 | }; 158 | }; 159 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 160 | compatibilityVersion = "Xcode 3.2"; 161 | developmentRegion = en; 162 | hasScannedForEncodings = 0; 163 | knownRegions = ( 164 | en, 165 | Base, 166 | ); 167 | mainGroup = 97C146E51CF9000F007C117D; 168 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 169 | projectDirPath = ""; 170 | projectRoot = ""; 171 | targets = ( 172 | 97C146ED1CF9000F007C117D /* Runner */, 173 | ); 174 | }; 175 | /* End PBXProject section */ 176 | 177 | /* Begin PBXResourcesBuildPhase section */ 178 | 97C146EC1CF9000F007C117D /* Resources */ = { 179 | isa = PBXResourcesBuildPhase; 180 | buildActionMask = 2147483647; 181 | files = ( 182 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 183 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 184 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 185 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXResourcesBuildPhase section */ 190 | 191 | /* Begin PBXShellScriptBuildPhase section */ 192 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 193 | isa = PBXShellScriptBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | ); 197 | inputPaths = ( 198 | ); 199 | name = "Thin Binary"; 200 | outputPaths = ( 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | shellPath = /bin/sh; 204 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 205 | }; 206 | 9740EEB61CF901F6004384FC /* Run Script */ = { 207 | isa = PBXShellScriptBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | ); 211 | inputPaths = ( 212 | ); 213 | name = "Run Script"; 214 | outputPaths = ( 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | shellPath = /bin/sh; 218 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 219 | }; 220 | /* End PBXShellScriptBuildPhase section */ 221 | 222 | /* Begin PBXSourcesBuildPhase section */ 223 | 97C146EA1CF9000F007C117D /* Sources */ = { 224 | isa = PBXSourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 228 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXSourcesBuildPhase section */ 233 | 234 | /* Begin PBXVariantGroup section */ 235 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 236 | isa = PBXVariantGroup; 237 | children = ( 238 | 97C146FB1CF9000F007C117D /* Base */, 239 | ); 240 | name = Main.storyboard; 241 | sourceTree = ""; 242 | }; 243 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 244 | isa = PBXVariantGroup; 245 | children = ( 246 | 97C147001CF9000F007C117D /* Base */, 247 | ); 248 | name = LaunchScreen.storyboard; 249 | sourceTree = ""; 250 | }; 251 | /* End PBXVariantGroup section */ 252 | 253 | /* Begin XCBuildConfiguration section */ 254 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 255 | isa = XCBuildConfiguration; 256 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 257 | buildSettings = { 258 | ALWAYS_SEARCH_USER_PATHS = NO; 259 | CLANG_ANALYZER_NONNULL = YES; 260 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 261 | CLANG_CXX_LIBRARY = "libc++"; 262 | CLANG_ENABLE_MODULES = YES; 263 | CLANG_ENABLE_OBJC_ARC = YES; 264 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 265 | CLANG_WARN_BOOL_CONVERSION = YES; 266 | CLANG_WARN_COMMA = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INFINITE_RECURSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 275 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 276 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 278 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 279 | CLANG_WARN_STRICT_PROTOTYPES = YES; 280 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 281 | CLANG_WARN_UNREACHABLE_CODE = YES; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = NO; 285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 286 | ENABLE_NS_ASSERTIONS = NO; 287 | ENABLE_STRICT_OBJC_MSGSEND = YES; 288 | GCC_C_LANGUAGE_STANDARD = gnu99; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 297 | MTL_ENABLE_DEBUG_INFO = NO; 298 | SDKROOT = iphoneos; 299 | SUPPORTED_PLATFORMS = iphoneos; 300 | TARGETED_DEVICE_FAMILY = "1,2"; 301 | VALIDATE_PRODUCT = YES; 302 | }; 303 | name = Profile; 304 | }; 305 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 306 | isa = XCBuildConfiguration; 307 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | CLANG_ENABLE_MODULES = YES; 311 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 312 | ENABLE_BITCODE = NO; 313 | FRAMEWORK_SEARCH_PATHS = ( 314 | "$(inherited)", 315 | "$(PROJECT_DIR)/Flutter", 316 | ); 317 | INFOPLIST_FILE = Runner/Info.plist; 318 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 319 | LIBRARY_SEARCH_PATHS = ( 320 | "$(inherited)", 321 | "$(PROJECT_DIR)/Flutter", 322 | ); 323 | PRODUCT_BUNDLE_IDENTIFIER = com.example.shopping; 324 | PRODUCT_NAME = "$(TARGET_NAME)"; 325 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 326 | SWIFT_VERSION = 4.0; 327 | VERSIONING_SYSTEM = "apple-generic"; 328 | }; 329 | name = Profile; 330 | }; 331 | 97C147031CF9000F007C117D /* Debug */ = { 332 | isa = XCBuildConfiguration; 333 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 334 | buildSettings = { 335 | ALWAYS_SEARCH_USER_PATHS = NO; 336 | CLANG_ANALYZER_NONNULL = YES; 337 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 338 | CLANG_CXX_LIBRARY = "libc++"; 339 | CLANG_ENABLE_MODULES = YES; 340 | CLANG_ENABLE_OBJC_ARC = YES; 341 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 342 | CLANG_WARN_BOOL_CONVERSION = YES; 343 | CLANG_WARN_COMMA = YES; 344 | CLANG_WARN_CONSTANT_CONVERSION = YES; 345 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 356 | CLANG_WARN_STRICT_PROTOTYPES = YES; 357 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 358 | CLANG_WARN_UNREACHABLE_CODE = YES; 359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 361 | COPY_PHASE_STRIP = NO; 362 | DEBUG_INFORMATION_FORMAT = dwarf; 363 | ENABLE_STRICT_OBJC_MSGSEND = YES; 364 | ENABLE_TESTABILITY = YES; 365 | GCC_C_LANGUAGE_STANDARD = gnu99; 366 | GCC_DYNAMIC_NO_PIC = NO; 367 | GCC_NO_COMMON_BLOCKS = YES; 368 | GCC_OPTIMIZATION_LEVEL = 0; 369 | GCC_PREPROCESSOR_DEFINITIONS = ( 370 | "DEBUG=1", 371 | "$(inherited)", 372 | ); 373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 375 | GCC_WARN_UNDECLARED_SELECTOR = YES; 376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 377 | GCC_WARN_UNUSED_FUNCTION = YES; 378 | GCC_WARN_UNUSED_VARIABLE = YES; 379 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 380 | MTL_ENABLE_DEBUG_INFO = YES; 381 | ONLY_ACTIVE_ARCH = YES; 382 | SDKROOT = iphoneos; 383 | TARGETED_DEVICE_FAMILY = "1,2"; 384 | }; 385 | name = Debug; 386 | }; 387 | 97C147041CF9000F007C117D /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_ANALYZER_NONNULL = YES; 393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 394 | CLANG_CXX_LIBRARY = "libc++"; 395 | CLANG_ENABLE_MODULES = YES; 396 | CLANG_ENABLE_OBJC_ARC = YES; 397 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 398 | CLANG_WARN_BOOL_CONVERSION = YES; 399 | CLANG_WARN_COMMA = YES; 400 | CLANG_WARN_CONSTANT_CONVERSION = YES; 401 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 402 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 403 | CLANG_WARN_EMPTY_BODY = YES; 404 | CLANG_WARN_ENUM_CONVERSION = YES; 405 | CLANG_WARN_INFINITE_RECURSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 408 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 409 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 410 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 411 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 412 | CLANG_WARN_STRICT_PROTOTYPES = YES; 413 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 414 | CLANG_WARN_UNREACHABLE_CODE = YES; 415 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 416 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 417 | COPY_PHASE_STRIP = NO; 418 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 419 | ENABLE_NS_ASSERTIONS = NO; 420 | ENABLE_STRICT_OBJC_MSGSEND = YES; 421 | GCC_C_LANGUAGE_STANDARD = gnu99; 422 | GCC_NO_COMMON_BLOCKS = YES; 423 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 424 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 425 | GCC_WARN_UNDECLARED_SELECTOR = YES; 426 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 427 | GCC_WARN_UNUSED_FUNCTION = YES; 428 | GCC_WARN_UNUSED_VARIABLE = YES; 429 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 430 | MTL_ENABLE_DEBUG_INFO = NO; 431 | SDKROOT = iphoneos; 432 | SUPPORTED_PLATFORMS = iphoneos; 433 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 434 | TARGETED_DEVICE_FAMILY = "1,2"; 435 | VALIDATE_PRODUCT = YES; 436 | }; 437 | name = Release; 438 | }; 439 | 97C147061CF9000F007C117D /* Debug */ = { 440 | isa = XCBuildConfiguration; 441 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | CLANG_ENABLE_MODULES = YES; 445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 446 | ENABLE_BITCODE = NO; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | INFOPLIST_FILE = Runner/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | LIBRARY_SEARCH_PATHS = ( 454 | "$(inherited)", 455 | "$(PROJECT_DIR)/Flutter", 456 | ); 457 | PRODUCT_BUNDLE_IDENTIFIER = com.example.shopping; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 460 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 461 | SWIFT_VERSION = 4.0; 462 | VERSIONING_SYSTEM = "apple-generic"; 463 | }; 464 | name = Debug; 465 | }; 466 | 97C147071CF9000F007C117D /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 469 | buildSettings = { 470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 471 | CLANG_ENABLE_MODULES = YES; 472 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 473 | ENABLE_BITCODE = NO; 474 | FRAMEWORK_SEARCH_PATHS = ( 475 | "$(inherited)", 476 | "$(PROJECT_DIR)/Flutter", 477 | ); 478 | INFOPLIST_FILE = Runner/Info.plist; 479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 480 | LIBRARY_SEARCH_PATHS = ( 481 | "$(inherited)", 482 | "$(PROJECT_DIR)/Flutter", 483 | ); 484 | PRODUCT_BUNDLE_IDENTIFIER = com.example.shopping; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 487 | SWIFT_VERSION = 4.0; 488 | VERSIONING_SYSTEM = "apple-generic"; 489 | }; 490 | name = Release; 491 | }; 492 | /* End XCBuildConfiguration section */ 493 | 494 | /* Begin XCConfigurationList section */ 495 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | 97C147031CF9000F007C117D /* Debug */, 499 | 97C147041CF9000F007C117D /* Release */, 500 | 249021D3217E4FDB00AE95B9 /* Profile */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 506 | isa = XCConfigurationList; 507 | buildConfigurations = ( 508 | 97C147061CF9000F007C117D /* Debug */, 509 | 97C147071CF9000F007C117D /* Release */, 510 | 249021D4217E4FDB00AE95B9 /* Profile */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | /* End XCConfigurationList section */ 516 | 517 | }; 518 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 519 | } 520 | --------------------------------------------------------------------------------