├── 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 ├── icons └── icon.png ├── lib ├── src │ └── app │ │ ├── shared │ │ ├── enums │ │ │ ├── sort_criteria_enum.dart │ │ │ └── login_enum.dart │ │ └── blocs │ │ │ ├── user_bloc.dart │ │ │ └── order_bloc.dart │ │ ├── components │ │ ├── tabs │ │ │ ├── users_tab │ │ │ │ ├── users_tab_bloc.dart │ │ │ │ ├── user_tile │ │ │ │ │ ├── user_tile_bloc.dart │ │ │ │ │ └── user_tile_widget.dart │ │ │ │ └── users_tab.dart │ │ │ ├── orders_tab │ │ │ │ ├── order_tile │ │ │ │ │ ├── order_tile_bloc.dart │ │ │ │ │ ├── order_header │ │ │ │ │ │ ├── order_header_bloc.dart │ │ │ │ │ │ └── order_header_widget.dart │ │ │ │ │ └── order_tile_widget.dart │ │ │ │ ├── orders_tab_bloc.dart │ │ │ │ └── orders_tab.dart │ │ │ └── products_tab │ │ │ │ ├── products_tab_bloc.dart │ │ │ │ ├── category_tile │ │ │ │ ├── category_tile_bloc.dart │ │ │ │ ├── edit_category_dialog │ │ │ │ │ ├── edit_category_dialog_bloc.dart │ │ │ │ │ └── edit_category_dialog_widget.dart │ │ │ │ └── category_tile_widget.dart │ │ │ │ └── products_tab.dart │ │ ├── imagesWidget │ │ │ ├── images_bloc.dart │ │ │ ├── image_source_sheet │ │ │ │ ├── image_source_sheet_bloc.dart │ │ │ │ └── image_source_sheet_widget.dart │ │ │ └── images_widget.dart │ │ ├── input_field │ │ │ ├── input_field_bloc.dart │ │ │ └── input_field_widget.dart │ │ └── product_size │ │ │ ├── product_size_bloc.dart │ │ │ ├── add_sizes_dialog │ │ │ ├── add_sizes_dialog_bloc.dart │ │ │ └── add_sizes_dialog_widget.dart │ │ │ └── product_size_widget.dart │ │ ├── app_bloc.dart │ │ ├── pages │ │ ├── Home │ │ │ ├── home_bloc.dart │ │ │ └── home_page.dart │ │ ├── product │ │ │ ├── images │ │ │ │ └── images_widget.dart │ │ │ ├── product_bloc.dart │ │ │ └── product_page.dart │ │ └── login │ │ │ ├── login_bloc.dart │ │ │ └── login_page.dart │ │ ├── app_widget.dart │ │ ├── validators │ │ ├── login_validator.dart │ │ └── product_validator.dart │ │ ├── repositories │ │ ├── orders_repository.dart │ │ ├── login_repository.dart │ │ ├── user_repository.dart │ │ └── product_repository.dart │ │ └── app_module.dart └── main.dart ├── images └── no_image.png ├── android ├── .settings │ └── org.eclipse.buildship.core.prefs ├── app │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── 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 │ │ │ │ │ └── gerenciamento_loja │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── .classpath │ ├── .project │ ├── google-services.json │ └── build.gradle ├── gradle.properties ├── .gitignore ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .project ├── 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" -------------------------------------------------------------------------------- /icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterGerenciadorLoja/HEAD/icons/icon.png -------------------------------------------------------------------------------- /lib/src/app/shared/enums/sort_criteria_enum.dart: -------------------------------------------------------------------------------- 1 | enum SortCriteria { READY_FIRST, READY_LAST } 2 | -------------------------------------------------------------------------------- /lib/src/app/shared/enums/login_enum.dart: -------------------------------------------------------------------------------- 1 | enum LoginState { INITIAL, IDLE, LOADING, SUCCESS, FAIL } 2 | -------------------------------------------------------------------------------- /images/no_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterGerenciadorLoja/HEAD/images/no_image.png -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir= 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /android/app/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir=.. 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 3 | 4 | void main() => runApp(AppModule()); 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterGerenciadorLoja/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterGerenciadorLoja/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toshiossada/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/FlutterGerenciadorLoja/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/src/app/components/tabs/users_tab/users_tab_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | 4 | class UsersTabBloc extends BlocBase { 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/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/src/app/components/tabs/orders_tab/order_tile/order_tile_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class OrderTileBloc extends BlocBase { 4 | 5 | @override 6 | void dispose() { 7 | 8 | super.dispose(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/src/app/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 | -------------------------------------------------------------------------------- /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/src/app/components/imagesWidget/images_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class ImagesBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/app/components/input_field/input_field_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class InputFieldBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/app/components/product_size/product_size_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class ProductSizeBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/orders_tab/orders_tab_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class OrdersTabBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/users_tab/user_tile/user_tile_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class UserTileBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/app/components/product_size/add_sizes_dialog/add_sizes_dialog_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class AddSizesDialogBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/app/components/imagesWidget/image_source_sheet/image_source_sheet_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class ImageSourceSheetBloc extends BlocBase { 4 | //dispose will be called automatically by closing its streams 5 | @override 6 | void dispose() { 7 | super.dispose(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/orders_tab/order_tile/order_header/order_header_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | 3 | class OrderHeaderBloc 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/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/gerenciamento_loja/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento_loja 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/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/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 | -------------------------------------------------------------------------------- /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/src/app/app_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gerenciamento_loja/src/app/pages/login/login_page.dart'; 3 | 4 | class AppWidget extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return MaterialApp( 8 | title: 'Flutter Slidy', 9 | theme: ThemeData( 10 | primarySwatch: Colors.blue, 11 | backgroundColor: Colors.grey[850], 12 | appBarTheme: AppBarTheme(color: Colors.pinkAccent), 13 | ), 14 | home: LoginPage(), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/products_tab/products_tab_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 4 | import 'package:gerenciamento_loja/src/app/repositories/product_repository.dart'; 5 | 6 | class ProductsTabBloc extends BlocBase { 7 | final _productRepository = AppModule.to.getDependency(); 8 | 9 | Stream getDocuments() { 10 | return _productRepository.getDocuments(); 11 | } 12 | 13 | @override 14 | void dispose() { 15 | super.dispose(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gerenciamento_loja 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 | "# FlutterGerenciadorLoja" 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/src/app/validators/login_validator.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | class LoginValidator { 4 | final validateEmail = StreamTransformer.fromHandlers( 5 | handleData: (email, sink) async { 6 | if (RegExp(r"^[a-zA-Z0-9._]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email)) sink.add(email); 7 | else sink.addError('Insira um email valido'); 8 | }, 9 | ); 10 | final validatePass = StreamTransformer.fromHandlers( 11 | handleData: (pass, sink) async { 12 | if (pass.length >= 4) sink.add(pass); 13 | else sink.addError('Senha inválida! Senha deve conter pelo menos 4 caracters'); 14 | }, 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 'com.google.gms:google-services:4.3.0' 11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/app/validators/product_validator.dart: -------------------------------------------------------------------------------- 1 | class ProductValidator { 2 | 3 | String validateImages(List images){ 4 | if(images.isEmpty) return "Adicione imagens do produto"; 5 | return null; 6 | } 7 | 8 | String validateTitle(String text){ 9 | if(text.isEmpty) return "Preencha o título do produto"; 10 | return null; 11 | } 12 | 13 | String validateDescription(String text){ 14 | if(text.isEmpty) return "Preencha a descrição do produto"; 15 | return null; 16 | } 17 | 18 | String validatePrice(String text){ 19 | double price = double.tryParse(text); 20 | if(price != null){ 21 | if(!text.contains(".") || text.split(".")[1].length != 2) 22 | return "Utilize 2 casas decimais"; 23 | } else { 24 | return "Preço inválido"; 25 | } 26 | return null; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /lib/src/app/components/tabs/products_tab/category_tile/category_tile_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 4 | import 'package:gerenciamento_loja/src/app/repositories/product_repository.dart'; 5 | 6 | class CategoryTileBloc extends BlocBase { 7 | final _productRepository = AppModule.to.getDependency(); 8 | 9 | Future getItems(DocumentSnapshot category) { 10 | return _productRepository.getItems(category); 11 | } 12 | 13 | deleteProduct(DocumentSnapshot p) { 14 | p.reference.delete(); 15 | } 16 | 17 | //dispose will be called automatically by closing its streams 18 | @override 19 | void dispose() { 20 | super.dispose(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/app/repositories/orders_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | 4 | class OrderRepository extends Disposable { 5 | var _firestore = Firestore.instance; 6 | final String _colletion = 'orders'; 7 | 8 | Future get({String documentId}) async { 9 | return await _firestore.collection(_colletion).document(documentId).get(); 10 | } 11 | 12 | addListener(Function f) { 13 | _firestore.collection(_colletion).snapshots().listen(f); 14 | } 15 | 16 | void updateData(DocumentSnapshot order, String field, dynamic value) { 17 | order.reference.updateData({field: value}); 18 | } 19 | 20 | void delete(DocumentSnapshot order){ 21 | order.reference.delete(); 22 | } 23 | 24 | 25 | @override 26 | void dispose() {} 27 | } 28 | -------------------------------------------------------------------------------- /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/src/app/repositories/login_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | import 'package:firebase_auth/firebase_auth.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | 6 | class LoginRepository extends Disposable { 7 | FirebaseAuth instance = FirebaseAuth.instance; 8 | Firestore get firestore => Firestore.instance; 9 | 10 | Future login( 11 | {@required String email, @required String pass}) async { 12 | var result = 13 | await instance.signInWithEmailAndPassword(email: email, password: pass); 14 | return result; 15 | } 16 | 17 | Future verifyPrivileges(FirebaseUser user) async { 18 | var result = await firestore.collection('admins').document(user.uid).get(); 19 | return result; 20 | } 21 | 22 | //dispose will be called automatically by closing its streams 23 | @override 24 | void dispose() {} 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/app/repositories/user_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | 4 | class UserRepository extends Disposable { 5 | var _firestore = Firestore.instance; 6 | final String _colletion = 'users'; 7 | 8 | subscribleToOrders(String uid, Function f) { 9 | _firestore 10 | .collection(_colletion) 11 | .document(uid) 12 | .collection('orders') 13 | .snapshots() 14 | .listen(f); 15 | } 16 | 17 | addListener(Function f) { 18 | _firestore.collection(_colletion).snapshots().listen(f); 19 | } 20 | 21 | Future getUser(String uid) async{ 22 | return await _firestore.collection(_colletion).document(uid).get(); 23 | } 24 | 25 | deleteOrders(String uid, String oid) async{ 26 | return await _firestore.collection(_colletion).document(uid).collection('orders').document(oid).delete(); 27 | } 28 | 29 | @override 30 | void dispose() {} 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/app/components/product_size/add_sizes_dialog/add_sizes_dialog_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AddSizesDialogWidget extends StatelessWidget { 4 | final _controller = TextEditingController(); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Dialog( 9 | child: Container( 10 | padding: EdgeInsets.only(left: 8, right: 8, top: 8), 11 | child: Column( 12 | mainAxisSize: MainAxisSize.min, 13 | children: [ 14 | TextField( 15 | controller: _controller, 16 | 17 | ), 18 | Container( 19 | alignment: Alignment.centerRight, 20 | child: FlatButton( 21 | child: Text('Add'), 22 | textColor: Colors.pinkAccent, 23 | onPressed: () { 24 | Navigator.pop(context, _controller.text); 25 | }, 26 | ), 27 | ), 28 | ], 29 | )), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/products_tab/products_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 3 | 4 | import 'category_tile/category_tile_widget.dart'; 5 | import 'products_tab_bloc.dart'; 6 | 7 | class ProductsTab extends StatefulWidget { 8 | @override 9 | _ProductsTabState createState() => _ProductsTabState(); 10 | } 11 | 12 | class _ProductsTabState extends State with AutomaticKeepAliveClientMixin{ 13 | final _productBloc = AppModule.to.getBloc(); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | super.build(context); 18 | 19 | return StreamBuilder( 20 | stream: _productBloc.getDocuments(), 21 | builder: (context, snapshot) { 22 | if (!snapshot.hasData) 23 | return Center( 24 | child: CircularProgressIndicator( 25 | valueColor: AlwaysStoppedAnimation(Colors.white), 26 | ), 27 | ); 28 | else 29 | return ListView.builder( 30 | itemCount: snapshot.data.documents.length, 31 | itemBuilder: (context, index) => 32 | CategoryTileWidget(snapshot.data.documents[index]), 33 | ); 34 | }, 35 | ); 36 | } 37 | 38 | @override 39 | bool get wantKeepAlive => true; 40 | } 41 | -------------------------------------------------------------------------------- /lib/src/app/components/input_field/input_field_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class InputField extends StatelessWidget { 4 | final IconData icon; 5 | final bool obscure; 6 | final String hint; 7 | final Stream stream; 8 | final Function(String) onChanged; 9 | 10 | InputField( 11 | {@required this.icon, 12 | @required this.hint, 13 | @required this.obscure, 14 | @required this.stream, 15 | @required this.onChanged}); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return StreamBuilder( 20 | stream: stream, 21 | builder: (context, snapshot) { 22 | return TextField( 23 | onChanged: onChanged, 24 | decoration: InputDecoration( 25 | icon: Icon( 26 | icon, 27 | color: Colors.white, 28 | ), 29 | hintText: hint, 30 | hintStyle: TextStyle(color: Colors.white), 31 | focusedBorder: UnderlineInputBorder( 32 | borderSide: BorderSide(color: Colors.pinkAccent), 33 | ), 34 | contentPadding: 35 | EdgeInsets.only(left: 5, top: 30, bottom: 30, right: 30), 36 | errorText: snapshot.hasError ? snapshot.error : null, 37 | ), 38 | style: TextStyle(color: Colors.white), 39 | obscureText: obscure, 40 | ); 41 | }, 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/orders_tab/orders_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 3 | import 'package:gerenciamento_loja/src/app/shared/blocs/order_bloc.dart'; 4 | 5 | import 'order_tile/order_tile_widget.dart'; 6 | 7 | class OrdersTab extends StatelessWidget { 8 | final _ordersBloc = AppModule.to.getBloc(); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Padding( 13 | padding: EdgeInsets.symmetric(vertical: 16), 14 | child: StreamBuilder( 15 | stream: _ordersBloc.outOrders, 16 | builder: (context, snapshot) { 17 | if (!snapshot.hasData) 18 | return Center( 19 | child: CircularProgressIndicator( 20 | valueColor: AlwaysStoppedAnimation(Colors.pinkAccent), 21 | ), 22 | ); 23 | else if (snapshot.data.length == 0) 24 | return Center( 25 | child: Text( 26 | 'Nenhum pedido encontrado!', 27 | style: TextStyle(color: Colors.pinkAccent), 28 | ), 29 | ); 30 | else 31 | return ListView.builder( 32 | itemCount: snapshot.data.length, 33 | itemBuilder: (context, index) { 34 | return OrderTileWidget(snapshot.data[index]); 35 | }, 36 | ); 37 | }, 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/orders_tab/order_tile/order_header/order_header_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 4 | import 'package:gerenciamento_loja/src/app/shared/blocs/user_bloc.dart'; 5 | 6 | class OrderHeaderWidget extends StatelessWidget { 7 | final DocumentSnapshot order; 8 | final _userBloc = AppModule.to.getBloc(); 9 | 10 | OrderHeaderWidget(this.order); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | var user = _userBloc.getUser(order.data['clientId']); 15 | return Row( 16 | children: [ 17 | Expanded( 18 | child: Column( 19 | crossAxisAlignment: CrossAxisAlignment.start, 20 | children: [ 21 | Text(user['name']), 22 | Text(user['address']), 23 | ], 24 | ), 25 | ), 26 | Column( 27 | crossAxisAlignment: CrossAxisAlignment.end, 28 | children: [ 29 | Text( 30 | 'Produtos: R\$${order.data['produtcsPrice'].toStringAsFixed(2)}', 31 | style: TextStyle(fontWeight: FontWeight.w500), 32 | ), 33 | Text( 34 | 'Total R\$${order.data['totalPrice'].toStringAsFixed(2)} ', 35 | style: TextStyle(fontWeight: FontWeight.w500), 36 | ), 37 | ], 38 | ), 39 | ], 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/src/app/repositories/product_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:bloc_pattern/bloc_pattern.dart'; 4 | import 'package:cloud_firestore/cloud_firestore.dart'; 5 | import 'package:firebase_storage/firebase_storage.dart'; 6 | 7 | class ProductRepository extends Disposable { 8 | var _firestore = Firestore.instance; 9 | final String _colletion = 'products'; 10 | 11 | addListener(Function f) { 12 | _firestore.collection(_colletion).snapshots().listen(f); 13 | } 14 | 15 | Stream getDocuments() { 16 | return _firestore.collection(_colletion).snapshots(); 17 | } 18 | 19 | Future getItems(DocumentSnapshot category) { 20 | return category.reference.collection('items').getDocuments(); 21 | } 22 | 23 | Future uploadImage( 24 | String categoryId, String productsId, File image) async { 25 | StorageUploadTask uploadTask = FirebaseStorage.instance 26 | .ref() 27 | .child(categoryId) 28 | .child(productsId) 29 | .child(DateTime.now().millisecondsSinceEpoch.toString()) 30 | .putFile(image); 31 | StorageTaskSnapshot s = await uploadTask.onComplete; 32 | 33 | return await s.ref.getDownloadURL(); 34 | } 35 | 36 | Future add( 37 | String categoryId, Map product) async { 38 | return await _firestore 39 | .collection(_colletion) 40 | .document(categoryId) 41 | .collection('items') 42 | .add(product); 43 | } 44 | 45 | @override 46 | void dispose() {} 47 | } 48 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /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 | gerenciamento_loja 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/src/app/components/imagesWidget/image_source_sheet/image_source_sheet_widget.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:image_cropper/image_cropper.dart'; 5 | import 'package:image_picker/image_picker.dart'; 6 | 7 | class ImageSourceSheetWidget extends StatelessWidget { 8 | final Function(File) onImageSelected; 9 | 10 | ImageSourceSheetWidget({this.onImageSelected}); 11 | 12 | void imageSelected(File image) async { 13 | if (image != null) { 14 | File croppedImage = await ImageCropper.cropImage( 15 | sourcePath: image.path, 16 | aspectRatioPresets: [ 17 | CropAspectRatioPreset.square, 18 | CropAspectRatioPreset.ratio3x2, 19 | CropAspectRatioPreset.original, 20 | CropAspectRatioPreset.ratio4x3, 21 | CropAspectRatioPreset.ratio16x9 22 | ], 23 | iosUiSettings: IOSUiSettings( 24 | minimumAspectRatio: 1.0, 25 | ), 26 | ); 27 | onImageSelected(croppedImage); 28 | } 29 | } 30 | 31 | @override 32 | Widget build(BuildContext context) { 33 | return BottomSheet( 34 | onClosing: () {}, 35 | builder: (context) => Column( 36 | mainAxisSize: MainAxisSize.min, 37 | children: [ 38 | FlatButton( 39 | child: Text("Câmera"), 40 | onPressed: () async { 41 | File image = 42 | await ImagePicker.pickImage(source: ImageSource.camera); 43 | imageSelected(image); 44 | }, 45 | ), 46 | FlatButton( 47 | child: Text("Galeria"), 48 | onPressed: () async { 49 | File image = 50 | await ImagePicker.pickImage(source: ImageSource.gallery); 51 | imageSelected(image); 52 | }, 53 | ) 54 | ], 55 | ), 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/users_tab/user_tile/user_tile_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shimmer/shimmer.dart'; 3 | 4 | class UserTileWidget extends StatelessWidget { 5 | final Map user; 6 | 7 | UserTileWidget(this.user); 8 | 9 | var style = TextStyle(color: Colors.white); 10 | @override 11 | Widget build(BuildContext context) { 12 | if (user.containsKey('money')) 13 | return ListTile( 14 | title: Text( 15 | user['name'], 16 | style: style, 17 | ), 18 | subtitle: Text( 19 | user['email'], 20 | style: style, 21 | ), 22 | trailing: Column( 23 | crossAxisAlignment: CrossAxisAlignment.end, 24 | children: [ 25 | Text( 26 | 'Pedidos: ${user['orders']}', 27 | style: style, 28 | ), 29 | Text( 30 | 'Gasto: R\$${user['money'].toStringAsFixed(2)}', 31 | style: style, 32 | ) 33 | ], 34 | ), 35 | ); 36 | else 37 | return Container( 38 | margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), 39 | child: Column( 40 | crossAxisAlignment: CrossAxisAlignment.start, 41 | children: [ 42 | SizedBox( 43 | height: 20, 44 | width: 200, 45 | child: Shimmer.fromColors( 46 | child: Container( 47 | color: Colors.white.withAlpha(200), 48 | margin: EdgeInsets.symmetric(vertical: 4), 49 | ), 50 | baseColor: Colors.white, 51 | highlightColor: Colors.grey, 52 | ), 53 | ), 54 | SizedBox( 55 | height: 20, 56 | width: 50, 57 | child: Shimmer.fromColors( 58 | child: Container( 59 | color: Colors.white.withAlpha(200), 60 | margin: EdgeInsets.symmetric(vertical: 4), 61 | ), 62 | baseColor: Colors.white, 63 | highlightColor: Colors.grey, 64 | ), 65 | ), 66 | ], 67 | ), 68 | ); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/users_tab/users_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 3 | import 'package:gerenciamento_loja/src/app/shared/blocs/user_bloc.dart'; 4 | 5 | import 'user_tile/user_tile_widget.dart'; 6 | 7 | class UsersTab extends StatelessWidget { 8 | var _userBloc = AppModule.to.getBloc(); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Column( 13 | children: [ 14 | Padding( 15 | padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), 16 | child: TextField( 17 | onChanged: (value){ 18 | _userBloc.onChangedSearch(value); 19 | }, 20 | style: TextStyle(color: Colors.white), 21 | decoration: InputDecoration( 22 | hintText: "Pesquisar", 23 | hintStyle: TextStyle(color: Colors.white), 24 | icon: Icon( 25 | Icons.search, 26 | color: Colors.white, 27 | ), 28 | border: InputBorder.none), 29 | ), 30 | ), 31 | Expanded( 32 | child: StreamBuilder( 33 | stream: _userBloc.outUsers, 34 | builder: (context, snapshot) { 35 | if (!snapshot.hasData) 36 | return Center( 37 | child: CircularProgressIndicator( 38 | valueColor: AlwaysStoppedAnimation(Colors.pinkAccent), 39 | ), 40 | ); 41 | else if (snapshot.data.length == 0) 42 | return Center( 43 | child: Text( 44 | 'Nenhum usuário encontrado', 45 | style: TextStyle(color: Colors.pinkAccent), 46 | ), 47 | ); 48 | else 49 | return ListView.separated( 50 | itemBuilder: (context, index) => UserTileWidget(snapshot.data[index]), 51 | separatorBuilder: (context, index) => Divider(), 52 | itemCount: snapshot.data.length, 53 | ); 54 | }), 55 | ) 56 | ], 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "869296241215", 4 | "firebase_url": "https://lojaflutter-e2b4c.firebaseio.com", 5 | "project_id": "lojaflutter-e2b4c", 6 | "storage_bucket": "lojaflutter-e2b4c.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:869296241215:android:6e4f46bb09ecae200dd68a", 12 | "android_client_info": { 13 | "package_name": "com.example.gerenciamento_loja" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "869296241215-ii06gnpm5pl88uhvbvi6dsl4u4ca6759.apps.googleusercontent.com", 19 | "client_type": 3 20 | } 21 | ], 22 | "api_key": [ 23 | { 24 | "current_key": "AIzaSyBuhPyTAUGc74ywP5FUc365zvB-rJnlURI" 25 | } 26 | ], 27 | "services": { 28 | "appinvite_service": { 29 | "other_platform_oauth_client": [ 30 | { 31 | "client_id": "869296241215-ii06gnpm5pl88uhvbvi6dsl4u4ca6759.apps.googleusercontent.com", 32 | "client_type": 3 33 | } 34 | ] 35 | } 36 | } 37 | }, 38 | { 39 | "client_info": { 40 | "mobilesdk_app_id": "1:869296241215:android:0c439b8f49a749410dd68a", 41 | "android_client_info": { 42 | "package_name": "com.example.loja_virtual" 43 | } 44 | }, 45 | "oauth_client": [ 46 | { 47 | "client_id": "869296241215-ii06gnpm5pl88uhvbvi6dsl4u4ca6759.apps.googleusercontent.com", 48 | "client_type": 3 49 | } 50 | ], 51 | "api_key": [ 52 | { 53 | "current_key": "AIzaSyBuhPyTAUGc74ywP5FUc365zvB-rJnlURI" 54 | } 55 | ], 56 | "services": { 57 | "appinvite_service": { 58 | "other_platform_oauth_client": [ 59 | { 60 | "client_id": "869296241215-ii06gnpm5pl88uhvbvi6dsl4u4ca6759.apps.googleusercontent.com", 61 | "client_type": 3 62 | } 63 | ] 64 | } 65 | } 66 | } 67 | ], 68 | "configuration_version": "1" 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.gerenciamento_loja" 42 | minSdkVersion 23 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 | apply plugin: 'com.google.gms.google-services' -------------------------------------------------------------------------------- /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/src/app/components/imagesWidget/images_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'image_source_sheet/image_source_sheet_widget.dart'; 4 | 5 | 6 | 7 | class ImagesWidget extends FormField { 8 | 9 | ImagesWidget({ 10 | BuildContext context, 11 | FormFieldSetter onSaved, 12 | FormFieldValidator validator, 13 | List initialValue, 14 | bool autoValidate = false, 15 | }) : super( 16 | onSaved: onSaved, 17 | validator: validator, 18 | initialValue: initialValue, 19 | autovalidate: autoValidate, 20 | builder: (state){ 21 | return Column( 22 | crossAxisAlignment: CrossAxisAlignment.start, 23 | children: [ 24 | Container( 25 | height: 124, 26 | padding: EdgeInsets.only(top: 16, bottom: 8), 27 | child: ListView( 28 | scrollDirection: Axis.horizontal, 29 | children: state.value.map((i){ 30 | return Container( 31 | height: 100, 32 | width: 100, 33 | margin: EdgeInsets.only(right: 8), 34 | child: GestureDetector( 35 | child: i is String ? Image.network(i, fit: BoxFit.cover,) : 36 | Image.file(i, fit: BoxFit.cover,), 37 | onLongPress: (){ 38 | state.didChange(state.value..remove(i)); 39 | }, 40 | ), 41 | ); 42 | }).toList()..add( 43 | GestureDetector( 44 | child: Container( 45 | height: 100, 46 | width: 100, 47 | child: Icon(Icons.camera_enhance, color: Colors.white,), 48 | color: Colors.white.withAlpha(50), 49 | ), 50 | onTap: (){ 51 | showModalBottomSheet(context: context, 52 | builder: (context) => ImageSourceSheetWidget( 53 | onImageSelected: (image){ 54 | state.didChange(state.value..add(image)); 55 | Navigator.of(context).pop(); 56 | }, 57 | ) 58 | ); 59 | }, 60 | ) 61 | ), 62 | ), 63 | ), 64 | state.hasError ? Text( 65 | state.errorText, 66 | style: TextStyle( 67 | color: Colors.red, 68 | fontSize: 12 69 | ), 70 | ) : Container() 71 | ], 72 | ); 73 | } 74 | ); 75 | 76 | } -------------------------------------------------------------------------------- /lib/src/app/pages/product/images/images_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gerenciamento_loja/src/app/components/imagesWidget/image_source_sheet/image_source_sheet_widget.dart'; 3 | 4 | 5 | 6 | 7 | 8 | class ImagesWidget extends FormField { 9 | 10 | ImagesWidget({ 11 | BuildContext context, 12 | FormFieldSetter onSaved, 13 | FormFieldValidator validator, 14 | List initialValue, 15 | bool autoValidate = false, 16 | }) : super( 17 | onSaved: onSaved, 18 | validator: validator, 19 | initialValue: initialValue, 20 | autovalidate: autoValidate, 21 | builder: (state){ 22 | return Column( 23 | crossAxisAlignment: CrossAxisAlignment.start, 24 | children: [ 25 | Container( 26 | height: 124, 27 | padding: EdgeInsets.only(top: 16, bottom: 8), 28 | child: ListView( 29 | scrollDirection: Axis.horizontal, 30 | children: state.value.map((i){ 31 | return Container( 32 | height: 100, 33 | width: 100, 34 | margin: EdgeInsets.only(right: 8), 35 | child: GestureDetector( 36 | child: i is String ? Image.network(i, fit: BoxFit.cover,) : 37 | Image.file(i, fit: BoxFit.cover,), 38 | onLongPress: (){ 39 | state.didChange(state.value..remove(i)); 40 | }, 41 | ), 42 | ); 43 | }).toList()..add( 44 | GestureDetector( 45 | child: Container( 46 | height: 100, 47 | width: 100, 48 | child: Icon(Icons.camera_enhance, color: Colors.white,), 49 | color: Colors.white.withAlpha(50), 50 | ), 51 | onTap: (){ 52 | showModalBottomSheet(context: context, 53 | builder: (context) => ImageSourceSheetWidget( 54 | onImageSelected: (image){ 55 | state.didChange(state.value..add(image)); 56 | Navigator.of(context).pop(); 57 | }, 58 | ) 59 | ); 60 | }, 61 | ) 62 | ), 63 | ), 64 | ), 65 | state.hasError ? Text( 66 | state.errorText, 67 | style: TextStyle( 68 | color: Colors.red, 69 | fontSize: 12 70 | ), 71 | ) : Container() 72 | ], 73 | ); 74 | } 75 | ); 76 | 77 | } -------------------------------------------------------------------------------- /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/src/app/components/tabs/products_tab/category_tile/edit_category_dialog/edit_category_dialog_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | import 'package:bloc_pattern/bloc_pattern.dart'; 5 | import 'package:cloud_firestore/cloud_firestore.dart'; 6 | import 'package:firebase_storage/firebase_storage.dart'; 7 | import 'package:rxdart/rxdart.dart'; 8 | 9 | class EditCategoryDialogBloc extends BlocBase { 10 | final _titleController = BehaviorSubject(); 11 | final _imageController = BehaviorSubject(); 12 | final _deleteController = BehaviorSubject(); 13 | 14 | File image; 15 | String title; 16 | 17 | Stream get outTitle => _titleController.stream 18 | .transform(StreamTransformer.fromHandlers( 19 | handleData: (title, sink) { 20 | if (title.isEmpty) 21 | sink.addError('Insira um titulo'); 22 | else 23 | sink.add(title); 24 | }, 25 | )); 26 | Stream get outImages => _imageController.stream; 27 | Stream get outDelete => _deleteController.stream; 28 | Stream get submitValid => 29 | Observable.combineLatest2(outTitle, outImages, (a, b) => true); 30 | 31 | DocumentSnapshot category; 32 | init(DocumentSnapshot c) { 33 | category = c; 34 | 35 | if (category != null) { 36 | title = category.data['title']; 37 | image = category.data['icon']; 38 | 39 | _titleController.add(category.data['title']); 40 | _imageController.add(category.data['icon']); 41 | _deleteController.add(true); 42 | } else { 43 | _deleteController.add(false); 44 | } 45 | } 46 | 47 | setImage(File file) { 48 | image = file; 49 | _imageController.add(file); 50 | } 51 | 52 | setTitle(String title) { 53 | this.title = title; 54 | 55 | _titleController.add(title); 56 | } 57 | 58 | savaData() async { 59 | if (image == null && category == null && title == category.data['title']) 60 | return; 61 | Map dataToUpdate = {}; 62 | 63 | if (image != null) { 64 | StorageUploadTask task = FirebaseStorage.instance 65 | .ref() 66 | .child('icons') 67 | .child(title) 68 | .putFile(image); 69 | StorageTaskSnapshot snap = await task.onComplete; 70 | 71 | dataToUpdate['icon'] = await snap.ref.getDownloadURL(); 72 | } 73 | if (category == null || title != category.data['title']) { 74 | dataToUpdate['title'] = title; 75 | } 76 | 77 | if (category == null) { 78 | await Firestore.instance 79 | .collection('products') 80 | .document(title.toLowerCase()) 81 | .setData(dataToUpdate); 82 | } else { 83 | await category.reference.updateData(dataToUpdate); 84 | } 85 | } 86 | 87 | delete(){ 88 | category.reference.delete(); 89 | } 90 | 91 | //dispose will be called automatically by closing its streams 92 | @override 93 | void dispose() { 94 | _titleController.close(); 95 | _imageController.close(); 96 | _deleteController.close(); 97 | super.dispose(); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /lib/src/app/shared/blocs/user_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 4 | import 'package:gerenciamento_loja/src/app/repositories/orders_repository.dart'; 5 | import 'package:gerenciamento_loja/src/app/repositories/user_repository.dart'; 6 | import 'package:rxdart/rxdart.dart'; 7 | 8 | class UserBloc extends BlocBase { 9 | 10 | final _usersController = BehaviorSubject(); 11 | Map> _users = {}; 12 | var _userRepository = AppModule.to.getDependency(); 13 | var _ordersRepository = AppModule.to.getDependency(); 14 | 15 | Stream get outUsers => _usersController.stream; 16 | 17 | UserBloc() { 18 | _addUsersListener(); 19 | } 20 | _addUsersListener() { 21 | _userRepository.addListener((QuerySnapshot snapshot) { 22 | snapshot.documentChanges.forEach((change) { 23 | var uid = change.document.documentID; 24 | 25 | switch (change.type) { 26 | case DocumentChangeType.added: 27 | _users[uid] = change.document.data; 28 | _subscribleToOrders(uid); 29 | break; 30 | case DocumentChangeType.modified: 31 | _users[uid].addAll(change.document.data); 32 | _usersController.add(_users.values.toList()); 33 | break; 34 | case DocumentChangeType.removed: 35 | _users.remove(uid); 36 | _unsubscribleToOrders(uid); 37 | _usersController.add(_users.values.toList()); 38 | break; 39 | } 40 | }); 41 | }); 42 | } 43 | 44 | _subscribleToOrders(String uid) { 45 | _users[uid]['subscription'] = 46 | _userRepository.subscribleToOrders(uid, (QuerySnapshot orders) async { 47 | var numOrders = orders.documents.length; 48 | 49 | var money = 0.0; 50 | 51 | for (DocumentSnapshot d in orders.documents) { 52 | var order = await _ordersRepository.get(documentId: d.documentID); 53 | 54 | if (order.data == null) continue; 55 | 56 | money += order.data['totalPrice']; 57 | } 58 | 59 | _users[uid].addAll({'money': money, 'orders': numOrders}); 60 | 61 | _usersController.add(_users.values.toList()); 62 | }); 63 | } 64 | 65 | _unsubscribleToOrders(String uid) { 66 | _users[uid]['subscription'].cancel(); 67 | } 68 | 69 | @override 70 | void dispose() { 71 | _usersController.close(); 72 | super.dispose(); 73 | } 74 | 75 | void onChangedSearch(String search) { 76 | if (search.trim().isEmpty) { 77 | _usersController.add(_users.values.toList()); 78 | } else { 79 | _usersController.add(_filter(search.trim())); 80 | } 81 | } 82 | 83 | Map getUser(String uid) { 84 | return _users[uid]; 85 | } 86 | 87 | List> _filter(String search) { 88 | List> filteredUsers = 89 | List.from(_users.values.toList()); 90 | filteredUsers.retainWhere((user) => 91 | user["name"].toUpperCase().contains(search.toUpperCase()) || 92 | user["email"].toUpperCase().contains(search.toUpperCase())); 93 | return filteredUsers; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/src/app/components/product_size/product_size_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'add_sizes_dialog/add_sizes_dialog_widget.dart'; 4 | 5 | 6 | class ProductSizeWidget extends FormField { 7 | ProductSizeWidget({ 8 | BuildContext context, 9 | List initialValue, 10 | FormFieldSetter onSaved, 11 | FormFieldValidator validator, 12 | }) : super( 13 | initialValue: initialValue, 14 | onSaved: onSaved, 15 | validator: validator, 16 | builder: (state) { 17 | return SizedBox( 18 | height: 34, 19 | child: GridView( 20 | padding: EdgeInsets.symmetric(vertical: 4), 21 | scrollDirection: Axis.horizontal, 22 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 23 | crossAxisCount: 1, 24 | mainAxisSpacing: 8, 25 | childAspectRatio: 0.5, 26 | ), 27 | children: state.value 28 | .map((s) => GestureDetector( 29 | onLongPress: () { 30 | state.didChange(state.value..remove(s)); 31 | }, 32 | child: Container( 33 | decoration: BoxDecoration( 34 | borderRadius: 35 | BorderRadius.all(Radius.circular(4)), 36 | border: Border.all( 37 | color: Colors.pinkAccent, width: 3)), 38 | alignment: Alignment.center, 39 | child: Text( 40 | s, 41 | style: TextStyle(color: Colors.white), 42 | ), 43 | ), 44 | )) 45 | .toList() 46 | ..add(GestureDetector( 47 | onTap: () async { 48 | var size = await showDialog(context: context, builder: (context) => AddSizesDialogWidget()); 49 | if(size != null){ 50 | state.didChange(state.value..add(size)); 51 | } 52 | }, 53 | child: Container( 54 | decoration: BoxDecoration( 55 | borderRadius: 56 | BorderRadius.all(Radius.circular(4)), 57 | border: Border.all( 58 | color: state.hasError ? Colors.red : Colors.pinkAccent, width: 3)), 59 | alignment: Alignment.center, 60 | child: Text( 61 | '+', 62 | style: TextStyle(color: Colors.white), 63 | ), 64 | ), 65 | )), 66 | ), 67 | ); 68 | }); 69 | @override 70 | Widget build(BuildContext context) { 71 | return Container(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/src/app/shared/blocs/order_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 4 | import 'package:gerenciamento_loja/src/app/repositories/orders_repository.dart'; 5 | import 'package:gerenciamento_loja/src/app/repositories/user_repository.dart'; 6 | import 'package:gerenciamento_loja/src/app/shared/enums/sort_criteria_enum.dart'; 7 | import 'package:rxdart/rxdart.dart'; 8 | 9 | 10 | class OrderBloc extends BlocBase { 11 | final _ordersController = BehaviorSubject(); 12 | List _orders = []; 13 | 14 | Stream get outOrders => _ordersController.stream; 15 | var _ordersRepository = AppModule.to.getDependency(); 16 | var _userRepository = AppModule.to.getDependency(); 17 | 18 | SortCriteria _criteria; 19 | 20 | OrderBloc() { 21 | _addOrdersListener(); 22 | } 23 | 24 | void _addOrdersListener() { 25 | _ordersRepository.addListener((QuerySnapshot snapshot) { 26 | snapshot.documentChanges.forEach((change) { 27 | var oid = change.document.documentID; 28 | 29 | switch (change.type) { 30 | case DocumentChangeType.added: 31 | _orders.add(change.document); 32 | break; 33 | case DocumentChangeType.modified: 34 | _orders.removeWhere((o) => o.documentID == oid); 35 | _orders.add(change.document); 36 | break; 37 | case DocumentChangeType.removed: 38 | _orders.remove(oid); 39 | break; 40 | } 41 | 42 | _sort(_criteria); 43 | }); 44 | }); 45 | } 46 | 47 | void updateData(DocumentSnapshot order, String field, dynamic value) { 48 | _ordersRepository.updateData(order, field, value); 49 | } 50 | 51 | Future delete(DocumentSnapshot order) async { 52 | await _userRepository.deleteOrders(order['clientId'], order.documentID); 53 | 54 | _ordersRepository.delete(order); 55 | } 56 | 57 | //dispose will be called automatically by closing its streams 58 | @override 59 | void dispose() { 60 | _ordersController.close(); 61 | super.dispose(); 62 | } 63 | 64 | void setOrderCriteria(SortCriteria criteria) { 65 | _criteria = criteria; 66 | _sort(criteria); 67 | } 68 | 69 | _sort(SortCriteria criteria) { 70 | switch (criteria) { 71 | case SortCriteria.READY_FIRST: 72 | _orders.sort((a, b) { 73 | var sa = a.data['status']; 74 | var sb = b.data['status']; 75 | 76 | if (sa < sb) 77 | return 1; 78 | else if (sa > sb) 79 | return -1; 80 | else 81 | return 0; 82 | }); 83 | break; 84 | case SortCriteria.READY_LAST: 85 | _orders.sort((a, b) { 86 | var sa = a.data['status']; 87 | var sb = b.data['status']; 88 | 89 | if (sa > sb) 90 | return 1; 91 | else if (sa < sb) 92 | return -1; 93 | else 94 | return 0; 95 | }); 96 | break; 97 | } 98 | 99 | _ordersController.add(_orders); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: gerenciamento_loja 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 | flutter_launcher_icons: ^0.7.3 21 | shimmer: ^1.0.1 22 | flutter_speed_dial: ^1.2.1 23 | image_cropper: ^1.1.0 24 | image_picker: ^0.6.1+4 25 | firebase_storage: ^3.0.6 26 | cloud_firestore: ^0.12.9+4 27 | firebase_auth: ^0.14.0+5 28 | dio: ^3.0.3 29 | rxdart: ^0.22.3 30 | bloc_pattern: ^2.3.4 31 | 32 | flutter: 33 | sdk: flutter 34 | 35 | # The following adds the Cupertino Icons font to your application. 36 | # Use with the CupertinoIcons class for iOS style icons. 37 | cupertino_icons: ^0.1.2 38 | 39 | dev_dependencies: 40 | flutter_test: 41 | sdk: flutter 42 | 43 | # For information on the generic Dart part of this file, see the 44 | # following page: https://dart.dev/tools/pub/pubspec 45 | 46 | # The following section is specific to Flutter. 47 | flutter: 48 | # The following line ensures that the Material Icons font is 49 | # included with your application, so that you can use the icons in 50 | # the material Icons class. 51 | uses-material-design: true 52 | 53 | # To add assets to your application, add an assets section, like this: 54 | # assets: 55 | # - images 56 | # - images/a_dot_ham.jpeg 57 | 58 | # An image asset can refer to one or more resolution-specific "variants", see 59 | # https://flutter.dev/assets-and-images/#resolution-aware. 60 | 61 | # For details regarding adding assets from package dependencies, see 62 | # https://flutter.dev/assets-and-images/#from-packages 63 | 64 | # To add custom fonts to your application, add a fonts section here, 65 | # in this "flutter" section. Each entry in this list should have a 66 | # "family" key with the font family name, and a "fonts" key with a 67 | # list giving the asset and other descriptors for the font. For 68 | # example: 69 | # fonts: 70 | # - family: Schyler 71 | # fonts: 72 | # - asset: fonts/Schyler-Regular.ttf 73 | # - asset: fonts/Schyler-Italic.ttf 74 | # style: italic 75 | # - family: Trajan Pro 76 | # fonts: 77 | # - asset: fonts/TrajanPro.ttf 78 | # - asset: fonts/TrajanPro_Bold.ttf 79 | # weight: 700 80 | # 81 | # For details regarding fonts from package dependencies, 82 | # see https://flutter.dev/custom-fonts/#from-packages 83 | 84 | flutter_icons: 85 | android: true 86 | ios: true 87 | image_path: "icons/icon.png" 88 | -------------------------------------------------------------------------------- /lib/src/app/pages/product/product_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_pattern/bloc_pattern.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 4 | import 'package:gerenciamento_loja/src/app/repositories/product_repository.dart'; 5 | import 'package:rxdart/subjects.dart'; 6 | 7 | class ProductBloc extends BlocBase { 8 | String categoryId; 9 | DocumentSnapshot product; 10 | var _productRepository = AppModule.to.getDependency(); 11 | 12 | final _dataController = BehaviorSubject(); 13 | final _loadingController = BehaviorSubject(); 14 | final _createdController = BehaviorSubject(); 15 | 16 | Stream get outData => _dataController.stream; 17 | Stream get outLoading => _loadingController.stream; 18 | Stream get outCreated => _createdController.stream; 19 | 20 | Map unsavedData; 21 | 22 | initial() { 23 | if (product != null) { 24 | unsavedData = Map.of(product.data); 25 | unsavedData['images'] = List.of(product.data['images']); 26 | unsavedData['sizes'] = List.of(product.data['sizes']); 27 | 28 | _createdController.add(true); 29 | } else { 30 | unsavedData = { 31 | 'title': null, 32 | 'description': null, 33 | 'price': null, 34 | 'images': [], 35 | 'sizes': [], 36 | }; 37 | 38 | _createdController.add(false); 39 | } 40 | 41 | _dataController.add(unsavedData); 42 | } 43 | 44 | saveTitle(String value) { 45 | unsavedData['title'] = value; 46 | } 47 | 48 | saveDescription(String value) { 49 | unsavedData['description'] = value; 50 | } 51 | 52 | savePrice(String value) { 53 | unsavedData['price'] = double.parse(value); 54 | } 55 | 56 | saveImages(List images) { 57 | unsavedData['images'] = images; 58 | } 59 | 60 | saveSizes(List sizes) { 61 | unsavedData['sizes'] = sizes; 62 | } 63 | 64 | Future saveProduct() async { 65 | _loadingController.add(true); 66 | 67 | try { 68 | if (product != null) { 69 | await _uploadImages(product.documentID); 70 | product.reference.updateData(unsavedData); 71 | } else { 72 | var dr = await _productRepository.add( 73 | categoryId, Map.from(unsavedData)..remove('images')); 74 | await _uploadImages(dr.documentID); 75 | await dr.updateData(unsavedData); 76 | } 77 | 78 | _createdController.add(true); 79 | return true; 80 | } catch (e) { 81 | return false; 82 | } finally { 83 | _loadingController.add(false); 84 | } 85 | } 86 | 87 | Future _uploadImages(String productsId) async { 88 | var images = []; 89 | for (var item in unsavedData['images']) { 90 | if (item is String) { 91 | images.add(item); 92 | continue; 93 | } 94 | var url = 95 | await _productRepository.uploadImage(categoryId, productsId, item); 96 | 97 | images.add(url); 98 | } 99 | unsavedData['images'] = images; 100 | } 101 | 102 | deleteProduct(DocumentSnapshot p) { 103 | p.reference.delete(); 104 | } 105 | 106 | @override 107 | void dispose() { 108 | _dataController.close(); 109 | _loadingController.close(); 110 | _createdController.close(); 111 | super.dispose(); 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /lib/src/app/pages/login/login_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:bloc_pattern/bloc_pattern.dart'; 4 | import 'package:firebase_auth/firebase_auth.dart'; 5 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 6 | import 'package:gerenciamento_loja/src/app/repositories/login_repository.dart'; 7 | import 'package:gerenciamento_loja/src/app/shared/enums/login_enum.dart'; 8 | import 'package:gerenciamento_loja/src/app/validators/login_validator.dart'; 9 | import 'package:rxdart/rxdart.dart'; 10 | import 'package:rxdart/subjects.dart'; 11 | 12 | 13 | class LoginBloc extends BlocBase with LoginValidator { 14 | var _loginRepository = AppModule.to.getDependency(); 15 | 16 | final _emailController = BehaviorSubject(); 17 | final _passwordController = BehaviorSubject(); 18 | final _stateController = BehaviorSubject(); 19 | 20 | get outEmail => _emailController.stream.transform(validateEmail); 21 | get outPasword => _passwordController.stream.transform(validatePass); 22 | get outState => _stateController.stream; 23 | 24 | Stream get outSubmitValue => 25 | Observable.combineLatest2(outEmail, outPasword, (a, b) => true); 26 | 27 | Function(String) get changeEmail => _emailController.sink.add; 28 | Function(String) get changePassword => _passwordController.sink.add; 29 | 30 | StreamSubscription _streamSubscription; 31 | 32 | LoginBloc() { 33 | 34 | registerListens(); 35 | } 36 | 37 | registerListens() { 38 | _streamSubscription = 39 | _loginRepository.instance.onAuthStateChanged.listen((user) async { 40 | if (user != null) { 41 | if (await verifyPrivileges(user)) { 42 | _stateController.add(LoginState.SUCCESS); 43 | } else { 44 | _loginRepository.instance.signOut(); 45 | _stateController.add(LoginState.FAIL); 46 | } 47 | } else { 48 | _stateController.add(LoginState.IDLE); 49 | } 50 | }); 51 | } 52 | 53 | submit() async { 54 | FirebaseAuth.instance.signOut(); 55 | final email = _emailController.value; 56 | final pass = _passwordController.value; 57 | 58 | _stateController.add(LoginState.LOADING); 59 | try { 60 | var user = await _loginRepository.login(email: email, pass: pass); 61 | 62 | // if (user != null) { 63 | // if (await verifyPrivileges(user.user)) { 64 | // _stateController.add(LoginState.SUCCESS); 65 | // } else { 66 | // _loginRepository.instance.signOut(); 67 | // _stateController.add(LoginState.FAIL); 68 | // } 69 | // } else { 70 | // _stateController.add(LoginState.IDLE); 71 | // } 72 | 73 | return user; 74 | 75 | } catch (e) { 76 | print(e); 77 | return _stateController.add(LoginState.FAIL); 78 | } 79 | } 80 | 81 | Future verifyPrivileges(FirebaseUser user) async { 82 | try { 83 | var doc = await _loginRepository.verifyPrivileges(user); 84 | if (doc.data != null) 85 | return true; 86 | else 87 | return false; 88 | } catch (e) { 89 | return false; 90 | } 91 | } 92 | 93 | @override 94 | void dispose() { 95 | _emailController.close(); 96 | _passwordController.close(); 97 | _streamSubscription.cancel(); 98 | 99 | super.dispose(); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /lib/src/app/app_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:gerenciamento_loja/src/app/components/product_size/add_sizes_dialog/add_sizes_dialog_bloc.dart'; 2 | import 'package:gerenciamento_loja/src/app/components/product_size/product_size_bloc.dart'; 3 | import 'package:gerenciamento_loja/src/app/components/imagesWidget/image_source_sheet/image_source_sheet_bloc.dart'; 4 | import 'package:gerenciamento_loja/src/app/components/imagesWidget/images_bloc.dart'; 5 | import 'package:gerenciamento_loja/src/app/components/input_field/input_field_bloc.dart'; 6 | import 'package:gerenciamento_loja/src/app/components/tabs/orders_tab/order_tile/order_header/order_header_bloc.dart'; 7 | import 'package:gerenciamento_loja/src/app/components/tabs/orders_tab/order_tile/order_tile_bloc.dart'; 8 | import 'package:gerenciamento_loja/src/app/components/tabs/orders_tab/orders_tab_bloc.dart'; 9 | import 'package:gerenciamento_loja/src/app/components/tabs/products_tab/category_tile/category_tile_bloc.dart'; 10 | import 'package:gerenciamento_loja/src/app/components/tabs/products_tab/category_tile/edit_category_dialog/edit_category_dialog_bloc.dart'; 11 | import 'package:gerenciamento_loja/src/app/components/tabs/products_tab/products_tab_bloc.dart'; 12 | import 'package:gerenciamento_loja/src/app/components/tabs/users_tab/user_tile/user_tile_bloc.dart'; 13 | import 'package:gerenciamento_loja/src/app/components/tabs/users_tab/users_tab_bloc.dart'; 14 | import 'package:gerenciamento_loja/src/app/pages/product/product_bloc.dart'; 15 | import 'package:gerenciamento_loja/src/app/repositories/product_repository.dart'; 16 | import 'package:gerenciamento_loja/src/app/shared/blocs/order_bloc.dart'; 17 | import 'package:gerenciamento_loja/src/app/shared/blocs/user_bloc.dart'; 18 | import 'package:gerenciamento_loja/src/app/repositories/orders_repository.dart'; 19 | import 'package:gerenciamento_loja/src/app/repositories/user_repository.dart'; 20 | import 'package:gerenciamento_loja/src/app/pages/Home/home_bloc.dart'; 21 | import 'package:gerenciamento_loja/src/app/pages/login/login_bloc.dart'; 22 | import 'package:bloc_pattern/bloc_pattern.dart'; 23 | import 'package:flutter/material.dart'; 24 | import 'package:gerenciamento_loja/src/app/app_bloc.dart'; 25 | import 'package:gerenciamento_loja/src/app/app_widget.dart'; 26 | import 'package:gerenciamento_loja/src/app/repositories/login_repository.dart'; 27 | 28 | class AppModule extends ModuleWidget { 29 | @override 30 | List get blocs => [ 31 | Bloc((i) => EditCategoryDialogBloc()), 32 | Bloc((i) => AddSizesDialogBloc()), 33 | Bloc((i) => ProductSizeBloc()), 34 | Bloc((i) => ImageSourceSheetBloc()), 35 | Bloc((i) => ImagesBloc()), 36 | Bloc((i) => ProductBloc()), 37 | Bloc((i) => CategoryTileBloc()), 38 | Bloc((i) => ProductBloc()), 39 | Bloc((i) => ProductsTabBloc()), 40 | Bloc((i) => OrderBloc()), 41 | Bloc((i) => UserBloc()), 42 | Bloc((i) => OrderHeaderBloc()), 43 | Bloc((i) => OrderTileBloc()), 44 | Bloc((i) => OrdersTabBloc()), 45 | Bloc((i) => UserTileBloc()), 46 | Bloc((i) => UsersTabBloc()), 47 | Bloc((i) => HomeBloc()), 48 | Bloc((i) => InputFieldBloc()), 49 | Bloc((i) => LoginBloc()), 50 | Bloc((i) => AppBloc()), 51 | ]; 52 | 53 | @override 54 | List get dependencies => [ 55 | Dependency((i) => ProductRepository()), 56 | Dependency((i) => OrderRepository()), 57 | Dependency((i) => UserRepository()), 58 | Dependency((i) => LoginRepository()), 59 | ]; 60 | 61 | @override 62 | Widget get view => AppWidget(); 63 | 64 | static Inject get to => Inject.of(); 65 | } 66 | -------------------------------------------------------------------------------- /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/src/app/components/tabs/orders_tab/order_tile/order_tile_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 4 | import 'package:gerenciamento_loja/src/app/shared/blocs/order_bloc.dart'; 5 | 6 | 7 | import 'order_header/order_header_widget.dart'; 8 | class OrderTileWidget extends StatelessWidget { 9 | final DocumentSnapshot order; 10 | final _orderBloc = AppModule.to.getBloc(); 11 | 12 | final states = [ 13 | 'Em preparação', 14 | 'Em transporte', 15 | 'Aguardando Entrega', 16 | 'Entregue' 17 | ]; 18 | 19 | OrderTileWidget(this.order); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | var status = order.data['status'] - 1; 24 | return Container( 25 | margin: EdgeInsets.symmetric(horizontal: 16, vertical: 4), 26 | child: Card( 27 | child: ExpansionTile( 28 | key: Key(order.documentID), 29 | initiallyExpanded: status != 3, 30 | title: Text( 31 | '${order.documentID.substring(order.documentID.length - 7, order.documentID.length)} - ${states[status]}', 32 | style: 33 | TextStyle(color: status != 3 ? Colors.grey[850] : Colors.green), 34 | ), 35 | children: [ 36 | Padding( 37 | padding: EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 8), 38 | child: Column( 39 | crossAxisAlignment: CrossAxisAlignment.stretch, 40 | children: [ 41 | OrderHeaderWidget(order), 42 | Column( 43 | mainAxisSize: MainAxisSize.min, 44 | children: order.data['products'] 45 | .map((p) => ListTile( 46 | title: Text( 47 | '${p['product']['title']} - ${p['size']}'), 48 | subtitle: Text('${p['category']}/${p['pid']}'), 49 | trailing: Text( 50 | p['quantity'].toString(), 51 | style: TextStyle(fontSize: 20), 52 | ), 53 | contentPadding: EdgeInsets.zero, 54 | )) 55 | .toList(), 56 | ), 57 | Row( 58 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 59 | children: [ 60 | FlatButton( 61 | onPressed: () { 62 | _orderBloc.delete(order); 63 | }, 64 | textColor: Colors.red, 65 | child: Text('Excluir'), 66 | ), 67 | FlatButton( 68 | onPressed: status > 0 69 | ? () { 70 | _orderBloc.updateData( 71 | order, 'status', order.data['status'] - 1); 72 | } 73 | : null, 74 | textColor: Colors.green[850], 75 | child: Text('Regredir'), 76 | ), 77 | FlatButton( 78 | onPressed: status < 3 79 | ? () { 80 | _orderBloc.updateData( 81 | order, 'status', order.data['status'] + 1); 82 | } 83 | : null, 84 | textColor: Colors.green, 85 | child: Text('Avançar'), 86 | ), 87 | ], 88 | ) 89 | ], 90 | ), 91 | ) 92 | ], 93 | ), 94 | ), 95 | ); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/products_tab/category_tile/category_tile_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 4 | import 'package:gerenciamento_loja/src/app/components/tabs/products_tab/category_tile/edit_category_dialog/edit_category_dialog_widget.dart'; 5 | import 'package:gerenciamento_loja/src/app/pages/product/product_page.dart'; 6 | 7 | import 'category_tile_bloc.dart'; 8 | 9 | class CategoryTileWidget extends StatelessWidget { 10 | final DocumentSnapshot category; 11 | final _productBloc = AppModule.to.getBloc(); 12 | 13 | CategoryTileWidget(this.category); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Container( 18 | margin: EdgeInsets.symmetric(horizontal: 16, vertical: 4), 19 | child: Card( 20 | child: ExpansionTile( 21 | leading: GestureDetector( 22 | onTap: () => showDialog( 23 | context: context, 24 | builder: (context) => 25 | EditCategoryDialogWidget(category: category)), 26 | child: CircleAvatar( 27 | backgroundImage: NetworkImage(category.data['icon']), 28 | backgroundColor: Colors.transparent, 29 | ), 30 | ), 31 | title: Text( 32 | category.data['title'], 33 | style: 34 | TextStyle(color: Colors.grey[850], fontWeight: FontWeight.w500), 35 | ), 36 | children: [ 37 | FutureBuilder( 38 | future: _productBloc.getItems(category), 39 | builder: (context, snapshot) { 40 | if (!snapshot.hasData) 41 | return Container(); 42 | else 43 | return Column( 44 | children: snapshot.data.documents 45 | .map((doc) => ListTile( 46 | leading: CircleAvatar( 47 | backgroundImage: NetworkImage(doc 48 | .data['images'] != 49 | null 50 | ? doc.data['images'][0] 51 | : 'https://bigsamsrawbar.com/wp-content/plugins/wordpress-ecommerce/marketpress-includes/images/default-product.png'), 52 | backgroundColor: Colors.transparent, 53 | ), 54 | title: Text(doc.data['title']), 55 | trailing: Text( 56 | 'R\$${doc.data['price'].toStringAsFixed(2)}'), 57 | onTap: () { 58 | Navigator.push( 59 | context, 60 | MaterialPageRoute( 61 | builder: (context) => ProductPage( 62 | categoryId: category.documentID, 63 | product: doc, 64 | ))); 65 | }, 66 | )) 67 | .toList() 68 | ..add(ListTile( 69 | leading: CircleAvatar( 70 | backgroundColor: Colors.transparent, 71 | child: Icon( 72 | Icons.add, 73 | color: Colors.pinkAccent, 74 | ), 75 | ), 76 | title: Text('Adicionar'), 77 | onTap: () { 78 | Navigator.push( 79 | context, 80 | MaterialPageRoute( 81 | builder: (context) => ProductPage( 82 | categoryId: category.documentID, 83 | ))); 84 | }, 85 | )), 86 | ); 87 | }, 88 | ), 89 | ], 90 | ), 91 | ), 92 | ); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /lib/src/app/components/tabs/products_tab/category_tile/edit_category_dialog/edit_category_dialog_widget.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:cloud_firestore/cloud_firestore.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 6 | import 'package:gerenciamento_loja/src/app/components/imagesWidget/image_source_sheet/image_source_sheet_widget.dart'; 7 | 8 | import 'edit_category_dialog_bloc.dart'; 9 | 10 | class EditCategoryDialogWidget extends StatefulWidget { 11 | DocumentSnapshot category; 12 | EditCategoryDialogWidget({@required this.category}); 13 | 14 | @override 15 | _EditCategoryDialogWidgetState createState() => 16 | _EditCategoryDialogWidgetState(category: category); 17 | } 18 | 19 | class _EditCategoryDialogWidgetState extends State { 20 | final EditCategoryDialogBloc _categoryBloc; 21 | final TextEditingController _controller; 22 | 23 | _EditCategoryDialogWidgetState({@required DocumentSnapshot category}) 24 | : _categoryBloc = AppModule.to.getBloc() 25 | ..init(category), 26 | _controller = TextEditingController( 27 | text: category != null ? category.data['title'] : ''); 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return Dialog( 32 | child: Card( 33 | child: Column( 34 | mainAxisSize: MainAxisSize.min, 35 | children: [ 36 | ListTile( 37 | leading: GestureDetector( 38 | onTap: () { 39 | showModalBottomSheet( 40 | context: context, 41 | builder: (context) => ImageSourceSheetWidget( 42 | onImageSelected: (image) { 43 | Navigator.pop(context); 44 | _categoryBloc.setImage(image); 45 | }, 46 | )); 47 | }, 48 | child: StreamBuilder( 49 | stream: _categoryBloc.outImages, 50 | builder: (context, snapshot) { 51 | if (snapshot.data != null) 52 | return CircleAvatar( 53 | child: snapshot.data is File 54 | ? Image.file(snapshot.data, fit: BoxFit.cover) 55 | : Image.network(snapshot.data, fit: BoxFit.cover), 56 | backgroundColor: Colors.transparent, 57 | ); 58 | else 59 | return Icon(Icons.image); 60 | }, 61 | ), 62 | ), 63 | title: StreamBuilder( 64 | stream: _categoryBloc.outTitle, 65 | builder: (context, s) => TextField( 66 | controller: _controller, 67 | onChanged: _categoryBloc.setTitle, 68 | decoration: 69 | InputDecoration(errorText: s.hasError ? s.error : null), 70 | ), 71 | ), 72 | ), 73 | Row( 74 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 75 | children: [ 76 | StreamBuilder( 77 | stream: _categoryBloc.outDelete, 78 | initialData: false, 79 | builder: (context, snapshot) { 80 | if (!snapshot.hasData) 81 | return Container(); 82 | else 83 | return FlatButton( 84 | child: Text('Excluir'), 85 | textColor: Colors.red, 86 | onPressed: snapshot.data ? () { 87 | _categoryBloc.delete(); 88 | Navigator.pop(context); 89 | } : null, 90 | ); 91 | }, 92 | ), 93 | StreamBuilder( 94 | stream: _categoryBloc.submitValid, 95 | builder: (context, s) => FlatButton( 96 | child: Text('Salvar'), 97 | onPressed: s.hasData ? () async { 98 | await _categoryBloc.savaData(); 99 | Navigator.pop(context); 100 | } : null, 101 | ), 102 | ), 103 | ], 104 | ) 105 | ], 106 | ), 107 | ), 108 | ); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /lib/src/app/pages/Home/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_speed_dial/flutter_speed_dial.dart'; 3 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 4 | import 'package:gerenciamento_loja/src/app/components/tabs/orders_tab/orders_tab.dart'; 5 | import 'package:gerenciamento_loja/src/app/components/tabs/products_tab/category_tile/edit_category_dialog/edit_category_dialog_widget.dart'; 6 | import 'package:gerenciamento_loja/src/app/components/tabs/products_tab/products_tab.dart'; 7 | import 'package:gerenciamento_loja/src/app/components/tabs/users_tab/users_tab.dart'; 8 | import 'package:gerenciamento_loja/src/app/shared/blocs/order_bloc.dart'; 9 | import 'package:gerenciamento_loja/src/app/shared/enums/sort_criteria_enum.dart'; 10 | 11 | class HomePage extends StatefulWidget { 12 | @override 13 | _HomePageState createState() => _HomePageState(); 14 | } 15 | 16 | class _HomePageState extends State { 17 | PageController _pageController; 18 | int _page = 0; 19 | final _ordersBloc = AppModule.to.getBloc(); 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | 25 | _pageController = PageController(); 26 | } 27 | 28 | @override 29 | void dispose() { 30 | _pageController.dispose(); 31 | 32 | super.dispose(); 33 | } 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | return Scaffold( 38 | backgroundColor: Colors.grey[850], 39 | bottomNavigationBar: Theme( 40 | data: Theme.of(context).copyWith( 41 | canvasColor: Colors.pinkAccent, 42 | primaryColor: Colors.white, 43 | textTheme: Theme.of(context) 44 | .textTheme 45 | .copyWith(caption: TextStyle(color: Colors.white54))), 46 | child: BottomNavigationBar( 47 | currentIndex: _page, 48 | onTap: (p) { 49 | _pageController.animateToPage(p, 50 | duration: Duration(milliseconds: 500), curve: Curves.ease); 51 | }, 52 | items: [ 53 | BottomNavigationBarItem( 54 | icon: Icon(Icons.person), title: Text("Clientes")), 55 | BottomNavigationBarItem( 56 | icon: Icon(Icons.shopping_cart), title: Text("Pedidos")), 57 | BottomNavigationBarItem( 58 | icon: Icon(Icons.list), title: Text("Produtos")) 59 | ]), 60 | ), 61 | body: Scaffold( 62 | backgroundColor: Colors.grey[850], 63 | body: SafeArea( 64 | child: PageView( 65 | onPageChanged: (p) { 66 | setState(() { 67 | _page = p; 68 | }); 69 | }, 70 | controller: _pageController, 71 | children: [ 72 | UsersTab(), 73 | OrdersTab(), 74 | ProductsTab(), 75 | ], 76 | ), 77 | ), 78 | floatingActionButton: _buildFloating(), 79 | ), 80 | ); 81 | } 82 | 83 | Widget _buildFloating() { 84 | switch (_page) { 85 | case 0: 86 | return null; 87 | break; 88 | case 1: 89 | return SpeedDial( 90 | child: Icon(Icons.sort), 91 | backgroundColor: Colors.pinkAccent, 92 | overlayOpacity: 0.4, 93 | overlayColor: Colors.black, 94 | children: [ 95 | SpeedDialChild( 96 | child: Icon( 97 | Icons.arrow_downward, 98 | color: Colors.pinkAccent, 99 | ), 100 | backgroundColor: Colors.white, 101 | label: 'Concluidos abaixo', 102 | labelStyle: TextStyle(fontSize: 14), 103 | onTap: () { 104 | _ordersBloc.setOrderCriteria(SortCriteria.READY_LAST); 105 | }), 106 | SpeedDialChild( 107 | child: Icon( 108 | Icons.arrow_upward, 109 | color: Colors.pinkAccent, 110 | ), 111 | backgroundColor: Colors.white, 112 | label: 'Concluidos acima', 113 | labelStyle: TextStyle(fontSize: 14), 114 | onTap: () { 115 | _ordersBloc.setOrderCriteria(SortCriteria.READY_FIRST); 116 | }), 117 | ], 118 | ); 119 | case 2: 120 | return FloatingActionButton( 121 | child: Icon(Icons.add), 122 | backgroundColor: Colors.pinkAccent, 123 | onPressed: () { 124 | showDialog( 125 | context: context, 126 | builder: (context) => EditCategoryDialogWidget()); 127 | }, 128 | ); 129 | default: 130 | return null; 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /lib/src/app/pages/login/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 3 | import 'package:gerenciamento_loja/src/app/components/input_field/input_field_widget.dart'; 4 | import 'package:gerenciamento_loja/src/app/pages/home/home_page.dart'; 5 | 6 | import 'package:gerenciamento_loja/src/app/shared/enums/login_enum.dart'; 7 | 8 | import 'login_bloc.dart'; 9 | 10 | class LoginPage extends StatefulWidget { 11 | @override 12 | _LoginPageState createState() => _LoginPageState(); 13 | } 14 | 15 | class _LoginPageState extends State { 16 | var _loginBloc = AppModule.to.getBloc(); 17 | 18 | @override 19 | void initState() { 20 | super.initState(); 21 | 22 | _loginBloc.outState.listen((state) { 23 | print(state); 24 | switch (state) { 25 | case LoginState.SUCCESS: 26 | Navigator.pushReplacement(context, 27 | MaterialPageRoute(builder: (context)=>HomePage()) 28 | ); 29 | break; 30 | case LoginState.FAIL: 31 | showDialog( 32 | context: context, 33 | builder: (context) => AlertDialog( 34 | title: Text("Erro"), 35 | content: Text("Você não possui os privilégios necessários"), 36 | )); 37 | break; 38 | default: 39 | } 40 | }); 41 | } 42 | 43 | @override 44 | void dispose() { 45 | _loginBloc.dispose(); 46 | super.dispose(); 47 | } 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | return Scaffold( 52 | backgroundColor: Colors.grey[850], 53 | body: StreamBuilder( 54 | stream: _loginBloc.outState, 55 | initialData: LoginState.LOADING, 56 | builder: (context, snapshot) { 57 | switch (snapshot.data) { 58 | case LoginState.LOADING: 59 | return Center( 60 | child: CircularProgressIndicator( 61 | valueColor: AlwaysStoppedAnimation(Colors.pinkAccent), 62 | ), 63 | ); 64 | default: 65 | return Stack( 66 | alignment: Alignment.center, 67 | children: [ 68 | Container(), 69 | SingleChildScrollView( 70 | child: Container( 71 | margin: EdgeInsets.all(16), 72 | child: Column( 73 | crossAxisAlignment: CrossAxisAlignment.stretch, 74 | children: [ 75 | Icon( 76 | Icons.store_mall_directory, 77 | color: Colors.pinkAccent, 78 | size: 160, 79 | ), 80 | InputField( 81 | icon: Icons.person_outline, 82 | hint: "Usuário", 83 | obscure: false, 84 | stream: _loginBloc.outEmail, 85 | onChanged: _loginBloc.changeEmail, 86 | ), 87 | InputField( 88 | icon: Icons.lock_outline, 89 | hint: "Senha", 90 | obscure: true, 91 | stream: _loginBloc.outPasword, 92 | onChanged: _loginBloc.changePassword, 93 | ), 94 | SizedBox( 95 | height: 32, 96 | ), 97 | StreamBuilder( 98 | stream: _loginBloc.outSubmitValue, 99 | builder: (context, snapshot) { 100 | return SizedBox( 101 | height: 50, 102 | child: RaisedButton( 103 | color: Colors.pinkAccent, 104 | child: Text("Entrar"), 105 | onPressed: snapshot.hasData 106 | ? _loginBloc.submit 107 | : null, 108 | textColor: Colors.white, 109 | disabledColor: 110 | Colors.pinkAccent.withAlpha(140), 111 | ), 112 | ); 113 | }) 114 | ], 115 | ), 116 | )), 117 | ], 118 | ); 119 | } 120 | }), 121 | ); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /lib/src/app/pages/product/product_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:gerenciamento_loja/src/app/app_module.dart'; 4 | import 'package:gerenciamento_loja/src/app/components/imagesWidget/images_widget.dart'; 5 | import 'package:gerenciamento_loja/src/app/components/product_size/product_size_widget.dart'; 6 | import 'package:gerenciamento_loja/src/app/validators/product_validator.dart'; 7 | 8 | import 'product_bloc.dart'; 9 | 10 | class ProductPage extends StatefulWidget { 11 | final String categoryId; 12 | final DocumentSnapshot product; 13 | ProductPage({@required this.categoryId, this.product}); 14 | 15 | @override 16 | _ProductPageState createState() => _ProductPageState(categoryId, product); 17 | } 18 | 19 | class _ProductPageState extends State with ProductValidator { 20 | final String categoryId; 21 | final DocumentSnapshot product; 22 | final ProductBloc _productBloc; 23 | final _formKey = GlobalKey(); 24 | final _scaffoldKey = GlobalKey(); 25 | 26 | _ProductPageState(this.categoryId, this.product) 27 | : _productBloc = AppModule.to.getBloc() 28 | ..categoryId = categoryId 29 | ..product = product 30 | ..initial(); 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | final _fieldStyle = TextStyle( 35 | color: Colors.white, 36 | fontSize: 16, 37 | ); 38 | 39 | InputDecoration _buildDecoration(String label) { 40 | return InputDecoration( 41 | labelText: label, 42 | labelStyle: TextStyle(color: Colors.grey), 43 | ); 44 | } 45 | 46 | return Scaffold( 47 | key: _scaffoldKey, 48 | backgroundColor: Colors.grey[850], 49 | appBar: AppBar( 50 | elevation: 0, 51 | title: StreamBuilder( 52 | stream: _productBloc.outCreated, 53 | initialData: false, 54 | builder: (context, snapshot) => 55 | Text(snapshot.data ? 'Editar Produto' : "Criar Produto"), 56 | ), 57 | actions: [ 58 | StreamBuilder( 59 | stream: _productBloc.outCreated, 60 | initialData: false, 61 | builder: (context, snapshot) => snapshot.data 62 | ? StreamBuilder( 63 | stream: _productBloc.outLoading, 64 | initialData: false, 65 | builder: (context, snapshot) { 66 | return IconButton( 67 | icon: Icon(Icons.remove), 68 | onPressed: snapshot.data ? null : removeProduct, 69 | ); 70 | }, 71 | ) 72 | : Container(), 73 | ), 74 | StreamBuilder( 75 | stream: _productBloc.outLoading, 76 | initialData: false, 77 | builder: (context, snapshot) { 78 | return IconButton( 79 | icon: Icon(Icons.save), 80 | onPressed: snapshot.data ? null : saveProduct, 81 | ); 82 | }, 83 | ), 84 | ], 85 | ), 86 | body: Stack( 87 | children: [ 88 | Form( 89 | key: _formKey, 90 | child: StreamBuilder( 91 | stream: _productBloc.outData, 92 | builder: (context, snapshot) { 93 | if (!snapshot.hasData) return Container(); 94 | 95 | return ListView( 96 | padding: EdgeInsets.all(16), 97 | children: [ 98 | Text( 99 | "Imagens", 100 | style: TextStyle(color: Colors.grey, fontSize: 12), 101 | ), 102 | ImagesWidget( 103 | context: context, 104 | initialValue: snapshot.data["images"], 105 | onSaved: _productBloc.saveImages, 106 | validator: validateImages, 107 | ), 108 | TextFormField( 109 | initialValue: snapshot.data['title'], 110 | style: _fieldStyle, 111 | decoration: _buildDecoration('Titulo'), 112 | onSaved: _productBloc.saveTitle, 113 | validator: validateTitle, 114 | ), 115 | TextFormField( 116 | style: _fieldStyle, 117 | initialValue: snapshot.data['description'], 118 | decoration: _buildDecoration('Descrição'), 119 | maxLines: 6, 120 | onSaved: _productBloc.saveDescription, 121 | validator: validateDescription, 122 | ), 123 | TextFormField( 124 | style: _fieldStyle, 125 | initialValue: snapshot.data['price']?.toStringAsFixed(2), 126 | decoration: _buildDecoration('Preço'), 127 | keyboardType: 128 | TextInputType.numberWithOptions(decimal: true), 129 | onSaved: _productBloc.savePrice, 130 | validator: validatePrice, 131 | ), 132 | SizedBox( 133 | height: 16, 134 | ), 135 | Text( 136 | "Tamanhos", 137 | style: TextStyle(color: Colors.grey, fontSize: 12), 138 | ), 139 | ProductSizeWidget( 140 | context: context, 141 | initialValue: snapshot.data['sizes'], 142 | onSaved: _productBloc.saveSizes, 143 | validator: (e) { 144 | if (e.isEmpty) return 'Adicione um tamanho!'; 145 | return null; 146 | }, 147 | ), 148 | ], 149 | ); 150 | }, 151 | ), 152 | ), 153 | StreamBuilder( 154 | stream: _productBloc.outLoading, 155 | initialData: false, 156 | builder: (context, snapshot) { 157 | return IgnorePointer( 158 | ignoring: !snapshot.data, 159 | child: Container( 160 | color: snapshot.data ? Colors.black54 : Colors.transparent, 161 | ), 162 | ); 163 | }, 164 | ) 165 | ], 166 | ), 167 | ); 168 | } 169 | 170 | removeProduct() async { 171 | _productBloc.deleteProduct(product); 172 | Navigator.pop(context); 173 | } 174 | 175 | saveProduct() async { 176 | if (_formKey.currentState.validate()) { 177 | _formKey.currentState.save(); 178 | _scaffoldKey.currentState.showSnackBar(SnackBar( 179 | content: Text( 180 | 'Salvando produto...', 181 | style: TextStyle(color: Colors.white), 182 | ), 183 | backgroundColor: Colors.pinkAccent, 184 | duration: Duration(minutes: 1), 185 | )); 186 | 187 | var success = await _productBloc.saveProduct(); 188 | 189 | _scaffoldKey.currentState.removeCurrentSnackBar(); 190 | _scaffoldKey.currentState.showSnackBar(SnackBar( 191 | content: Text( 192 | success ? 'Produto salvo' : 'Erro ao salvar produto', 193 | style: TextStyle(color: Colors.white), 194 | ), 195 | backgroundColor: Colors.pinkAccent, 196 | )); 197 | } 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /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.3.4" 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 | cloud_firestore: 47 | dependency: "direct main" 48 | description: 49 | name: cloud_firestore 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "0.12.9+4" 53 | collection: 54 | dependency: transitive 55 | description: 56 | name: collection 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.14.11" 60 | convert: 61 | dependency: transitive 62 | description: 63 | name: convert 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.1" 67 | crypto: 68 | dependency: transitive 69 | description: 70 | name: crypto 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "2.1.3" 74 | cupertino_icons: 75 | dependency: "direct main" 76 | description: 77 | name: cupertino_icons 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "0.1.2" 81 | dio: 82 | dependency: "direct main" 83 | description: 84 | name: dio 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "3.0.3" 88 | firebase_auth: 89 | dependency: "direct main" 90 | description: 91 | name: firebase_auth 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "0.14.0+5" 95 | firebase_core: 96 | dependency: transitive 97 | description: 98 | name: firebase_core 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "0.4.0+9" 102 | firebase_storage: 103 | dependency: "direct main" 104 | description: 105 | name: firebase_storage 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "3.0.6" 109 | flutter: 110 | dependency: "direct main" 111 | description: flutter 112 | source: sdk 113 | version: "0.0.0" 114 | flutter_launcher_icons: 115 | dependency: "direct main" 116 | description: 117 | name: flutter_launcher_icons 118 | url: "https://pub.dartlang.org" 119 | source: hosted 120 | version: "0.7.3" 121 | flutter_speed_dial: 122 | dependency: "direct main" 123 | description: 124 | name: flutter_speed_dial 125 | url: "https://pub.dartlang.org" 126 | source: hosted 127 | version: "1.2.1" 128 | flutter_test: 129 | dependency: "direct dev" 130 | description: flutter 131 | source: sdk 132 | version: "0.0.0" 133 | http_parser: 134 | dependency: transitive 135 | description: 136 | name: http_parser 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "3.1.3" 140 | image: 141 | dependency: transitive 142 | description: 143 | name: image 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "2.1.4" 147 | image_cropper: 148 | dependency: "direct main" 149 | description: 150 | name: image_cropper 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "1.1.0" 154 | image_picker: 155 | dependency: "direct main" 156 | description: 157 | name: image_picker 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "0.6.1+4" 161 | matcher: 162 | dependency: transitive 163 | description: 164 | name: matcher 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "0.12.5" 168 | meta: 169 | dependency: transitive 170 | description: 171 | name: meta 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "1.1.7" 175 | path: 176 | dependency: transitive 177 | description: 178 | name: path 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "1.6.4" 182 | pedantic: 183 | dependency: transitive 184 | description: 185 | name: pedantic 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "1.8.0+1" 189 | petitparser: 190 | dependency: transitive 191 | description: 192 | name: petitparser 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "2.4.0" 196 | quiver: 197 | dependency: transitive 198 | description: 199 | name: quiver 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "2.0.5" 203 | rxdart: 204 | dependency: "direct main" 205 | description: 206 | name: rxdart 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "0.22.3" 210 | shimmer: 211 | dependency: "direct main" 212 | description: 213 | name: shimmer 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "1.0.1" 217 | sky_engine: 218 | dependency: transitive 219 | description: flutter 220 | source: sdk 221 | version: "0.0.99" 222 | source_span: 223 | dependency: transitive 224 | description: 225 | name: source_span 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "1.5.5" 229 | stack_trace: 230 | dependency: transitive 231 | description: 232 | name: stack_trace 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "1.9.3" 236 | stream_channel: 237 | dependency: transitive 238 | description: 239 | name: stream_channel 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "2.0.0" 243 | string_scanner: 244 | dependency: transitive 245 | description: 246 | name: string_scanner 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "1.0.5" 250 | term_glyph: 251 | dependency: transitive 252 | description: 253 | name: term_glyph 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "1.1.0" 257 | test_api: 258 | dependency: transitive 259 | description: 260 | name: test_api 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "0.2.5" 264 | typed_data: 265 | dependency: transitive 266 | description: 267 | name: typed_data 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "1.1.6" 271 | vector_math: 272 | dependency: transitive 273 | description: 274 | name: vector_math 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "2.0.8" 278 | xml: 279 | dependency: transitive 280 | description: 281 | name: xml 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "3.5.0" 285 | yaml: 286 | dependency: transitive 287 | description: 288 | name: yaml 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "2.2.0" 292 | sdks: 293 | dart: ">2.4.0 <3.0.0" 294 | flutter: ">=1.5.0 <2.0.0" 295 | -------------------------------------------------------------------------------- /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.gerenciamentoLoja; 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.gerenciamentoLoja; 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.gerenciamentoLoja; 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 | --------------------------------------------------------------------------------