save before experiment, broken

This commit is contained in:
Felix 2019-07-19 12:06:02 +01:00
parent 1b207c1ce6
commit 2e0802ac73
No known key found for this signature in database
GPG key ID: 130EF6DC43E4DD07
3 changed files with 103 additions and 37 deletions

View file

@ -13,7 +13,7 @@ class Category {
});
}
Future<List<Category>> getCategories() async {
Future<List<Category>> getCategories() async { // confusing name
const url = "https://dev.peartrade.org/api/search/category";
var token;

View file

@ -0,0 +1,35 @@
import 'package:flutter/material.dart';
class DropDownMenu extends StatefulWidget {
final List<DropdownMenuItem> items;
final Function onChanged;
final String value;
DropDownMenu({
this.items,
this.onChanged,
this.value,
});
@override
_DropDownMenuState createState() => _DropDownMenuState(items: this.items, onNewValue: this.onChanged, value: this.value);
}
class _DropDownMenuState extends State<DropDownMenu> {
final List<DropdownMenuItem> items;
final Function onNewValue;
final String value;
_DropDownMenuState({
this.items,
this.onNewValue,
this.value
});
@override
Widget build(BuildContext context) {
return new DropdownButton(value: this.value, items: this.items, onChanged: (newValue) => onNewValue(newValue),);
}
}