2019-05-08 18:54:14 +00:00
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
2019-05-10 11:43:45 +00:00
|
|
|
import 'package:local_spend/common/apifunctions/submit_receipt_api.dart';
|
2019-05-08 18:54:14 +00:00
|
|
|
import 'package:local_spend/common/functions/show_dialog_single_button.dart';
|
|
|
|
import 'package:local_spend/common/platform/platform_scaffold.dart';
|
|
|
|
import 'package:local_spend/common/widgets/basic_drawer.dart';
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
2019-05-16 16:04:08 +00:00
|
|
|
import 'package:intl/intl.dart';
|
2019-07-15 11:09:10 +00:00
|
|
|
import 'package:local_spend/pages/settings.dart';
|
2019-05-10 11:43:45 +00:00
|
|
|
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
|
2019-07-08 10:53:10 +00:00
|
|
|
import 'package:local_spend/common/apifunctions/find_organisations.dart';
|
2019-07-08 14:03:11 +00:00
|
|
|
import 'package:local_spend/common/widgets/popupListView.dart';
|
2019-07-15 11:09:10 +00:00
|
|
|
import 'package:local_spend/common/widgets/labeled_checkbox.dart';
|
2019-05-08 18:54:14 +00:00
|
|
|
|
|
|
|
const URL = "https://flutter.io/";
|
2019-07-16 10:28:36 +00:00
|
|
|
const demonstration = false;
|
2019-05-08 18:54:14 +00:00
|
|
|
|
|
|
|
class ReceiptPage extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() {
|
|
|
|
return new ReceiptPageState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class ReceiptPageState extends State<ReceiptPage> {
|
2019-05-10 11:43:45 +00:00
|
|
|
final TextEditingController _timeController = TextEditingController();
|
|
|
|
final TextEditingController _amountController = TextEditingController();
|
|
|
|
final TextEditingController _essentialController = TextEditingController();
|
2019-07-15 13:48:41 +00:00
|
|
|
final TextEditingController _recurringController = TextEditingController(text: "None");
|
2019-05-10 11:43:45 +00:00
|
|
|
final TextEditingController _typeController = TextEditingController();
|
|
|
|
final TextEditingController _orgController = TextEditingController();
|
2019-07-16 10:28:36 +00:00
|
|
|
final OrganizationController _organizationController = OrganizationController();
|
2019-05-08 18:54:14 +00:00
|
|
|
|
2019-07-05 21:56:15 +00:00
|
|
|
FocusNode focusNode; // added so focus can move automatically
|
|
|
|
|
2019-05-16 16:04:08 +00:00
|
|
|
DateTime date;
|
|
|
|
|
2019-05-08 18:54:14 +00:00
|
|
|
Future launchURL(String url) async {
|
|
|
|
if (await canLaunch(url)) {
|
|
|
|
await launch(url, forceSafariVC: true, forceWebView: true);
|
|
|
|
} else {
|
|
|
|
showDialogSingleButton(
|
|
|
|
context,
|
|
|
|
"Unable to reach your website.",
|
|
|
|
"Currently unable to reach the website $URL. Please try again at a later time.",
|
|
|
|
"OK");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
2019-05-10 11:43:45 +00:00
|
|
|
_saveCurrentRoute("/ReceiptPageState");
|
2019-07-05 21:56:15 +00:00
|
|
|
|
|
|
|
focusNode = FocusNode();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
super.dispose();
|
|
|
|
|
|
|
|
focusNode.dispose(); //disposes focus node when form disposed
|
2019-05-08 18:54:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_saveCurrentRoute(String lastRoute) async {
|
|
|
|
SharedPreferences preferences = await SharedPreferences.getInstance();
|
|
|
|
await preferences.setString('LastPageRoute', lastRoute);
|
|
|
|
}
|
|
|
|
|
2019-07-15 13:48:41 +00:00
|
|
|
// this file is getting really messy sorry everyone
|
|
|
|
|
2019-07-16 10:28:36 +00:00
|
|
|
void submitReceipt(String amount, String time, Organisation organisation) async {
|
2019-07-05 14:34:39 +00:00
|
|
|
SystemChannels.textInput.invokeMethod('TextInput.hide');
|
|
|
|
|
|
|
|
if (demonstration)
|
|
|
|
{
|
|
|
|
await showDialog(
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
// return object of type Dialog
|
|
|
|
return AlertDialog(
|
|
|
|
title: new Text("Success"),
|
2019-07-15 15:17:41 +00:00
|
|
|
content: new Text("Receipt successfully submitted."),
|
2019-07-05 14:34:39 +00:00
|
|
|
actions: <Widget>[
|
|
|
|
// usually buttons at the bottom of the dialog
|
|
|
|
new FlatButton(
|
|
|
|
child: new Text("OK"),
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.of(context).pop();
|
2019-07-16 10:28:36 +00:00
|
|
|
Navigator.of(context).pushReplacementNamed('/HomePage');
|
2019-07-15 15:17:41 +00:00
|
|
|
//TODO: Reset form after dialog exit
|
2019-07-05 14:34:39 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
},
|
|
|
|
).then((_) {
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Receipt receipt = new Receipt();
|
|
|
|
|
|
|
|
// setting up 'receipt'
|
|
|
|
receipt.amount = amount;
|
2019-07-05 21:56:15 +00:00
|
|
|
receipt.time = formatDate(time);
|
2019-07-16 11:09:10 +00:00
|
|
|
// debugPrint(organisation.name + ", " + organisation.streetName + ", " + organisation.town + ", " + organisation.postcode);
|
2019-07-16 10:28:36 +00:00
|
|
|
receipt.organisationName = organisation.name;
|
|
|
|
receipt.street = organisation.streetName;
|
|
|
|
receipt.town = organisation.town;
|
|
|
|
receipt.postcode = organisation.postcode;
|
2019-07-05 21:56:15 +00:00
|
|
|
|
|
|
|
// receipt.essential = convertBoolToString(toConvert)
|
2019-07-05 14:34:39 +00:00
|
|
|
|
2019-07-16 10:28:36 +00:00
|
|
|
// TODO: Categories
|
2019-07-05 14:34:39 +00:00
|
|
|
|
|
|
|
// receipt.category = category;
|
|
|
|
// receipt.etc = etc;
|
|
|
|
|
|
|
|
submitReceiptAPI(context, receipt);
|
2019-07-16 10:28:36 +00:00
|
|
|
Navigator.of(context).pushReplacementNamed('/HomePage');
|
2019-07-05 14:34:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-05 21:56:15 +00:00
|
|
|
String convertBoolToString(bool toConvert) {
|
|
|
|
if (toConvert)
|
|
|
|
{
|
|
|
|
return "true";
|
|
|
|
}
|
|
|
|
|
|
|
|
return "false";
|
|
|
|
}
|
|
|
|
|
2019-07-15 13:48:41 +00:00
|
|
|
List<String> getOptions() {
|
|
|
|
var options = new List<String>(7);
|
|
|
|
options[0] = "None";
|
|
|
|
options[1] = "Daily";
|
|
|
|
options[2] = "Weekly";
|
|
|
|
options[3] = "Fortnightly";
|
|
|
|
options[4] = "Monthly";
|
|
|
|
options[5] = "Quarterly";
|
|
|
|
options[6] = "Yearly";
|
|
|
|
|
|
|
|
return options;
|
|
|
|
}
|
|
|
|
|
2019-07-05 21:56:15 +00:00
|
|
|
String formatDate(String date) {
|
|
|
|
// return "";
|
|
|
|
// should be in format:
|
|
|
|
// yyyy-MM-ddThh:mm:00.000+01:00
|
|
|
|
// eg 2019-07-05T10:24:00.000+01.00 (real life example, works)
|
|
|
|
|
|
|
|
// current format = "dd/MM/yyyy 'at' hh:mm"
|
2019-07-08 14:34:02 +00:00
|
|
|
// 0123456789ABCDEFGHIJK
|
2019-07-05 21:56:15 +00:00
|
|
|
|
|
|
|
var components = new List(5);
|
|
|
|
|
|
|
|
components[0] = (date.substring(0,2)); // dd
|
|
|
|
components[1] = (date.substring(3,5)); // MM
|
|
|
|
components[2] = (date.substring(6,10)); // yyyy
|
|
|
|
components[3] = (date.substring(14,16)); // hh
|
|
|
|
components[4] = (date.substring(17,19)); // mm
|
|
|
|
|
|
|
|
//print(components);
|
|
|
|
|
|
|
|
return (components[2] + "-" + components[1] + "-" + components[0]
|
|
|
|
+ "T" + components[3] + ":" + components[4] + ":00.000+01:00");
|
|
|
|
|
|
|
|
// Yes, there is probably a function to convert dates, but I didn't
|
|
|
|
// know that before writing this and it's done now so I'm keeping it.
|
|
|
|
}
|
|
|
|
|
2019-07-16 10:28:36 +00:00
|
|
|
Organisation listOrganisations(List<Organisation> organisations, context) {
|
2019-07-15 15:17:41 +00:00
|
|
|
if (organisations.length == 0) {
|
|
|
|
showDialogSingleButton(
|
|
|
|
context,
|
|
|
|
"No matching organizations",
|
|
|
|
"We were unable to find any organizations matching this text.",
|
|
|
|
"OK"
|
|
|
|
);
|
|
|
|
return null;
|
|
|
|
}
|
2019-07-08 14:03:11 +00:00
|
|
|
var optionsList = new List<String>();
|
|
|
|
|
|
|
|
for (var i = 0; i < organisations.length; i++) {
|
|
|
|
optionsList.add(organisations[i].name);
|
|
|
|
}
|
|
|
|
|
2019-07-15 13:48:41 +00:00
|
|
|
// var popupListView = new PopupListView(context, optionsList, "Choose Organization");
|
2019-07-08 14:03:11 +00:00
|
|
|
|
2019-07-15 13:48:41 +00:00
|
|
|
var popupListView = new PopupListView();
|
|
|
|
var dialog = popupListView.dialog(context, optionsList, "Choose Organization");
|
2019-07-08 14:03:11 +00:00
|
|
|
|
2019-07-15 13:48:41 +00:00
|
|
|
// dialog.then((value) => debugPrint(value));
|
2019-07-08 14:03:11 +00:00
|
|
|
|
2019-07-16 10:28:36 +00:00
|
|
|
|
|
|
|
dialog.then((value) {
|
|
|
|
_orgController.text = value;
|
|
|
|
_organizationController.organisation = organisations.where((thisOrg) => thisOrg.name == value).elementAt(0);
|
|
|
|
// this may not work when two organisations have the same name,
|
|
|
|
// then again the popupListView can't display two of the same names properly either
|
|
|
|
});
|
2019-07-15 13:48:41 +00:00
|
|
|
//can't return value as it is <future> and thus would block
|
2019-07-08 14:03:11 +00:00
|
|
|
}
|
|
|
|
|
2019-05-08 18:54:14 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return WillPopScope(
|
|
|
|
onWillPop: () {
|
|
|
|
if (Navigator.canPop(context)) {
|
|
|
|
Navigator.of(context).pushNamedAndRemoveUntil(
|
2019-07-15 11:09:10 +00:00
|
|
|
'/LoginPage', (Route<dynamic> route) => false);
|
2019-05-08 18:54:14 +00:00
|
|
|
} else {
|
2019-07-15 11:09:10 +00:00
|
|
|
Navigator.of(context).pushReplacementNamed('/LoginPage');
|
2019-05-08 18:54:14 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
child: PlatformScaffold(
|
2019-07-15 11:09:10 +00:00
|
|
|
|
2019-05-08 18:54:14 +00:00
|
|
|
appBar: AppBar(
|
2019-07-15 11:09:10 +00:00
|
|
|
backgroundColor: Colors.blue[400],
|
2019-05-08 18:54:14 +00:00
|
|
|
title: Text(
|
2019-05-10 11:43:45 +00:00
|
|
|
"Submit Receipt",
|
2019-05-08 18:54:14 +00:00
|
|
|
style: TextStyle(
|
2019-07-15 11:09:10 +00:00
|
|
|
fontSize: 20,
|
2019-07-15 13:55:10 +00:00
|
|
|
color: Colors.white,
|
2019-05-08 18:54:14 +00:00
|
|
|
),
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
// leading: BackButton(),
|
2019-05-08 18:54:14 +00:00
|
|
|
centerTitle: true,
|
|
|
|
iconTheme: IconThemeData(color: Colors.black),
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
|
2019-05-08 18:54:14 +00:00
|
|
|
body: Container(
|
2019-07-15 11:09:10 +00:00
|
|
|
padding: EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 0.0),
|
|
|
|
child: ListView(
|
|
|
|
children: <Widget>[
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(0.0,25,0.0,0.0),
|
|
|
|
child : Text(
|
|
|
|
"Time of Transaction",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 18.0,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
2019-05-08 18:54:14 +00:00
|
|
|
),
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
|
|
|
DateTimePickerFormField(
|
|
|
|
inputType: InputType.both,
|
|
|
|
format: DateFormat("dd/MM/yyyy 'at' hh:mm"),
|
|
|
|
editable: true,
|
|
|
|
controller: _timeController,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
labelText: 'Date/Time of Transaction', hasFloatingPlaceholder: false),
|
|
|
|
onChanged: (dt) => setState(() => date = dt),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(0.0,25,0.0,0.0),
|
|
|
|
child: Text(
|
|
|
|
"Amount",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 18.0,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
2019-05-08 18:54:14 +00:00
|
|
|
),
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0),
|
|
|
|
child: TextField(
|
|
|
|
controller: _amountController,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: 'Value in £',
|
|
|
|
),
|
2019-07-05 12:39:24 +00:00
|
|
|
// obscureText: true,
|
2019-07-15 11:09:10 +00:00
|
|
|
autocorrect: false,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 18.0,
|
|
|
|
color: Colors.grey[800],
|
|
|
|
fontWeight: FontWeight.bold,
|
2019-07-05 21:56:15 +00:00
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
onSubmitted: (_) {
|
|
|
|
FocusScope.of(context).requestFocus(focusNode);
|
|
|
|
// submitReceipt(_amountController.text, _timeController.text);
|
|
|
|
},
|
2019-07-05 21:56:15 +00:00
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
2019-07-05 21:56:15 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(0.0,25,0.0,0.0),
|
2019-07-05 21:56:15 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
child : Container (
|
|
|
|
height: 22, // this should be the same height as text
|
2019-07-05 21:56:15 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
child : ListView(
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
children: <Widget>[
|
2019-07-05 21:56:15 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
"Organization Name",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 18.0,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
2019-07-05 21:56:15 +00:00
|
|
|
),
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
child : Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(5,0,0,4), // sorry about hardcoded constraints
|
|
|
|
child: FlatButton(
|
|
|
|
onPressed: () {
|
2019-07-15 13:48:41 +00:00
|
|
|
if (_orgController.text != "") {
|
|
|
|
var organisations = findOrganisations(
|
2019-07-16 10:28:36 +00:00
|
|
|
_orgController.text); // returns Future<List<Organisation>>
|
2019-07-15 13:48:41 +00:00
|
|
|
|
|
|
|
var choice = organisations.then((data) =>
|
|
|
|
listOrganisations(data, context));
|
|
|
|
|
2019-07-16 10:28:36 +00:00
|
|
|
choice.then((value) => _orgController.text = value.name);
|
|
|
|
choice.then((value) => _organizationController.organisation = value);
|
2019-07-15 11:09:10 +00:00
|
|
|
|
2019-07-15 13:48:41 +00:00
|
|
|
} else {
|
|
|
|
// no data entered
|
|
|
|
|
|
|
|
showDialogSingleButton(
|
|
|
|
context,
|
|
|
|
"No data",
|
|
|
|
"We were unable to service your request because no data was entered.",
|
|
|
|
"OK"
|
|
|
|
);
|
|
|
|
}
|
2019-07-15 11:09:10 +00:00
|
|
|
},
|
|
|
|
child: Text("Find",
|
2019-07-15 13:48:41 +00:00
|
|
|
style: TextStyle(color: Colors.blue, fontSize: 18.0)
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
2019-07-05 21:56:15 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
],
|
2019-07-05 21:56:15 +00:00
|
|
|
),
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
2019-07-05 21:56:15 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0),
|
|
|
|
child: TextField(
|
|
|
|
controller: _orgController,
|
|
|
|
focusNode: focusNode,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: 'Eg. Pear Trading',
|
|
|
|
),
|
2019-07-05 21:56:15 +00:00
|
|
|
// obscureText: true,
|
2019-07-15 11:09:10 +00:00
|
|
|
autocorrect: true,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 18.0,
|
|
|
|
color: Colors.grey[800],
|
|
|
|
fontWeight: FontWeight.bold,
|
2019-05-08 18:54:14 +00:00
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
onSubmitted: (_) {
|
|
|
|
submitReceipt(_amountController.text,
|
2019-07-16 10:28:36 +00:00
|
|
|
_timeController.text, _organizationController.organisation);
|
2019-07-15 11:09:10 +00:00
|
|
|
// TODO: make sure organisation is valid
|
|
|
|
// TODO: Add 'find organisation' button which displays a dialog to, well, find the organisation's address or manual entry
|
|
|
|
},
|
2019-05-08 18:54:14 +00:00
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
2019-07-05 14:34:39 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(0.0,25,0.0,0.0),
|
2019-07-05 14:34:39 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
child : Container (
|
|
|
|
height: 18,
|
2019-07-05 14:34:39 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
child : ListView(
|
|
|
|
scrollDirection: Axis.horizontal,
|
2019-07-05 14:34:39 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
"Essential",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 18.0,
|
|
|
|
color: Colors.black,
|
2019-07-05 14:34:39 +00:00
|
|
|
),
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
child : Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(20.0, 0.0, 0, 0),
|
|
|
|
|
|
|
|
child: Checkbox(value:
|
|
|
|
_essentialController.text.toLowerCase() == 'true',
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
setState(() {
|
|
|
|
_essentialController.text =
|
|
|
|
convertBoolToString(newValue);
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Padding(
|
2019-07-15 13:48:41 +00:00
|
|
|
padding: EdgeInsets.fromLTRB(0.0,18,0.0,0.0),
|
2019-07-15 11:09:10 +00:00
|
|
|
|
|
|
|
child : Container (
|
2019-07-15 13:48:41 +00:00
|
|
|
height: 35,
|
2019-07-15 11:09:10 +00:00
|
|
|
// width: 400,
|
2019-07-05 14:34:39 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
child : ListView(
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
2019-07-15 13:48:41 +00:00
|
|
|
padding: const EdgeInsets.fromLTRB(0, 7, 0, 8),
|
2019-07-15 11:09:10 +00:00
|
|
|
child: Text(
|
|
|
|
"Recurring",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 18.0,
|
|
|
|
color: Colors.black,
|
2019-07-05 14:34:39 +00:00
|
|
|
),
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
2019-07-15 13:48:41 +00:00
|
|
|
padding: const EdgeInsets.fromLTRB(29, 0, 0, 0),
|
|
|
|
child: DropdownButton<String>(
|
|
|
|
value: _recurringController.text,
|
|
|
|
onChanged: (String newValue) {
|
|
|
|
setState(() {
|
|
|
|
_recurringController.text = newValue;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
items: getOptions().map<DropdownMenuItem<String>>((String value) {
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
value: value,
|
|
|
|
child: Text(value),
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.toList(),
|
|
|
|
)
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
|
|
|
],
|
2019-07-05 14:34:39 +00:00
|
|
|
),
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
2019-07-05 14:34:39 +00:00
|
|
|
|
2019-07-15 11:09:10 +00:00
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(0.0, 40.0, 0.0, 0.0),
|
|
|
|
child: Container(
|
|
|
|
height: 65.0,
|
|
|
|
child: RaisedButton(
|
|
|
|
onPressed: () {
|
2019-07-16 10:28:36 +00:00
|
|
|
submitReceipt(_amountController.text, _timeController.text, _organizationController.organisation);
|
2019-07-15 11:09:10 +00:00
|
|
|
},
|
2019-07-15 13:55:10 +00:00
|
|
|
child: Text("GO",
|
2019-07-15 11:09:10 +00:00
|
|
|
style:
|
|
|
|
TextStyle(color: Colors.white, fontSize: 22.0)),
|
|
|
|
color: Colors.blue,
|
2019-05-08 18:54:14 +00:00
|
|
|
),
|
|
|
|
),
|
2019-07-15 11:09:10 +00:00
|
|
|
),
|
|
|
|
],
|
2019-05-08 18:54:14 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|