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: /// HTTP POST request sample:
/// {"graph":"total_last_week","session_key":"blahblahblah"} /// {"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"; final url = "https://dev.peartrade.org/api/v1/customer/graphs";
SharedPreferences preferences = await SharedPreferences.getInstance(); SharedPreferences preferences = await SharedPreferences.getInstance();

View file

@ -542,23 +542,24 @@ class ReceiptPageState extends State<ReceiptPage> {
), ),
), ),
Container( // Container(
padding: const EdgeInsets.fromLTRB(29, 0, 0, 0), // padding: const EdgeInsets.fromLTRB(29, 0, 0, 0),
child: DropdownButton<String>( // child: DropdownButton<String>(
value: _categoryController.text, // value: _categoryController.text,
onChanged: (String newValue) { // onChanged: (String newValue) {
setState(() { // setState(() {
_categoryController.text = newValue; // _categoryController.text = newValue;
}); // });
}, // },
items: _categoryDropDownItems.map<DropdownMenuItem<String>>((String value) { // items: _categoryDropDownItems.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( // return DropdownMenuItem<String>(
value: value, // value: value,
child: Text(value), // child: Text(value),
); // );
}).toList(), // fix errors here by [items] being an empty container while _categoryDropDownItems is null // }).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> { class _SplashScreenState extends State<SplashScreen> {
final int splashDuration = 3; final int splashDuration = 1;
startTime() async { startTime() async {
return Timer(Duration(seconds: splashDuration), () { return Timer(Duration(seconds: splashDuration), () {

View file

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