new organisation picker -actually- works now

This commit is contained in:
Felix 2019-08-12 10:48:50 +01:00
parent 9cba3e037c
commit ee682eef82
2 changed files with 11 additions and 5 deletions

View file

@ -151,7 +151,10 @@ class ReceiptPage2State extends State<ReceiptPage2> {
var orgDialog = organisations.dialog(context);
orgDialog.then((organisation) {
try {
debugPrint(organisation.name);
organisation.name.length;
transaction.organisation = organisation;
// debugPrint(organisation.name);
setState(() {});
} catch(_) {
debugPrint("No organisation chosen.");
}
@ -160,7 +163,9 @@ class ReceiptPage2State extends State<ReceiptPage2> {
child: Text(
transaction.organisation.name == null
? 'Find'
: transaction.organisation.name,
: transaction.organisation.name.length > 14
? transaction.organisation.name.substring(0,12) + "..."
: transaction.organisation.name,
style:
TextStyle(color: Colors.white, fontSize: 18.0),
),