fixing weird CupertinoPicker

This commit is contained in:
Felix 2019-08-12 16:28:46 +01:00
parent 8bdc413eab
commit 2734131f08

View file

@ -101,19 +101,20 @@ class ReceiptPage2State extends State<ReceiptPage2> {
} }
List<String> _sampleRecurringOptions = new List<String>(7); List<String> _sampleRecurringOptions = new List<String>(7);
List<String> _categories = new List<String>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Future<List<String>> _futureCats = getCats(); if (_categories.length == 0) {
List<String> _categories = new List<String>(); Future<List<String>> _futureCats = getCats();
_categories.add("Fetching categories..."); _categories.add("Fetching categories...");
_futureCats.then((value) {
_futureCats.then((value) { _categories = null;
_categories = null; _categories = value;
_categories = value; setState(() {});
setState(() {}); });
}); }
_sampleRecurringOptions[0] = "None"; _sampleRecurringOptions[0] = "None";
_sampleRecurringOptions[1] = "Daily"; _sampleRecurringOptions[1] = "Daily";