Advertisement
Guest User

Untitled

a guest
Jul 18th, 2021
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.79 KB | None | 0 0
  1. Align(
  2. alignment: Alignment.topLeft,
  3.  
  4. child: Container(
  5. child: Material(
  6. child: Container(
  7. height: 8,
  8. child: RawAutocomplete<String>(
  9. key: _autocompleteKey,
  10. focusNode: focusNode,
  11. textEditingController: search,
  12.  
  13. optionsBuilder: (TextEditingValue textEditingValue) => _options,
  14. optionsViewBuilder: (BuildContext context,
  15. AutocompleteOnSelected<String> onSelected,
  16. Iterable<String> options) {
  17. return SizedBox(
  18.  
  19. child: Align(
  20. alignment: Alignment.topLeft,
  21. child: Container(
  22. decoration: BoxDecoration(
  23. color: Colors.white,
  24. boxShadow: [
  25. BoxShadow(
  26. color: Colors.grey.withOpacity(0.3),
  27. blurRadius: 34,
  28. spreadRadius: 3,
  29. offset: Offset(0, 10),
  30. )
  31. ],
  32. border: Border.all(color: Colors.black12),
  33. borderRadius: BorderRadius.circular(8),
  34.  
  35. ),
  36. height: 250,
  37.  
  38. child: ListView(
  39. physics: AlwaysScrollableScrollPhysics(),
  40. shrinkWrap:true ,
  41. padding: const EdgeInsets.only(top: 10),
  42. children:[
  43. Column(
  44. children: _options.map((String option) =>
  45. ElevatedButton(
  46. style: ElevatedButton.styleFrom(
  47. primary: Colors.transparent,
  48. elevation: 0,
  49. shadowColor: Colors.transparent,
  50. shape: RoundedRectangleBorder(
  51. borderRadius: BorderRadius.circular(8),
  52. )),
  53. onPressed: () {
  54. focusNode.unfocus();
  55. // address.text = option;
  56. // currentAddress.value = option;
  57. onSelected(option);
  58. debugPrint("5555555555");
  59. setState(() {
  60. });
  61. },
  62. child: Container(
  63. width: MediaQuery.of(context).size.width / 1.2,
  64. alignment: Alignment.topLeft,
  65. child: FittedBox(
  66. fit: BoxFit.fitWidth,
  67. child: Text("${option}",
  68. style: TextStyle(
  69. fontFamily: 'Gilroy-bold',
  70. fontWeight: FontWeight.w500,
  71. fontSize: 16,
  72. color: Colors.black54)),
  73. ),
  74. ),
  75. )).toList(),
  76. ),]
  77. )
  78. ),
  79. ),
  80. );
  81. },
  82. ),
  83. ),
  84. ),
  85. ),
  86.  
  87. ),
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement