From 9ff86146eb67daf623418279df4fd68dfb501528 Mon Sep 17 00:00:00 2001 From: Jaydev Date: Fri, 30 Aug 2024 23:53:25 +0530 Subject: [PATCH 1/2] Add missing files --- .firebaserc | 5 + .metadata | 10 +- .../example/get_flutter_fire/MainActivity.kt | 5 + firebase.json | 26 ++++++ ios/Flutter/Generated.xcconfig | 14 +++ ios/Flutter/flutter_export_environment.sh | 13 +++ ios/Runner/GeneratedPluginRegistrant.h | 19 ++++ ios/Runner/GeneratedPluginRegistrant.m | 91 +++++++++++++++++++ .../cart/controllers/cart_controller.dart | 12 --- .../controllers/categories_controller.dart | 12 --- .../controllers/checkout_controller.dart | 12 --- lib/app/modules/home/views/home_view.dart | 2 +- .../controllers/my_products_controller.dart | 12 --- .../modules/profile/views/profile_view.dart | 6 +- .../controllers/settings_controller.dart | 8 -- .../controllers/task_details_controller.dart | 12 --- .../tasks/controllers/tasks_controller.dart | 12 --- .../users/controllers/users_controller.dart | 12 --- .../ephemeral/Flutter-Generated.xcconfig | 11 +++ .../ephemeral/flutter_export_environment.sh | 12 +++ pubspec.lock | 36 ++++---- pubspec.yaml | 4 +- 22 files changed, 224 insertions(+), 122 deletions(-) create mode 100644 .firebaserc create mode 100644 android/app/src/main/kotlin/com/example/get_flutter_fire/MainActivity.kt create mode 100644 firebase.json create mode 100644 ios/Flutter/Generated.xcconfig create mode 100644 ios/Flutter/flutter_export_environment.sh create mode 100644 ios/Runner/GeneratedPluginRegistrant.h create mode 100644 ios/Runner/GeneratedPluginRegistrant.m create mode 100644 macos/Flutter/ephemeral/Flutter-Generated.xcconfig create mode 100644 macos/Flutter/ephemeral/flutter_export_environment.sh diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 00000000..0bde4c2e --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "my-get-flutter-fire-copy" + } +} diff --git a/.metadata b/.metadata index 784ce129..02e9c7bf 100644 --- a/.metadata +++ b/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3" + revision: "80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819" channel: "stable" project_type: app @@ -13,11 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 - base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 + base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 - platform: web - create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 - base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 + base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 # User provided section diff --git a/android/app/src/main/kotlin/com/example/get_flutter_fire/MainActivity.kt b/android/app/src/main/kotlin/com/example/get_flutter_fire/MainActivity.kt new file mode 100644 index 00000000..018e286b --- /dev/null +++ b/android/app/src/main/kotlin/com/example/get_flutter_fire/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.get_flutter_fire + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/firebase.json b/firebase.json new file mode 100644 index 00000000..b33265d0 --- /dev/null +++ b/firebase.json @@ -0,0 +1,26 @@ +{ + "flutter": { + "platforms": { + "dart": { + "lib/firebase_options.dart": { + "projectId": "my-get-flutter-fire-copy", + "configurations": { + "android": "1:590917401999:android:40731735b1ab7004d35ffa", + "ios": "1:590917401999:ios:0e6a97ed0c288b9fd35ffa", + "macos": "1:590917401999:ios:58be1a0f40c90751d35ffa", + "web": "1:590917401999:web:324d850113549676d35ffa" + } + } + } + } + }, + "emulators": { + "singleProjectMode": true, + "auth": { + "port": 9099 + }, + "ui": { + "enabled": true + } + } +} diff --git a/ios/Flutter/Generated.xcconfig b/ios/Flutter/Generated.xcconfig new file mode 100644 index 00000000..97a54c2c --- /dev/null +++ b/ios/Flutter/Generated.xcconfig @@ -0,0 +1,14 @@ +// This is a generated file; do not edit or check into version control. +FLUTTER_ROOT=C:\Users\jdhan\flutter\flutter +FLUTTER_APPLICATION_PATH=C:\Users\jdhan\OneDrive\Documents\GitHub\get_flutter_fire +COCOAPODS_PARALLEL_CODE_SIGN=true +FLUTTER_TARGET=lib\main.dart +FLUTTER_BUILD_DIR=build +FLUTTER_BUILD_NAME=1.0.0 +FLUTTER_BUILD_NUMBER=1 +EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 +EXCLUDED_ARCHS[sdk=iphoneos*]=armv7 +DART_OBFUSCATION=false +TRACK_WIDGET_CREATION=true +TREE_SHAKE_ICONS=false +PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh new file mode 100644 index 00000000..07048d76 --- /dev/null +++ b/ios/Flutter/flutter_export_environment.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=C:\Users\jdhan\flutter\flutter" +export "FLUTTER_APPLICATION_PATH=C:\Users\jdhan\OneDrive\Documents\GitHub\get_flutter_fire" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_TARGET=lib\main.dart" +export "FLUTTER_BUILD_DIR=build" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=true" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/ios/Runner/GeneratedPluginRegistrant.h b/ios/Runner/GeneratedPluginRegistrant.h new file mode 100644 index 00000000..7a890927 --- /dev/null +++ b/ios/Runner/GeneratedPluginRegistrant.h @@ -0,0 +1,19 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GeneratedPluginRegistrant_h +#define GeneratedPluginRegistrant_h + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface GeneratedPluginRegistrant : NSObject ++ (void)registerWithRegistry:(NSObject*)registry; +@end + +NS_ASSUME_NONNULL_END +#endif /* GeneratedPluginRegistrant_h */ diff --git a/ios/Runner/GeneratedPluginRegistrant.m b/ios/Runner/GeneratedPluginRegistrant.m new file mode 100644 index 00000000..11a184c0 --- /dev/null +++ b/ios/Runner/GeneratedPluginRegistrant.m @@ -0,0 +1,91 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#import "GeneratedPluginRegistrant.h" + +#if __has_include() +#import +#else +@import desktop_webview_auth; +#endif + +#if __has_include() +#import +#else +@import file_picker; +#endif + +#if __has_include() +#import +#else +@import firebase_analytics; +#endif + +#if __has_include() +#import +#else +@import firebase_auth; +#endif + +#if __has_include() +#import +#else +@import firebase_core; +#endif + +#if __has_include() +#import +#else +@import firebase_dynamic_links; +#endif + +#if __has_include() +#import +#else +@import firebase_remote_config; +#endif + +#if __has_include() +#import +#else +@import firebase_storage; +#endif + +#if __has_include() +#import +#else +@import google_sign_in_ios; +#endif + +#if __has_include() +#import +#else +@import image_picker_ios; +#endif + +#if __has_include() +#import +#else +@import path_provider_foundation; +#endif + +@implementation GeneratedPluginRegistrant + ++ (void)registerWithRegistry:(NSObject*)registry { + [DesktopWebviewAuthPlugin registerWithRegistrar:[registry registrarForPlugin:@"DesktopWebviewAuthPlugin"]]; + [FilePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FilePickerPlugin"]]; + [FLTFirebaseAnalyticsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAnalyticsPlugin"]]; + [FLTFirebaseAuthPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAuthPlugin"]]; + [FLTFirebaseCorePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseCorePlugin"]]; + [FLTFirebaseDynamicLinksPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseDynamicLinksPlugin"]]; + [FLTFirebaseRemoteConfigPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseRemoteConfigPlugin"]]; + [FLTFirebaseStoragePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseStoragePlugin"]]; + [FLTGoogleSignInPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTGoogleSignInPlugin"]]; + [FLTImagePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTImagePickerPlugin"]]; + [PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]]; +} + +@end diff --git a/lib/app/modules/cart/controllers/cart_controller.dart b/lib/app/modules/cart/controllers/cart_controller.dart index c938ec4c..e47bca63 100644 --- a/lib/app/modules/cart/controllers/cart_controller.dart +++ b/lib/app/modules/cart/controllers/cart_controller.dart @@ -4,20 +4,8 @@ class CartController extends GetxController { //TODO: Implement CartController final count = 0.obs; - @override - void onInit() { - super.onInit(); - } - @override - void onReady() { - super.onReady(); - } - @override - void onClose() { - super.onClose(); - } void increment() => count.value++; } diff --git a/lib/app/modules/categories/controllers/categories_controller.dart b/lib/app/modules/categories/controllers/categories_controller.dart index 6612e511..b0379d96 100644 --- a/lib/app/modules/categories/controllers/categories_controller.dart +++ b/lib/app/modules/categories/controllers/categories_controller.dart @@ -4,20 +4,8 @@ class CategoriesController extends GetxController { //TODO: Implement CategoriesController final count = 0.obs; - @override - void onInit() { - super.onInit(); - } - @override - void onReady() { - super.onReady(); - } - @override - void onClose() { - super.onClose(); - } void increment() => count.value++; } diff --git a/lib/app/modules/checkout/controllers/checkout_controller.dart b/lib/app/modules/checkout/controllers/checkout_controller.dart index aa1265f6..40806f98 100644 --- a/lib/app/modules/checkout/controllers/checkout_controller.dart +++ b/lib/app/modules/checkout/controllers/checkout_controller.dart @@ -4,20 +4,8 @@ class CheckoutController extends GetxController { //TODO: Implement CheckoutController final count = 0.obs; - @override - void onInit() { - super.onInit(); - } - @override - void onReady() { - super.onReady(); - } - @override - void onClose() { - super.onClose(); - } void increment() => count.value++; } diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart index 0cfc040d..33c687e5 100644 --- a/lib/app/modules/home/views/home_view.dart +++ b/lib/app/modules/home/views/home_view.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import '../../../routes/app_pages.dart'; +import 'package:get_flutter_fire/app/routes/app_pages.dart'; import '../../../widgets/screen_widget.dart'; import '../controllers/home_controller.dart'; diff --git a/lib/app/modules/my_products/controllers/my_products_controller.dart b/lib/app/modules/my_products/controllers/my_products_controller.dart index 31696ea2..ab927480 100644 --- a/lib/app/modules/my_products/controllers/my_products_controller.dart +++ b/lib/app/modules/my_products/controllers/my_products_controller.dart @@ -4,20 +4,8 @@ class MyProductsController extends GetxController { //TODO: Implement MyProductsController final count = 0.obs; - @override - void onInit() { - super.onInit(); - } - @override - void onReady() { - super.onReady(); - } - @override - void onClose() { - super.onClose(); - } void increment() => count.value++; } diff --git a/lib/app/modules/profile/views/profile_view.dart b/lib/app/modules/profile/views/profile_view.dart index c26d11c1..bc5e3263 100644 --- a/lib/app/modules/profile/views/profile_view.dart +++ b/lib/app/modules/profile/views/profile_view.dart @@ -102,10 +102,8 @@ class ProfileView extends GetView { //Upload to Store String? dest = await controller.uploadFile(path); //attach it to User imageUrl - if (dest != null) { - await controller.updatePhotoURL(dest); - } - } + await controller.updatePhotoURL(dest!); + } }) ], ) diff --git a/lib/app/modules/settings/controllers/settings_controller.dart b/lib/app/modules/settings/controllers/settings_controller.dart index 265e54b1..f8e1f3c2 100644 --- a/lib/app/modules/settings/controllers/settings_controller.dart +++ b/lib/app/modules/settings/controllers/settings_controller.dart @@ -4,15 +4,7 @@ class SettingsController extends GetxController { //TODO: Implement SettingsController final count = 0.obs; - @override - void onInit() { - super.onInit(); - } - @override - void onReady() { - super.onReady(); - } @override void onClose() {} diff --git a/lib/app/modules/task_details/controllers/task_details_controller.dart b/lib/app/modules/task_details/controllers/task_details_controller.dart index e0a6a0d9..dfd1fefa 100644 --- a/lib/app/modules/task_details/controllers/task_details_controller.dart +++ b/lib/app/modules/task_details/controllers/task_details_controller.dart @@ -4,20 +4,8 @@ class TaskDetailsController extends GetxController { //TODO: Implement TaskDetailsController final count = 0.obs; - @override - void onInit() { - super.onInit(); - } - @override - void onReady() { - super.onReady(); - } - @override - void onClose() { - super.onClose(); - } void increment() => count.value++; } diff --git a/lib/app/modules/tasks/controllers/tasks_controller.dart b/lib/app/modules/tasks/controllers/tasks_controller.dart index 4d4196e4..08e175e5 100644 --- a/lib/app/modules/tasks/controllers/tasks_controller.dart +++ b/lib/app/modules/tasks/controllers/tasks_controller.dart @@ -4,20 +4,8 @@ class TasksController extends GetxController { //TODO: Implement TasksController final count = 0.obs; - @override - void onInit() { - super.onInit(); - } - @override - void onReady() { - super.onReady(); - } - @override - void onClose() { - super.onClose(); - } void increment() => count.value++; } diff --git a/lib/app/modules/users/controllers/users_controller.dart b/lib/app/modules/users/controllers/users_controller.dart index 871467c4..663dd341 100644 --- a/lib/app/modules/users/controllers/users_controller.dart +++ b/lib/app/modules/users/controllers/users_controller.dart @@ -4,20 +4,8 @@ class UsersController extends GetxController { //TODO: Implement UsersController final count = 0.obs; - @override - void onInit() { - super.onInit(); - } - @override - void onReady() { - super.onReady(); - } - @override - void onClose() { - super.onClose(); - } void increment() => count.value++; } diff --git a/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/macos/Flutter/ephemeral/Flutter-Generated.xcconfig new file mode 100644 index 00000000..3224d8eb --- /dev/null +++ b/macos/Flutter/ephemeral/Flutter-Generated.xcconfig @@ -0,0 +1,11 @@ +// This is a generated file; do not edit or check into version control. +FLUTTER_ROOT=C:\Users\jdhan\flutter\flutter +FLUTTER_APPLICATION_PATH=C:\Users\jdhan\OneDrive\Documents\GitHub\get_flutter_fire +COCOAPODS_PARALLEL_CODE_SIGN=true +FLUTTER_BUILD_DIR=build +FLUTTER_BUILD_NAME=1.0.0 +FLUTTER_BUILD_NUMBER=1 +DART_OBFUSCATION=false +TRACK_WIDGET_CREATION=true +TREE_SHAKE_ICONS=false +PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/macos/Flutter/ephemeral/flutter_export_environment.sh b/macos/Flutter/ephemeral/flutter_export_environment.sh new file mode 100644 index 00000000..e9798e3f --- /dev/null +++ b/macos/Flutter/ephemeral/flutter_export_environment.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=C:\Users\jdhan\flutter\flutter" +export "FLUTTER_APPLICATION_PATH=C:\Users\jdhan\OneDrive\Documents\GitHub\get_flutter_fire" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_BUILD_DIR=build" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=true" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/pubspec.lock b/pubspec.lock index 877fc75e..d103776c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -181,26 +181,26 @@ packages: dependency: "direct main" description: name: firebase_auth - sha256: f0a75f61992d036e4c46ad0e9febd364d98aa2c092690a5475cb1421a8243cfe + sha256: cfc2d970829202eca09e2896f0a5aa7c87302817ecc0bdfa954f026046bf10ba url: "https://pub.dev" source: hosted - version: "4.19.5" + version: "4.20.0" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: feb77258404309ffc7761c78e1c0ad2ed5e4fdc378e035619e2cc13be4397b62 + sha256: a0270e1db3b2098a14cb2a2342b3cd2e7e458e0c391b1f64f6f78b14296ec093 url: "https://pub.dev" source: hosted - version: "7.2.6" + version: "7.3.0" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: "6d527f357da2bf93a67a42b423aa92943104a0c290d1d72ad9a42c779d501cd2" + sha256: "64e067e763c6378b7e774e872f0f59f6812885e43020e25cde08f42e9459837b" url: "https://pub.dev" source: hosted - version: "5.11.5" + version: "5.12.0" firebase_core: dependency: "direct main" description: @@ -537,18 +537,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -577,18 +577,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mime: dependency: transitive description: @@ -734,10 +734,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" typed_data: dependency: transitive description: @@ -782,10 +782,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.4" web: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2909a374..fe460bd5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,9 +10,9 @@ dependencies: get: 4.6.6 flutter: sdk: flutter - firebase_core: ^2.31.0 + firebase_core: ^2.32.0 firebase_ui_auth: ^1.14.0 - firebase_auth: ^4.19.5 + firebase_auth: ^4.20.0 google_sign_in: ^6.2.1 firebase_ui_oauth_google: ^1.3.2 google_fonts: ^6.2.1 From 4545fd3b821cfe8dbeef01bc940bc71b54cf0ed3 Mon Sep 17 00:00:00 2001 From: Jaydev Date: Sat, 31 Aug 2024 00:15:24 +0530 Subject: [PATCH 2/2] tryed to add a dark mode for the hole app --- lib/main.dart | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 30c258f2..eb0f221d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,3 @@ -// ignore_for_file: inference_failure_on_instance_creation - import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -10,6 +8,9 @@ import 'firebase_options.dart'; import 'services/auth_service.dart'; void main() async { + + bool _isDarkMode = false; + WidgetsFlutterBinding.ensureInitialized(); await GetStorage.init(); await Firebase.initializeApp( @@ -36,9 +37,20 @@ void main() async { // PreventDuplicateHandlingMode.ReorderRoutes, // ), theme: ThemeData( + // ignore: dead_code + brightness: _isDarkMode ? Brightness.dark : Brightness.light, highlightColor: Colors.black.withOpacity(0.5), bottomSheetTheme: const BottomSheetThemeData(surfaceTintColor: Colors.blue)), ), ); + void toggleThemeMode() + { + _isDarkMode = !_isDarkMode; + }; + ElevatedButton( + onPressed: toggleThemeMode, + child: Text(_isDarkMode ? 'Light Mode' : 'Dark Mode'), + ); } +