2023-12-27 15:45:55 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
2023-12-30 15:46:13 +00:00
|
|
|
import 'package:go_router/go_router.dart';
|
2023-12-27 15:45:55 +00:00
|
|
|
|
2024-01-01 16:11:05 +00:00
|
|
|
import '../../constants/color_constants.dart';
|
2023-12-27 15:45:55 +00:00
|
|
|
|
|
|
|
class SideMenu extends StatelessWidget {
|
|
|
|
const SideMenu({
|
2024-02-24 22:48:16 +00:00
|
|
|
super.key,
|
|
|
|
});
|
2023-12-27 15:45:55 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Drawer(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
// it enables scrolling
|
|
|
|
child: Column(
|
|
|
|
children: [
|
2023-12-29 17:13:51 +00:00
|
|
|
const DrawerHeader(
|
2023-12-27 15:45:55 +00:00
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
2024-02-24 22:48:16 +00:00
|
|
|
SizedBox(
|
|
|
|
height: defaultPadding,
|
|
|
|
),
|
|
|
|
Icon(Icons.storage_sharp, size: 60, color: Colors.white54),
|
2023-12-27 15:45:55 +00:00
|
|
|
SizedBox(
|
|
|
|
height: defaultPadding,
|
|
|
|
),
|
2023-12-29 17:13:51 +00:00
|
|
|
Text("AURCache")
|
2023-12-27 15:45:55 +00:00
|
|
|
],
|
|
|
|
)),
|
|
|
|
DrawerListTile(
|
|
|
|
title: "Dashboard",
|
|
|
|
svgSrc: "assets/icons/menu_dashbord.svg",
|
2023-12-30 15:46:13 +00:00
|
|
|
press: () {
|
|
|
|
context.go("/");
|
|
|
|
},
|
2023-12-27 15:45:55 +00:00
|
|
|
),
|
|
|
|
DrawerListTile(
|
|
|
|
title: "Builds",
|
|
|
|
svgSrc: "assets/icons/menu_tran.svg",
|
2024-01-27 13:51:45 +00:00
|
|
|
press: () {
|
|
|
|
context.go("/builds");
|
|
|
|
},
|
2023-12-27 15:45:55 +00:00
|
|
|
),
|
|
|
|
DrawerListTile(
|
|
|
|
title: "AUR",
|
|
|
|
svgSrc: "assets/icons/menu_task.svg",
|
2024-01-27 13:51:45 +00:00
|
|
|
press: () {
|
|
|
|
context.go("/aur");
|
|
|
|
},
|
2023-12-27 15:45:55 +00:00
|
|
|
),
|
|
|
|
DrawerListTile(
|
|
|
|
title: "Settings",
|
|
|
|
svgSrc: "assets/icons/menu_setting.svg",
|
|
|
|
press: () {},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class DrawerListTile extends StatelessWidget {
|
|
|
|
const DrawerListTile({
|
2024-02-24 22:48:16 +00:00
|
|
|
super.key,
|
2023-12-27 15:45:55 +00:00
|
|
|
required this.title,
|
|
|
|
required this.svgSrc,
|
|
|
|
required this.press,
|
2024-02-24 22:48:16 +00:00
|
|
|
});
|
2023-12-27 15:45:55 +00:00
|
|
|
|
|
|
|
final String title, svgSrc;
|
|
|
|
final VoidCallback press;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ListTile(
|
|
|
|
onTap: press,
|
|
|
|
horizontalTitleGap: 0.0,
|
|
|
|
leading: SvgPicture.asset(
|
|
|
|
svgSrc,
|
|
|
|
color: Colors.white54,
|
|
|
|
height: 16,
|
|
|
|
),
|
|
|
|
title: Text(
|
|
|
|
title,
|
2024-01-01 16:11:05 +00:00
|
|
|
style: const TextStyle(color: Colors.white54),
|
2023-12-27 15:45:55 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|