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

26 lines
626 B
Dart
Raw Permalink Normal View History

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