upodate for login system and app name, icon

This commit is contained in:
Mohamed Nouffer
2022-09-14 19:51:50 +05:30
parent b5932f2578
commit e0c33435ef
105 changed files with 325 additions and 146 deletions

View File

@ -1,11 +1,13 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart';
class DrawerPage extends StatelessWidget {
const DrawerPage({ Key? key }) : super(key: key);
DrawerPage({ Key? key }) : super(key: key);
final IndexController indexController = Get.find<IndexController>();
@override
Widget build(BuildContext context) {
@ -19,49 +21,86 @@ class DrawerPage extends StatelessWidget {
Container(
height: 100,
color: Colors.amber,
child: Obx(() =>
Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child:
indexController.currentUser.length == 0 ?
Flexible(child: Text("drawer_title".tr, style: TextStyle(color: Colors.black, fontSize: 20),))
:
Text(indexController.currentUser[0]['user']['email'], style: TextStyle(color: Colors.black, fontSize: 20),),
),
)
),
),
ListTile(
leading: const Icon(Icons.login),
title: Text("login".tr),
onTap: (){
Get.toNamed(AppPages.LANDING);
},
Obx(() =>
indexController.currentUser.length == 0 ?
ListTile(
leading: const Icon(Icons.login),
title: Text("login".tr),
onTap: (){
Get.toNamed(AppPages.LOGIN);
},
) :
ListTile(
leading: const Icon(Icons.login),
title: Text("logout".tr),
onTap: (){
indexController.currentUser.clear();
Get.toNamed(AppPages.TRAVEL);
},
)
),
indexController.currentUser.length > 0 ?
ListTile(
leading: const Icon(Icons.password),
title: Text("change_password".tr),
onTap: (){},
),
) :
Container(width: 0, height: 0,),
indexController.currentUser.length == 0 ?
ListTile(
leading: const Icon(Icons.person),
title: Text("profile".tr),
onTap: (){},
),
ListTile(
leading: const Icon(Icons.route),
title: Text("recommended_route".tr),
onTap: (){},
),
ListTile(
leading: const Icon(Icons.favorite_rounded),
title: Text("point_rank".tr),
onTap: (){},
),
title: Text("sign_up".tr),
onTap: (){
Get.toNamed(AppPages.REGISTER);
},
) :
Container(width: 0, height: 0,),
// ListTile(
// leading: const Icon(Icons.person),
// title: Text("profile".tr),
// onTap: (){},
// ),
// ListTile(
// leading: const Icon(Icons.route),
// title: Text("recommended_route".tr),
// onTap: (){},
// ),
// ListTile(
// leading: const Icon(Icons.favorite_rounded),
// title: Text("point_rank".tr),
// onTap: (){},
// ),
indexController.currentUser.length > 0 ?
ListTile(
leading: const Icon(Icons.featured_video),
title: Text("game_rank".tr),
title: Text("rog_web".tr),
onTap: (){},
),
ListTile(
leading: const Icon(Icons.router),
title: Text("my_route".tr),
onTap: (){},
),
ListTile(
leading: const Icon(Icons.history_sharp),
title: Text("visit_history".tr),
onTap: (){},
),
) :
Container(width: 0, height: 0,),
// ListTile(
// leading: const Icon(Icons.router),
// title: Text("my_route".tr),
// onTap: (){},
// ),
// ListTile(
// leading: const Icon(Icons.history_sharp),
// title: Text("visit_history".tr),
// onTap: (){},
// ),
],
),
),