You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
130 lines
4.0 KiB
Dart
130 lines
4.0 KiB
Dart
import 'package:car_provider_app/api/shared_prefrence.dart';
|
|
import 'package:car_provider_app/config/routes.dart';
|
|
import 'package:car_provider_app/theme/colors.dart';
|
|
import 'package:car_provider_app/utils/navigator.dart';
|
|
import 'package:car_provider_app/widgets/app_bar.dart';
|
|
import 'package:car_provider_app/widgets/show_fill_button.dart';
|
|
import 'package:car_provider_app/extensions/int_extensions.dart';
|
|
import 'package:car_provider_app/extensions/string_extensions.dart';
|
|
import 'package:car_provider_app/extensions/widget_extensions.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
class DashboardPage extends StatefulWidget {
|
|
@override
|
|
State<DashboardPage> createState() => _DashboardPageState();
|
|
}
|
|
|
|
class _DashboardPageState extends State<DashboardPage> {
|
|
String userName = "";
|
|
|
|
@override
|
|
void initState() {
|
|
// TODO: implement initState
|
|
super.initState();
|
|
fetchUsername();
|
|
}
|
|
|
|
fetchUsername() async {
|
|
userName = await SharedPrefManager.getPhoneOrEmail();
|
|
setState(() {});
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: appBar(
|
|
title: "Logo/Brand",
|
|
),
|
|
drawer: showDrawer(context),
|
|
body: Container(
|
|
child: Center(
|
|
child: "Dashboard/Main Page".toText24(),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget showDrawer(BuildContext context) {
|
|
return Drawer(
|
|
child: Container(
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
width: double.infinity,
|
|
height: 200,
|
|
color: accentColor.withOpacity(0.3),
|
|
child: Icon(
|
|
Icons.person,
|
|
size: 80,
|
|
color: accentColor.withOpacity(0.3),
|
|
),
|
|
),
|
|
Container(
|
|
width: double.infinity,
|
|
color: accentColor.withOpacity(0.1),
|
|
padding: EdgeInsets.all(20),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
userName.toText24(),
|
|
"User role or title".toText12(),
|
|
],
|
|
),
|
|
),
|
|
ShowFillButton(
|
|
title: "EDIT",
|
|
onPressed: () {},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
ListTile(
|
|
leading: SvgPicture.asset("assets/images/ic_notification.svg"),
|
|
title: "Notifications".toText12(),
|
|
),
|
|
ListTile(
|
|
leading: SvgPicture.asset("assets/images/ic_settings.svg"),
|
|
title: "General".toText12(),
|
|
),
|
|
ListTile(
|
|
leading: SvgPicture.asset("assets/images/ic_notes.svg"),
|
|
title: "Define Licenses".toText12(),
|
|
onTap: (){
|
|
navigateWithName(context, AppRoutes.defineLicense);
|
|
},
|
|
),
|
|
ListTile(
|
|
leading: SvgPicture.asset("assets/images/ic_car.svg"),
|
|
title: "Dealership Settings".toText12(),
|
|
onTap: (){
|
|
navigateWithName(context, AppRoutes.dealershipSetting);
|
|
},
|
|
),
|
|
ListTile(
|
|
leading: SvgPicture.asset("assets/images/ic_lock.svg"),
|
|
title: "Change Password".toText12(),
|
|
),
|
|
ListTile(
|
|
leading: SvgPicture.asset("assets/images/ic_mobile.svg"),
|
|
title: "Change Mobile".toText12(),
|
|
),
|
|
ListTile(
|
|
leading: SvgPicture.asset("assets/images/ic_logout.svg"),
|
|
title: "Sign Out".toText12(),
|
|
onTap: () {
|
|
pop(context);
|
|
pop(context);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|