passo_mobile_app/lib/screens/unit2/homepage.dart/components/menu-screen.dart

80 lines
2.9 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import 'package:unit2/theme-data.dart/colors.dart';
import 'package:fluttericon/web_symbols_icons.dart';
import 'package:fluttericon/font_awesome5_icons.dart';
2023-01-23 03:02:59 +00:00
import '../../../../model/login_data/user_info/user_data.dart';
import 'menu.dart';
import '../../../../utils/global.dart';
class MenuScreen extends StatefulWidget {
2023-01-23 03:02:59 +00:00
final UserData? userData;
const MenuScreen({Key? key, required this.userData}) : super(key: key);
@override
State<MenuScreen> createState() => _MenuScreenState();
}
class _MenuScreenState extends State<MenuScreen> {
@override
Widget build(BuildContext context) {
2023-01-23 03:02:59 +00:00
final String firstName =
widget.userData!.user!.login!.user!.firstName!.toUpperCase();
final String lastname =
widget.userData!.user!.login!.user!.lastName!.toUpperCase();
2023-02-08 08:06:27 +00:00
return Drawer(
2023-06-06 06:54:51 +00:00
child: SizedBox(
height: screenHeight,
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Column(
// ignore: prefer_const_literals_to_create_immutables
children: <Widget>[
UserAccountsDrawerHeader(
decoration: const BoxDecoration(
color: primary,
image: DecorationImage(
image: AssetImage('assets/pngs/bg.png'),
fit: BoxFit.cover)),
accountName: Text("$firstName $lastname"),
accountEmail: null,
currentAccountPicture: CircleAvatar(
radius: 40,
backgroundColor: fifth,
child: CircleAvatar(
radius: 33,
backgroundColor: third,
child: //Icon(Icons.person, size: 40, color: fifth),
Text(
firstName[0].toUpperCase(),
style: const TextStyle(fontSize: 45.0, color: fifth),
2023-06-06 06:54:51 +00:00
),
),
),
),
getTile(FontAwesome5.user, "Basic Info", '/basic-info', context,
widget.userData!),
const Divider(),
getTile(FontAwesome5.user_circle, "Profile",
'/profile', context, widget.userData!),
const Divider(),
getTile(FontAwesome5.life_ring, "Request SOS", '/sos',
context, widget.userData!),
],
2023-06-06 06:54:51 +00:00
),
const Expanded(child: SizedBox()),
2023-06-06 06:54:51 +00:00
const Divider(),
Align(
alignment: FractionalOffset.bottomLeft,
child: getTile(WebSymbols.logout, "Logout", '/', context,
2023-01-23 03:02:59 +00:00
widget.userData!),
2023-06-06 06:54:51 +00:00
),
const SizedBox(height: 10,),
2023-06-06 06:54:51 +00:00
],
),
),
);
}
}