ui improvements
This commit is contained in:
parent
28cd64aaee
commit
f5d2e991a8
6 changed files with 184 additions and 199 deletions
|
@ -6,13 +6,13 @@ PODS:
|
||||||
- Flutter
|
- Flutter
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- Flutter (from `.symlinks/flutter/ios`)
|
- Flutter (from `.symlinks/flutter/ios-profile`)
|
||||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
Flutter:
|
Flutter:
|
||||||
:path: ".symlinks/flutter/ios"
|
:path: ".symlinks/flutter/ios-profile"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
:path: ".symlinks/plugins/shared_preferences/ios"
|
:path: ".symlinks/plugins/shared_preferences/ios"
|
||||||
url_launcher:
|
url_launcher:
|
||||||
|
|
|
@ -281,7 +281,7 @@
|
||||||
);
|
);
|
||||||
inputPaths = (
|
inputPaths = (
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
|
||||||
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
|
"${PODS_ROOT}/../.symlinks/flutter/ios-profile/Flutter.framework",
|
||||||
);
|
);
|
||||||
name = "[CP] Embed Pods Frameworks";
|
name = "[CP] Embed Pods Frameworks";
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
|
|
|
@ -2,11 +2,22 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:simple_animations/simple_animations.dart';
|
import 'package:simple_animations/simple_animations.dart';
|
||||||
|
|
||||||
class AnimatedBackground extends StatelessWidget {
|
class AnimatedBackground extends StatelessWidget {
|
||||||
|
final List<Color> animateColors;
|
||||||
|
final Color lastColor;
|
||||||
|
final Alignment begin, end;
|
||||||
|
|
||||||
|
AnimatedBackground(
|
||||||
|
this.animateColors,
|
||||||
|
this.lastColor,
|
||||||
|
this.begin,
|
||||||
|
this.end,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final tween = MultiTrackTween([
|
final tween = MultiTrackTween([
|
||||||
Track("color1").add(Duration(seconds: 4),
|
Track("color1").add(Duration(seconds: 4),
|
||||||
ColorTween(begin: Colors.lightBlue, end: Colors.lightBlue[300])),
|
ColorTween(begin: this.animateColors[0], end: this.animateColors[1])),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return ControlledAnimation(
|
return ControlledAnimation(
|
||||||
|
@ -17,9 +28,9 @@ class AnimatedBackground extends StatelessWidget {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin: Alignment.topCenter,
|
begin: this.begin,
|
||||||
end: Alignment.bottomCenter,
|
end: this.end,
|
||||||
colors: [animation["color1"], Colors.lightBlue])),
|
colors: [animation["color1"], this.lastColor])),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -15,10 +15,6 @@ void main() {
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// GraphData gd = new GraphData();
|
|
||||||
// gd.getGraphData('total_last_week');
|
|
||||||
|
|
||||||
//var config = ConfigWrapper.of(context);
|
|
||||||
return new MaterialApp(
|
return new MaterialApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
localizationsDelegates: [
|
localizationsDelegates: [
|
||||||
|
|
|
@ -7,6 +7,7 @@ import 'package:local_spend/common/platform/platform_scaffold.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:local_spend/common/widgets/labeled_checkbox.dart';
|
import 'package:local_spend/common/widgets/labeled_checkbox.dart';
|
||||||
|
import 'package:local_spend/common/widgets/animatedGradientButton.dart';
|
||||||
|
|
||||||
const URL = "https://flutter.io/";
|
const URL = "https://flutter.io/";
|
||||||
|
|
||||||
|
@ -101,137 +102,117 @@ class LoginPageState extends State<LoginPage> {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: PlatformScaffold(
|
child: PlatformScaffold(
|
||||||
body: Container(
|
body: Stack(
|
||||||
decoration: new BoxDecoration(
|
children: [
|
||||||
gradient: new LinearGradient(
|
AnimatedBackground([Colors.blue[50], Colors.lightBlue[50]], Colors.white, Alignment.topRight, Alignment.bottomLeft),
|
||||||
colors: [Colors.blue[50], Colors.white],
|
|
||||||
stops: [0,1],
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: AnimatedContainer(
|
|
||||||
duration: Duration(seconds: 2),
|
|
||||||
margin: EdgeInsets.fromLTRB(60,30,60,0),
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: AnimatedContainer(
|
|
||||||
duration: Duration(seconds: 2),
|
|
||||||
margin: EdgeInsets.fromLTRB(15,0,15,0),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
image: DecorationImage(
|
|
||||||
image: AssetImage('assets/images/launch_image.png')
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
|
|
||||||
child: TextField(
|
|
||||||
autocorrect: false,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
controller: _emailController,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: "EMAIL",
|
|
||||||
hintStyle: TextStyle(fontSize: 15),
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 18.0,
|
|
||||||
color: Colors.grey[800],
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
onSubmitted: (_) {
|
|
||||||
FocusScope.of(context).requestFocus(focusNode);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
|
|
||||||
child: TextField(
|
|
||||||
autocorrect: false,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
controller: _passwordController,
|
|
||||||
focusNode: focusNode,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: 'PASSWORD',
|
|
||||||
hintStyle: TextStyle(fontSize: 15),
|
|
||||||
),
|
|
||||||
obscureText: true,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 18.0,
|
|
||||||
color: Colors.grey[800],
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
onSubmitted: (_) {
|
|
||||||
login( _emailController.text,
|
|
||||||
_passwordController.text);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
Padding(
|
Container(
|
||||||
padding: EdgeInsets.fromLTRB(0.0, 40.0, 0.0, 30.0),
|
margin: EdgeInsets.fromLTRB(60,30,60,0),
|
||||||
|
child: Column(
|
||||||
child: Opacity(
|
children: <Widget>[
|
||||||
opacity: _isLoggingIn ? 0.5 : 1,
|
Expanded(
|
||||||
child : Material(
|
child: AnimatedContainer(
|
||||||
child: new Container(
|
duration: Duration(seconds: 2),
|
||||||
decoration: new BoxDecoration(
|
margin: EdgeInsets.fromLTRB(15,0,15,0),
|
||||||
border: new Border.all(color : Colors.transparent, width: 2),
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(2)),
|
image: DecorationImage(
|
||||||
gradient: new LinearGradient(
|
image: AssetImage('assets/images/launch_image.png')
|
||||||
colors: [
|
|
||||||
Colors.blue[300],
|
|
||||||
Colors.blue[500],
|
|
||||||
],
|
|
||||||
stops: [0,1],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
child : Material(
|
|
||||||
type: MaterialType.transparency,
|
|
||||||
|
|
||||||
child : InkWell(
|
|
||||||
onTap: _isLoggingIn ? null : () => login( _emailController.text, _passwordController.text),
|
|
||||||
child: new Container(
|
|
||||||
width: 100,
|
|
||||||
height: 50,
|
|
||||||
child: new Center(
|
|
||||||
child: new Text(
|
|
||||||
'GO', style: new TextStyle(fontSize: 18, color: Colors.white),),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
|
||||||
|
child: TextField(
|
||||||
|
autocorrect: false,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
controller: _emailController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: "EMAIL",
|
||||||
|
hintStyle: TextStyle(fontSize: 15),
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.0,
|
||||||
|
color: Colors.grey[800],
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
onSubmitted: (_) {
|
||||||
|
FocusScope.of(context).requestFocus(focusNode);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
|
||||||
|
child: TextField(
|
||||||
|
autocorrect: false,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
controller: _passwordController,
|
||||||
|
focusNode: focusNode,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: 'PASSWORD',
|
||||||
|
hintStyle: TextStyle(fontSize: 15),
|
||||||
|
),
|
||||||
|
obscureText: true,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.0,
|
||||||
|
color: Colors.grey[800],
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
onSubmitted: (_) {
|
||||||
|
login( _emailController.text,
|
||||||
|
_passwordController.text);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(0.0, 40.0, 0.0, 30.0),
|
||||||
|
width: 100,
|
||||||
|
height: 50,
|
||||||
|
child: Opacity(
|
||||||
|
opacity: _isLoggingIn ? 0.5 : 1,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(2),
|
||||||
|
child : Stack(
|
||||||
|
children : [
|
||||||
|
AnimatedBackground([Colors.blue, Colors.lightBlue[300]], Colors.lightBlue, Alignment.topRight, Alignment.bottomLeft),
|
||||||
|
Material(
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child : InkWell(
|
||||||
|
onTap: _isLoggingIn ? null : () => login( _emailController.text, _passwordController.text),
|
||||||
|
|
||||||
|
child: new Center(
|
||||||
|
child: new Text(
|
||||||
|
'GO', style: new TextStyle(fontSize: 18, color: Colors.white),),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.fromLTRB(0, 10, 0, 50),
|
padding: EdgeInsets.fromLTRB(0, 10, 0, 50),
|
||||||
|
|
||||||
child: LabeledCheckbox(
|
child: LabeledCheckbox(
|
||||||
label : "SAVE LOGIN",
|
label : "SAVE LOGIN",
|
||||||
textStyle: TextStyle(fontSize: 18, color: Colors.black54, fontWeight: FontWeight.bold),
|
textStyle: TextStyle(fontSize: 18, color: Colors.black54, fontWeight: FontWeight.bold),
|
||||||
padding: const EdgeInsets.fromLTRB(0,0,0,0),
|
padding: const EdgeInsets.fromLTRB(0,0,0,0),
|
||||||
value : _saveLoginDetails,
|
value : _saveLoginDetails,
|
||||||
|
|
||||||
onChanged: (bool newValue) {
|
onChanged: (bool newValue) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_saveLoginDetails = newValue;
|
_saveLoginDetails = newValue;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -66,15 +66,6 @@ class ReceiptPage2State extends State<ReceiptPage2> {
|
||||||
|
|
||||||
_submitReceipt(Transaction transaction) {
|
_submitReceipt(Transaction transaction) {
|
||||||
DateTime dt = new DateTime.now();
|
DateTime dt = new DateTime.now();
|
||||||
// sample transaction:
|
|
||||||
// {
|
|
||||||
// "transaction_type":1,
|
|
||||||
// "transaction_value":33,
|
|
||||||
// "purchase_time":"2019-08-12T11:06:00.000+01:00",
|
|
||||||
// "organisation_id":59661,
|
|
||||||
// "essential":false,
|
|
||||||
// "session_key":"C438440A-B775-11E9-8EE8-147589E69626"
|
|
||||||
// }
|
|
||||||
|
|
||||||
Receipt receipt = new Receipt();
|
Receipt receipt = new Receipt();
|
||||||
receipt.organisationName = transaction.organisation.name;
|
receipt.organisationName = transaction.organisation.name;
|
||||||
|
@ -205,10 +196,12 @@ class ReceiptPage2State extends State<ReceiptPage2> {
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
transaction.date == null
|
transaction.date == null
|
||||||
? 'None set'
|
? 'None set.'
|
||||||
: transaction.date.year == DateTime.now().year
|
: transaction.date.year != DateTime.now().year
|
||||||
? '${new DateFormat.MMMd().format(transaction.date)}' + ", " + '${new DateFormat.Hm().format(transaction.date)}'
|
? '${new DateFormat.MMMd().format(transaction.date)}' + " " + transaction.date.year.toString() + " at " + '${new DateFormat.Hm().format(transaction.date)}'
|
||||||
: '${new DateFormat.MMMd().format(transaction.date)}' + " " + transaction.date.year.toString() + ", " + '${new DateFormat.Hm().format(transaction.date)}',
|
: transaction.date.day == DateTime.now().day && transaction.date.month == DateTime.now().month
|
||||||
|
? "Today at " + '${new DateFormat.Hm().format(transaction.date)}'
|
||||||
|
: '${new DateFormat.MMMd().format(transaction.date)}' + " at " + '${new DateFormat.Hm().format(transaction.date)}',
|
||||||
style:
|
style:
|
||||||
TextStyle(color: Colors.white, fontSize: 22.0),
|
TextStyle(color: Colors.white, fontSize: 22.0),
|
||||||
),
|
),
|
||||||
|
@ -299,23 +292,24 @@ class ReceiptPage2State extends State<ReceiptPage2> {
|
||||||
child: RaisedButton(
|
child: RaisedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext builder) {
|
builder: (BuildContext builder) {
|
||||||
return Container(
|
return Container(
|
||||||
height: MediaQuery.of(context).copyWith().size.height / 3,
|
height: MediaQuery.of(context).copyWith().size.height / 3,
|
||||||
child: CupertinoPicker(
|
child: CupertinoPicker(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
children: _sampleRecurringOptions.map((thisOption) => Text(thisOption, style: TextStyle(fontSize: 30))).toList(),
|
children: _sampleRecurringOptions.map((thisOption) => Text(thisOption, style: TextStyle(fontSize: 30))).toList(),
|
||||||
onSelectedItemChanged: ((newValue) {
|
onSelectedItemChanged: ((newValue) {
|
||||||
transaction.recurring = _sampleRecurringOptions[newValue];
|
transaction.recurring = _sampleRecurringOptions[newValue];
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}),
|
}),
|
||||||
magnification: 1.1,
|
magnification: 1.1,
|
||||||
useMagnifier: true,
|
useMagnifier: true,
|
||||||
itemExtent: 36,
|
itemExtent: 36,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
transaction.recurring == null
|
transaction.recurring == null
|
||||||
|
@ -380,7 +374,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
|
||||||
? 'None'
|
? 'None'
|
||||||
: transaction.category,
|
: transaction.category,
|
||||||
style:
|
style:
|
||||||
TextStyle(color: Colors.white, fontSize: 22.0),
|
TextStyle(color: Colors.white, fontSize: 22.0),
|
||||||
),
|
),
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
),
|
),
|
||||||
|
@ -471,52 +465,55 @@ class ReceiptPage2State extends State<ReceiptPage2> {
|
||||||
height: 75.0,
|
height: 75.0,
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(2),
|
borderRadius: BorderRadius.circular(2),
|
||||||
child: Stack(
|
child: Opacity(
|
||||||
children: [
|
opacity: 1,
|
||||||
AnimatedBackground(),
|
child: Stack(
|
||||||
Material(
|
children: [
|
||||||
type: MaterialType.transparency,
|
AnimatedBackground([Colors.blue, Colors.lightBlue[300]], Colors.lightBlue, Alignment.topLeft, Alignment.bottomRight),
|
||||||
child: InkWell(
|
Material(
|
||||||
child: Center(
|
type: MaterialType.transparency,
|
||||||
child : Text("GO",
|
child: InkWell(
|
||||||
style:
|
child: Center(
|
||||||
TextStyle(color: Colors.white, fontSize: 30.0),
|
child : Text("GO",
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.white, fontSize: 30.0),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
onTap: () {
|
||||||
onTap: () {
|
try {
|
||||||
try {
|
if (transaction.amount.text == "" || transaction.organisation.name == null) {
|
||||||
if (transaction.amount.text == "" || transaction.organisation.name == null) {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return _invalidDialog(context);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
if (double.tryParse(transaction.amount.text) != null && double.tryParse(transaction.amount.text) > 0) {
|
|
||||||
_submitReceipt(transaction);
|
|
||||||
} else {
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return _invalidDialog(context);
|
return _invalidDialog(context);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
if (double.tryParse(transaction.amount.text) != null && double.tryParse(transaction.amount.text) > 0) {
|
||||||
|
_submitReceipt(transaction);
|
||||||
|
} else {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return _invalidDialog(context);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
catch (_) {
|
||||||
catch (_) {
|
showDialog(
|
||||||
showDialog(
|
context: context,
|
||||||
context: context,
|
builder: (BuildContext context) {
|
||||||
builder: (BuildContext context) {
|
return _invalidDialog(context);
|
||||||
return _invalidDialog(context);
|
}
|
||||||
}
|
);
|
||||||
);
|
}
|
||||||
}
|
},
|
||||||
},
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Reference in a new issue