cleanup, 'recurring' now is submitted too
also getting ready to add categories
This commit is contained in:
parent
3ff1f7053d
commit
4ec386019d
9 changed files with 109 additions and 275 deletions
|
@ -6,9 +6,6 @@ import 'package:http/http.dart' as http;
|
|||
import 'package:local_spend/common/functions/save_current_login.dart';
|
||||
import 'package:local_spend/common/functions/show_dialog_single_button.dart';
|
||||
import 'package:local_spend/model/json/login_model.dart';
|
||||
import 'package:local_spend/config.dart';
|
||||
// debug
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
Future<LoginModel> requestLoginAPI(
|
||||
BuildContext context, String email, String password) async {
|
||||
|
|
|
@ -6,9 +6,6 @@ import 'package:http/http.dart' as http;
|
|||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:local_spend/common/functions/show_dialog_single_button.dart';
|
||||
import 'package:local_spend/model/json/login_model.dart';
|
||||
import 'package:local_spend/config.dart';
|
||||
// debug
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class Receipt {
|
||||
var amount = "";
|
||||
|
|
|
@ -3,6 +3,6 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||
getToken() async {
|
||||
SharedPreferences preferences = await SharedPreferences.getInstance();
|
||||
|
||||
String getToken = await preferences.getString("LastToken");
|
||||
String getToken = preferences.getString("LastToken");
|
||||
return getToken;
|
||||
}
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
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';
|
||||
import 'package:local_spend/common/functions/logout.dart';
|
||||
// debug
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class BasicDrawer extends StatefulWidget {
|
||||
@override
|
||||
_BasicDrawerState createState() => _BasicDrawerState();
|
||||
}
|
||||
|
||||
class _BasicDrawerState extends State<BasicDrawer> {
|
||||
var token;
|
||||
// TODO: add getter with getToken to check logged in
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
child: Container(
|
||||
padding: new EdgeInsets.all(32),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
title: Text (
|
||||
"Home",
|
||||
style: TextStyle(color: Colors.black, fontSize: 20.0),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed('/HomePage');
|
||||
}
|
||||
),
|
||||
ListTile(
|
||||
title: Text(
|
||||
"Submit Receipt",
|
||||
style: TextStyle(color: Colors.black, fontSize: 20.0),
|
||||
),
|
||||
onTap: () {
|
||||
// debugPrint('$token');
|
||||
Navigator.of(context).pushNamed('/ReceiptPage');
|
||||
},
|
||||
// enabled: token != null && token.isNotEmpty,
|
||||
),
|
||||
ListTile(
|
||||
title: Text(
|
||||
"About",
|
||||
style: TextStyle(color: Colors.black, fontSize: 20.0),
|
||||
),
|
||||
onTap: () {
|
||||
SystemChannels.textInput.invokeMethod('TextInput.hide');
|
||||
Navigator.of(context).pushReplacementNamed('/AboutPage');
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text(
|
||||
"Logout",
|
||||
style: TextStyle(color: Colors.black, fontSize: 20.0),
|
||||
),
|
||||
onTap: () {
|
||||
logout(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in a new issue