Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. children: <Widget>[
  2. FormBuilder(
  3. key: _fbKey,
  4. autovalidate: true,
  5. child: Column(
  6. children: <Widget>[
  7. FormBuilderDropdown(
  8. attribute: "value",
  9. decoration: InputDecoration(
  10. labelText: "Choose something?"),
  11. hint: Text('Select Option'),
  12. validators: [FormBuilderValidators.required()],
  13. items: user.option.map((v) {
  14. return DropdownMenuItem(
  15. value: v,
  16. child: ListTile(
  17. leading: Image.asset(
  18. 'assets/img/image.png',
  19. width: 50,
  20. height: 50,
  21. ),
  22. title: Text("${v.option}"),
  23. ));
  24.  
  25. }).toList(),
  26. ),
  27. ],
  28. ),
  29. // if v.option == "A" is selected here build Widget A()
  30. // if v.option == "B" is selected here build Widget B()
  31. // if v.option == "C" is selected here build Widget C()
  32. ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement