Closed nilpkthmsk closed 2 years ago
which version are using ?
It's version 2.0.1.
could you past an example of your code
DropdownSearch(
mode: Mode.BOTTOM_SHEET,
dropdownSearchDecoration: InputDecoration(
labelText: context.localeString("Currency"),
hintText: context.localeString("Currency Hint"),
contentPadding:
const EdgeInsets.fromLTRB(12, 12, 0, 0),
border: const OutlineInputBorder(),
),
showSearchBox: true,
// showClearButton: true,
searchFieldProps: TextFieldProps(
decoration: InputDecoration(
labelText: context.localeString("Currency Search"),
contentPadding: const EdgeInsets.all(12),
border: const OutlineInputBorder(),
)),
items: Currency.list,
onChanged: (CurrencyUnit? c) => {Currency.save(c!)},
onFind: (String? filter) =>
Currency.findAll(keyword: filter),
itemAsString: (CurrencyUnit? c) => c.toString(),
selectedItem: Currency.load(),
),
For Currency.findAll, I use the filter to make list, and return the new list with it.
i think you have somthinng wrong in your data.
try to use isFilteredOnline
to true
I tried setting the isFilteredOnline to true, but the result remains the same. I tried to print the data in the filter function, and it is like below.
flutter: THB
flutter: 1
THB = filtered text 1 = length of the list return The same result goes for no isFilteredOnline setting. And I found another error, don't know if it's related.
#0 _validateRpcStringParam (package:flutter_tools/src/vmservice.dart:377:5)
#1 setUpVmService. (package:flutter_tools/src/vmservice.dart:236:33)
#2 setUpVmService. (package:flutter_tools/src/vmservice.dart:234:60)
#3 VmService._routeRequest (package:vm_service/src/vm_service.dart:2253:27)
#4 VmService._processRequest (package:vm_service/src/vm_service.dart:2223:25)
#5 VmService._processMessageStr (package:vm_service/src/vm_service.dart:2190:9)
#6 _rootRunUnary (dart:async/zone.dart:1436:47)
#7 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#8 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#9 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#10 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#11 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#12 _StreamController._add (dart:async/stream_controller.dart:607:7)
#13 _StreamController.add (dart:async/stream_controller.dart:554:5)
#14 new _WebSocketImpl._fromSocket. (dart:_http/websocket_impl.dart:1144:21)
#15 _rootRunUnary (dart:async/zone.dart:1436:47)
#16 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#17 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#18 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#19 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#20 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)
#21 _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)
#22 _WebSocketProtocolTransformer._messageFrameEnd (dart:_http/websocket_impl.dart:332:23)
#23 _WebSocketProtocolTransformer.add (dart:_http/websocket_impl.dart:226:46)
#24 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#25 _rootRunUnary (dart:async/zone.dart:1436:47)
#26 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#27 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#28 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#29 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#30 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#31 _StreamController._add (dart:async/stream_controller.dart:607:7)
#32 _StreamController.add (dart:async/stream_controller.dart:554:5)
#33 _Socket._onData (dart:io-patch/socket_patch.dart:2302:41)
#34 _rootRunUnary (dart:async/zone.dart:1444:13)
#35 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#36 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#37 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#38 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#39 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#40 _StreamController._add (dart:async/stream_controller.dart:607:7)
#41 _StreamController.add (dart:async/stream_controller.dart:554:5)
#42 new _RawSocket. (dart:io-patch/socket_patch.dart:1830:33)
#43 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1314:14)
#44 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#45 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#46 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122:13)
#47 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)
I encounter the same issue, just remove the onFind function, it seems like the itemAsString is enough
I encounter the same issue, just remove the onFind function, it seems like the itemAsString is enough
Oh it works now. Thank you so much.
I use onFind to filter the items list for the dropdown, but the selected on will be duplicated, and shown twice in the dropdown. Any work around ?
Thank you in advance.