This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
LocalSpend-Tracker/lib/common/widgets/future_dropdownmenu.dart
Felix 525a092f40
dropdownbutton still not working fully
...but it works a bit more than before!
2019-07-19 15:15:04 +01:00

25 lines
626 B
Dart

import 'package:flutter/material.dart';
import 'package:local_spend/common/apifunctions/categories.dart';
import 'dart:async';
Future<List<DropdownMenuItem>> getDropDownItems(String type) async {
List<DropdownMenuItem<String>> items = new List<DropdownMenuItem<String>>();
// if (type == "categories") {
var categories = await getCategories();
categories.forEach((thisValue) {
items.add(
new DropdownMenuItem(
child: new Text(thisValue.name),
value: thisValue.index,
key: Key(thisValue.index),
),
);
});
print("oof");
return items;
// }
}