workouttest_app/lib/widgets/nav_drawer.dart
Bossanyi Tibor c8f0ced24d Aitrainer_app 1.1.0
Login and Registraion
2020-06-12 21:34:15 +02:00

59 lines
1.7 KiB
Dart

import 'package:aitrainer_app/model/auth.dart';
import 'package:flutter/material.dart';
class NavDrawer extends StatelessWidget {
final Auth auth = Auth();
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
child: Text(
'Customers And Exercises',
style: TextStyle(color: Colors.blue, fontSize: 25),
),
),
ListTile(
leading: Icon(Icons.home),
title: Text('Home'),
onTap: () => Navigator.of(context).pushNamed('home'),
),
ListTile(
leading: Icon(Icons.people),
title: Text('Customers'),
//onTap: () => navigateToPage(context, 'customersPage'),
onTap: () => Navigator.of(context).pushNamed('customersPage'),
),
ListTile(
leading: Icon(Icons.directions_run),
title: Text('Exercises'),
onTap: () => Navigator.of(context).pushNamed('exerciseTypeListPage'),
),
ListTile(
leading: Icon(Icons.arrow_upward),
title: Text("TRAINING!"),
onTap: () => Navigator.of(context).pushNamed('exerciseNewPage'),
),
ListTile(
leading: Icon(Icons.perm_identity),
title: Text('Login'),
onTap: () => Navigator.of(context).pushNamed('login'),
),
ListTile(
leading: Icon(Icons.cancel),
title: Text("Logout"),
onTap: () => {
auth.logout(),
Navigator.of(context).pushNamed('home'),
}
),
],
),
);
}
}