Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. Scaffold(
  2. appBar: AppBar(
  3. title: appBarTitle,
  4. actions: <Widget>[
  5. IconButton(
  6. icon: actionIcon,
  7. onPressed: () {
  8. setState(() {
  9. if (this.actionIcon.icon == Icons.search) {
  10. this.actionIcon = new Icon(
  11. Icons.close,
  12. color: Colors.white,
  13. );
  14. appBarTitle = AutoCompleteTextField<AutoCompleteObject>(
  15. key: key,
  16. controller: TextEditingController(),
  17. clearOnSubmit: true,
  18. suggestions: listName,
  19. itemBuilder: (context, suggestion) => Padding(
  20. child: ListTile(
  21. title: Text(suggestion.name),
  22. trailing: Text(suggestion.owner),
  23. ),
  24. padding: EdgeInsets.all(8.0),
  25. ),
  26. itemSubmitted: (item) => setState(() {
  27. globals.tagStream.sink.add(item.tag);
  28. controller.halfExpand();
  29. _handleSearchEnd();
  30. }),
  31. focusNode: _focusField,
  32. itemSorter: (a, b) => 0,
  33. itemFilter: (suggestion, query) => Filter();
  34. );
  35. requestFocus();
  36. } else {
  37. _handleSearchEnd();
  38. }
  39. });
  40. },
  41. ),
  42. ],
  43. ),
  44. drawer: leftMenuConnected
  45. body: CommunityPage(),
  46. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement