new change to use intaleq_map sdk 04-16-4
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../services/auth_service.dart';
|
||||
import '../../../routes/app_pages.dart';
|
||||
|
||||
class DrawerWidget extends StatelessWidget {
|
||||
const DrawerWidget({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 100,
|
||||
color: Colors.red,
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Home'),
|
||||
onTap: () {
|
||||
Get.rootDelegate.toNamed(Routes.HOME);
|
||||
//to close the drawer
|
||||
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Settings'),
|
||||
onTap: () {
|
||||
Get.rootDelegate.toNamed(Routes.SETTINGS);
|
||||
//to close the drawer
|
||||
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
if (AuthService.to.isLoggedInValue)
|
||||
ListTile(
|
||||
title: Text(
|
||||
'Logout',
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
AuthService.to.logout();
|
||||
Get.rootDelegate.toNamed(Routes.LOGIN);
|
||||
//to close the drawer
|
||||
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
if (!AuthService.to.isLoggedInValue)
|
||||
ListTile(
|
||||
title: Text(
|
||||
'Login',
|
||||
style: TextStyle(
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Get.rootDelegate.toNamed(Routes.LOGIN);
|
||||
//to close the drawer
|
||||
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../routes/app_pages.dart';
|
||||
import '../controllers/root_controller.dart';
|
||||
import 'drawer.dart';
|
||||
|
||||
class RootView extends GetView<RootController> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetRouterOutlet.builder(
|
||||
builder: (context, delegate, current) {
|
||||
final title = current?.location;
|
||||
return Scaffold(
|
||||
drawer: DrawerWidget(),
|
||||
appBar: AppBar(
|
||||
title: Text(title ?? ''),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: GetRouterOutlet(
|
||||
initialRoute: Routes.HOME,
|
||||
// anchorRoute: '/',
|
||||
// filterPages: (afterAnchor) {
|
||||
// return afterAnchor.take(1);
|
||||
// },
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user