Skip to content

Bugs, ToDo 13.3 #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Step 5: Add Guest User/Anonymous login with a Cart and Checkout use case [https:

* delete unlinked anonymous user post logout

Step 6: Add ImagePicker and Firebase Storage for profile image
Step 6: Add ImagePicker and Firebase Storage for profile image (Done)

* Create PopupMenu button for web [https://api.flutter.dev/flutter/material/PopupMenuButton-class.html]
* BottomSheet for phones and single file button for desktops
Expand Down
3 changes: 3 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
14 changes: 14 additions & 0 deletions ios/Flutter/Generated.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\Users\Aastha Gadhvi\Downloads\flutter_windows_3.10.5-stable\flutter
FLUTTER_APPLICATION_PATH=C:\Users\Aastha Gadhvi\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
13 changes: 13 additions & 0 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\Users\Aastha Gadhvi\Downloads\flutter_windows_3.10.5-stable\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\Aastha Gadhvi\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"
19 changes: 19 additions & 0 deletions ios/Runner/GeneratedPluginRegistrant.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Generated file. Do not edit.
//

// clang-format off

#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h

#import <Flutter/Flutter.h>

NS_ASSUME_NONNULL_BEGIN

@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end

NS_ASSUME_NONNULL_END
#endif /* GeneratedPluginRegistrant_h */
91 changes: 91 additions & 0 deletions ios/Runner/GeneratedPluginRegistrant.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
//
// Generated file. Do not edit.
//

// clang-format off

#import "GeneratedPluginRegistrant.h"

#if __has_include(<desktop_webview_auth/DesktopWebviewAuthPlugin.h>)
#import <desktop_webview_auth/DesktopWebviewAuthPlugin.h>
#else
@import desktop_webview_auth;
#endif

#if __has_include(<file_picker/FilePickerPlugin.h>)
#import <file_picker/FilePickerPlugin.h>
#else
@import file_picker;
#endif

#if __has_include(<firebase_analytics/FLTFirebaseAnalyticsPlugin.h>)
#import <firebase_analytics/FLTFirebaseAnalyticsPlugin.h>
#else
@import firebase_analytics;
#endif

#if __has_include(<firebase_auth/FLTFirebaseAuthPlugin.h>)
#import <firebase_auth/FLTFirebaseAuthPlugin.h>
#else
@import firebase_auth;
#endif

#if __has_include(<firebase_core/FLTFirebaseCorePlugin.h>)
#import <firebase_core/FLTFirebaseCorePlugin.h>
#else
@import firebase_core;
#endif

#if __has_include(<firebase_dynamic_links/FLTFirebaseDynamicLinksPlugin.h>)
#import <firebase_dynamic_links/FLTFirebaseDynamicLinksPlugin.h>
#else
@import firebase_dynamic_links;
#endif

#if __has_include(<firebase_remote_config/FLTFirebaseRemoteConfigPlugin.h>)
#import <firebase_remote_config/FLTFirebaseRemoteConfigPlugin.h>
#else
@import firebase_remote_config;
#endif

#if __has_include(<firebase_storage/FLTFirebaseStoragePlugin.h>)
#import <firebase_storage/FLTFirebaseStoragePlugin.h>
#else
@import firebase_storage;
#endif

#if __has_include(<google_sign_in_ios/FLTGoogleSignInPlugin.h>)
#import <google_sign_in_ios/FLTGoogleSignInPlugin.h>
#else
@import google_sign_in_ios;
#endif

#if __has_include(<image_picker_ios/FLTImagePickerPlugin.h>)
#import <image_picker_ios/FLTImagePickerPlugin.h>
#else
@import image_picker_ios;
#endif

#if __has_include(<path_provider_foundation/PathProviderPlugin.h>)
#import <path_provider_foundation/PathProviderPlugin.h>
#else
@import path_provider_foundation;
#endif

@implementation GeneratedPluginRegistrant

+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)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
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ class DashboardController extends GetxController {
},
);
}
var isSearchBarVisible = true.obs;
void toggleSearchBarVisibility() {
isSearchBarVisible.value = !isSearchBarVisible.value;
}
// Observable state for current time (example)
}
137 changes: 126 additions & 11 deletions lib/app/modules/dashboard/views/dashboard_view.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
// import 'package:flutter/material.dart';
// import 'package:get/get.dart';
//
// import '../controllers/dashboard_controller.dart';
//
// class DashboardView extends GetView<DashboardController> {
// const DashboardView({super.key});
//
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// body: Center(
// child: Obx(
// () => Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// const Text(
// 'DashboardView is working',
// style: TextStyle(fontSize: 20),
// ),
// Text('Time: ${controller.now.value.toString()}'),
// ],
// ),
// ),
// ),
// );
// }
// }
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:firebase_remote_config/firebase_remote_config.dart';

import '../../../../services/remote_config.dart';
import '../controllers/dashboard_controller.dart';

class DashboardView extends GetView<DashboardController> {
Expand All @@ -9,20 +39,105 @@ class DashboardView extends GetView<DashboardController> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Obx(
() => Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
'DashboardView is working',
style: TextStyle(fontSize: 20),
),
Text('Time: ${controller.now.value.toString()}'),
],
appBar: AppBar(
title: const Text('Dashboard'),
centerTitle: true,
actions: [
GetBuilder<DashboardController>(
builder: (controller) {
return FutureBuilder<bool>(
future: RemoteConfig.instance.then((config) => config.showSearchBarOnTop()),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
} else if (snapshot.hasError || !snapshot.data!) {
return const SizedBox.shrink();
} else {
return GetPlatform.isMobile
? PopupMenuButton<String>(
onSelected: (value) {
if (value == 'toggleSearchBar') {
controller.toggleSearchBarVisibility();
}
},
itemBuilder: (BuildContext context) {
return [
PopupMenuItem<String>(
value: 'toggleSearchBar',
child: Row(
children: [
const Icon(Icons.search),
const SizedBox(width: 8),
const Text('Toggle Search Bar'),
],
),
),
];
},
)
: const SizedBox.shrink();
}
},
);
},
),
],
),
body: Obx(
() {
// Use the controller's state for search bar visibility
bool isSearchBarVisible = controller.isSearchBarVisible.value;

return FutureBuilder<bool>(
future: RemoteConfig.instance.then((config) => config.showSearchBarOnTop()),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
} else if (snapshot.hasError) {
return Center(child: Text('Error: ${snapshot.error}'));
} else {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
if (isSearchBarVisible)
Padding(
padding: const EdgeInsets.all(8.0),
child: _buildSearchBar(),
),
Expanded(
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
'DashboardView is working',
style: TextStyle(fontSize: 20),
),
Text('Time: ${controller.now.value.toString()}'),
],
),
),
),
],
);
}
},
);
},
),
);
}

Widget _buildSearchBar() {
return TextField(
decoration: InputDecoration(
hintText: 'Search...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
),
prefixIcon: Icon(Icons.search),
),
);
}
}

51 changes: 50 additions & 1 deletion lib/app/modules/login/controllers/login_controller.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,59 @@
// // import 'package:get/get.dart';
// //
// // import '../../../../services/auth_service.dart';
// //
// // class LoginController extends GetxController {
// // static AuthService get to => Get.find();
// //
// // final Rx<bool> showReverificationButton = Rx(false);
// //
// // bool get isRobot => AuthService.to.robot.value == true;
// //
// // set robot(bool v) => AuthService.to.robot.value = v;
// //
// // bool get isLoggedIn => AuthService.to.isLoggedInValue;
// //
// // bool get isAnon => AuthService.to.isAnon;
// //
// // bool get isRegistered =>
// // AuthService.to.registered.value || AuthService.to.isEmailVerified;
// // // }
// import 'package:firebase_auth/firebase_auth.dart' as fba;
// import 'package:get/get.dart';
// import '../../../../services/auth_service.dart';
//
// class LoginController extends GetxController {
// static AuthService get to => Get.find();
//
// final Rx<bool> showReverificationButton = Rx(false);
// final Rx<String> verificationId = ''.obs;
// final Rxn<fba.EmailAuthCredential> credential = Rxn<fba.EmailAuthCredential>();
// final Rx<bool> isPhoneVerified = false.obs;
//
// bool get isRobot => AuthService.to.robot.value == true;
//
// set robot(bool v) => AuthService.to.robot.value = v;
//
// bool get isLoggedIn => AuthService.to.isLoggedInValue;
//
// bool get isAnon => AuthService.to.isAnon;
//
// bool get isRegistered => AuthService.to.registered.value || AuthService.to.isEmailVerified;
//
// }
import 'package:firebase_auth/firebase_auth.dart' as fba;
import 'package:firebase_auth/firebase_auth.dart';
import 'package:get/get.dart';

import '../../../../services/auth_service.dart';

class LoginController extends GetxController {
static AuthService get to => Get.find();

final Rx<bool> showReverificationButton = Rx(false);
final Rx<String> verificationId = ''.obs;
final Rxn<fba.EmailAuthCredential> credential =
Rxn<fba.EmailAuthCredential>();
final Rx<bool> isPhoneVerified = false.obs; // New observable

bool get isRobot => AuthService.to.robot.value == true;

Expand All @@ -17,4 +65,5 @@ class LoginController extends GetxController {

bool get isRegistered =>
AuthService.to.registered.value || AuthService.to.isEmailVerified;

}
Loading