mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
54 lines
1.6 KiB
Dart
54 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:wger/providers/auth.dart';
|
|
|
|
class AppDrawer extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Drawer(
|
|
child: Column(
|
|
children: [
|
|
AppBar(
|
|
title: Text('wger'),
|
|
automaticallyImplyLeading: false,
|
|
),
|
|
Divider(),
|
|
ListTile(
|
|
leading: Icon(Icons.shop),
|
|
title: Text('Training'),
|
|
onTap: () => Navigator.of(context).pushReplacementNamed('/'),
|
|
),
|
|
Divider(),
|
|
ListTile(
|
|
leading: Icon(Icons.fastfood),
|
|
title: Text('Nutrition'),
|
|
onTap: () => Navigator.of(context).pushReplacementNamed('/'),
|
|
),
|
|
Divider(),
|
|
ListTile(
|
|
leading: Icon(Icons.bar_chart),
|
|
title: Text('Weight'),
|
|
onTap: () => Navigator.of(context).pushReplacementNamed('/'),
|
|
),
|
|
Divider(),
|
|
ListTile(
|
|
leading: Icon(Icons.edit),
|
|
title: Text('Options'),
|
|
onTap: () => Navigator.of(context).pushReplacementNamed('/'),
|
|
),
|
|
Divider(),
|
|
ListTile(
|
|
leading: Icon(Icons.exit_to_app),
|
|
title: Text('Logout'),
|
|
onTap: () {
|
|
Navigator.of(context).pop();
|
|
Navigator.of(context).pushReplacementNamed('/');
|
|
Provider.of<Auth>(context, listen: false).logout();
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|