2024-04-29 17:11:35 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2024-06-02 16:32:19 +02:00
|
|
|
import '../pages/conversations_page.dart';
|
2024-06-03 23:12:42 +02:00
|
|
|
import '../pages/liked_users_page.dart';
|
2024-05-16 13:28:57 +02:00
|
|
|
import '../pages/settings_page.dart';
|
2024-05-30 01:10:53 +02:00
|
|
|
import '../pages/user_matching_page.dart';
|
2024-05-24 00:30:08 +02:00
|
|
|
import '../pages/user_profile_page.dart';
|
2024-05-16 13:28:57 +02:00
|
|
|
import '../services/auth/auth_service.dart';
|
2024-05-15 23:24:26 +02:00
|
|
|
import 'feedback_dialog.dart';
|
2024-05-26 17:33:28 +02:00
|
|
|
import 'my_about_dialog.dart';
|
2024-05-15 23:24:26 +02:00
|
|
|
|
2024-04-29 17:11:35 +02:00
|
|
|
class MyDrawer extends StatelessWidget {
|
|
|
|
const MyDrawer({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Drawer(
|
2024-06-03 23:22:43 +02:00
|
|
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
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
|
2024-06-19 19:31:18 +02:00
|
|
|
SizedBox(
|
|
|
|
height: 100,
|
|
|
|
child: DrawerHeader(
|
|
|
|
child: Center(
|
|
|
|
child: Icon(
|
|
|
|
Icons.people_alt,
|
|
|
|
color: Theme.of(context).colorScheme.primary,
|
|
|
|
size: 40,
|
|
|
|
),
|
2024-05-16 13:28:57 +02:00
|
|
|
),
|
|
|
|
),
|
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(
|
2024-06-02 16:32:19 +02:00
|
|
|
title: const Text('Home'),
|
2024-05-16 13:28:57 +02:00
|
|
|
leading: const Icon(Icons.home),
|
|
|
|
onTap: () {
|
2024-06-13 00:47:53 +02:00
|
|
|
// home screen is the only place this drawer is used on,
|
|
|
|
// so just pop the drawer, else add page navigation.
|
2024-05-16 13:28:57 +02:00
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
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(
|
2024-06-02 16:32:19 +02:00
|
|
|
title: const Text('Find Matches'),
|
2024-05-16 13:28:57 +02:00
|
|
|
leading: const Icon(Icons.person_search),
|
2024-05-24 00:30:08 +02:00
|
|
|
onTap: () {
|
2024-06-14 14:15:11 +02:00
|
|
|
// pop the drawer first, then navigate to destination
|
2024-05-24 00:30:08 +02:00
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (BuildContext context) =>
|
2024-05-30 01:10:53 +02:00
|
|
|
const UserMatchingPage(),
|
2024-05-24 00:30:08 +02:00
|
|
|
),
|
|
|
|
);
|
2024-06-03 23:12:42 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
// liked users tile
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
2024-08-16 14:07:13 +02:00
|
|
|
title: const Text('Favored Profiles'),
|
2024-06-03 23:12:42 +02:00
|
|
|
leading: const Icon(Icons.format_list_bulleted),
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
const LikedUsersPage(),
|
|
|
|
),
|
|
|
|
);
|
2024-05-24 00:30:08 +02:00
|
|
|
},
|
2024-05-16 13:28:57 +02:00
|
|
|
),
|
|
|
|
),
|
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(
|
2024-06-02 16:32:19 +02:00
|
|
|
title: const Text('Chats'),
|
2024-05-16 13:28:57 +02:00
|
|
|
leading: const Icon(Icons.chat),
|
2024-06-02 16:32:19 +02:00
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (context) => ConversationsPage(),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
2024-05-16 13:28:57 +02:00
|
|
|
),
|
|
|
|
),
|
2024-04-29 17:11:35 +02:00
|
|
|
|
2024-05-16 13:28:57 +02:00
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
2024-06-04 20:12:12 +02:00
|
|
|
title: const Text('My Profile'),
|
|
|
|
leading: const Icon(Icons.edit_note),
|
2024-05-16 13:28:57 +02:00
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.push(
|
2024-05-20 01:16:54 +02:00
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
2024-06-04 20:12:12 +02:00
|
|
|
builder: (context) => const UserProfilePage(),
|
2024-05-20 01:16:54 +02:00
|
|
|
),
|
|
|
|
);
|
2024-05-16 13:28:57 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
2024-04-29 17:11:35 +02:00
|
|
|
|
2024-06-04 20:12:12 +02:00
|
|
|
// settings list tile
|
2024-05-30 01:10:53 +02:00
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
2024-06-04 20:12:12 +02:00
|
|
|
title: const Text("App Settings"),
|
|
|
|
leading: const Icon(Icons.settings),
|
2024-05-30 01:10:53 +02:00
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
2024-06-04 20:12:12 +02:00
|
|
|
builder: (context) => const SettingsPage(),
|
2024-05-30 01:10:53 +02:00
|
|
|
),
|
|
|
|
);
|
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
|
2024-06-19 19:31:18 +02:00
|
|
|
const Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
child: Divider(),
|
2024-05-16 13:28:57 +02:00
|
|
|
),
|
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(
|
2024-06-02 16:32:19 +02:00
|
|
|
title: const Text('About the app'),
|
2024-05-16 13:28:57 +02:00
|
|
|
leading: const Icon(Icons.perm_device_info),
|
2024-05-26 17:33:28 +02:00
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
builder: (context) => const MyAboutDialog());
|
|
|
|
},
|
2024-05-16 13:28:57 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
// feedback tile
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
child: ListTile(
|
2024-06-02 16:32:19 +02:00
|
|
|
title: const Text('Send feedback'),
|
2024-05-16 13:28:57 +02:00
|
|
|
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-06-02 16:32:19 +02:00
|
|
|
title: const Text('L O G O U T'),
|
2024-05-16 13:28:57 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|