2024-04-29 17:11:35 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2024-05-20 01:16:54 +02:00
|
|
|
import '../pages/home_page.dart';
|
2024-05-16 13:28:57 +02:00
|
|
|
import '../pages/user_data_page.dart';
|
|
|
|
import '../pages/settings_page.dart';
|
|
|
|
import '../services/auth/auth_service.dart';
|
2024-05-15 23:24:26 +02:00
|
|
|
import 'feedback_dialog.dart';
|
|
|
|
|
2024-04-29 17:11:35 +02:00
|
|
|
class MyDrawer extends StatelessWidget {
|
|
|
|
const MyDrawer({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Drawer(
|
2024-05-15 23:24:26 +02:00
|
|
|
backgroundColor: Theme.of(context).colorScheme.background,
|
2024-05-16 13:28:57 +02:00
|
|
|
child: CustomScrollView(slivers: [
|
|
|
|
SliverFillRemaining(
|
|
|
|
hasScrollBody: false,
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
2024-05-15 23:24:26 +02:00
|
|
|
children: [
|
2024-05-16 13:28:57 +02:00
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
// logo
|
|
|
|
DrawerHeader(
|
|
|
|
child: Center(
|
|
|
|
child: Icon(
|
|
|
|
Icons.people_alt,
|
|
|
|
color: Theme.of(context).colorScheme.primary,
|
|
|
|
size: 40,
|
|
|
|
),
|
|
|
|
),
|
2024-04-29 17:11:35 +02:00
|
|
|
),
|
|
|
|
|
2024-05-16 13:28:57 +02:00
|
|
|
// home list tile
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
|
|
|
title: const Text("Home"),
|
|
|
|
leading: const Icon(Icons.home),
|
|
|
|
onTap: () {
|
|
|
|
// pop the drawer
|
|
|
|
Navigator.pop(context);
|
2024-05-20 01:16:54 +02:00
|
|
|
// Navigate to HomePage?
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (BuildContext context) => HomePage(),
|
|
|
|
),
|
|
|
|
);
|
2024-05-16 13:28:57 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
2024-04-29 17:11:35 +02:00
|
|
|
|
2024-05-16 13:28:57 +02:00
|
|
|
// matching list tile
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
|
|
|
title: const Text("Find Matches"),
|
|
|
|
leading: const Icon(Icons.person_search),
|
|
|
|
onTap: () {}, // TODO
|
|
|
|
),
|
|
|
|
),
|
2024-04-29 17:11:35 +02:00
|
|
|
|
2024-05-16 13:28:57 +02:00
|
|
|
// chats list tile
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
|
|
|
title: const Text("Conversations"),
|
|
|
|
leading: const Icon(Icons.chat),
|
|
|
|
onTap: () {}, // TODO
|
|
|
|
),
|
|
|
|
),
|
2024-04-29 17:11:35 +02:00
|
|
|
|
2024-05-16 13:28:57 +02:00
|
|
|
// settings list tile
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
|
|
|
title: const Text("My Profile"),
|
|
|
|
leading: const Icon(Icons.settings),
|
|
|
|
onTap: () {
|
2024-05-20 01:16:54 +02:00
|
|
|
// pop the drawer and navigate to settings page
|
2024-05-16 13:28:57 +02:00
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.push(
|
2024-05-20 01:16:54 +02:00
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (context) => const SettingsPage(),
|
|
|
|
),
|
|
|
|
);
|
2024-05-16 13:28:57 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
2024-04-29 17:11:35 +02:00
|
|
|
|
2024-05-16 13:28:57 +02:00
|
|
|
// TODO TESTING - user data tile
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
|
|
|
title: const Text("User Data"),
|
|
|
|
leading: const Icon(Icons.supervised_user_circle),
|
|
|
|
onTap: () {
|
2024-05-20 01:16:54 +02:00
|
|
|
// pop the drawer first, then navigate to destination
|
2024-05-16 13:28:57 +02:00
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.push(
|
2024-05-20 01:16:54 +02:00
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (context) => const UserDataPage(
|
|
|
|
isRegProcess: false,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
2024-05-16 13:28:57 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
2024-05-05 01:02:09 +02:00
|
|
|
|
2024-05-16 13:28:57 +02:00
|
|
|
// horizontal line
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
child: Divider(
|
|
|
|
color: Theme.of(context).colorScheme.primary,
|
|
|
|
),
|
|
|
|
),
|
2024-04-29 17:11:35 +02:00
|
|
|
|
2024-05-16 13:28:57 +02:00
|
|
|
// about tile
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
|
|
|
title: const Text("About the app"),
|
|
|
|
leading: const Icon(Icons.perm_device_info),
|
|
|
|
onTap: () {}, // TODO
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
// feedback tile
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
|
|
|
title: const Text("Send feedback"),
|
|
|
|
leading: const Icon(Icons.sentiment_satisfied_alt),
|
|
|
|
onTap: () {
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
builder: (context) => const FeedbackDialog());
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
2024-05-15 23:24:26 +02:00
|
|
|
),
|
2024-04-29 17:11:35 +02:00
|
|
|
|
2024-05-16 13:28:57 +02:00
|
|
|
// logout list tile
|
2024-05-15 23:24:26 +02:00
|
|
|
Padding(
|
2024-05-16 13:28:57 +02:00
|
|
|
padding: const EdgeInsets.only(left: 25, bottom: 25),
|
2024-05-15 23:24:26 +02:00
|
|
|
child: ListTile(
|
2024-05-16 13:28:57 +02:00
|
|
|
title: const Text("L O G O U T"),
|
|
|
|
leading: const Icon(Icons.logout),
|
2024-05-20 01:16:54 +02:00
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
AuthService().signOut();
|
|
|
|
},
|
2024-04-29 17:11:35 +02:00
|
|
|
),
|
|
|
|
),
|
2024-05-15 23:24:26 +02:00
|
|
|
],
|
|
|
|
),
|
2024-05-16 13:28:57 +02:00
|
|
|
),
|
|
|
|
]),
|
2024-05-15 23:24:26 +02:00
|
|
|
);
|
2024-04-29 17:11:35 +02:00
|
|
|
}
|
|
|
|
}
|