├── .gitignore ├── .metadata ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── admin_dashboard │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── loader.gif ├── no-image.jpg ├── twitter-bg.png └── twitter-white-logo.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── api │ └── CafeApi.dart ├── datatables │ ├── categories_datasource.dart │ └── users_datasource.dart ├── main.dart ├── models │ ├── category.dart │ ├── http │ │ ├── auth_response.dart │ │ ├── categories_response.dart │ │ └── users_response.dart │ └── usuario.dart ├── providers │ ├── auth_provider.dart │ ├── categories_provider.dart │ ├── login_form_provider.dart │ ├── providers.dart │ ├── register_form_provider.dart │ ├── sidemenu_provider.dart │ ├── user_form_provider.dart │ └── users_provider.dart ├── router │ ├── admin_handlers.dart │ ├── dashboard_handlers.dart │ ├── no_page_found_handlers.dart │ └── router.dart ├── services │ ├── local_storage.dart │ ├── navigation_service.dart │ └── notifications_service.dart └── ui │ ├── buttons │ ├── custom_icon_button.dart │ ├── custom_outlined_button.dart │ └── link_text.dart │ ├── cards │ └── white_card.dart │ ├── inputs │ └── custom_inputs.dart │ ├── labels │ └── custom_labels.dart │ ├── layouts │ ├── auth │ │ ├── auth_layout.dart │ │ └── widgets │ │ │ ├── background_twitter.dart │ │ │ ├── custom_title.dart │ │ │ └── links_bar.dart │ ├── dashboard │ │ └── dashboard_layout.dart │ └── splash │ │ └── splash_layout.dart │ ├── modals │ └── category_modal.dart │ ├── shared │ ├── navbar.dart │ ├── sidebar.dart │ └── widgets │ │ ├── logo.dart │ │ ├── menu_item.dart │ │ ├── navbar_avatar.dart │ │ ├── notifications_indicator.dart │ │ ├── search_text.dart │ │ └── text_separator.dart │ └── views │ ├── blank_view.dart │ ├── categories_view.dart │ ├── dashboard_view.dart │ ├── icons_view.dart │ ├── login_view.dart │ ├── no_page_found_view.dart │ ├── register_view.dart │ ├── user_view.dart │ └── users_view.dart ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart └── web ├── favicon.png ├── icons ├── Icon-192.png └── Icon-512.png ├── index.html └── manifest.json /.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 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /.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: adc687823a831bbebe28bdccfac1a628ca621513 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # admin_dashboard 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 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /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 30 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | defaultConfig { 36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 | applicationId "com.example.admin_dashboard" 38 | minSdkVersion 16 39 | targetSdkVersion 30 40 | versionCode flutterVersionCode.toInteger() 41 | versionName flutterVersionName 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 59 | } 60 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/admin_dashboard/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.admin_dashboard 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /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-6.7-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /assets/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/assets/loader.gif -------------------------------------------------------------------------------- /assets/no-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/assets/no-image.jpg -------------------------------------------------------------------------------- /assets/twitter-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/assets/twitter-bg.png -------------------------------------------------------------------------------- /assets/twitter-white-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/assets/twitter-white-logo.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | INFOPLIST_FILE = Runner/Info.plist; 293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 294 | PRODUCT_BUNDLE_IDENTIFIER = com.example.adminDashboard; 295 | PRODUCT_NAME = "$(TARGET_NAME)"; 296 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 297 | SWIFT_VERSION = 5.0; 298 | VERSIONING_SYSTEM = "apple-generic"; 299 | }; 300 | name = Profile; 301 | }; 302 | 97C147031CF9000F007C117D /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_COMMA = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = dwarf; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | ENABLE_TESTABILITY = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_DYNAMIC_NO_PIC = NO; 337 | GCC_NO_COMMON_BLOCKS = YES; 338 | GCC_OPTIMIZATION_LEVEL = 0; 339 | GCC_PREPROCESSOR_DEFINITIONS = ( 340 | "DEBUG=1", 341 | "$(inherited)", 342 | ); 343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 345 | GCC_WARN_UNDECLARED_SELECTOR = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 347 | GCC_WARN_UNUSED_FUNCTION = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 350 | MTL_ENABLE_DEBUG_INFO = YES; 351 | ONLY_ACTIVE_ARCH = YES; 352 | SDKROOT = iphoneos; 353 | TARGETED_DEVICE_FAMILY = "1,2"; 354 | }; 355 | name = Debug; 356 | }; 357 | 97C147041CF9000F007C117D /* Release */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | ALWAYS_SEARCH_USER_PATHS = NO; 361 | CLANG_ANALYZER_NONNULL = YES; 362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 363 | CLANG_CXX_LIBRARY = "libc++"; 364 | CLANG_ENABLE_MODULES = YES; 365 | CLANG_ENABLE_OBJC_ARC = YES; 366 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 367 | CLANG_WARN_BOOL_CONVERSION = YES; 368 | CLANG_WARN_COMMA = YES; 369 | CLANG_WARN_CONSTANT_CONVERSION = YES; 370 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INFINITE_RECURSION = YES; 375 | CLANG_WARN_INT_CONVERSION = YES; 376 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 377 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 378 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 379 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 380 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 381 | CLANG_WARN_STRICT_PROTOTYPES = YES; 382 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 383 | CLANG_WARN_UNREACHABLE_CODE = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = NO; 387 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 388 | ENABLE_NS_ASSERTIONS = NO; 389 | ENABLE_STRICT_OBJC_MSGSEND = YES; 390 | GCC_C_LANGUAGE_STANDARD = gnu99; 391 | GCC_NO_COMMON_BLOCKS = YES; 392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 394 | GCC_WARN_UNDECLARED_SELECTOR = YES; 395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 396 | GCC_WARN_UNUSED_FUNCTION = YES; 397 | GCC_WARN_UNUSED_VARIABLE = YES; 398 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 399 | MTL_ENABLE_DEBUG_INFO = NO; 400 | SDKROOT = iphoneos; 401 | SUPPORTED_PLATFORMS = iphoneos; 402 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | VALIDATE_PRODUCT = YES; 405 | }; 406 | name = Release; 407 | }; 408 | 97C147061CF9000F007C117D /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 411 | buildSettings = { 412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 413 | CLANG_ENABLE_MODULES = YES; 414 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 415 | ENABLE_BITCODE = NO; 416 | INFOPLIST_FILE = Runner/Info.plist; 417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 418 | PRODUCT_BUNDLE_IDENTIFIER = com.example.adminDashboard; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 421 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 422 | SWIFT_VERSION = 5.0; 423 | VERSIONING_SYSTEM = "apple-generic"; 424 | }; 425 | name = Debug; 426 | }; 427 | 97C147071CF9000F007C117D /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CLANG_ENABLE_MODULES = YES; 433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 434 | ENABLE_BITCODE = NO; 435 | INFOPLIST_FILE = Runner/Info.plist; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = com.example.adminDashboard; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 440 | SWIFT_VERSION = 5.0; 441 | VERSIONING_SYSTEM = "apple-generic"; 442 | }; 443 | name = Release; 444 | }; 445 | /* End XCBuildConfiguration section */ 446 | 447 | /* Begin XCConfigurationList section */ 448 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | 97C147031CF9000F007C117D /* Debug */, 452 | 97C147041CF9000F007C117D /* Release */, 453 | 249021D3217E4FDB00AE95B9 /* Profile */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 97C147061CF9000F007C117D /* Debug */, 462 | 97C147071CF9000F007C117D /* Release */, 463 | 249021D4217E4FDB00AE95B9 /* Profile */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | /* End XCConfigurationList section */ 469 | }; 470 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 471 | } 472 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/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/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | admin_dashboard 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/api/CafeApi.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | 3 | import 'package:admin_dashboard/services/local_storage.dart'; 4 | import 'package:dio/dio.dart'; 5 | 6 | 7 | class CafeApi { 8 | 9 | static Dio _dio = new Dio(); 10 | 11 | static void configureDio() { 12 | 13 | // Base del url 14 | // _dio.options.baseUrl = 'http://localhost:8080/api'; 15 | _dio.options.baseUrl = 'https://flutter-web-admin.herokuapp.com/api'; 16 | 17 | // Configurar Headers 18 | _dio.options.headers = { 19 | 'x-token': LocalStorage.prefs.getString('token') ?? '' 20 | }; 21 | 22 | } 23 | 24 | static Future httpGet( String path ) async { 25 | try { 26 | 27 | final resp = await _dio.get(path); 28 | 29 | return resp.data; 30 | 31 | 32 | } on DioError catch (e) { 33 | print(e.response); 34 | throw('Error en el GET'); 35 | } 36 | } 37 | 38 | static Future post( String path, Map data ) async { 39 | 40 | final formData = FormData.fromMap(data); 41 | 42 | try { 43 | 44 | final resp = await _dio.post(path, data: formData ); 45 | return resp.data; 46 | 47 | } on DioError catch (e) { 48 | print(e); 49 | throw('Error en el POST'); 50 | } 51 | } 52 | 53 | 54 | static Future put( String path, Map data ) async { 55 | 56 | final formData = FormData.fromMap(data); 57 | 58 | try { 59 | 60 | final resp = await _dio.put(path, data: formData ); 61 | return resp.data; 62 | 63 | } on DioError catch (e) { 64 | print(e); 65 | throw('Error en el PUT $e'); 66 | } 67 | } 68 | 69 | 70 | static Future delete( String path, Map data ) async { 71 | 72 | final formData = FormData.fromMap(data); 73 | 74 | try { 75 | 76 | final resp = await _dio.delete(path, data: formData ); 77 | return resp.data; 78 | 79 | } on DioError catch (e) { 80 | print(e); 81 | throw('Error en el delete'); 82 | } 83 | } 84 | 85 | 86 | 87 | static Future uploadFile( String path, Uint8List bytes ) async { 88 | 89 | final formData = FormData.fromMap({ 90 | 'archivo': MultipartFile.fromBytes(bytes) 91 | }); 92 | 93 | try { 94 | 95 | final resp = await _dio.put( 96 | path, 97 | data: formData 98 | ); 99 | 100 | return resp.data; 101 | 102 | } on DioError catch (e) { 103 | print(e); 104 | throw('Error en el PUT $e'); 105 | } 106 | } 107 | 108 | } -------------------------------------------------------------------------------- /lib/datatables/categories_datasource.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | 4 | import 'package:admin_dashboard/providers/categories_provider.dart'; 5 | 6 | import 'package:admin_dashboard/models/category.dart'; 7 | 8 | import 'package:admin_dashboard/ui/modals/category_modal.dart'; 9 | 10 | 11 | 12 | 13 | class CategoriesDTS extends DataTableSource { 14 | 15 | final List categorias; 16 | final BuildContext context; 17 | 18 | CategoriesDTS(this.categorias, this.context); 19 | 20 | 21 | @override 22 | DataRow getRow(int index) { 23 | 24 | final categoria = this.categorias[index]; 25 | 26 | return DataRow.byIndex( 27 | index: index, 28 | cells: [ 29 | DataCell( Text( categoria.id ) ), 30 | DataCell( Text( categoria.nombre ) ), 31 | DataCell( Text( categoria.usuario.nombre ) ), 32 | DataCell( 33 | Row( 34 | children: [ 35 | IconButton( 36 | icon: Icon( Icons.edit_outlined ), 37 | onPressed: () { 38 | showModalBottomSheet( 39 | backgroundColor: Colors.transparent, 40 | context: context, 41 | builder: ( _ ) => CategoryModal( categoria: categoria ) 42 | ); 43 | } 44 | ), 45 | IconButton( 46 | icon: Icon( Icons.delete_outline, color: Colors.red.withOpacity(0.8)), 47 | onPressed: () { 48 | 49 | final dialog = AlertDialog( 50 | title: Text('¿Está seguro de borrarlo?'), 51 | content: Text('¿Borrar definitivamente ${ categoria.nombre }?'), 52 | actions: [ 53 | TextButton( 54 | child: Text('No'), 55 | onPressed: () { 56 | Navigator.of(context).pop(); 57 | }, 58 | ), 59 | TextButton( 60 | child: Text('Si, borrar'), 61 | onPressed: () async { 62 | await Provider.of(context, listen: false) 63 | .deleteCategory(categoria.id); 64 | 65 | Navigator.of(context).pop(); 66 | }, 67 | ), 68 | ], 69 | ); 70 | 71 | showDialog( 72 | context: context, 73 | builder: ( _ ) => dialog 74 | ); 75 | 76 | 77 | } 78 | ), 79 | ], 80 | ) 81 | ), 82 | ] 83 | ); 84 | } 85 | 86 | @override 87 | bool get isRowCountApproximate => false; 88 | 89 | @override 90 | int get rowCount => categorias.length; 91 | 92 | @override 93 | 94 | int get selectedRowCount => 0; 95 | 96 | } -------------------------------------------------------------------------------- /lib/datatables/users_datasource.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:admin_dashboard/services/navigation_service.dart'; 4 | 5 | import 'package:admin_dashboard/models/usuario.dart'; 6 | 7 | class UsersDataSource extends DataTableSource { 8 | 9 | final List users; 10 | 11 | UsersDataSource(this.users); 12 | 13 | 14 | @override 15 | DataRow getRow(int index) { 16 | 17 | final Usuario user = users[index]; 18 | 19 | final image = ( user.img == null ) 20 | ? Image(image: AssetImage('no-image.jpg'), width: 35, height: 35, ) 21 | : FadeInImage.assetNetwork(placeholder: 'loader.gif', image: user.img!, width: 35, height: 35, ); 22 | 23 | return DataRow.byIndex( 24 | index: index, 25 | cells: [ 26 | DataCell( 27 | ClipOval( child: image ) 28 | ), 29 | DataCell( Text( user.nombre ) ), 30 | DataCell( Text( user.correo ) ), 31 | DataCell( Text( user.uid ) ), 32 | DataCell( 33 | IconButton( 34 | icon: Icon( Icons.edit_outlined ), 35 | onPressed: () { 36 | NavigationService.replaceTo('/dashboard/users/${ user.uid }'); 37 | } 38 | ) 39 | ), 40 | ] 41 | ); 42 | } 43 | 44 | @override 45 | 46 | bool get isRowCountApproximate => false; 47 | 48 | @override 49 | 50 | int get rowCount => this.users.length; 51 | 52 | @override 53 | 54 | int get selectedRowCount => 0; 55 | 56 | 57 | } -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | 4 | import 'package:admin_dashboard/api/CafeApi.dart'; 5 | 6 | import 'package:admin_dashboard/ui/layouts/dashboard/dashboard_layout.dart'; 7 | import 'package:admin_dashboard/ui/layouts/splash/splash_layout.dart'; 8 | 9 | import 'package:admin_dashboard/router/router.dart'; 10 | 11 | 12 | import 'package:admin_dashboard/providers/providers.dart'; 13 | 14 | 15 | import 'package:admin_dashboard/services/local_storage.dart'; 16 | import 'package:admin_dashboard/services/navigation_service.dart'; 17 | import 'package:admin_dashboard/services/notifications_service.dart'; 18 | 19 | import 'package:admin_dashboard/ui/layouts/auth/auth_layout.dart'; 20 | 21 | void main() async { 22 | 23 | await LocalStorage.configurePrefs(); 24 | CafeApi.configureDio(); 25 | 26 | Flurorouter.configureRoutes(); 27 | runApp(AppState()); 28 | } 29 | 30 | class AppState extends StatelessWidget { 31 | @override 32 | Widget build(BuildContext context) { 33 | return MultiProvider( 34 | providers: [ 35 | ChangeNotifierProvider(lazy: false, create: ( _ ) => AuthProvider() ), 36 | ChangeNotifierProvider(lazy: false, create: ( _ ) => SideMenuProvider() ), 37 | ChangeNotifierProvider(create: ( _ ) => CategoriesProvider() ), 38 | ChangeNotifierProvider(create: ( _ ) => UsersProvider() ), 39 | ChangeNotifierProvider(create: ( _ ) => UserFormProvider() ), 40 | 41 | ], 42 | child: MyApp(), 43 | ); 44 | } 45 | } 46 | 47 | 48 | class MyApp extends StatelessWidget { 49 | @override 50 | Widget build(BuildContext context) { 51 | return MaterialApp( 52 | debugShowCheckedModeBanner: false, 53 | title: 'Admin Dashboard', 54 | initialRoute: '/', 55 | onGenerateRoute: Flurorouter.router.generator, 56 | navigatorKey: NavigationService.navigatorKey, 57 | scaffoldMessengerKey: NotificationsService.messengerKey, 58 | builder: ( _ , child ){ 59 | 60 | final authProvider = Provider.of(context); 61 | 62 | if ( authProvider.authStatus == AuthStatus.checking ) 63 | return SplashLayout(); 64 | 65 | if( authProvider.authStatus == AuthStatus.authenticated ) { 66 | return DashboardLayout( child: child! ); 67 | } else { 68 | return AuthLayout( child: child! ); 69 | } 70 | 71 | 72 | }, 73 | theme: ThemeData.light().copyWith( 74 | scrollbarTheme: ScrollbarThemeData().copyWith( 75 | thumbColor: MaterialStateProperty.all( 76 | Colors.grey.withOpacity(0.5) 77 | ) 78 | ) 79 | ), 80 | ); 81 | } 82 | } -------------------------------------------------------------------------------- /lib/models/category.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class Categoria { 4 | Categoria({ 5 | required this.id, 6 | required this.nombre, 7 | required this.usuario, 8 | }); 9 | 10 | String id; 11 | String nombre; 12 | _Usuario usuario; 13 | 14 | factory Categoria.fromJson(String str) => Categoria.fromMap(json.decode(str)); 15 | 16 | String toJson() => json.encode(toMap()); 17 | 18 | factory Categoria.fromMap(Map json) => Categoria( 19 | id: json["_id"], 20 | nombre: json["nombre"], 21 | usuario: _Usuario.fromMap(json["usuario"]), 22 | ); 23 | 24 | Map toMap() => { 25 | "_id": id, 26 | "nombre": nombre, 27 | "usuario": usuario.toMap(), 28 | }; 29 | 30 | @override 31 | String toString() { 32 | return 'Categoria: ${ this.nombre }'; 33 | } 34 | } 35 | 36 | class _Usuario { 37 | _Usuario({ 38 | required this.id, 39 | required this.nombre, 40 | }); 41 | 42 | String id; 43 | String nombre; 44 | 45 | factory _Usuario.fromJson(String str) => _Usuario.fromMap(json.decode(str)); 46 | 47 | String toJson() => json.encode(toMap()); 48 | 49 | factory _Usuario.fromMap(Map json) => _Usuario( 50 | id: json["_id"], 51 | nombre: json["nombre"], 52 | ); 53 | 54 | Map toMap() => { 55 | "_id": id, 56 | "nombre": nombre, 57 | }; 58 | } 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /lib/models/http/auth_response.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final authResponse = authResponseFromMap(jsonString); 4 | import 'dart:convert'; 5 | 6 | import '../usuario.dart'; 7 | 8 | class AuthResponse { 9 | AuthResponse({ 10 | required this.usuario, 11 | required this.token, 12 | }); 13 | 14 | Usuario usuario; 15 | String token; 16 | 17 | factory AuthResponse.fromJson(String str) => AuthResponse.fromMap(json.decode(str)); 18 | 19 | String toJson() => json.encode(toMap()); 20 | 21 | factory AuthResponse.fromMap(Map json) => AuthResponse( 22 | usuario: Usuario.fromMap(json["usuario"]), 23 | token: json["token"], 24 | ); 25 | 26 | Map toMap() => { 27 | "usuario": usuario.toMap(), 28 | "token": token, 29 | }; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /lib/models/http/categories_response.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final categoriesResponse = categoriesResponseFromMap(jsonString); 4 | import 'dart:convert'; 5 | 6 | import '../category.dart'; 7 | 8 | class CategoriesResponse { 9 | CategoriesResponse({ 10 | required this.total, 11 | required this.categorias, 12 | }); 13 | 14 | int total; 15 | List categorias; 16 | 17 | factory CategoriesResponse.fromJson(String str) => CategoriesResponse.fromMap(json.decode(str)); 18 | 19 | String toJson() => json.encode(toMap()); 20 | 21 | factory CategoriesResponse.fromMap(Map json) => CategoriesResponse( 22 | total: json["total"], 23 | categorias: List.from(json["categorias"].map((x) => Categoria.fromMap(x))), 24 | ); 25 | 26 | Map toMap() => { 27 | "total": total, 28 | "categorias": List.from(categorias.map((x) => x.toMap())), 29 | }; 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /lib/models/http/users_response.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final usersResponse = usersResponseFromMap(jsonString); 4 | import 'dart:convert'; 5 | 6 | import '../usuario.dart'; 7 | 8 | class UsersResponse { 9 | UsersResponse({ 10 | required this.total, 11 | required this.usuarios, 12 | }); 13 | 14 | int total; 15 | List usuarios; 16 | 17 | factory UsersResponse.fromJson(String str) => UsersResponse.fromMap(json.decode(str)); 18 | 19 | String toJson() => json.encode(toMap()); 20 | 21 | factory UsersResponse.fromMap(Map json) => UsersResponse( 22 | total: json["total"], 23 | usuarios: List.from(json["usuarios"].map((x) => Usuario.fromMap(x))), 24 | ); 25 | 26 | Map toMap() => { 27 | "total": total, 28 | "usuarios": List.from(usuarios.map((x) => x.toMap())), 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /lib/models/usuario.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:convert'; 3 | 4 | class Usuario { 5 | Usuario({ 6 | required this.rol, 7 | required this.estado, 8 | required this.google, 9 | required this.nombre, 10 | required this.correo, 11 | required this.uid, 12 | this.img, 13 | }); 14 | 15 | String rol; 16 | bool estado; 17 | bool google; 18 | String nombre; 19 | String correo; 20 | String uid; 21 | String? img; 22 | 23 | factory Usuario.fromJson(String str) => Usuario.fromMap(json.decode(str)); 24 | 25 | String toJson() => json.encode(toMap()); 26 | 27 | factory Usuario.fromMap(Map json) => Usuario( 28 | rol: json["rol"], 29 | estado: json["estado"], 30 | google: json["google"], 31 | nombre: json["nombre"], 32 | correo: json["correo"], 33 | uid: json["uid"], 34 | img: json["img"], 35 | ); 36 | 37 | Map toMap() => { 38 | "rol": rol, 39 | "estado": estado, 40 | "google": google, 41 | "nombre": nombre, 42 | "correo": correo, 43 | "uid": uid, 44 | "img": img, 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /lib/providers/auth_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/models/usuario.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | 5 | import 'package:admin_dashboard/api/CafeApi.dart'; 6 | import 'package:admin_dashboard/models/http/auth_response.dart'; 7 | 8 | import 'package:admin_dashboard/router/router.dart'; 9 | 10 | import 'package:admin_dashboard/services/local_storage.dart'; 11 | import 'package:admin_dashboard/services/navigation_service.dart'; 12 | import 'package:admin_dashboard/services/notifications_service.dart'; 13 | 14 | enum AuthStatus { 15 | checking, 16 | authenticated, 17 | notAuthenticated 18 | } 19 | 20 | class AuthProvider extends ChangeNotifier { 21 | 22 | String? _token; 23 | AuthStatus authStatus = AuthStatus.checking; 24 | Usuario? user; 25 | 26 | AuthProvider() { 27 | this.isAuthenticated(); 28 | } 29 | 30 | 31 | login( String email, String password ) { 32 | 33 | final data = { 34 | 'correo': email, 35 | 'password': password 36 | }; 37 | 38 | CafeApi.post('/auth/login', data ).then( 39 | (json) { 40 | print(json); 41 | final authResponse = AuthResponse.fromMap(json); 42 | this.user = authResponse.usuario; 43 | 44 | authStatus = AuthStatus.authenticated; 45 | LocalStorage.prefs.setString('token', authResponse.token ); 46 | NavigationService.replaceTo(Flurorouter.dashboardRoute); 47 | 48 | CafeApi.configureDio(); 49 | 50 | notifyListeners(); 51 | 52 | } 53 | 54 | ).catchError( (e){ 55 | print('error en: $e'); 56 | NotificationsService.showSnackbarError('Usuario / Password no válidos'); 57 | }); 58 | 59 | } 60 | 61 | register( String email, String password, String name ) { 62 | 63 | final data = { 64 | 'nombre': name, 65 | 'correo': email, 66 | 'password': password 67 | }; 68 | 69 | CafeApi.post('/usuarios', data ).then( 70 | (json) { 71 | print(json); 72 | final authResponse = AuthResponse.fromMap(json); 73 | this.user = authResponse.usuario; 74 | 75 | authStatus = AuthStatus.authenticated; 76 | LocalStorage.prefs.setString('token', authResponse.token ); 77 | NavigationService.replaceTo(Flurorouter.dashboardRoute); 78 | 79 | CafeApi.configureDio(); 80 | notifyListeners(); 81 | 82 | } 83 | 84 | ).catchError( (e){ 85 | print('error en: $e'); 86 | NotificationsService.showSnackbarError('Usuario / Password no válidos'); 87 | }); 88 | 89 | 90 | 91 | 92 | } 93 | 94 | Future isAuthenticated() async { 95 | 96 | final token = LocalStorage.prefs.getString('token'); 97 | 98 | if( token == null ) { 99 | authStatus = AuthStatus.notAuthenticated; 100 | notifyListeners(); 101 | return false; 102 | } 103 | 104 | try { 105 | final resp = await CafeApi.httpGet('/auth'); 106 | final authReponse = AuthResponse.fromMap(resp); 107 | LocalStorage.prefs.setString('token', authReponse.token ); 108 | 109 | this.user = authReponse.usuario; 110 | authStatus = AuthStatus.authenticated; 111 | notifyListeners(); 112 | return true; 113 | 114 | } catch (e) { 115 | print(e); 116 | authStatus = AuthStatus.notAuthenticated; 117 | notifyListeners(); 118 | return false; 119 | } 120 | 121 | } 122 | 123 | 124 | logout() { 125 | LocalStorage.prefs.remove('token'); 126 | authStatus = AuthStatus.notAuthenticated; 127 | notifyListeners(); 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /lib/providers/categories_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:admin_dashboard/api/CafeApi.dart'; 4 | 5 | import 'package:admin_dashboard/models/category.dart'; 6 | import 'package:admin_dashboard/models/http/categories_response.dart'; 7 | 8 | class CategoriesProvider extends ChangeNotifier { 9 | 10 | List categorias = []; 11 | 12 | 13 | getCategories() async { 14 | final resp = await CafeApi.httpGet('/categorias'); 15 | final categoriesResp = CategoriesResponse.fromMap(resp); 16 | 17 | this.categorias = [...categoriesResp.categorias]; 18 | 19 | print( this.categorias ); 20 | 21 | notifyListeners(); 22 | } 23 | 24 | Future newCategory( String name ) async { 25 | 26 | final data = { 27 | 'nombre': name 28 | }; 29 | 30 | try { 31 | 32 | final json = await CafeApi.post('/categorias', data ); 33 | final newCategory = Categoria.fromMap(json); 34 | 35 | categorias.add( newCategory ); 36 | notifyListeners(); 37 | 38 | } catch (e) { 39 | throw 'Error al crear categoria'; 40 | } 41 | 42 | } 43 | 44 | Future updateCategory( String id, String name ) async { 45 | 46 | final data = { 47 | 'nombre': name 48 | }; 49 | 50 | try { 51 | 52 | await CafeApi.put('/categorias/$id', data ); 53 | 54 | this.categorias = this.categorias.map( 55 | (category) { 56 | if ( category.id != id ) return category; 57 | category.nombre = name; 58 | return category; 59 | } 60 | ).toList(); 61 | 62 | notifyListeners(); 63 | 64 | } catch (e) { 65 | throw 'Error al crear categoria'; 66 | } 67 | 68 | } 69 | 70 | Future deleteCategory( String id ) async { 71 | 72 | try { 73 | 74 | await CafeApi.delete('/categorias/$id', {} ); 75 | 76 | categorias.removeWhere((categoria) => categoria.id == id ); 77 | 78 | notifyListeners(); 79 | 80 | 81 | } catch (e) { 82 | print(e); 83 | print('Error al crear categoria'); 84 | } 85 | 86 | } 87 | 88 | } -------------------------------------------------------------------------------- /lib/providers/login_form_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LoginFormProvider extends ChangeNotifier { 4 | 5 | GlobalKey formKey = new GlobalKey(); 6 | 7 | String email = ''; 8 | String password = ''; 9 | 10 | bool validateForm() { 11 | 12 | if ( formKey.currentState!.validate() ) { 13 | // print('Form valid ... Login'); 14 | // print('$email === $password'); 15 | return true; 16 | } else { 17 | // print('Form not valid'); 18 | return false; 19 | } 20 | 21 | } 22 | 23 | 24 | } -------------------------------------------------------------------------------- /lib/providers/providers.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | export 'package:admin_dashboard/providers/auth_provider.dart'; 4 | export 'package:admin_dashboard/providers/categories_provider.dart'; 5 | 6 | export 'package:admin_dashboard/providers/users_provider.dart'; 7 | export 'package:admin_dashboard/providers/user_form_provider.dart'; 8 | 9 | export 'package:admin_dashboard/providers/sidemenu_provider.dart'; -------------------------------------------------------------------------------- /lib/providers/register_form_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class RegisterFormProvider extends ChangeNotifier { 4 | 5 | GlobalKey formKey = new GlobalKey(); 6 | 7 | String email = ''; 8 | String password = ''; 9 | String name = ''; 10 | 11 | 12 | validateForm() { 13 | 14 | if ( formKey.currentState!.validate() ) { 15 | print('Form valid ... Login'); 16 | print('$email === $password === $name'); 17 | return true; 18 | } else { 19 | print('Form not valid'); 20 | return false; 21 | } 22 | 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /lib/providers/sidemenu_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SideMenuProvider extends ChangeNotifier { 4 | 5 | static late AnimationController menuController; 6 | static bool isOpen = false; 7 | 8 | String _currentPage = ''; 9 | 10 | String get currentPage{ 11 | return _currentPage; 12 | } 13 | 14 | void setCurrentPageUrl( String routeName ) { 15 | _currentPage = routeName; 16 | Future.delayed(Duration(milliseconds: 100), () { 17 | notifyListeners(); 18 | }); 19 | } 20 | 21 | 22 | 23 | static Animation movement = Tween( begin: -200, end: 0 ) 24 | .animate( CurvedAnimation(parent: menuController, curve: Curves.easeInOut ) ); 25 | 26 | static Animation opacity = Tween( begin: 0, end: 1 ) 27 | .animate( CurvedAnimation(parent: menuController, curve: Curves.easeInOut ) ); 28 | 29 | 30 | static void openMenu() { 31 | isOpen = true; 32 | menuController.forward(); 33 | } 34 | 35 | static void closeMenu() { 36 | isOpen = false; 37 | menuController.reverse(); 38 | } 39 | 40 | static void toggleMenu() { 41 | ( isOpen ) 42 | ? menuController.reverse() 43 | : menuController.forward(); 44 | 45 | isOpen = !isOpen; 46 | } 47 | 48 | 49 | } -------------------------------------------------------------------------------- /lib/providers/user_form_provider.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | 3 | import 'package:admin_dashboard/api/CafeApi.dart'; 4 | import 'package:admin_dashboard/models/usuario.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class UserFormProvider extends ChangeNotifier { 8 | 9 | Usuario? user; 10 | late GlobalKey formKey; 11 | 12 | // void updateListener() { 13 | // notifyListeners(); 14 | // } 15 | copyUserWith({ 16 | String? rol, 17 | bool? estado, 18 | bool? google, 19 | String? nombre, 20 | String? correo, 21 | String? uid, 22 | String? img, 23 | }) { 24 | user = new Usuario( 25 | rol: rol ?? this.user!.rol, 26 | estado: estado ?? this.user!.estado, 27 | google: google ?? this.user!.google, 28 | nombre: nombre ?? this.user!.nombre, 29 | correo: correo ?? this.user!.correo, 30 | uid: uid ?? this.user!.uid, 31 | img: img ?? this.user!.img, 32 | ); 33 | notifyListeners(); 34 | } 35 | 36 | 37 | 38 | bool _validForm() { 39 | return formKey.currentState!.validate(); 40 | } 41 | 42 | Future updateUser() async { 43 | 44 | if ( !this._validForm() ) return false; 45 | 46 | final data = { 47 | 'nombre': user!.nombre, 48 | 'correo': user!.correo, 49 | }; 50 | 51 | try { 52 | 53 | final resp = await CafeApi.put('/usuarios/${ user!.uid }', data); 54 | print( resp ); 55 | return true; 56 | 57 | } catch (e) { 58 | print('error en updateUser: $e'); 59 | return false; 60 | } 61 | 62 | 63 | } 64 | 65 | 66 | Future uploadImage( String path, Uint8List bytes ) async { 67 | 68 | try { 69 | 70 | final resp = await CafeApi.uploadFile(path, bytes); 71 | user = Usuario.fromMap(resp); 72 | notifyListeners(); 73 | 74 | return user!; 75 | 76 | } catch (e) { 77 | print(e); 78 | throw 'Error en user from provider provider'; 79 | } 80 | 81 | } 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /lib/providers/users_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/models/http/users_response.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'package:admin_dashboard/api/CafeApi.dart'; 5 | 6 | import 'package:admin_dashboard/models/usuario.dart'; 7 | 8 | 9 | class UsersProvider extends ChangeNotifier { 10 | 11 | List users = []; 12 | bool isLoading = true; 13 | bool ascending = true; 14 | int? sortColumnIndex; 15 | 16 | UsersProvider() { 17 | this.getPaginatedUsers(); 18 | } 19 | 20 | 21 | getPaginatedUsers() async { 22 | 23 | final resp = await CafeApi.httpGet('/usuarios?limite=100&desde=0'); 24 | final usersResp = UsersResponse.fromMap(resp); 25 | this.users = [ ... usersResp.usuarios ]; 26 | isLoading = false; 27 | notifyListeners(); 28 | } 29 | 30 | Future getUserById( String uid ) async { 31 | 32 | try { 33 | final resp = await CafeApi.httpGet('/usuarios/$uid'); 34 | final user = Usuario.fromMap(resp); 35 | return user; 36 | 37 | } catch (e) { 38 | return null; 39 | } 40 | } 41 | 42 | 43 | void sort( Comparable Function( Usuario user ) getField ) { 44 | 45 | users.sort(( a, b ) { 46 | 47 | final aValue = getField( a ); 48 | final bValue = getField( b ); 49 | 50 | return ascending 51 | ? Comparable.compare(aValue, bValue) 52 | : Comparable.compare(bValue, aValue); 53 | }); 54 | 55 | ascending = !ascending; 56 | 57 | notifyListeners(); 58 | 59 | } 60 | 61 | 62 | void refreshUser( Usuario newUser ) { 63 | 64 | this.users = this.users.map( 65 | (user){ 66 | if ( user.uid == newUser.uid ) { 67 | user = newUser; 68 | } 69 | 70 | return user; 71 | } 72 | ).toList(); 73 | 74 | 75 | notifyListeners(); 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /lib/router/admin_handlers.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/providers/auth_provider.dart'; 2 | import 'package:admin_dashboard/ui/views/dashboard_view.dart'; 3 | import 'package:fluro/fluro.dart'; 4 | 5 | import 'package:admin_dashboard/ui/views/login_view.dart'; 6 | import 'package:admin_dashboard/ui/views/register_view.dart'; 7 | import 'package:provider/provider.dart'; 8 | 9 | class AdminHandlers { 10 | 11 | static Handler login = Handler( 12 | handlerFunc: ( context, params ) { 13 | 14 | final authProvider = Provider.of(context!); 15 | 16 | if ( authProvider.authStatus == AuthStatus.notAuthenticated ) 17 | return LoginView(); 18 | else 19 | return DashboardView(); 20 | 21 | } 22 | ); 23 | 24 | static Handler register = Handler( 25 | handlerFunc: ( context, params ) { 26 | 27 | final authProvider = Provider.of(context!); 28 | 29 | if ( authProvider.authStatus == AuthStatus.notAuthenticated ) 30 | return RegisterView(); 31 | else 32 | return DashboardView(); 33 | } 34 | ); 35 | 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /lib/router/dashboard_handlers.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/ui/views/user_view.dart'; 2 | import 'package:fluro/fluro.dart'; 3 | import 'package:provider/provider.dart'; 4 | 5 | 6 | import 'package:admin_dashboard/router/router.dart'; 7 | 8 | import 'package:admin_dashboard/providers/sidemenu_provider.dart'; 9 | import 'package:admin_dashboard/providers/auth_provider.dart'; 10 | 11 | import 'package:admin_dashboard/ui/views/categories_view.dart'; 12 | import 'package:admin_dashboard/ui/views/blank_view.dart'; 13 | import 'package:admin_dashboard/ui/views/dashboard_view.dart'; 14 | import 'package:admin_dashboard/ui/views/icons_view.dart'; 15 | import 'package:admin_dashboard/ui/views/login_view.dart'; 16 | import 'package:admin_dashboard/ui/views/users_view.dart'; 17 | 18 | 19 | class DashboardHandlers { 20 | 21 | static Handler dashboard = Handler( 22 | handlerFunc: ( context, params ) { 23 | 24 | final authProvider = Provider.of(context!); 25 | Provider.of(context, listen: false) 26 | .setCurrentPageUrl( Flurorouter.dashboardRoute ); 27 | 28 | if ( authProvider.authStatus == AuthStatus.authenticated ) 29 | return DashboardView(); 30 | else 31 | return LoginView(); 32 | } 33 | ); 34 | 35 | 36 | static Handler icons = Handler( 37 | handlerFunc: ( context, params ) { 38 | 39 | final authProvider = Provider.of(context!); 40 | Provider.of(context, listen: false) 41 | .setCurrentPageUrl( Flurorouter.iconsRoute ); 42 | 43 | if ( authProvider.authStatus == AuthStatus.authenticated ) 44 | return IconsView(); 45 | else 46 | return LoginView(); 47 | } 48 | ); 49 | 50 | 51 | static Handler blank = Handler( 52 | handlerFunc: ( context, params ) { 53 | 54 | final authProvider = Provider.of(context!); 55 | Provider.of(context, listen: false) 56 | .setCurrentPageUrl( Flurorouter.blankRoute ); 57 | 58 | if ( authProvider.authStatus == AuthStatus.authenticated ) 59 | return BlankView(); 60 | else 61 | return LoginView(); 62 | } 63 | ); 64 | 65 | 66 | static Handler categories = Handler( 67 | handlerFunc: ( context, params ) { 68 | 69 | final authProvider = Provider.of(context!); 70 | Provider.of(context, listen: false) 71 | .setCurrentPageUrl( Flurorouter.categoriesRoute ); 72 | 73 | if ( authProvider.authStatus == AuthStatus.authenticated ) 74 | return CategoriesView(); 75 | else 76 | return LoginView(); 77 | } 78 | ); 79 | 80 | // users 81 | static Handler users = Handler( 82 | handlerFunc: ( context, params ) { 83 | 84 | final authProvider = Provider.of(context!); 85 | Provider.of(context, listen: false) 86 | .setCurrentPageUrl( Flurorouter.usersRoute ); 87 | 88 | if ( authProvider.authStatus == AuthStatus.authenticated ) 89 | return UsersView(); 90 | else 91 | return LoginView(); 92 | } 93 | ); 94 | 95 | // user 96 | static Handler user = Handler( 97 | handlerFunc: ( context, params ) { 98 | 99 | final authProvider = Provider.of(context!); 100 | Provider.of(context, listen: false) 101 | .setCurrentPageUrl( Flurorouter.userRoute ); 102 | 103 | if ( authProvider.authStatus == AuthStatus.authenticated ){ 104 | print( params ); 105 | if ( params['uid']?.first != null ) { 106 | return UserView(uid: params['uid']!.first ); 107 | } else { 108 | return UsersView(); 109 | } 110 | 111 | 112 | } else { 113 | return LoginView(); 114 | } 115 | } 116 | ); 117 | 118 | } 119 | 120 | -------------------------------------------------------------------------------- /lib/router/no_page_found_handlers.dart: -------------------------------------------------------------------------------- 1 | import 'package:provider/provider.dart'; 2 | import 'package:fluro/fluro.dart'; 3 | 4 | import 'package:admin_dashboard/providers/sidemenu_provider.dart'; 5 | 6 | import 'package:admin_dashboard/ui/views/no_page_found_view.dart'; 7 | 8 | class NoPageFoundHandlers { 9 | 10 | static Handler noPageFound = Handler( 11 | handlerFunc: ( context, params ) { 12 | 13 | Provider.of(context!, listen: false).setCurrentPageUrl('/404'); 14 | 15 | return NoPageFoundView(); 16 | } 17 | ); 18 | 19 | 20 | } 21 | 22 | -------------------------------------------------------------------------------- /lib/router/router.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/router/dashboard_handlers.dart'; 2 | import 'package:admin_dashboard/router/no_page_found_handlers.dart'; 3 | import 'package:fluro/fluro.dart'; 4 | import 'package:admin_dashboard/router/admin_handlers.dart'; 5 | 6 | class Flurorouter { 7 | 8 | static final FluroRouter router = new FluroRouter(); 9 | 10 | static String rootRoute = '/'; 11 | 12 | // Auth Router 13 | static String loginRoute = '/auth/login'; 14 | static String registerRoute = '/auth/register'; 15 | 16 | // Dashboard 17 | static String dashboardRoute = '/dashboard'; 18 | static String iconsRoute = '/dashboard/icons'; 19 | static String blankRoute = '/dashboard/blank'; 20 | static String categoriesRoute = '/dashboard/categories'; 21 | 22 | static String usersRoute = '/dashboard/users'; 23 | static String userRoute = '/dashboard/users/:uid'; 24 | 25 | 26 | static void configureRoutes() { 27 | // Auth Routes 28 | router.define( rootRoute, handler: AdminHandlers.login, transitionType: TransitionType.none ); 29 | router.define( loginRoute, handler: AdminHandlers.login, transitionType: TransitionType.none ); 30 | router.define( registerRoute, handler: AdminHandlers.register, transitionType: TransitionType.none ); 31 | 32 | // Dashboard 33 | router.define( dashboardRoute, handler: DashboardHandlers.dashboard, transitionType: TransitionType.fadeIn ); 34 | router.define( blankRoute, handler: DashboardHandlers.blank, transitionType: TransitionType.fadeIn ); 35 | router.define( categoriesRoute, handler: DashboardHandlers.categories, transitionType: TransitionType.fadeIn ); 36 | router.define( iconsRoute, handler: DashboardHandlers.icons, transitionType: TransitionType.fadeIn ); 37 | 38 | // users 39 | router.define( usersRoute, handler: DashboardHandlers.users, transitionType: TransitionType.fadeIn ); 40 | router.define( userRoute, handler: DashboardHandlers.user, transitionType: TransitionType.fadeIn ); 41 | 42 | // 404 43 | router.notFoundHandler = NoPageFoundHandlers.noPageFound; 44 | 45 | } 46 | 47 | 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /lib/services/local_storage.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | class LocalStorage { 6 | 7 | static late SharedPreferences prefs; 8 | 9 | static Future configurePrefs() async { 10 | prefs = await SharedPreferences.getInstance(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /lib/services/navigation_service.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | import 'package:flutter/material.dart'; 5 | 6 | class NavigationService { 7 | 8 | static GlobalKey navigatorKey = new GlobalKey(); 9 | 10 | static navigateTo( String routeName ) { 11 | return navigatorKey.currentState!.pushNamed( routeName ); 12 | } 13 | 14 | static replaceTo( String routeName ) { 15 | return navigatorKey.currentState!.pushReplacementNamed( routeName ); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /lib/services/notifications_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | 4 | 5 | class NotificationsService { 6 | 7 | static GlobalKey messengerKey = new GlobalKey(); 8 | 9 | 10 | static showSnackbarError( String message ) { 11 | 12 | final snackBar = new SnackBar( 13 | backgroundColor: Colors.red.withOpacity(0.9), 14 | content: Text( message, style: TextStyle( color: Colors.white, fontSize: 20 ) ) 15 | ); 16 | 17 | messengerKey.currentState!.showSnackBar(snackBar); 18 | 19 | } 20 | 21 | static showSnackbar( String message ) { 22 | 23 | final snackBar = new SnackBar( 24 | content: Text( message, style: TextStyle( color: Colors.white, fontSize: 20 ) ) 25 | ); 26 | 27 | messengerKey.currentState!.showSnackBar(snackBar); 28 | 29 | } 30 | 31 | static showBusyIndicator( BuildContext context ) { 32 | 33 | final AlertDialog dialog = AlertDialog( 34 | content: Container( 35 | width: 100, 36 | height: 100, 37 | child: Center( 38 | child: CircularProgressIndicator(), 39 | ), 40 | ), 41 | ); 42 | 43 | showDialog(context: context, builder: ( _ )=> dialog ); 44 | 45 | } 46 | 47 | 48 | } -------------------------------------------------------------------------------- /lib/ui/buttons/custom_icon_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | 4 | 5 | 6 | class CustomIconButton extends StatelessWidget { 7 | 8 | final Function onPressed; 9 | final String text; 10 | final Color color; 11 | final bool isFilled; 12 | final IconData icon; 13 | 14 | const CustomIconButton({ 15 | Key? key, 16 | required this.onPressed, 17 | required this.text, 18 | required this.icon, 19 | this.color = Colors.indigo, 20 | this.isFilled = false, 21 | }) : super(key: key); 22 | 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return OutlinedButton( 27 | style: ButtonStyle( 28 | shape: MaterialStateProperty.all( StadiumBorder() ), 29 | backgroundColor: MaterialStateProperty.all( color.withOpacity(0.5) ), 30 | overlayColor: MaterialStateProperty.all( color.withOpacity(0.3) ), 31 | ), 32 | onPressed: () => onPressed(), 33 | child: Row( 34 | children: [ 35 | Icon( icon, color: Colors.white ), 36 | Text( text, style: TextStyle( color: Colors.white ), ) 37 | ], 38 | ) 39 | ); 40 | } 41 | } -------------------------------------------------------------------------------- /lib/ui/buttons/custom_outlined_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomOutlinedButton extends StatelessWidget { 4 | 5 | final Function onPressed; 6 | final String text; 7 | final Color color; 8 | final bool isFilled; 9 | final bool isTextWhite; 10 | 11 | const CustomOutlinedButton({ 12 | Key? key, 13 | required this.onPressed, 14 | required this.text, 15 | this.color = Colors.blue, 16 | this.isFilled = false, 17 | this.isTextWhite = false 18 | }) : super(key: key); 19 | 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return OutlinedButton( 24 | style: ButtonStyle( 25 | shape: MaterialStateProperty.all( 26 | RoundedRectangleBorder( borderRadius: BorderRadius.circular(30)) 27 | ), 28 | side: MaterialStateProperty.all( 29 | BorderSide( color: color ) 30 | ), 31 | backgroundColor: MaterialStateProperty.all( 32 | isFilled ? color.withOpacity(0.3) : Colors.transparent 33 | ), 34 | ), 35 | onPressed: () => onPressed(), 36 | child: Padding( 37 | padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10 ), 38 | child: Text( 39 | text, 40 | style: TextStyle( fontSize: 16, color: isTextWhite ? Colors.white : color ), 41 | ), 42 | ) 43 | ); 44 | } 45 | } -------------------------------------------------------------------------------- /lib/ui/buttons/link_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/rendering.dart'; 3 | 4 | class LinkText extends StatefulWidget { 5 | 6 | final String text; 7 | final Function? onPressed; 8 | 9 | const LinkText({ 10 | Key? key, 11 | required this.text, 12 | this.onPressed 13 | }) : super(key: key); 14 | 15 | @override 16 | _LinkTextState createState() => _LinkTextState(); 17 | } 18 | 19 | class _LinkTextState extends State { 20 | 21 | 22 | bool isHover = false; 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return GestureDetector( 27 | onTap: (){ 28 | if( widget.onPressed != null ) widget.onPressed!(); 29 | }, 30 | child: MouseRegion( 31 | cursor: SystemMouseCursors.click, 32 | onEnter: ( _ ) => setState(()=> isHover = true ), 33 | onExit: ( _ ) => setState(()=> isHover = false ), 34 | child: Container( 35 | margin: EdgeInsets.symmetric( horizontal: 10, vertical: 5 ), 36 | child: Text( 37 | widget.text, 38 | style: TextStyle( 39 | fontSize: 16, 40 | color: Colors.grey[700], 41 | decoration: isHover ? TextDecoration.underline : TextDecoration.none 42 | ), 43 | ), 44 | ), 45 | ), 46 | ); 47 | } 48 | } -------------------------------------------------------------------------------- /lib/ui/cards/white_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | 4 | 5 | class WhiteCard extends StatelessWidget { 6 | 7 | final String? title; 8 | final Widget child; 9 | final double? width; 10 | 11 | const WhiteCard({ 12 | Key? key, 13 | required this.child, 14 | this.title, 15 | this.width, 16 | }) : super(key: key); 17 | 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Container( 22 | width: width != null ? width : null, 23 | margin: EdgeInsets.all(8), 24 | padding: EdgeInsets.all(10), 25 | decoration: buildBoxDecoration(), 26 | child: Column( 27 | crossAxisAlignment: CrossAxisAlignment.start, 28 | children: [ 29 | 30 | if( title != null ) 31 | ...[ 32 | FittedBox( 33 | fit: BoxFit.contain, 34 | child: Text( 35 | title!, 36 | style: GoogleFonts.roboto( 37 | fontSize: 15, 38 | fontWeight: FontWeight.bold 39 | ), 40 | ), 41 | ), 42 | 43 | Divider() 44 | ], 45 | 46 | child 47 | ], 48 | ), 49 | ); 50 | } 51 | 52 | BoxDecoration buildBoxDecoration() => BoxDecoration( 53 | color: Colors.white, 54 | borderRadius: BorderRadius.circular(5), 55 | boxShadow: [ 56 | BoxShadow( 57 | color: Colors.black.withOpacity(0.05), 58 | blurRadius: 5 59 | ) 60 | ] 61 | ); 62 | } -------------------------------------------------------------------------------- /lib/ui/inputs/custom_inputs.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | 4 | class CustomInputs { 5 | 6 | static InputDecoration loginInputDecoration({ 7 | required String hint, 8 | required String label, 9 | required IconData icon, 10 | }){ 11 | return InputDecoration( 12 | border: OutlineInputBorder( 13 | borderSide: BorderSide(color: Colors.white.withOpacity(0.3)) 14 | ), 15 | enabledBorder: OutlineInputBorder( 16 | borderSide: BorderSide(color: Colors.white.withOpacity(0.3)) 17 | ), 18 | hintText: hint, 19 | labelText: label, 20 | prefixIcon: Icon( icon, color: Colors.grey ), 21 | labelStyle: TextStyle( color: Colors.grey ), 22 | hintStyle: TextStyle( color: Colors.grey ), 23 | ); 24 | } 25 | 26 | static InputDecoration searchInputDecoration({ 27 | required String hint, 28 | required IconData icon 29 | }) { 30 | return InputDecoration( 31 | border: InputBorder.none, 32 | enabledBorder: InputBorder.none, 33 | hintText: hint, 34 | prefixIcon: Icon( icon, color: Colors.grey ), 35 | labelStyle: TextStyle( color: Colors.grey ), 36 | hintStyle: TextStyle( color: Colors.grey ) 37 | ); 38 | } 39 | 40 | 41 | static InputDecoration formInputDecoration({ 42 | required String hint, 43 | required String label, 44 | required IconData icon, 45 | }){ 46 | return InputDecoration( 47 | border: OutlineInputBorder( 48 | borderSide: BorderSide(color: Colors.indigo.withOpacity(0.3)) 49 | ), 50 | enabledBorder: OutlineInputBorder( 51 | borderSide: BorderSide(color: Colors.indigo.withOpacity(0.3)) 52 | ), 53 | hintText: hint, 54 | labelText: label, 55 | prefixIcon: Icon( icon, color: Colors.grey ), 56 | labelStyle: TextStyle( color: Colors.grey ), 57 | hintStyle: TextStyle( color: Colors.grey ), 58 | ); 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /lib/ui/labels/custom_labels.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | 4 | class CustomLabels { 5 | 6 | static TextStyle h1 = GoogleFonts.roboto( 7 | fontSize: 30, 8 | fontWeight: FontWeight.w400 9 | ); 10 | 11 | static TextStyle h2 = GoogleFonts.roboto( 12 | fontSize: 20, 13 | fontWeight: FontWeight.w400 14 | ); 15 | 16 | } -------------------------------------------------------------------------------- /lib/ui/layouts/auth/auth_layout.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:admin_dashboard/ui/layouts/auth/widgets/background_twitter.dart'; 4 | import 'package:admin_dashboard/ui/layouts/auth/widgets/custom_title.dart'; 5 | import 'package:admin_dashboard/ui/layouts/auth/widgets/links_bar.dart'; 6 | 7 | 8 | class AuthLayout extends StatelessWidget { 9 | 10 | final Widget child; 11 | 12 | const AuthLayout({ 13 | Key? key, 14 | required this.child 15 | }) : super(key: key); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | 20 | final size = MediaQuery.of(context).size; 21 | 22 | return Scaffold( 23 | body: Scrollbar( 24 | // isAlwaysShown: true, 25 | child: ListView( 26 | physics: ClampingScrollPhysics(), 27 | children: [ 28 | 29 | ( size.width > 1000 ) 30 | ? _DesktopBody( child: child) 31 | : _MobileBody( child: child ), 32 | 33 | // LinksBar 34 | LinksBar() 35 | ], 36 | ), 37 | ) 38 | ); 39 | } 40 | } 41 | 42 | 43 | class _MobileBody extends StatelessWidget { 44 | 45 | final Widget child; 46 | 47 | const _MobileBody({ 48 | Key? key, 49 | required this.child 50 | }) : super(key: key); 51 | 52 | @override 53 | Widget build(BuildContext context) { 54 | return Container( 55 | height: 1000, 56 | color: Colors.black, 57 | child: Column( 58 | mainAxisAlignment: MainAxisAlignment.start, 59 | children: [ 60 | SizedBox( height: 20 ), 61 | CustomTitle(), 62 | Container( 63 | width: double.infinity, 64 | height: 420, 65 | child: child, 66 | ), 67 | 68 | Container( 69 | width: double.infinity, 70 | height: 400, 71 | child: BackgroundTwitter(), 72 | ) 73 | ], 74 | ), 75 | ); 76 | } 77 | } 78 | 79 | 80 | class _DesktopBody extends StatelessWidget { 81 | 82 | final Widget child; 83 | 84 | const _DesktopBody({ 85 | Key? key, 86 | required this.child 87 | }) : super(key: key); 88 | 89 | 90 | 91 | @override 92 | Widget build(BuildContext context) { 93 | 94 | final size = MediaQuery.of(context).size; 95 | 96 | return Container( 97 | width: size.width, 98 | height: size.height * 0.95, 99 | color: Colors.black, 100 | child: Row( 101 | children: [ 102 | 103 | // Twitter Background 104 | Expanded(child: BackgroundTwitter()), 105 | 106 | 107 | // View Container 108 | Container( 109 | width: 600, 110 | height: double.infinity, 111 | color: Colors.black, 112 | child: Column( 113 | children: [ 114 | SizedBox( height: 20 ), 115 | CustomTitle(), 116 | SizedBox( height: 50 ), 117 | Expanded(child: child ), 118 | ], 119 | ), 120 | ) 121 | 122 | ], 123 | ), 124 | ); 125 | } 126 | } -------------------------------------------------------------------------------- /lib/ui/layouts/auth/widgets/background_twitter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class BackgroundTwitter extends StatelessWidget { 4 | 5 | @override 6 | Widget build(BuildContext context) { 7 | return Container( 8 | decoration: buildBoxDecoration(), 9 | child: Container( 10 | constraints: BoxConstraints( maxWidth: 400 ), 11 | child: Center( 12 | child: Padding( 13 | padding: const EdgeInsets.symmetric(horizontal: 30), 14 | child: Image( 15 | image: AssetImage('twitter-white-logo.png'), 16 | width: 400, 17 | ), 18 | ), 19 | ), 20 | ), 21 | ); 22 | } 23 | 24 | BoxDecoration buildBoxDecoration() { 25 | return BoxDecoration( 26 | image: DecorationImage( 27 | image: AssetImage('twitter-bg.png'), 28 | fit: BoxFit.cover 29 | ) 30 | ); 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /lib/ui/layouts/auth/widgets/custom_title.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | 4 | class CustomTitle extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Container( 8 | padding: EdgeInsets.symmetric( horizontal: 20 ), 9 | child: Column( 10 | crossAxisAlignment: CrossAxisAlignment.start, 11 | children: [ 12 | Image.asset( 13 | 'twitter-white-logo.png', 14 | width: 50, 15 | height: 50, 16 | ), 17 | 18 | SizedBox( height: 20 ), 19 | 20 | FittedBox( 21 | fit: BoxFit.contain, 22 | child: Text( 23 | 'Happening Now', 24 | style: GoogleFonts.montserratAlternates( 25 | fontSize: 60, 26 | color: Colors.white, 27 | fontWeight: FontWeight.bold 28 | ), 29 | ), 30 | ) 31 | ], 32 | ), 33 | ); 34 | } 35 | } -------------------------------------------------------------------------------- /lib/ui/layouts/auth/widgets/links_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/ui/buttons/link_text.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class LinksBar extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | 8 | final size = MediaQuery.of(context).size; 9 | 10 | return Container( 11 | color: Colors.black, 12 | height: (size.width > 1000 ) ? size.height * 0.07 : null, 13 | child: Wrap( 14 | alignment: WrapAlignment.center, 15 | children: [ 16 | LinkText( text: 'About', onPressed: () => print('about') ), 17 | LinkText( text: 'Help Center' ), 18 | LinkText( text: 'Terms of Service' ), 19 | LinkText( text: 'Privacy Policy' ), 20 | LinkText( text: 'Cookie Policy' ), 21 | LinkText( text: 'Ads info' ), 22 | LinkText( text: 'Blog' ), 23 | LinkText( text: 'Status' ), 24 | LinkText( text: 'Careers' ), 25 | LinkText( text: 'Brand Resources' ), 26 | LinkText( text: 'Advertising' ), 27 | LinkText( text: 'Marketing' ), 28 | ], 29 | ) 30 | ); 31 | } 32 | } -------------------------------------------------------------------------------- /lib/ui/layouts/dashboard/dashboard_layout.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/providers/sidemenu_provider.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'package:admin_dashboard/ui/shared/navbar.dart'; 5 | import 'package:admin_dashboard/ui/shared/sidebar.dart'; 6 | 7 | class DashboardLayout extends StatefulWidget { 8 | 9 | final Widget child; 10 | 11 | const DashboardLayout({ 12 | Key? key, 13 | required this.child 14 | }) : super(key: key); 15 | 16 | @override 17 | _DashboardLayoutState createState() => _DashboardLayoutState(); 18 | } 19 | 20 | class _DashboardLayoutState extends State with SingleTickerProviderStateMixin { 21 | 22 | 23 | @override 24 | void initState() { 25 | super.initState(); 26 | 27 | SideMenuProvider.menuController = new AnimationController( 28 | vsync: this, 29 | duration: Duration(milliseconds: 300) 30 | ); 31 | 32 | } 33 | 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | 38 | final size = MediaQuery.of(context).size; 39 | 40 | return Scaffold( 41 | backgroundColor: Color( 0xffEDF1F2 ), 42 | body: Stack( 43 | children: [ 44 | Row( 45 | children: [ 46 | 47 | if ( size.width >= 700 ) 48 | Sidebar(), 49 | 50 | Expanded( 51 | child: Column( 52 | children: [ 53 | // Navbar 54 | Navbar(), 55 | 56 | // View 57 | Expanded( 58 | child: Container( 59 | child: widget.child, 60 | ) 61 | ), 62 | ], 63 | ), 64 | ) 65 | // Contenedor de nuestro view 66 | ], 67 | ), 68 | 69 | 70 | if( size.width < 700 ) 71 | AnimatedBuilder( 72 | animation: SideMenuProvider.menuController, 73 | builder: ( context, _ ) => Stack( 74 | children: [ 75 | 76 | if( SideMenuProvider.isOpen ) 77 | Opacity( 78 | opacity: SideMenuProvider.opacity.value, 79 | child: GestureDetector( 80 | onTap: () => SideMenuProvider.closeMenu(), 81 | child: Container( 82 | width: size.width, 83 | height: size.height, 84 | color: Colors.black26, 85 | ), 86 | ), 87 | ), 88 | 89 | 90 | Transform.translate( 91 | offset: Offset( SideMenuProvider.movement.value, 0 ), 92 | child: Sidebar(), 93 | ) 94 | ], 95 | )) 96 | ], 97 | ) 98 | ); 99 | } 100 | } -------------------------------------------------------------------------------- /lib/ui/layouts/splash/splash_layout.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SplashLayout extends StatelessWidget { 4 | 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | body: Center( 9 | child: Column( 10 | mainAxisAlignment: MainAxisAlignment.center, 11 | children: [ 12 | CircularProgressIndicator(), 13 | SizedBox( height: 20 ), 14 | Text('Checking...') 15 | ], 16 | ), 17 | ), 18 | ); 19 | } 20 | } -------------------------------------------------------------------------------- /lib/ui/modals/category_modal.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | 4 | import 'package:admin_dashboard/models/category.dart'; 5 | 6 | import 'package:admin_dashboard/providers/categories_provider.dart'; 7 | 8 | import 'package:admin_dashboard/services/notifications_service.dart'; 9 | 10 | import 'package:admin_dashboard/ui/buttons/custom_outlined_button.dart'; 11 | import 'package:admin_dashboard/ui/inputs/custom_inputs.dart'; 12 | import 'package:admin_dashboard/ui/labels/custom_labels.dart'; 13 | 14 | 15 | class CategoryModal extends StatefulWidget { 16 | 17 | final Categoria? categoria; 18 | 19 | const CategoryModal({ 20 | Key? key, 21 | this.categoria 22 | }) : super(key: key); 23 | 24 | @override 25 | _CategoryModalState createState() => _CategoryModalState(); 26 | } 27 | 28 | class _CategoryModalState extends State { 29 | 30 | String nombre = ''; 31 | String? id; 32 | 33 | @override 34 | void initState() { 35 | super.initState(); 36 | 37 | id = widget.categoria?.id; 38 | nombre = widget.categoria?.nombre ?? ''; 39 | 40 | } 41 | 42 | 43 | @override 44 | Widget build(BuildContext context) { 45 | 46 | final categoryProvider = Provider.of(context, listen: false); 47 | 48 | return Container( 49 | padding: EdgeInsets.all(20), 50 | height: 500, 51 | width: 300, // expanded 52 | decoration: buildBoxDecoration(), 53 | child: Column( 54 | children: [ 55 | 56 | Row( 57 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 58 | children: [ 59 | Text( widget.categoria?.nombre ?? 'Nueva categoría', style: CustomLabels.h1.copyWith( color: Colors.white )), 60 | IconButton( 61 | icon: Icon( Icons.close, color: Colors.white, ), 62 | onPressed: () => Navigator.of(context).pop() 63 | ) 64 | ], 65 | ), 66 | 67 | Divider( color: Colors.white.withOpacity(0.3 )), 68 | 69 | SizedBox(height: 20 ), 70 | 71 | TextFormField( 72 | initialValue: widget.categoria?.nombre ?? '', 73 | onChanged: ( value ) => nombre = value, 74 | decoration: CustomInputs.loginInputDecoration( 75 | hint: 'Nombre de la categoría', 76 | label: 'Categoría', 77 | icon: Icons.new_releases_outlined 78 | ), 79 | style: TextStyle( color: Colors.white ), 80 | ), 81 | 82 | Container( 83 | margin: EdgeInsets.only(top: 30), 84 | alignment: Alignment.center, 85 | child: CustomOutlinedButton( 86 | onPressed: () async{ 87 | 88 | try { 89 | if( id == null ) { 90 | // Crear 91 | await categoryProvider.newCategory(nombre); 92 | NotificationsService.showSnackbar('$nombre creado!'); 93 | 94 | } else { 95 | // Actualizar 96 | await categoryProvider.updateCategory( id!, nombre ); 97 | NotificationsService.showSnackbar('$nombre Actualizado!'); 98 | } 99 | 100 | Navigator.of(context).pop(); 101 | 102 | } catch (e) { 103 | Navigator.of(context).pop(); 104 | NotificationsService.showSnackbarError('No se pudo guardar la categoría'); 105 | } 106 | 107 | 108 | 109 | 110 | }, 111 | text: 'Guardar', 112 | color: Colors.white, 113 | ), 114 | ) 115 | 116 | ], 117 | ), 118 | ); 119 | } 120 | 121 | BoxDecoration buildBoxDecoration() => BoxDecoration( 122 | borderRadius: BorderRadius.only( topLeft: Radius.circular(20), topRight: Radius.circular(20) ), 123 | color: Color(0xff0F2041), 124 | boxShadow: [ 125 | BoxShadow( 126 | color: Colors.black26 127 | ) 128 | ] 129 | ); 130 | } 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /lib/ui/shared/navbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/providers/sidemenu_provider.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'package:admin_dashboard/ui/shared/widgets/navbar_avatar.dart'; 5 | import 'package:admin_dashboard/ui/shared/widgets/notifications_indicator.dart'; 6 | import 'package:admin_dashboard/ui/shared/widgets/search_text.dart'; 7 | 8 | 9 | class Navbar extends StatelessWidget { 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | 14 | final size = MediaQuery.of(context).size; 15 | 16 | return Container( 17 | width: double.infinity, 18 | height: 50, 19 | decoration: buildBoxDecoration(), 20 | child: Row( 21 | children: [ 22 | 23 | if ( size.width <= 700 ) 24 | IconButton( 25 | icon: Icon( Icons.menu_outlined ), 26 | onPressed: () => SideMenuProvider.openMenu() 27 | ), 28 | 29 | SizedBox( width: 5 ), 30 | 31 | // Search input 32 | if ( size.width > 390 ) 33 | ConstrainedBox( 34 | constraints: BoxConstraints( maxWidth: 250 ), 35 | child: SearchText(), 36 | ), 37 | 38 | Spacer(), 39 | 40 | NotificationsIndicator(), 41 | SizedBox( width: 10 ), 42 | NavbarAvatar(), 43 | SizedBox( width: 10 ) 44 | 45 | ], 46 | ), 47 | ); 48 | } 49 | 50 | BoxDecoration buildBoxDecoration() => BoxDecoration( 51 | color: Colors.white, 52 | boxShadow: [ 53 | BoxShadow( 54 | color: Colors.black12, 55 | blurRadius: 5 56 | ) 57 | ] 58 | ); 59 | } -------------------------------------------------------------------------------- /lib/ui/shared/sidebar.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/providers/auth_provider.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:provider/provider.dart'; 4 | 5 | import 'package:admin_dashboard/providers/sidemenu_provider.dart'; 6 | 7 | import 'package:admin_dashboard/router/router.dart'; 8 | 9 | import 'package:admin_dashboard/services/navigation_service.dart'; 10 | 11 | import 'package:admin_dashboard/ui/shared/widgets/menu_item.dart'; 12 | import 'package:admin_dashboard/ui/shared/widgets/logo.dart'; 13 | import 'package:admin_dashboard/ui/shared/widgets/text_separator.dart'; 14 | 15 | 16 | class Sidebar extends StatelessWidget { 17 | 18 | 19 | void navigateTo( String routeName ) { 20 | NavigationService.replaceTo( routeName ); 21 | SideMenuProvider.closeMenu(); 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | 27 | final sideMenuProvider = Provider.of(context); 28 | 29 | return Container( 30 | width: 200, 31 | height: double.infinity, 32 | decoration: buildBoxDecoration(), 33 | child: ListView( 34 | physics: ClampingScrollPhysics(), 35 | children: [ 36 | 37 | Logo(), 38 | 39 | SizedBox( height: 50 ), 40 | 41 | TextSeparator( text: 'main' ), 42 | 43 | MenuItem( 44 | text: 'Dashboard', 45 | icon: Icons.compass_calibration_outlined, 46 | onPressed: () => navigateTo( Flurorouter.dashboardRoute ), 47 | isActive: sideMenuProvider.currentPage == Flurorouter.dashboardRoute, 48 | ), 49 | 50 | MenuItem( text: 'Orders', icon: Icons.shopping_cart_outlined, onPressed: (){}), 51 | MenuItem( text: 'Analytic', icon: Icons.show_chart_outlined, onPressed: (){}), 52 | 53 | MenuItem( 54 | text: 'Categories', 55 | icon: Icons.layers_outlined, 56 | onPressed: () => navigateTo( Flurorouter.categoriesRoute ), 57 | isActive: sideMenuProvider.currentPage == Flurorouter.categoriesRoute, 58 | ), 59 | 60 | MenuItem( text: 'Products', icon: Icons.dashboard_outlined, onPressed: (){}), 61 | MenuItem( text: 'Discount', icon: Icons.attach_money_outlined, onPressed: (){}) 62 | , 63 | MenuItem( 64 | text: 'Users', 65 | icon: Icons.people_alt_outlined, 66 | onPressed: () => navigateTo( Flurorouter.usersRoute ), 67 | isActive: sideMenuProvider.currentPage == Flurorouter.usersRoute, 68 | ), 69 | 70 | SizedBox( height: 30 ), 71 | 72 | TextSeparator( text: 'UI Elements' ), 73 | 74 | MenuItem( 75 | text: 'Icons', 76 | icon: Icons.list_alt_outlined, 77 | onPressed: () => navigateTo( Flurorouter.iconsRoute ), 78 | isActive: sideMenuProvider.currentPage == Flurorouter.iconsRoute, 79 | ), 80 | 81 | MenuItem( text: 'Marketing', icon: Icons.mark_email_read_outlined, onPressed: (){}), 82 | MenuItem( text: 'Campaign', icon: Icons.note_add_outlined, onPressed: (){}), 83 | MenuItem( 84 | text: 'Black', 85 | icon: Icons.post_add_outlined, 86 | onPressed: () => navigateTo( Flurorouter.blankRoute ), 87 | isActive: sideMenuProvider.currentPage == Flurorouter.blankRoute, 88 | ), 89 | 90 | SizedBox( height: 50 ), 91 | TextSeparator( text: 'Exit' ), 92 | MenuItem( 93 | text: 'Logout', 94 | icon: Icons.exit_to_app_outlined, 95 | onPressed: (){ 96 | Provider.of(context, listen: false) 97 | .logout(); 98 | }), 99 | ], 100 | ), 101 | ); 102 | } 103 | 104 | BoxDecoration buildBoxDecoration() => BoxDecoration( 105 | gradient: LinearGradient( 106 | colors: [ 107 | Color( 0xff092044 ), 108 | Color( 0xff092042 ), 109 | ] 110 | ), 111 | boxShadow: [ 112 | BoxShadow( 113 | color: Colors.black26, 114 | blurRadius: 10 115 | ) 116 | ] 117 | ); 118 | } -------------------------------------------------------------------------------- /lib/ui/shared/widgets/logo.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | 4 | class Logo extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Container( 8 | padding: EdgeInsets.only( top: 30 ), 9 | child: Row( 10 | mainAxisAlignment: MainAxisAlignment.center, 11 | children: [ 12 | Icon( Icons.bubble_chart_outlined, color: Color(0xff7A6BF5) ), 13 | SizedBox( width: 10 ), 14 | Text( 15 | 'Admin', 16 | style: GoogleFonts.montserratAlternates( 17 | fontSize: 20, 18 | fontWeight: FontWeight.w200, 19 | color: Colors.white 20 | ), 21 | ) 22 | ], 23 | ), 24 | ); 25 | } 26 | } -------------------------------------------------------------------------------- /lib/ui/shared/widgets/menu_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | 4 | class MenuItem extends StatefulWidget { 5 | 6 | final String text; 7 | final IconData icon; 8 | final bool isActive; 9 | final Function onPressed; 10 | 11 | const MenuItem({ 12 | Key? key, 13 | required this.text, 14 | required this.icon, 15 | required this.onPressed, 16 | this.isActive = false, 17 | }) : super(key: key); 18 | 19 | @override 20 | _MenuItemState createState() => _MenuItemState(); 21 | } 22 | 23 | class _MenuItemState extends State { 24 | 25 | bool isHovered = false; 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return AnimatedContainer( 30 | duration: Duration( milliseconds: 250 ), 31 | color: isHovered 32 | ? Colors.white.withOpacity(0.1) 33 | : widget.isActive ? Colors.white.withOpacity(0.1) : Colors.transparent, 34 | child: Material( 35 | color: Colors.transparent, 36 | child: InkWell( 37 | onTap: widget.isActive ? null : () => widget.onPressed(), 38 | child: Padding( 39 | padding: EdgeInsets.symmetric( horizontal: 30, vertical: 10), 40 | child: MouseRegion( 41 | onEnter: ( _ ) => setState( () => isHovered = true ), 42 | onExit: ( _ ) => setState( () => isHovered = false ), 43 | child: Row( 44 | crossAxisAlignment: CrossAxisAlignment.center, 45 | children: [ 46 | Icon( widget.icon, color: Colors.white.withOpacity(0.3)), 47 | SizedBox( width: 10 ), 48 | Text( 49 | widget.text, 50 | style: GoogleFonts.roboto( 51 | fontSize: 16, 52 | color: Colors.white.withOpacity(0.8) 53 | ), 54 | ) 55 | ], 56 | ), 57 | ), 58 | ), 59 | ), 60 | ), 61 | ); 62 | } 63 | } -------------------------------------------------------------------------------- /lib/ui/shared/widgets/navbar_avatar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class NavbarAvatar extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return ClipOval( 7 | child: Container( 8 | child: Image.network('https://dl.airtable.com/DH4ROlhgSVG6TpXY0xrI_large_Joel-Monegro-pic-458x458.jpg'), 9 | width: 30, 10 | height: 30, 11 | ), 12 | ); 13 | } 14 | } -------------------------------------------------------------------------------- /lib/ui/shared/widgets/notifications_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class NotificationsIndicator extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Container( 7 | child: Stack( 8 | children: [ 9 | Icon( Icons.notifications_none_outlined, color: Colors.grey ), 10 | Positioned( 11 | left: 2, 12 | child: Container( 13 | width: 5, 14 | height: 5, 15 | decoration: buildBoxDecoration(), 16 | ), 17 | ) 18 | ], 19 | ), 20 | ); 21 | } 22 | 23 | BoxDecoration buildBoxDecoration() => BoxDecoration( 24 | color: Colors.red, 25 | borderRadius: BorderRadius.circular(100) 26 | ); 27 | } -------------------------------------------------------------------------------- /lib/ui/shared/widgets/search_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:admin_dashboard/ui/inputs/custom_inputs.dart'; 4 | 5 | class SearchText extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Container( 9 | height: 40, 10 | decoration: buildBoxDecoration(), 11 | child: TextField( 12 | decoration: CustomInputs.searchInputDecoration( 13 | hint: 'Buscar', 14 | icon: Icons.search_outlined 15 | ), 16 | ), 17 | ); 18 | } 19 | 20 | BoxDecoration buildBoxDecoration() => BoxDecoration( 21 | borderRadius: BorderRadius.circular(10), 22 | color: Colors.grey.withOpacity(0.1) 23 | ); 24 | } -------------------------------------------------------------------------------- /lib/ui/shared/widgets/text_separator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | 4 | class TextSeparator extends StatelessWidget { 5 | 6 | final String text; 7 | 8 | const TextSeparator({ 9 | Key? key, 10 | required this.text 11 | }) : super(key: key); 12 | 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Container( 17 | padding: EdgeInsets.symmetric( horizontal: 20 ), 18 | margin: EdgeInsets.only( bottom: 5 ), 19 | child: Text( 20 | text, 21 | style: GoogleFonts.roboto( 22 | color: Colors.white.withOpacity(0.3), 23 | fontSize: 12 24 | ), 25 | ), 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /lib/ui/views/blank_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:admin_dashboard/ui/labels/custom_labels.dart'; 4 | import 'package:admin_dashboard/ui/cards/white_card.dart'; 5 | 6 | class BlankView extends StatelessWidget { 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10 ), 12 | child: ListView( 13 | physics: ClampingScrollPhysics(), 14 | children: [ 15 | Text('Blank View', style: CustomLabels.h1 ), 16 | 17 | SizedBox( height: 10 ), 18 | 19 | WhiteCard( 20 | title: 'Blank Page', 21 | child: Text('Hola Mundo!!') 22 | ) 23 | 24 | ], 25 | ), 26 | ); 27 | } 28 | } -------------------------------------------------------------------------------- /lib/ui/views/categories_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/ui/modals/category_modal.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:provider/provider.dart'; 4 | 5 | 6 | import 'package:admin_dashboard/datatables/categories_datasource.dart'; 7 | 8 | import 'package:admin_dashboard/providers/categories_provider.dart'; 9 | 10 | import 'package:admin_dashboard/ui/buttons/custom_icon_button.dart'; 11 | import 'package:admin_dashboard/ui/labels/custom_labels.dart'; 12 | 13 | 14 | class CategoriesView extends StatefulWidget { 15 | 16 | @override 17 | _CategoriesViewState createState() => _CategoriesViewState(); 18 | } 19 | 20 | class _CategoriesViewState extends State { 21 | 22 | int _rowsPerPage = PaginatedDataTable.defaultRowsPerPage; 23 | 24 | @override 25 | void initState() { 26 | super.initState(); 27 | 28 | Provider.of(context, listen: false).getCategories(); 29 | 30 | } 31 | 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | 36 | final categorias = Provider.of(context).categorias; 37 | 38 | return Container( 39 | padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10 ), 40 | child: ListView( 41 | physics: ClampingScrollPhysics(), 42 | children: [ 43 | Text('Categorías', style: CustomLabels.h1 ), 44 | 45 | SizedBox( height: 10 ), 46 | 47 | PaginatedDataTable( 48 | columns: [ 49 | DataColumn(label: Text('ID')), 50 | DataColumn(label: Text('Categoría')), 51 | DataColumn(label: Text('Creado por')), 52 | DataColumn(label: Text('Acciones')), 53 | ], 54 | source: CategoriesDTS( categorias, context ), 55 | header: Text('Categorías disponibles', maxLines: 2 ), 56 | onRowsPerPageChanged: ( value ) { 57 | setState(() { 58 | _rowsPerPage = value ?? 10; 59 | }); 60 | }, 61 | rowsPerPage: _rowsPerPage, 62 | actions: [ 63 | CustomIconButton( 64 | onPressed: () { 65 | showModalBottomSheet( 66 | backgroundColor: Colors.transparent, 67 | context: context, 68 | builder: ( _ ) => CategoryModal( categoria: null ) 69 | ); 70 | }, 71 | text: 'Crear', 72 | icon: Icons.add_outlined, 73 | ) 74 | ], 75 | ) 76 | 77 | ], 78 | ), 79 | ); 80 | } 81 | } -------------------------------------------------------------------------------- /lib/ui/views/dashboard_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | 4 | import 'package:admin_dashboard/ui/labels/custom_labels.dart'; 5 | import 'package:admin_dashboard/ui/cards/white_card.dart'; 6 | 7 | import 'package:admin_dashboard/providers/auth_provider.dart'; 8 | 9 | class DashboardView extends StatelessWidget { 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | 14 | final user = Provider.of(context).user!; 15 | 16 | return Container( 17 | padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10 ), 18 | child: ListView( 19 | physics: ClampingScrollPhysics(), 20 | children: [ 21 | Text('Dashboard View', style: CustomLabels.h1 ), 22 | 23 | SizedBox( height: 10 ), 24 | 25 | WhiteCard( 26 | title: user.nombre, 27 | child: Text( user.correo ) 28 | ) 29 | 30 | ], 31 | ), 32 | ); 33 | } 34 | } -------------------------------------------------------------------------------- /lib/ui/views/icons_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:admin_dashboard/ui/labels/custom_labels.dart'; 4 | import 'package:admin_dashboard/ui/cards/white_card.dart'; 5 | 6 | class IconsView extends StatelessWidget { 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10 ), 12 | child: ListView( 13 | physics: ClampingScrollPhysics(), 14 | children: [ 15 | Text('Icons', style: CustomLabels.h1 ), 16 | 17 | SizedBox( height: 10 ), 18 | 19 | Wrap( 20 | crossAxisAlignment: WrapCrossAlignment.start, 21 | direction: Axis.horizontal, 22 | children: [ 23 | 24 | WhiteCard( 25 | title: 'ac_unit_outlined', 26 | child: Center( child: Icon( Icons.ac_unit_outlined) ), 27 | width: 170 28 | ), 29 | 30 | WhiteCard( 31 | title: 'access_alarms_outlined', 32 | child: Center( child: Icon( Icons.access_alarms_outlined) ), 33 | width: 170 34 | ), 35 | 36 | WhiteCard( 37 | title: 'access_time_rounded', 38 | child: Center( child: Icon( Icons.access_time_rounded) ), 39 | width: 170 40 | ), 41 | 42 | WhiteCard( 43 | title: 'all_inbox_outlined', 44 | child: Center( child: Icon( Icons.all_inbox_outlined) ), 45 | width: 170 46 | ), 47 | 48 | WhiteCard( 49 | title: 'desktop_mac_sharp', 50 | child: Center( child: Icon( Icons.desktop_mac_sharp) ), 51 | width: 170 52 | ), 53 | 54 | WhiteCard( 55 | title: 'keyboard_tab_rounded', 56 | child: Center( child: Icon( Icons.keyboard_tab_rounded) ), 57 | width: 170 58 | ), 59 | 60 | WhiteCard( 61 | title: 'not_listed_location', 62 | child: Center( child: Icon( Icons.not_listed_location) ), 63 | width: 170 64 | ), 65 | 66 | ], 67 | ) 68 | 69 | 70 | ], 71 | ), 72 | ); 73 | } 74 | } -------------------------------------------------------------------------------- /lib/ui/views/login_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/providers/auth_provider.dart'; 2 | import 'package:admin_dashboard/providers/login_form_provider.dart'; 3 | import 'package:email_validator/email_validator.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | import 'package:admin_dashboard/router/router.dart'; 7 | 8 | import 'package:admin_dashboard/ui/inputs/custom_inputs.dart'; 9 | import 'package:admin_dashboard/ui/buttons/custom_outlined_button.dart'; 10 | import 'package:admin_dashboard/ui/buttons/link_text.dart'; 11 | import 'package:provider/provider.dart'; 12 | 13 | class LoginView extends StatelessWidget { 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | 18 | final authProvider = Provider.of(context); 19 | 20 | return ChangeNotifierProvider( 21 | create: ( _ ) => LoginFormProvider(), 22 | child: Builder(builder: ( context ){ 23 | 24 | final loginFormProvider = Provider.of(context, listen: false); 25 | 26 | 27 | return Container( 28 | margin: EdgeInsets.only(top: 100), 29 | padding: EdgeInsets.symmetric( horizontal: 20 ), 30 | child: Center( 31 | child: ConstrainedBox( 32 | constraints: BoxConstraints( maxWidth: 370 ), 33 | child: Form( 34 | autovalidateMode: AutovalidateMode.always, 35 | key: loginFormProvider.formKey, 36 | child: Column( 37 | children: [ 38 | 39 | // Email 40 | TextFormField( 41 | onFieldSubmitted: ( _ ) => onFormSubmit( loginFormProvider, authProvider ), 42 | validator: ( value ) { 43 | if( !EmailValidator.validate(value ?? '') ) return 'Email no válido'; 44 | 45 | return null; 46 | }, 47 | onChanged: ( value ) => loginFormProvider.email = value, 48 | style: TextStyle( color: Colors.white ), 49 | decoration: CustomInputs.loginInputDecoration( 50 | hint: 'Ingrese su correo', 51 | label: 'Email', 52 | icon: Icons.email_outlined 53 | ), 54 | ), 55 | 56 | SizedBox( height: 20 ), 57 | 58 | // Password 59 | TextFormField( 60 | onFieldSubmitted: ( _ ) => onFormSubmit( loginFormProvider, authProvider ), 61 | onChanged: ( value ) => loginFormProvider.password = value, 62 | validator: ( value ) { 63 | if ( value == null || value.isEmpty ) return 'Ingrese su contraseña'; 64 | if ( value.length < 6 ) return 'La contraseña debe de ser de 6 caracteres'; 65 | 66 | return null; // Válido 67 | }, 68 | obscureText: true, 69 | style: TextStyle( color: Colors.white ), 70 | decoration: CustomInputs.loginInputDecoration( 71 | hint: '*********', 72 | label: 'Contraseña', 73 | icon: Icons.lock_outline_rounded 74 | ), 75 | ), 76 | 77 | SizedBox( height: 20 ), 78 | CustomOutlinedButton( 79 | onPressed: () => onFormSubmit( loginFormProvider, authProvider ), 80 | text: 'Ingresar', 81 | ), 82 | 83 | 84 | SizedBox( height: 20 ), 85 | LinkText( 86 | text: 'Nueva cuenta', 87 | onPressed: () { 88 | Navigator.pushReplacementNamed( context, Flurorouter.registerRoute ); 89 | }, 90 | ) 91 | 92 | ], 93 | ) 94 | ), 95 | ), 96 | ), 97 | ); 98 | }) 99 | ); 100 | } 101 | 102 | void onFormSubmit(LoginFormProvider loginFormProvider, AuthProvider authProvider ) { 103 | final isValid = loginFormProvider.validateForm(); 104 | if ( isValid ) 105 | authProvider.login(loginFormProvider.email, loginFormProvider.password); 106 | } 107 | 108 | } -------------------------------------------------------------------------------- /lib/ui/views/no_page_found_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | 4 | class NoPageFoundView extends StatelessWidget { 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Container( 9 | child: Center( 10 | child: Text( 11 | '404 - Página no encontrada', 12 | style: GoogleFonts.montserratAlternates( 13 | fontSize: 50, 14 | fontWeight: FontWeight.bold 15 | ), 16 | ), 17 | ), 18 | ); 19 | } 20 | } -------------------------------------------------------------------------------- /lib/ui/views/register_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:provider/provider.dart'; 4 | 5 | import 'package:admin_dashboard/providers/auth_provider.dart'; 6 | import 'package:admin_dashboard/providers/register_form_provider.dart'; 7 | 8 | import 'package:email_validator/email_validator.dart'; 9 | 10 | import 'package:admin_dashboard/router/router.dart'; 11 | 12 | import 'package:admin_dashboard/ui/inputs/custom_inputs.dart'; 13 | import 'package:admin_dashboard/ui/buttons/custom_outlined_button.dart'; 14 | import 'package:admin_dashboard/ui/buttons/link_text.dart'; 15 | 16 | class RegisterView extends StatelessWidget { 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return ChangeNotifierProvider( 21 | create: ( _ ) => RegisterFormProvider(), 22 | child: Builder(builder: (context) { 23 | 24 | final registerFormProvider = Provider.of(context, listen: false); 25 | 26 | return Container( 27 | margin: EdgeInsets.only(top: 50), 28 | padding: EdgeInsets.symmetric( horizontal: 20 ), 29 | child: Center( 30 | child: ConstrainedBox( 31 | constraints: BoxConstraints( maxWidth: 370 ), 32 | child: Form( 33 | autovalidateMode: AutovalidateMode.always, 34 | key: registerFormProvider.formKey, 35 | child: Column( 36 | children: [ 37 | 38 | // Email 39 | TextFormField( 40 | onChanged: ( value ) => registerFormProvider.name = value, 41 | validator: ( value ) { 42 | if ( value == null || value.isEmpty ) return 'El nombre es obligatario'; 43 | return null; 44 | }, 45 | style: TextStyle( color: Colors.white ), 46 | decoration: CustomInputs.loginInputDecoration( 47 | hint: 'Ingrese su nombre', 48 | label: 'Nombre', 49 | icon: Icons.supervised_user_circle_sharp 50 | ), 51 | ), 52 | 53 | SizedBox( height: 20 ), 54 | 55 | // Email 56 | TextFormField( 57 | onChanged: ( value ) => registerFormProvider.email = value, 58 | validator: ( value ) { 59 | if( !EmailValidator.validate(value ?? '') ) return 'Email no válido'; 60 | return null; 61 | }, 62 | style: TextStyle( color: Colors.white ), 63 | decoration: CustomInputs.loginInputDecoration( 64 | hint: 'Ingrese su correo', 65 | label: 'Email', 66 | icon: Icons.email_outlined 67 | ), 68 | ), 69 | 70 | SizedBox( height: 20 ), 71 | 72 | // Password 73 | TextFormField( 74 | onChanged: ( value ) => registerFormProvider.password = value, 75 | validator: ( value ) { 76 | if ( value == null || value.isEmpty ) return 'Ingrese su contraseña'; 77 | if ( value.length < 6 ) return 'La contraseña debe de ser de 6 caracteres'; 78 | 79 | return null; // Válido 80 | }, 81 | obscureText: true, 82 | style: TextStyle( color: Colors.white ), 83 | decoration: CustomInputs.loginInputDecoration( 84 | hint: '*********', 85 | label: 'Contraseña', 86 | icon: Icons.lock_outline_rounded 87 | ), 88 | ), 89 | 90 | SizedBox( height: 20 ), 91 | CustomOutlinedButton( 92 | onPressed: () { 93 | 94 | final validForm = registerFormProvider.validateForm(); 95 | if ( !validForm ) return; 96 | 97 | final authProvider = Provider.of(context, listen: false); 98 | authProvider.register( 99 | registerFormProvider.email, 100 | registerFormProvider.password, 101 | registerFormProvider.name 102 | ); 103 | 104 | }, 105 | text: 'Crear cuenta', 106 | ), 107 | 108 | 109 | SizedBox( height: 20 ), 110 | LinkText( 111 | text: 'Ir al login', 112 | onPressed: () { 113 | Navigator.pushReplacementNamed(context, Flurorouter.loginRoute ); 114 | }, 115 | ) 116 | 117 | ], 118 | ) 119 | ), 120 | ), 121 | ), 122 | ); 123 | 124 | }), 125 | ); 126 | } 127 | 128 | 129 | } -------------------------------------------------------------------------------- /lib/ui/views/user_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:email_validator/email_validator.dart'; 4 | import 'package:file_picker/file_picker.dart'; 5 | 6 | import 'package:admin_dashboard/models/usuario.dart'; 7 | 8 | import 'package:admin_dashboard/providers/providers.dart'; 9 | 10 | 11 | import 'package:admin_dashboard/services/navigation_service.dart'; 12 | import 'package:admin_dashboard/services/notifications_service.dart'; 13 | 14 | import 'package:admin_dashboard/ui/inputs/custom_inputs.dart'; 15 | import 'package:admin_dashboard/ui/labels/custom_labels.dart'; 16 | import 'package:admin_dashboard/ui/cards/white_card.dart'; 17 | 18 | class UserView extends StatefulWidget { 19 | 20 | final String uid; 21 | 22 | const UserView({ 23 | Key? key, 24 | required this.uid 25 | }) : super(key: key); 26 | 27 | @override 28 | _UserViewState createState() => _UserViewState(); 29 | } 30 | 31 | class _UserViewState extends State { 32 | 33 | Usuario? user; 34 | 35 | 36 | @override 37 | void initState() { 38 | super.initState(); 39 | final usersProvider = Provider.of(context, listen: false); 40 | final userFormProvider = Provider.of(context, listen: false); 41 | 42 | usersProvider.getUserById(widget.uid) 43 | .then((userDB) { 44 | 45 | if ( userDB != null ) { 46 | userFormProvider.user = userDB; 47 | userFormProvider.formKey = new GlobalKey(); 48 | 49 | setState((){ this.user = userDB; }); 50 | } else { 51 | NavigationService.replaceTo('/dashboard/users'); 52 | } 53 | 54 | } 55 | ); 56 | 57 | } 58 | 59 | @override 60 | void dispose() { 61 | Provider.of(context, listen: false).user = null; 62 | super.dispose(); 63 | } 64 | 65 | 66 | 67 | @override 68 | Widget build(BuildContext context) { 69 | 70 | return Container( 71 | padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10 ), 72 | child: ListView( 73 | physics: ClampingScrollPhysics(), 74 | children: [ 75 | Text('User View', style: CustomLabels.h1 ), 76 | 77 | SizedBox( height: 10 ), 78 | 79 | if( user == null ) 80 | WhiteCard( 81 | child: Container( 82 | alignment: Alignment.center, 83 | height: 300, 84 | child: CircularProgressIndicator(), 85 | ) 86 | ), 87 | 88 | if( user != null ) 89 | _UserViewBody() 90 | 91 | ], 92 | ), 93 | ); 94 | } 95 | } 96 | 97 | class _UserViewBody extends StatelessWidget { 98 | 99 | @override 100 | Widget build(BuildContext context) { 101 | return Container( 102 | child: Table( 103 | columnWidths: { 104 | 0: FixedColumnWidth(250) 105 | }, 106 | 107 | children: [ 108 | TableRow( 109 | children: [ 110 | // AVATAR 111 | _AvatarContainer(), 112 | 113 | // Formulario de actualización 114 | _UserViewForm(), 115 | ] 116 | ) 117 | ], 118 | ), 119 | ); 120 | } 121 | } 122 | 123 | class _UserViewForm extends StatelessWidget { 124 | const _UserViewForm({ 125 | Key? key, 126 | }) : super(key: key); 127 | 128 | @override 129 | Widget build(BuildContext context) { 130 | 131 | final userFormProvider = Provider.of(context); 132 | final user = userFormProvider.user!; 133 | 134 | return WhiteCard( 135 | title: 'Información general', 136 | child: Form( 137 | key: userFormProvider.formKey, 138 | autovalidateMode: AutovalidateMode.always, 139 | child: Column( 140 | children: [ 141 | 142 | TextFormField( 143 | initialValue: user.nombre, 144 | decoration: CustomInputs.formInputDecoration( 145 | hint: 'Nombre del usuario', 146 | label: 'Nombre', 147 | icon: Icons.supervised_user_circle_outlined 148 | ), 149 | onChanged: ( value )=> userFormProvider.copyUserWith( nombre: value ), 150 | validator: ( value ) { 151 | if ( value == null || value.isEmpty ) return 'Ingrese un nombre.'; 152 | if ( value.length < 2 ) return 'El nombre debe de ser de dos letras como mínimo.'; 153 | return null; 154 | }, 155 | ), 156 | 157 | SizedBox( height: 20 ), 158 | 159 | TextFormField( 160 | initialValue: user.correo, 161 | decoration: CustomInputs.formInputDecoration( 162 | hint: 'Correo del usuario', 163 | label: 'Correo', 164 | icon: Icons.mark_email_read_outlined 165 | ), 166 | onChanged: ( value )=> userFormProvider.copyUserWith( correo: value ), 167 | validator: ( value ) { 168 | if( !EmailValidator.validate(value ?? '') ) return 'Email no válido'; 169 | 170 | return null; 171 | }, 172 | ), 173 | 174 | SizedBox( height: 20 ), 175 | 176 | ConstrainedBox( 177 | constraints: BoxConstraints( maxWidth: 100 ), 178 | child: ElevatedButton( 179 | onPressed: () async { 180 | 181 | final saved = await userFormProvider.updateUser(); 182 | if( saved ) { 183 | NotificationsService.showSnackbar('Usuario actualizado'); 184 | Provider.of(context, listen: false).refreshUser( user ); 185 | } else { 186 | NotificationsService.showSnackbarError('No se pudo guardar'); 187 | } 188 | 189 | 190 | }, 191 | style: ButtonStyle( 192 | backgroundColor: MaterialStateProperty.all( Colors.indigo ), 193 | shadowColor: MaterialStateProperty.all( Colors.transparent ), 194 | ), 195 | child: Row( 196 | children: [ 197 | Icon( Icons.save_outlined, size: 20 ), 198 | Text(' Guardar') 199 | ], 200 | ) 201 | ), 202 | ) 203 | 204 | ], 205 | ), 206 | ) 207 | ); 208 | } 209 | } 210 | 211 | 212 | 213 | 214 | class _AvatarContainer extends StatelessWidget { 215 | 216 | @override 217 | Widget build(BuildContext context) { 218 | 219 | final userFormProvider = Provider.of(context); 220 | final user = userFormProvider.user!; 221 | 222 | final image = ( user.img == null ) 223 | ? Image(image: AssetImage('no-image.jpg') ) 224 | : FadeInImage.assetNetwork(placeholder: 'loader.gif', image: user.img! ); 225 | 226 | 227 | return WhiteCard( 228 | width: 250, 229 | child: Container( 230 | width: double.infinity, 231 | child: Column( 232 | mainAxisAlignment: MainAxisAlignment.center, 233 | crossAxisAlignment: CrossAxisAlignment.center, 234 | children: [ 235 | Text('Profile', style: CustomLabels.h2), 236 | SizedBox( height: 20 ), 237 | 238 | Container( 239 | width: 150, 240 | height: 160, 241 | child: Stack( 242 | children: [ 243 | 244 | ClipOval( 245 | child: image 246 | ), 247 | 248 | Positioned( 249 | bottom: 5, 250 | right: 5, 251 | child: Container( 252 | width: 45, 253 | height: 45, 254 | decoration: BoxDecoration( 255 | borderRadius: BorderRadius.circular(100), 256 | border: Border.all( color: Colors.white, width: 5 ) 257 | ), 258 | child: FloatingActionButton( 259 | backgroundColor: Colors.indigo, 260 | elevation: 0, 261 | child: Icon( Icons.camera_alt_outlined, size: 20,), 262 | onPressed: () async { 263 | 264 | FilePickerResult? result = await FilePicker.platform.pickFiles( 265 | allowedExtensions: ['jpg','jpeg','png'], 266 | allowMultiple: false 267 | ); 268 | 269 | if(result != null) { 270 | // PlatformFile file = result.files.first; 271 | NotificationsService.showBusyIndicator(context); 272 | 273 | final newUser = await userFormProvider.uploadImage('/uploads/usuarios/${ user.uid }', result.files.first.bytes! ); 274 | 275 | Provider.of(context, listen: false) 276 | .refreshUser(newUser); 277 | 278 | 279 | Navigator.of(context).pop(); 280 | 281 | } else { 282 | // User canceled the picker 283 | print('no hay imagen'); 284 | } 285 | 286 | }, 287 | ), 288 | ), 289 | ) 290 | 291 | ], 292 | ) 293 | ), 294 | 295 | SizedBox( height: 20 ), 296 | 297 | Text( 298 | user.nombre, 299 | style: TextStyle( fontWeight: FontWeight.bold ), 300 | textAlign: TextAlign.center, 301 | ) 302 | ], 303 | ), 304 | ) 305 | ); 306 | } 307 | } -------------------------------------------------------------------------------- /lib/ui/views/users_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:admin_dashboard/providers/users_provider.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'package:admin_dashboard/datatables/users_datasource.dart'; 5 | 6 | import 'package:admin_dashboard/ui/labels/custom_labels.dart'; 7 | import 'package:provider/provider.dart'; 8 | 9 | 10 | class UsersView extends StatelessWidget { 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | 15 | final usersProvider = Provider.of(context); 16 | 17 | 18 | final usersDataSource = new UsersDataSource( usersProvider.users ); 19 | 20 | return Container( 21 | padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10 ), 22 | child: ListView( 23 | physics: ClampingScrollPhysics(), 24 | children: [ 25 | Text('Users View', style: CustomLabels.h1 ), 26 | 27 | SizedBox( height: 10 ), 28 | 29 | PaginatedDataTable( 30 | sortAscending: usersProvider.ascending, 31 | sortColumnIndex: usersProvider.sortColumnIndex, 32 | columns: [ 33 | DataColumn(label: Text('Avatar')), 34 | DataColumn(label: Text('Nombre'), onSort: ( colIndex, _ ) { 35 | usersProvider.sortColumnIndex = colIndex; 36 | usersProvider.sort((user) => user.nombre); 37 | }), 38 | DataColumn(label: Text('Email'), onSort: ( colIndex, _ ) { 39 | usersProvider.sortColumnIndex = colIndex; 40 | usersProvider.sort((user) => user.correo); 41 | }), 42 | DataColumn(label: Text('UID')), 43 | DataColumn(label: Text('Acciones')), 44 | ], 45 | source: usersDataSource, 46 | onPageChanged: ( page ) { 47 | print('page: $page'); 48 | }, 49 | ) 50 | 51 | ], 52 | ), 53 | ); 54 | } 55 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.5.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.2.0" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.15.0" 46 | crypto: 47 | dependency: transitive 48 | description: 49 | name: crypto 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "3.0.1" 53 | cupertino_icons: 54 | dependency: "direct main" 55 | description: 56 | name: cupertino_icons 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.0.2" 60 | dio: 61 | dependency: "direct main" 62 | description: 63 | name: dio 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "4.0.0" 67 | email_validator: 68 | dependency: "direct main" 69 | description: 70 | name: email_validator 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "2.0.1" 74 | fake_async: 75 | dependency: transitive 76 | description: 77 | name: fake_async 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.2.0" 81 | ffi: 82 | dependency: transitive 83 | description: 84 | name: ffi 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "1.0.0" 88 | file: 89 | dependency: transitive 90 | description: 91 | name: file 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "6.1.0" 95 | file_picker: 96 | dependency: "direct main" 97 | description: 98 | name: file_picker 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "3.0.1" 102 | fluro: 103 | dependency: "direct main" 104 | description: 105 | name: fluro 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "2.0.3" 109 | flutter: 110 | dependency: "direct main" 111 | description: flutter 112 | source: sdk 113 | version: "0.0.0" 114 | flutter_plugin_android_lifecycle: 115 | dependency: transitive 116 | description: 117 | name: flutter_plugin_android_lifecycle 118 | url: "https://pub.dartlang.org" 119 | source: hosted 120 | version: "2.0.2" 121 | flutter_test: 122 | dependency: "direct dev" 123 | description: flutter 124 | source: sdk 125 | version: "0.0.0" 126 | flutter_web_plugins: 127 | dependency: transitive 128 | description: flutter 129 | source: sdk 130 | version: "0.0.0" 131 | google_fonts: 132 | dependency: "direct main" 133 | description: 134 | name: google_fonts 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "2.0.0" 138 | http: 139 | dependency: transitive 140 | description: 141 | name: http 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "0.13.1" 145 | http_parser: 146 | dependency: transitive 147 | description: 148 | name: http_parser 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "4.0.0" 152 | js: 153 | dependency: transitive 154 | description: 155 | name: js 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "0.6.3" 159 | matcher: 160 | dependency: transitive 161 | description: 162 | name: matcher 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "0.12.10" 166 | meta: 167 | dependency: transitive 168 | description: 169 | name: meta 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.3.0" 173 | nested: 174 | dependency: transitive 175 | description: 176 | name: nested 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "1.0.0" 180 | path: 181 | dependency: transitive 182 | description: 183 | name: path 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "1.8.0" 187 | path_provider: 188 | dependency: transitive 189 | description: 190 | name: path_provider 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "2.0.1" 194 | path_provider_linux: 195 | dependency: transitive 196 | description: 197 | name: path_provider_linux 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "2.0.0" 201 | path_provider_macos: 202 | dependency: transitive 203 | description: 204 | name: path_provider_macos 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "2.0.0" 208 | path_provider_platform_interface: 209 | dependency: transitive 210 | description: 211 | name: path_provider_platform_interface 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "2.0.1" 215 | path_provider_windows: 216 | dependency: transitive 217 | description: 218 | name: path_provider_windows 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "2.0.1" 222 | pedantic: 223 | dependency: transitive 224 | description: 225 | name: pedantic 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "1.11.0" 229 | platform: 230 | dependency: transitive 231 | description: 232 | name: platform 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "3.0.0" 236 | plugin_platform_interface: 237 | dependency: transitive 238 | description: 239 | name: plugin_platform_interface 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "2.0.0" 243 | process: 244 | dependency: transitive 245 | description: 246 | name: process 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "4.2.1" 250 | provider: 251 | dependency: "direct main" 252 | description: 253 | name: provider 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "5.0.0" 257 | shared_preferences: 258 | dependency: "direct main" 259 | description: 260 | name: shared_preferences 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "2.0.5" 264 | shared_preferences_linux: 265 | dependency: transitive 266 | description: 267 | name: shared_preferences_linux 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "2.0.0" 271 | shared_preferences_macos: 272 | dependency: transitive 273 | description: 274 | name: shared_preferences_macos 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "2.0.0" 278 | shared_preferences_platform_interface: 279 | dependency: transitive 280 | description: 281 | name: shared_preferences_platform_interface 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "2.0.0" 285 | shared_preferences_web: 286 | dependency: transitive 287 | description: 288 | name: shared_preferences_web 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "2.0.0" 292 | shared_preferences_windows: 293 | dependency: transitive 294 | description: 295 | name: shared_preferences_windows 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "2.0.0" 299 | sky_engine: 300 | dependency: transitive 301 | description: flutter 302 | source: sdk 303 | version: "0.0.99" 304 | source_span: 305 | dependency: transitive 306 | description: 307 | name: source_span 308 | url: "https://pub.dartlang.org" 309 | source: hosted 310 | version: "1.8.0" 311 | stack_trace: 312 | dependency: transitive 313 | description: 314 | name: stack_trace 315 | url: "https://pub.dartlang.org" 316 | source: hosted 317 | version: "1.10.0" 318 | stream_channel: 319 | dependency: transitive 320 | description: 321 | name: stream_channel 322 | url: "https://pub.dartlang.org" 323 | source: hosted 324 | version: "2.1.0" 325 | string_scanner: 326 | dependency: transitive 327 | description: 328 | name: string_scanner 329 | url: "https://pub.dartlang.org" 330 | source: hosted 331 | version: "1.1.0" 332 | term_glyph: 333 | dependency: transitive 334 | description: 335 | name: term_glyph 336 | url: "https://pub.dartlang.org" 337 | source: hosted 338 | version: "1.2.0" 339 | test_api: 340 | dependency: transitive 341 | description: 342 | name: test_api 343 | url: "https://pub.dartlang.org" 344 | source: hosted 345 | version: "0.2.19" 346 | typed_data: 347 | dependency: transitive 348 | description: 349 | name: typed_data 350 | url: "https://pub.dartlang.org" 351 | source: hosted 352 | version: "1.3.0" 353 | vector_math: 354 | dependency: transitive 355 | description: 356 | name: vector_math 357 | url: "https://pub.dartlang.org" 358 | source: hosted 359 | version: "2.1.0" 360 | win32: 361 | dependency: transitive 362 | description: 363 | name: win32 364 | url: "https://pub.dartlang.org" 365 | source: hosted 366 | version: "2.0.5" 367 | xdg_directories: 368 | dependency: transitive 369 | description: 370 | name: xdg_directories 371 | url: "https://pub.dartlang.org" 372 | source: hosted 373 | version: "0.2.0" 374 | sdks: 375 | dart: ">=2.12.0 <3.0.0" 376 | flutter: ">=1.20.0" 377 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: admin_dashboard 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.12.0 <3.0.0" 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | cupertino_icons: ^1.0.2 27 | dio: ^4.0.0 28 | email_validator: ^2.0.1 29 | file_picker: ^3.0.1 30 | fluro: ^2.0.3 31 | google_fonts: ^2.0.0 32 | provider: ^5.0.0 33 | shared_preferences: ^2.0.5 34 | 35 | dev_dependencies: 36 | flutter_test: 37 | sdk: flutter 38 | 39 | # For information on the generic Dart part of this file, see the 40 | # following page: https://dart.dev/tools/pub/pubspec 41 | # The following section is specific to Flutter. 42 | flutter: 43 | 44 | # The following line ensures that the Material Icons font is 45 | # included with your application, so that you can use the icons in 46 | # the material Icons class. 47 | uses-material-design: true 48 | # To add assets to your application, add an assets section, like this: 49 | assets: 50 | - assets/ 51 | # - images/a_dot_ham.jpeg 52 | # An image asset can refer to one or more resolution-specific "variants", see 53 | # https://flutter.dev/assets-and-images/#resolution-aware. 54 | # For details regarding adding assets from package dependencies, see 55 | # https://flutter.dev/assets-and-images/#from-packages 56 | # To add custom fonts to your application, add a fonts section here, 57 | # in this "flutter" section. Each entry in this list should have a 58 | # "family" key with the font family name, and a "fonts" key with a 59 | # list giving the asset and other descriptors for the font. For 60 | # example: 61 | # fonts: 62 | # - family: Schyler 63 | # fonts: 64 | # - asset: fonts/Schyler-Regular.ttf 65 | # - asset: fonts/Schyler-Italic.ttf 66 | # style: italic 67 | # - family: Trajan Pro 68 | # fonts: 69 | # - asset: fonts/TrajanPro.ttf 70 | # - asset: fonts/TrajanPro_Bold.ttf 71 | # weight: 700 72 | # 73 | # For details regarding fonts from package dependencies, 74 | # see https://flutter.dev/custom-fonts/#from-packages 75 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:admin_dashboard/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/fl-web-admin-dashboard/6079b1cb64fb0d6a16547337574a0269c40393fc/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | admin_dashboard 30 | 31 | 32 | 33 | 36 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "admin_dashboard", 3 | "short_name": "admin_dashboard", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | --------------------------------------------------------------------------------