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(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: ListBody(
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(applicationLegalese ?? '', style: Theme.of(context).textTheme.caption),
],

View file

@ -5,18 +5,20 @@ class AnimatedBackground extends StatelessWidget {
final List<Color> animateColors;
final Color lastColor;
final Alignment begin, end;
final int duration;
AnimatedBackground(
this.animateColors,
this.lastColor,
this.begin,
this.end,
this.duration,
);
@override
Widget build(BuildContext context) {
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])),
]);

View file

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

View file

@ -104,7 +104,7 @@ class LoginPageState extends State<LoginPage> {
child: PlatformScaffold(
body: Stack(
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(
margin: EdgeInsets.fromLTRB(60,30,60,0),
@ -175,7 +175,7 @@ class LoginPageState extends State<LoginPage> {
borderRadius: BorderRadius.circular(2),
child : Stack(
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(
type: MaterialType.transparency,
child : InkWell(

View file

@ -70,12 +70,11 @@ class MorePageState extends State<MorePage> {
),
body: Container(
padding: EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 0.0),
child: ListView(
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(0.0,25,0.0,0.0),
padding: EdgeInsets.fromLTRB(30.0,25,30.0,0.0),
child : Text(
"Local Spend Tracker",
textAlign: TextAlign.center,
@ -88,7 +87,7 @@ class MorePageState extends State<MorePage> {
),
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(
height: 65.0,
child: RaisedButton(
@ -98,22 +97,56 @@ class MorePageState extends State<MorePage> {
context: context,
applicationIcon: new Icon(Icons.receipt),
applicationName: "Local Spend Tracker",
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"),
Padding(
padding: EdgeInsets.fromLTRB(0,20,0,0),
child: InkWell(
child: Text
('Developed by Shadowcat Systems',
style: TextStyle(
color: Colors.blue,
),
),
onTap: () => launch('https://shadow.cat/')
children: <Widget>
[
Text("Pear Trading is a commerce company designed to register and monitor money circulating in the local economy.\n"),
Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 35,
child: RaisedButton(
onPressed: () => {},
child: Text("Contact us",
style:
TextStyle(color: Colors.white, fontSize: 18.0)),
color: Colors.green,
),
),
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: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 0.0),
padding: EdgeInsets.fromLTRB(30.0, 20.0, 30.0, 0.0),
child: Container(
height: 65.0,
child: RaisedButton(
@ -150,7 +183,7 @@ class MorePageState extends State<MorePage> {
),
// 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(
// height: 65.0,
// child: RaisedButton(

View file

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