Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Container(
- child: ListTile(
- title: Text("Category :-"),
- subtitle: DropdownButtonFormField<Service>(
- value: _category,
- items: List.generate(
- snapshot.data.length,
- (index) => DropdownMenuItem<Service>(
- child: Text(snapshot.data[index].name),
- value: snapshot.data[index],
- ),
- ),
- hint: Text("Choose.."),
- onChanged: (value) {
- setState(() {
- _category = value;
- });
- },
- ),
- ),
- ),
- //TODO:- need to work on it
- Container(
- child: ListTile(
- title: Text("Service :-"),
- subtitle: (_category != null)
- ? DropdownButtonFormField<SubService>(
- value: _service,
- items: List.generate(
- _category.childs.length,
- (index) => DropdownMenuItem<SubService>(
- child: Text(_category.childs[index].name),
- value: _category.childs[index],
- ),
- ),
- hint: Text("Choose.."),
- onChanged: (value) {
- setState(() {
- _service = value;
- });
- },
- )
- : Text(
- "Choose a category first!",
- style: TextStyle(
- color: Colors.red,
- ),
- ),
- ),
- ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement