lots of UI and some improvements to logic

This commit is contained in:
Felix 2019-08-21 10:16:46 +01:00
parent 68102ea628
commit cf6753363c
7 changed files with 201 additions and 48 deletions

View File

@ -0,0 +1,116 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>

View File

@ -264,9 +264,13 @@ class AboutDialog extends StatelessWidget {
body.add(Expanded( body.add(Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0), padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: ListBody( child: ListBody(
children: <Widget>[ children: <Widget>[
Text(name, style: Theme.of(context).textTheme.title), Container(
padding: EdgeInsets.only(top: 10),
child: Text(name, style: Theme.of(context).textTheme.title),
),
Text(version, style: Theme.of(context).textTheme.body1), Text(version, style: Theme.of(context).textTheme.body1),
Text(applicationLegalese ?? '', style: Theme.of(context).textTheme.caption), Text(applicationLegalese ?? '', style: Theme.of(context).textTheme.caption),
], ],

View File

@ -5,18 +5,20 @@ class AnimatedBackground extends StatelessWidget {
final List<Color> animateColors; final List<Color> animateColors;
final Color lastColor; final Color lastColor;
final Alignment begin, end; final Alignment begin, end;
final int duration;
AnimatedBackground( AnimatedBackground(
this.animateColors, this.animateColors,
this.lastColor, this.lastColor,
this.begin, this.begin,
this.end, this.end,
this.duration,
); );
@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: this.duration),
ColorTween(begin: this.animateColors[0], end: this.animateColors[1])), ColorTween(begin: this.animateColors[0], end: this.animateColors[1])),
]); ]);

View File

@ -82,7 +82,6 @@ class FindOrganisations {
} }
Future<Organisation> dialog(context) { Future<Organisation> dialog(context) {
var focusNode = new FocusNode();
bool _searchEnabled = false; bool _searchEnabled = false;
bool _orgsFetched = false; bool _orgsFetched = false;
@ -106,15 +105,10 @@ class FindOrganisations {
barrierDismissible: true, barrierDismissible: true,
builder: (BuildContext context) { builder: (BuildContext context) {
FocusScope.of(context).requestFocus(focusNode);
return StatefulBuilder( return StatefulBuilder(
builder: (context, setState) { builder: (context, setState) {
return return SimpleDialog(
// AnimatedContainer(
// duration: Duration(seconds: 1),
// child :
SimpleDialog(
children: <Widget>[ children: <Widget>[
Column( Column(
children: [ children: [
@ -126,7 +120,7 @@ class FindOrganisations {
width: 150, width: 150,
height: 50, height: 50,
child: TextField( child: TextField(
focusNode: focusNode, autofocus: true,
controller: searchBarText, controller: searchBarText,
decoration: InputDecoration( decoration: InputDecoration(
hintText: "Payee Name", hintText: "Payee Name",
@ -157,13 +151,13 @@ class FindOrganisations {
child: RaisedButton( child: RaisedButton(
onPressed: _searchEnabled ? (() { onPressed: _searchEnabled ? (() {
SystemChannels.textInput.invokeMethod('TextInput.hide'); SystemChannels.textInput.invokeMethod('TextInput.hide');
var result = _submitSearch(searchBarText.text); var result = _submitSearch(searchBarText.text);
result.then((_) { result.then((_) {
setState(() { setState(() {
_orgsFetched = true; _orgsFetched = true;
});
}); });
});
}) : null, }) : null,
child: Icon(Icons.search, color: Colors.white), child: Icon(Icons.search, color: Colors.white),

View File

@ -104,7 +104,7 @@ class LoginPageState extends State<LoginPage> {
child: PlatformScaffold( child: PlatformScaffold(
body: Stack( body: Stack(
children: [ children: [
AnimatedBackground([Colors.blue[50], Colors.lightBlue[50]], Colors.white, Alignment.topRight, Alignment.bottomLeft), AnimatedBackground([Colors.lightBlue[50], Colors.lightBlue[50]], Colors.white, Alignment.topRight, Alignment.bottomLeft, 3),
Container( Container(
margin: EdgeInsets.fromLTRB(60,30,60,0), margin: EdgeInsets.fromLTRB(60,30,60,0),
@ -175,7 +175,7 @@ class LoginPageState extends State<LoginPage> {
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
child : Stack( child : Stack(
children : [ children : [
AnimatedBackground([Colors.blue, Colors.lightBlue[300]], Colors.lightBlue, Alignment.topRight, Alignment.bottomLeft), AnimatedBackground([Colors.blue, Colors.lightBlue[300]], Colors.lightBlue, Alignment.bottomRight, Alignment.topLeft, 3),
Material( Material(
type: MaterialType.transparency, type: MaterialType.transparency,
child : InkWell( child : InkWell(

View File

@ -70,12 +70,11 @@ class MorePageState extends State<MorePage> {
), ),
body: Container( body: Container(
padding: EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 0.0),
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
Container( Container(
padding: EdgeInsets.fromLTRB(0.0,25,0.0,0.0), padding: EdgeInsets.fromLTRB(30.0,25,30.0,0.0),
child : Text( child : Text(
"Local Spend Tracker", "Local Spend Tracker",
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -88,7 +87,7 @@ class MorePageState extends State<MorePage> {
), ),
Padding( Padding(
padding: EdgeInsets.fromLTRB(0.0, 25.0, 0.0, 0.0), padding: EdgeInsets.fromLTRB(30.0, 25.0, 30.0, 0.0),
child: Container( child: Container(
height: 65.0, height: 65.0,
child: RaisedButton( child: RaisedButton(
@ -98,22 +97,56 @@ class MorePageState extends State<MorePage> {
context: context, context: context,
applicationIcon: new Icon(Icons.receipt), applicationIcon: new Icon(Icons.receipt),
applicationName: "Local Spend Tracker", applicationName: "Local Spend Tracker",
children: <Widget> [ children: <Widget>
Text("Pear Trading is a commerce company designed to register and monitor money circulating in the local economy."), [
Text("\nContact at test@example.com or +44 01524 64544"), Text("Pear Trading is a commerce company designed to register and monitor money circulating in the local economy.\n"),
Container(
Padding( padding: EdgeInsets.symmetric(horizontal: 10),
padding: EdgeInsets.fromLTRB(0,20,0,0), height: 35,
child: InkWell( child: RaisedButton(
child: Text onPressed: () => {},
('Developed by Shadowcat Systems', child: Text("Contact us",
style: TextStyle( style:
color: Colors.blue, TextStyle(color: Colors.white, fontSize: 18.0)),
), color: Colors.green,
),
onTap: () => launch('https://shadow.cat/')
), ),
), ),
Container(
height: 35,
margin: EdgeInsets.fromLTRB(10, 20, 10, 0),
child: RaisedButton(
child: Text
('Pear Trading',
style: TextStyle(
color: Colors.white,
fontSize: 18.0
),
),
color: Colors.lightGreen,
onPressed: () => launch('http://www.peartrade.org')
),
),
Container(
height: 35,
margin: EdgeInsets.fromLTRB(10, 20, 10, 0),
child: Material(
child: OutlineButton(
child: Text
('Shadowcat Systems',
style: TextStyle(
color: Colors.black,
fontSize: 18.0 /// I don't know what to do with this button
),
),
onPressed: () => launch('https://shadow.cat/'),
),
color: Colors.lightGreenAccent,
shadowColor: Colors.transparent,
),
),
], ],
); );
@ -127,7 +160,7 @@ class MorePageState extends State<MorePage> {
), ),
Padding( Padding(
padding: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 0.0), padding: EdgeInsets.fromLTRB(30.0, 20.0, 30.0, 0.0),
child: Container( child: Container(
height: 65.0, height: 65.0,
child: RaisedButton( child: RaisedButton(
@ -150,7 +183,7 @@ class MorePageState extends State<MorePage> {
), ),
// Padding( // Padding(
// padding: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 0.0), // padding: EdgeInsets.fromLTRB(30.0, 20.0, 30.0, 0.0),
// child: Container( // child: Container(
// height: 65.0, // height: 65.0,
// child: RaisedButton( // child: RaisedButton(

View File

@ -98,6 +98,10 @@ class ReceiptPage2State extends State<ReceiptPage2> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var _widgetHeight = MediaQuery.of(context).size.height * 0.06 < 40.0 ? 40.0 : MediaQuery.of(context).size.height * 0.06;
debugPrint(_widgetHeight.toString());
if (_categories.length == 0) { if (_categories.length == 0) {
Future<List<String>> _futureCats = getCats(); Future<List<String>> _futureCats = getCats();
_categories.add("Fetching categories..."); _categories.add("Fetching categories...");
@ -136,7 +140,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
// doesn't fit the screen properly and looks weird // doesn't fit the screen properly and looks weird
Container( Container(
padding: const EdgeInsets.fromLTRB(15, 17, 0, 0), padding: EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.025,MediaQuery.of(context).size.height * 0.025,0,0.0),
child : Text( child : Text(
"Receipt Details", "Receipt Details",
style: TextStyle( style: TextStyle(
@ -167,7 +171,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
Container( Container(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0), padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
height: 40.0, height: _widgetHeight,
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.6,
child: RaisedButton( child: RaisedButton(
onPressed: () { onPressed: () {
@ -232,7 +236,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
Container( Container(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0), padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
height: 40.0, height: _widgetHeight,
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.6,
child: RaisedButton( child: RaisedButton(
onPressed: () { onPressed: () {
@ -269,7 +273,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
Container( Container(
padding: EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.05,15,MediaQuery.of(context).size.width * 0.05,0.0), padding: EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.05,15,MediaQuery.of(context).size.width * 0.05,0.0),
child: Tooltip( child: Tooltip(
message: "Transaction recrudescence", message: "Repeating?",
child: Row( child: Row(
children: <Widget> [ children: <Widget> [
Container( Container(
@ -286,7 +290,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
Container( Container(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0), padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
height: 40.0, height: _widgetHeight,
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.6,
child: RaisedButton( child: RaisedButton(
onPressed: () { onPressed: () {
@ -343,7 +347,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
Container( Container(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0), padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
height: 40.0, height: _widgetHeight,
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.6,
child: Tooltip( child: Tooltip(
message: "Category of transaction", message: "Category of transaction",
@ -402,7 +406,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
), ),
Container( Container(
height: 40.0, height: _widgetHeight,
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.6,
child: Checkbox( child: Checkbox(
value: transaction.isEssential, value: transaction.isEssential,
@ -437,7 +441,7 @@ class ReceiptPage2State extends State<ReceiptPage2> {
Container( Container(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0), padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
height: 40.0, height: _widgetHeight,
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.6,
child: TextField( child: TextField(
style: TextStyle( style: TextStyle(
@ -457,18 +461,18 @@ class ReceiptPage2State extends State<ReceiptPage2> {
), // Amount picker ), // Amount picker
Padding( Padding(
padding: EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.05,15,MediaQuery.of(context).size.width * 0.05,0.0), padding: EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.05,MediaQuery.of(context).size.height * 0.03,MediaQuery.of(context).size.width * 0.05,15.0),
child: Tooltip( child: Tooltip(
message: "Submit receipt", message: "Submit receipt",
child: Container( child: Container(
height: 75.0, height: _widgetHeight * 1.7,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
child: Opacity( child: Opacity(
opacity: 1, opacity: 1,
child: Stack( child: Stack(
children: [ children: [
AnimatedBackground([Colors.blue, Colors.lightBlue[300]], Colors.lightBlue, Alignment.topLeft, Alignment.bottomRight), AnimatedBackground([Colors.blue, Colors.lightBlue[300]], Colors.lightBlue, Alignment.topLeft, Alignment.bottomRight, 4),
Material( Material(
type: MaterialType.transparency, type: MaterialType.transparency,
child: InkWell( child: InkWell(