Skip to content

Commit 47dc1d1

Browse files
authored
Merge pull request #15 from anshumandas/revert-13-main
Revert "Bugs, ToDo 13.3"
2 parents aa7f6fa + 170bedb commit 47dc1d1

19 files changed

+13
-834
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Step 5: Add Guest User/Anonymous login with a Cart and Checkout use case [https:
4242

4343
* delete unlinked anonymous user post logout
4444

45-
Step 6: Add ImagePicker and Firebase Storage for profile image (Done)
45+
Step 6: Add ImagePicker and Firebase Storage for profile image
4646

4747
* Create PopupMenu button for web [https://api.flutter.dev/flutter/material/PopupMenuButton-class.html]
4848
* BottomSheet for phones and single file button for desktops

devtools_options.yaml

-3
This file was deleted.

ios/Flutter/Generated.xcconfig

-14
This file was deleted.

ios/Flutter/flutter_export_environment.sh

-13
This file was deleted.

ios/Runner/GeneratedPluginRegistrant.h

-19
This file was deleted.

ios/Runner/GeneratedPluginRegistrant.m

-91
This file was deleted.

lib/app/modules/dashboard/controllers/dashboard_controller.dart

-5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,4 @@ class DashboardController extends GetxController {
1414
},
1515
);
1616
}
17-
var isSearchBarVisible = true.obs;
18-
void toggleSearchBarVisibility() {
19-
isSearchBarVisible.value = !isSearchBarVisible.value;
20-
}
21-
// Observable state for current time (example)
2217
}
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,6 @@
1-
// import 'package:flutter/material.dart';
2-
// import 'package:get/get.dart';
3-
//
4-
// import '../controllers/dashboard_controller.dart';
5-
//
6-
// class DashboardView extends GetView<DashboardController> {
7-
// const DashboardView({super.key});
8-
//
9-
// @override
10-
// Widget build(BuildContext context) {
11-
// return Scaffold(
12-
// body: Center(
13-
// child: Obx(
14-
// () => Column(
15-
// mainAxisSize: MainAxisSize.min,
16-
// children: [
17-
// const Text(
18-
// 'DashboardView is working',
19-
// style: TextStyle(fontSize: 20),
20-
// ),
21-
// Text('Time: ${controller.now.value.toString()}'),
22-
// ],
23-
// ),
24-
// ),
25-
// ),
26-
// );
27-
// }
28-
// }
291
import 'package:flutter/material.dart';
302
import 'package:get/get.dart';
31-
import 'package:firebase_remote_config/firebase_remote_config.dart';
323

33-
import '../../../../services/remote_config.dart';
344
import '../controllers/dashboard_controller.dart';
355

366
class DashboardView extends GetView<DashboardController> {
@@ -39,105 +9,20 @@ class DashboardView extends GetView<DashboardController> {
399
@override
4010
Widget build(BuildContext context) {
4111
return Scaffold(
42-
appBar: AppBar(
43-
title: const Text('Dashboard'),
44-
centerTitle: true,
45-
actions: [
46-
GetBuilder<DashboardController>(
47-
builder: (controller) {
48-
return FutureBuilder<bool>(
49-
future: RemoteConfig.instance.then((config) => config.showSearchBarOnTop()),
50-
builder: (context, snapshot) {
51-
if (snapshot.connectionState == ConnectionState.waiting) {
52-
return const Center(child: CircularProgressIndicator());
53-
} else if (snapshot.hasError || !snapshot.data!) {
54-
return const SizedBox.shrink();
55-
} else {
56-
return GetPlatform.isMobile
57-
? PopupMenuButton<String>(
58-
onSelected: (value) {
59-
if (value == 'toggleSearchBar') {
60-
controller.toggleSearchBarVisibility();
61-
}
62-
},
63-
itemBuilder: (BuildContext context) {
64-
return [
65-
PopupMenuItem<String>(
66-
value: 'toggleSearchBar',
67-
child: Row(
68-
children: [
69-
const Icon(Icons.search),
70-
const SizedBox(width: 8),
71-
const Text('Toggle Search Bar'),
72-
],
73-
),
74-
),
75-
];
76-
},
77-
)
78-
: const SizedBox.shrink();
79-
}
80-
},
81-
);
82-
},
12+
body: Center(
13+
child: Obx(
14+
() => Column(
15+
mainAxisSize: MainAxisSize.min,
16+
children: [
17+
const Text(
18+
'DashboardView is working',
19+
style: TextStyle(fontSize: 20),
20+
),
21+
Text('Time: ${controller.now.value.toString()}'),
22+
],
8323
),
84-
],
85-
),
86-
body: Obx(
87-
() {
88-
// Use the controller's state for search bar visibility
89-
bool isSearchBarVisible = controller.isSearchBarVisible.value;
90-
91-
return FutureBuilder<bool>(
92-
future: RemoteConfig.instance.then((config) => config.showSearchBarOnTop()),
93-
builder: (context, snapshot) {
94-
if (snapshot.connectionState == ConnectionState.waiting) {
95-
return const Center(child: CircularProgressIndicator());
96-
} else if (snapshot.hasError) {
97-
return Center(child: Text('Error: ${snapshot.error}'));
98-
} else {
99-
return Column(
100-
mainAxisSize: MainAxisSize.min,
101-
children: [
102-
if (isSearchBarVisible)
103-
Padding(
104-
padding: const EdgeInsets.all(8.0),
105-
child: _buildSearchBar(),
106-
),
107-
Expanded(
108-
child: Center(
109-
child: Column(
110-
mainAxisSize: MainAxisSize.min,
111-
children: [
112-
const Text(
113-
'DashboardView is working',
114-
style: TextStyle(fontSize: 20),
115-
),
116-
Text('Time: ${controller.now.value.toString()}'),
117-
],
118-
),
119-
),
120-
),
121-
],
122-
);
123-
}
124-
},
125-
);
126-
},
127-
),
128-
);
129-
}
130-
131-
Widget _buildSearchBar() {
132-
return TextField(
133-
decoration: InputDecoration(
134-
hintText: 'Search...',
135-
border: OutlineInputBorder(
136-
borderRadius: BorderRadius.circular(10.0),
13724
),
138-
prefixIcon: Icon(Icons.search),
13925
),
14026
);
14127
}
14228
}
143-
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,11 @@
1-
// // import 'package:get/get.dart';
2-
// //
3-
// // import '../../../../services/auth_service.dart';
4-
// //
5-
// // class LoginController extends GetxController {
6-
// // static AuthService get to => Get.find();
7-
// //
8-
// // final Rx<bool> showReverificationButton = Rx(false);
9-
// //
10-
// // bool get isRobot => AuthService.to.robot.value == true;
11-
// //
12-
// // set robot(bool v) => AuthService.to.robot.value = v;
13-
// //
14-
// // bool get isLoggedIn => AuthService.to.isLoggedInValue;
15-
// //
16-
// // bool get isAnon => AuthService.to.isAnon;
17-
// //
18-
// // bool get isRegistered =>
19-
// // AuthService.to.registered.value || AuthService.to.isEmailVerified;
20-
// // // }
21-
// import 'package:firebase_auth/firebase_auth.dart' as fba;
22-
// import 'package:get/get.dart';
23-
// import '../../../../services/auth_service.dart';
24-
//
25-
// class LoginController extends GetxController {
26-
// static AuthService get to => Get.find();
27-
//
28-
// final Rx<bool> showReverificationButton = Rx(false);
29-
// final Rx<String> verificationId = ''.obs;
30-
// final Rxn<fba.EmailAuthCredential> credential = Rxn<fba.EmailAuthCredential>();
31-
// final Rx<bool> isPhoneVerified = false.obs;
32-
//
33-
// bool get isRobot => AuthService.to.robot.value == true;
34-
//
35-
// set robot(bool v) => AuthService.to.robot.value = v;
36-
//
37-
// bool get isLoggedIn => AuthService.to.isLoggedInValue;
38-
//
39-
// bool get isAnon => AuthService.to.isAnon;
40-
//
41-
// bool get isRegistered => AuthService.to.registered.value || AuthService.to.isEmailVerified;
42-
//
43-
// }
44-
import 'package:firebase_auth/firebase_auth.dart' as fba;
45-
import 'package:firebase_auth/firebase_auth.dart';
461
import 'package:get/get.dart';
2+
473
import '../../../../services/auth_service.dart';
484

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

528
final Rx<bool> showReverificationButton = Rx(false);
53-
final Rx<String> verificationId = ''.obs;
54-
final Rxn<fba.EmailAuthCredential> credential =
55-
Rxn<fba.EmailAuthCredential>();
56-
final Rx<bool> isPhoneVerified = false.obs; // New observable
579

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

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

6618
bool get isRegistered =>
6719
AuthService.to.registered.value || AuthService.to.isEmailVerified;
68-
6920
}

0 commit comments

Comments
 (0)