From c15fdf1382e565c2cc205e93dcd5f4ec65998db3 Mon Sep 17 00:00:00 2001 From: Finn Date: Thu, 16 May 2019 17:04:08 +0100 Subject: [PATCH] added proper date and time picker --- lib/pages/login_page.dart | 4 ++-- lib/pages/receipt_page.dart | 27 ++++++++++++--------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index 4a3abb2..0d0a249 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -128,7 +128,7 @@ class LoginPageState extends State { ), style: TextStyle( fontSize: 18.0, - color: Colors.grey, + color: Colors.grey[800], fontWeight: FontWeight.bold, ), ), @@ -154,7 +154,7 @@ class LoginPageState extends State { obscureText: true, style: TextStyle( fontSize: 18.0, - color: Colors.grey, + color: Colors.grey[800], fontWeight: FontWeight.bold, ), ), diff --git a/lib/pages/receipt_page.dart b/lib/pages/receipt_page.dart index c977d5b..8fd05ac 100644 --- a/lib/pages/receipt_page.dart +++ b/lib/pages/receipt_page.dart @@ -8,6 +8,7 @@ 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'; +import 'package:intl/intl.dart'; import 'package:datetime_picker_formfield/datetime_picker_formfield.dart'; const URL = "https://flutter.io/"; @@ -27,6 +28,8 @@ class ReceiptPageState extends State { final TextEditingController _typeController = TextEditingController(); final TextEditingController _orgController = TextEditingController(); + DateTime date; + Future launchURL(String url) async { if (await canLaunch(url)) { await launch(url, forceSafariVC: true, forceWebView: true); @@ -97,19 +100,13 @@ class ReceiptPageState extends State { fontWeight: FontWeight.bold, ), ), - Padding( - padding: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0), - child: TextField( - controller: _timeController, - decoration: InputDecoration( - hintText: "Use your login email", - ), - style: TextStyle( - fontSize: 18.0, - color: Colors.grey, - fontWeight: FontWeight.bold, - ), - ), + DateTimePickerFormField( + inputType: InputType.both, + format: DateFormat("EEEE, MMMM d, yyyy 'at' h:mma"), + editable: true, + decoration: InputDecoration( + labelText: 'Date/Time of Transaction', hasFloatingPlaceholder: false), + onChanged: (dt) => setState(() => date = dt), ), Padding( padding: EdgeInsets.fromLTRB(0.0, 35.0, 0.0, 0.0), @@ -127,12 +124,12 @@ class ReceiptPageState extends State { child: TextField( controller: _amountController, decoration: InputDecoration( - hintText: 'Your password, keep it secret, keep it safe.', + hintText: 'Value in £', ), obscureText: true, style: TextStyle( fontSize: 18.0, - color: Colors.grey, + color: Colors.grey[800], fontWeight: FontWeight.bold, ), ),