ui improvements

This commit is contained in:
Felix 2019-08-20 16:01:56 +01:00
parent 28cd64aaee
commit f5d2e991a8
6 changed files with 184 additions and 199 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -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,17 +102,11 @@ 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], Container(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: AnimatedContainer(
duration: Duration(seconds: 2),
margin: EdgeInsets.fromLTRB(60,30,60,0), margin: EdgeInsets.fromLTRB(60,30,60,0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -170,44 +165,29 @@ class LoginPageState extends State<LoginPage> {
), ),
), ),
Padding( Container(
padding: EdgeInsets.fromLTRB(0.0, 40.0, 0.0, 30.0), margin: EdgeInsets.fromLTRB(0.0, 40.0, 0.0, 30.0),
child: Opacity(
opacity: _isLoggingIn ? 0.5 : 1,
child : Material(
child: new Container(
decoration: new BoxDecoration(
border: new Border.all(color : Colors.transparent, width: 2),
borderRadius: BorderRadius.all(Radius.circular(2)),
gradient: new LinearGradient(
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, width: 100,
height: 50, 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 Center(
child: new Text( child: new Text(
'GO', style: new TextStyle(fontSize: 18, color: Colors.white),), 'GO', style: new TextStyle(fontSize: 18, color: Colors.white),),
), ),
), ),
), ),
), ],
), ),
), ),
), ),
@ -232,6 +212,7 @@ class LoginPageState extends State<LoginPage> {
], ],
), ),
), ),
],
), ),
), ),
); );

View file

@ -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),
), ),
@ -315,7 +308,8 @@ class ReceiptPage2State extends State<ReceiptPage2> {
itemExtent: 36, itemExtent: 36,
), ),
); );
}); }
);
}, },
child: Text( child: Text(
transaction.recurring == null transaction.recurring == null
@ -471,9 +465,11 @@ class ReceiptPage2State extends State<ReceiptPage2> {
height: 75.0, height: 75.0,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
child: Opacity(
opacity: 1,
child: Stack( child: Stack(
children: [ children: [
AnimatedBackground(), AnimatedBackground([Colors.blue, Colors.lightBlue[300]], Colors.lightBlue, Alignment.topLeft, Alignment.bottomRight),
Material( Material(
type: MaterialType.transparency, type: MaterialType.transparency,
child: InkWell( child: InkWell(
@ -522,6 +518,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
), ),
), ),
), ),
),
], ],
), ),
); );