save before checking-out previous

This commit is contained in:
Felix 2019-07-18 14:28:34 +01:00
parent d7625f7b88
commit 9a09154332
No known key found for this signature in database
GPG key ID: 130EF6DC43E4DD07
4 changed files with 22 additions and 21 deletions

View file

@ -17,7 +17,7 @@ class GraphData {
/// HTTP POST request sample:
/// {"graph":"total_last_week","session_key":"blahblahblah"}
charts.Series dataSeries = new charts.Series();
charts.Series<dynamic, DateTime> dataSeries = new charts.Series<dynamic, DateTime>();
final url = "https://dev.peartrade.org/api/v1/customer/graphs";
SharedPreferences preferences = await SharedPreferences.getInstance();

View file

@ -542,23 +542,24 @@ class ReceiptPageState extends State<ReceiptPage> {
),
),
Container(
padding: const EdgeInsets.fromLTRB(29, 0, 0, 0),
child: DropdownButton<String>(
value: _categoryController.text,
onChanged: (String newValue) {
setState(() {
_categoryController.text = newValue;
});
},
items: _categoryDropDownItems.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(), // fix errors here by [items] being an empty container while _categoryDropDownItems is null
)
),
// Container(
// padding: const EdgeInsets.fromLTRB(29, 0, 0, 0),
// child: DropdownButton<String>(
// value: _categoryController.text,
// onChanged: (String newValue) {
// setState(() {
// _categoryController.text = newValue;
// });
// },
// items: _categoryDropDownItems.map<DropdownMenuItem<String>>((String value) {
// return DropdownMenuItem<String>(
// value: value,
// child: Text(value),
// );
// }).toList(), // fix errors here by [items] being an empty container while _categoryDropDownItems is null
// )
// ),
],
),
),

View file

@ -10,7 +10,7 @@ class SplashScreen extends StatefulWidget {
}
class _SplashScreenState extends State<SplashScreen> {
final int splashDuration = 3;
final int splashDuration = 1;
startTime() async {
return Timer(Duration(seconds: splashDuration), () {

View file

@ -49,14 +49,14 @@ class StatsPageState extends State<StatsPage> {
@override
Widget build(BuildContext context) {
if (graphData.data != null) {
// if (graphData.data != null) {
graphData.getGraphData('total_last_week').then((val) {
totalLastWeek = val;
setState(() {
// update view
});
});
}
// }
return PlatformScaffold(
appBar: AppBar(