Skip to content

Commit bb53107

Browse files
code refactoring
1 parent f5c697a commit bb53107

File tree

4 files changed

+117
-2
lines changed

4 files changed

+117
-2
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// // ignore_for_file: curly_braces_in_flow_control_structures
2+
// import 'package:cloud_firestore/cloud_firestore.dart';
3+
// import 'package:emart/common_widgets/loading_indicator.dart';
4+
// import 'package:emart/consts/consts.dart';
5+
// import 'package:emart/services/firestore_service.dart';
6+
7+
// class MessagesScreen extends StatelessWidget {
8+
// const MessagesScreen({super.key});
9+
10+
// @override
11+
// Widget build(BuildContext context) {
12+
// return Scaffold(
13+
// backgroundColor: whiteColor,
14+
// appBar: AppBar(
15+
// title:
16+
// "My Wishlist".text.color(darkFontGrey).fontFamily(semibold).make(),
17+
// ),
18+
// body: StreamBuilder(
19+
// stream: FirestoreService.getAllMessages(),
20+
// builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
21+
// if (!snapshot.hasData)
22+
// return loadingIndicator();
23+
// else if (snapshot.data!.docs.isEmpty)
24+
// return "No messages yet!".text.color(darkFontGrey).makeCentered();
25+
// else
26+
// return Container();
27+
// },
28+
// ),
29+
// );
30+
// }
31+
// }
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// // ignore_for_file: curly_braces_in_flow_control_structures
2+
// import 'package:cloud_firestore/cloud_firestore.dart';
3+
// import 'package:emart/common_widgets/loading_indicator.dart';
4+
// import 'package:emart/consts/consts.dart';
5+
// import 'package:emart/services/firestore_service.dart';
6+
7+
// class OrdersScreen extends StatelessWidget {
8+
// const OrdersScreen({super.key});
9+
10+
// @override
11+
// Widget build(BuildContext context) {
12+
// return Scaffold(
13+
// backgroundColor: whiteColor,
14+
// appBar: AppBar(
15+
// title: "My Order".text.color(darkFontGrey).fontFamily(semibold).make(),
16+
// ),
17+
// body: StreamBuilder(
18+
// stream: FirestoreService.getAllOrders(),
19+
// builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
20+
// if (!snapshot.hasData)
21+
// return loadingIndicator();
22+
// else if (snapshot.data!.docs.isEmpty)
23+
// return "No orders yet!".text.color(darkFontGrey).makeCentered();
24+
25+
// var data = snapshot.data!.docs;
26+
27+
// return ListView.builder(
28+
// itemCount: data.length,
29+
// itemBuilder: (BuildContext context, int index) => ListTile(
30+
// title: data[index]['order_code']
31+
// .toString()
32+
// .text
33+
// .color(redColor)
34+
// .fontFamily(semibold)
35+
// .make(),
36+
// subtitle: data[index]['total_amount']
37+
// .toString()
38+
// .numCurrency
39+
// .text
40+
// .fontFamily(bold)
41+
// .make(),
42+
// ),
43+
// );
44+
// },
45+
// ),
46+
// );
47+
// }
48+
// }

lib/views/profile_screen_view/profile_screen.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ class ProfileScreen extends StatelessWidget {
2626
if (!snapshot.hasData)
2727
return const Center(
2828
child: CircularProgressIndicator(
29-
valueColor: AlwaysStoppedAnimation(redColor)),
29+
valueColor: AlwaysStoppedAnimation(redColor),
30+
),
31+
);
32+
else if (snapshot.data!.docs.isEmpty)
33+
return Center(
34+
child: "No data".text.color(darkFontGrey).makeCentered(),
3035
);
3136
else {
3237
var data = snapshot.data!.docs[0];
@@ -41,7 +46,7 @@ class ProfileScreen extends StatelessWidget {
4146
child: Icon(Icons.edit, color: whiteColor))
4247
.onTap(() async {
4348
controller.nameController.text = data['name'];
44-
49+
4550
Get.to(() => EditProfileScreen(data: data));
4651
}),
4752
),
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// // ignore_for_file: curly_braces_in_flow_control_structures
2+
// import 'package:cloud_firestore/cloud_firestore.dart';
3+
// import 'package:emart/common_widgets/loading_indicator.dart';
4+
// import 'package:emart/consts/consts.dart';
5+
// import 'package:emart/services/firestore_service.dart';
6+
7+
// class WishlistScreen extends StatelessWidget {
8+
// const WishlistScreen({super.key});
9+
10+
// @override
11+
// Widget build(BuildContext context) {
12+
// return Scaffold(
13+
// backgroundColor: whiteColor,
14+
// appBar: AppBar(
15+
// title:
16+
// "My Wishlist".text.color(darkFontGrey).fontFamily(semibold).make(),
17+
// ),
18+
// body: StreamBuilder(
19+
// stream: FirestoreService.getWishlistItems(),
20+
// builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
21+
// if (!snapshot.hasData)
22+
// return loadingIndicator();
23+
// else if (snapshot.data!.docs.isEmpty)
24+
// return "No items yet!".text.color(darkFontGrey).makeCentered();
25+
// else
26+
// return Container();
27+
// },
28+
// ),
29+
// );
30+
// }
31+
// }

0 commit comments

Comments
 (0)