added changes to login model and start of receipt

This commit is contained in:
Finn 2019-05-10 12:43:45 +01:00
parent 3af4997c01
commit 075a57278f
No known key found for this signature in database
GPG key ID: 7455B4B17685B598
10 changed files with 122 additions and 79 deletions

View file

@ -1,6 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:local_spend/common/apifunctions/request_logout_api.dart';
import 'package:local_spend/common/functions/get_token.dart';
// debug
import 'package:flutter/foundation.dart';
class BasicDrawer extends StatefulWidget {
@override
@ -8,6 +11,9 @@ class BasicDrawer extends StatefulWidget {
}
class _BasicDrawerState extends State<BasicDrawer> {
var token;
// TODO: add getter with getToken to check logged in
@override
Widget build(BuildContext context) {
return Drawer(
@ -21,9 +27,10 @@ class _BasicDrawerState extends State<BasicDrawer> {
style: TextStyle(color: Colors.black, fontSize: 20.0),
),
onTap: () {
requestLogoutAPI(context);
debugPrint('$token');
Navigator.of(context).pushNamed('/ReceiptPage');
},
// enabled: token != null && token.isNotEmpty,
),
ListTile(
title: Text(