-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:
Felix 2019-07-05 13:39:24 +01:00
parent cad91d5fd4
commit f065e3df6a
11 changed files with 132 additions and 27 deletions

View file

@ -4,9 +4,9 @@
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<item>
<!--<item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item>
</item>-->
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

View file

@ -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(

View file

@ -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,

View file

@ -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');
},
),
],
),
),

View file

@ -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",

View file

@ -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:

View file

@ -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,
),
),
),

View file

@ -160,6 +160,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_fadein:
dependency: "direct main"
description:
name: flutter_fadein
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
flutter_linkify:
dependency: "direct main"
description:
@ -167,6 +174,11 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
flutter_localizations:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_test:
dependency: "direct dev"
description: flutter

View file

@ -15,12 +15,15 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
shared_preferences: ^0.4.2
url_launcher: ^3.0.3
json_annotation : ^2.2.0
http: ^0.12.0+2
datetime_picker_formfield: ^0.1.8
flutter_linkify: ^1.0.3
flutter_fadein: ^1.1.1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
@ -48,7 +51,10 @@ flutter:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
assets:
- assets/
- assets/images/
- assets/images/launch_image.png
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.