-turned off autocorrect on relevant textfields
-money input field uses number keyboard - validation still required -added fadein animation to first menu -added splash screen (white) (logo looks better on white) -added (temporary?) navigation menu -removed access to navigator from login screen
This commit is contained in:
parent
cad91d5fd4
commit
f065e3df6a
11 changed files with 132 additions and 27 deletions
|
@ -18,17 +18,17 @@ class _BasicDrawerState extends State<BasicDrawer> {
|
|||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
child: Container(
|
||||
padding: new EdgeInsets.all(32.0),
|
||||
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');
|
||||
}
|
||||
title: Text (
|
||||
"Home",
|
||||
style: TextStyle(color: Colors.black, fontSize: 20.0),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed('/HomePage');
|
||||
}
|
||||
),
|
||||
ListTile(
|
||||
title: Text(
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:local_spend/pages/receipt_page.dart';
|
|||
import 'package:local_spend/pages/spash_screen.dart';
|
||||
import 'package:local_spend/pages/about_screen.dart';
|
||||
import 'package:local_spend/config.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
|
||||
void main() {
|
||||
runApp(MyApp());
|
||||
|
@ -15,6 +16,15 @@ class MyApp extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
//var config = ConfigWrapper.of(context);
|
||||
return new MaterialApp(
|
||||
|
||||
localizationsDelegates: [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: [
|
||||
Locale("en")
|
||||
],
|
||||
|
||||
title: "Splash and Token Authentication",
|
||||
theme: new ThemeData(
|
||||
primarySwatch: Colors.blueGrey,
|
||||
|
|
|
@ -2,6 +2,10 @@ import 'package:flutter/material.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:flutter/services.dart';
|
||||
import 'package:local_spend/common/apifunctions/request_logout_api.dart';
|
||||
import 'package:local_spend/common/functions/get_token.dart';
|
||||
import 'package:flutter_fadein/flutter_fadein.dart';
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
@override
|
||||
|
@ -10,6 +14,7 @@ class HomePage extends StatefulWidget {
|
|||
|
||||
class _HomePageState extends State<HomePage> {
|
||||
@override
|
||||
|
||||
void initState() {
|
||||
super.initState();
|
||||
_saveCurrentRoute("/HomePage");
|
||||
|
@ -25,7 +30,7 @@ class _HomePageState extends State<HomePage> {
|
|||
return PlatformScaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
"Home Page",
|
||||
"Navigation",
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
iconTheme: IconThemeData(color: Colors.black),
|
||||
|
@ -33,11 +38,54 @@ class _HomePageState extends State<HomePage> {
|
|||
),
|
||||
drawer: BasicDrawer(),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(32.0),
|
||||
child: Center(
|
||||
child: FadeIn(
|
||||
duration: Duration(milliseconds: 500),
|
||||
curve: Curves.easeIn,
|
||||
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text('This is the Home page'),
|
||||
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.fromLTRB(0, 15, 0, 0),
|
||||
title: new Center(
|
||||
child: new Text(
|
||||
"Submit Receipt",
|
||||
style: TextStyle(color: Colors.black, fontSize: 20.0),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
// debugPrint('$token');
|
||||
Navigator.of(context).pushNamed('/ReceiptPage');
|
||||
},
|
||||
),
|
||||
|
||||
ListTile(
|
||||
title: new Center(
|
||||
child: new Text(
|
||||
"About",
|
||||
style: TextStyle(color: Colors.black, fontSize: 20.0),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
SystemChannels.textInput.invokeMethod('TextInput.hide');
|
||||
Navigator.of(context).pushReplacementNamed('/AboutPage');
|
||||
},
|
||||
),
|
||||
|
||||
ListTile(
|
||||
title: new Center(
|
||||
child: new Text(
|
||||
"Logout",
|
||||
style: TextStyle(color: Colors.black, fontSize: 20.0),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
requestLogoutAPI(context);
|
||||
Navigator.of(context).pushReplacementNamed('/LoginPage');
|
||||
},
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
@ -58,7 +57,6 @@ class LoginPageState extends State<LoginPage> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var drawer = Drawer();
|
||||
return WillPopScope(
|
||||
onWillPop: () {
|
||||
if (Navigator.canPop(context)) {
|
||||
|
@ -69,7 +67,7 @@ class LoginPageState extends State<LoginPage> {
|
|||
}
|
||||
},
|
||||
child: PlatformScaffold(
|
||||
drawer: BasicDrawer(),
|
||||
// drawer: BasicDrawer(),
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
"LOGIN",
|
||||
|
|
|
@ -12,6 +12,7 @@ import 'package:intl/intl.dart';
|
|||
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
|
||||
|
||||
const URL = "https://flutter.io/";
|
||||
const demonstration = true;
|
||||
|
||||
class ReceiptPage extends StatefulWidget {
|
||||
@override
|
||||
|
@ -127,12 +128,30 @@ class ReceiptPageState extends State<ReceiptPage> {
|
|||
decoration: InputDecoration(
|
||||
hintText: 'Value in £',
|
||||
),
|
||||
obscureText: true,
|
||||
// obscureText: true,
|
||||
autocorrect: false,
|
||||
keyboardType: TextInputType.number,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
color: Colors.grey[800],
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
onSubmitted: (_) {
|
||||
SystemChannels.textInput.invokeMethod('TextInput.hide');
|
||||
|
||||
if (demonstration)
|
||||
{
|
||||
showDialogSingleButton(
|
||||
context,
|
||||
"Success",
|
||||
"Recepit successfully submitted.",
|
||||
"OK");
|
||||
}
|
||||
else {
|
||||
submitReceiptAPI(context, _amountController.text,
|
||||
_timeController.text);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
|
@ -142,8 +161,19 @@ class ReceiptPageState extends State<ReceiptPage> {
|
|||
child: RaisedButton(
|
||||
onPressed: () {
|
||||
SystemChannels.textInput.invokeMethod('TextInput.hide');
|
||||
submitReceiptAPI(context, _amountController.text,
|
||||
_timeController.text);
|
||||
|
||||
if (demonstration)
|
||||
{
|
||||
showDialogSingleButton(
|
||||
context,
|
||||
"Success",
|
||||
"Recepit successfully submitted.",
|
||||
"OK");
|
||||
}
|
||||
else {
|
||||
submitReceiptAPI(context, _amountController.text,
|
||||
_timeController.text);
|
||||
}
|
||||
},
|
||||
child: Text("SUBMIT",
|
||||
style:
|
||||
|
|
|
@ -32,16 +32,17 @@ class _SplashScreenState extends State<SplashScreen> {
|
|||
return PlatformScaffold(
|
||||
drawer: drawer,
|
||||
body: Container(
|
||||
decoration: BoxDecoration(color: Colors.black),
|
||||
decoration: BoxDecoration(color: Colors.white),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(color: Colors.black),
|
||||
margin: EdgeInsets.all(15),
|
||||
alignment: FractionalOffset(0.5, 0.3),
|
||||
child: Text(
|
||||
"Local Loop",
|
||||
style: TextStyle(fontSize: 40.0, color: Colors.white),
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/launch_image.png')
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -51,7 +52,7 @@ class _SplashScreenState extends State<SplashScreen> {
|
|||
"© Copyright Statement 2018",
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: Colors.white,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Reference in a new issue