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
DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios`)
- Flutter (from `.symlinks/flutter/ios-profile`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
EXTERNAL SOURCES:
Flutter:
:path: ".symlinks/flutter/ios"
:path: ".symlinks/flutter/ios-profile"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
url_launcher:

View File

@ -281,7 +281,7 @@
);
inputPaths = (
"${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";
outputPaths = (

View File

@ -2,11 +2,22 @@ import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';
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
Widget build(BuildContext context) {
final tween = MultiTrackTween([
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(
@ -17,9 +28,9 @@ class AnimatedBackground extends StatelessWidget {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [animation["color1"], Colors.lightBlue])),
begin: this.begin,
end: this.end,
colors: [animation["color1"], this.lastColor])),
);
},
);

View File

@ -15,10 +15,6 @@ void main() {
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// GraphData gd = new GraphData();
// gd.getGraphData('total_last_week');
//var config = ConfigWrapper.of(context);
return new MaterialApp(
debugShowCheckedModeBanner: false,
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:url_launcher/url_launcher.dart';
import 'package:local_spend/common/widgets/labeled_checkbox.dart';
import 'package:local_spend/common/widgets/animatedGradientButton.dart';
const URL = "https://flutter.io/";
@ -101,17 +102,11 @@ class LoginPageState extends State<LoginPage> {
}
},
child: PlatformScaffold(
body: Container(
decoration: new BoxDecoration(
gradient: new LinearGradient(
colors: [Colors.blue[50], Colors.white],
stops: [0,1],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: AnimatedContainer(
duration: Duration(seconds: 2),
body: Stack(
children: [
AnimatedBackground([Colors.blue[50], Colors.lightBlue[50]], Colors.white, Alignment.topRight, Alignment.bottomLeft),
Container(
margin: EdgeInsets.fromLTRB(60,30,60,0),
child: Column(
children: <Widget>[
@ -170,44 +165,29 @@ class LoginPageState extends State<LoginPage> {
),
),
Padding(
padding: 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(
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),),
),
),
),
),
],
),
),
),
@ -232,6 +212,7 @@ class LoginPageState extends State<LoginPage> {
],
),
),
],
),
),
);

View File

@ -66,15 +66,6 @@ class ReceiptPage2State extends State<ReceiptPage2> {
_submitReceipt(Transaction transaction) {
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.organisationName = transaction.organisation.name;
@ -205,10 +196,12 @@ class ReceiptPage2State extends State<ReceiptPage2> {
},
child: Text(
transaction.date == null
? 'None set'
: 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() + ", " + '${new DateFormat.Hm().format(transaction.date)}',
? 'None set.'
: transaction.date.year != DateTime.now().year
? '${new DateFormat.MMMd().format(transaction.date)}' + " " + transaction.date.year.toString() + " at " + '${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:
TextStyle(color: Colors.white, fontSize: 22.0),
),
@ -315,7 +308,8 @@ class ReceiptPage2State extends State<ReceiptPage2> {
itemExtent: 36,
),
);
});
}
);
},
child: Text(
transaction.recurring == null
@ -471,9 +465,11 @@ class ReceiptPage2State extends State<ReceiptPage2> {
height: 75.0,
child: ClipRRect(
borderRadius: BorderRadius.circular(2),
child: Opacity(
opacity: 1,
child: Stack(
children: [
AnimatedBackground(),
AnimatedBackground([Colors.blue, Colors.lightBlue[300]], Colors.lightBlue, Alignment.topLeft, Alignment.bottomRight),
Material(
type: MaterialType.transparency,
child: InkWell(
@ -522,6 +518,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
),
),
),
),
],
),
);