Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type '(String, String) => bool' is not a subtype of type '(dynamic, String) => bool' #11

Closed
SalehHub opened this issue Mar 19, 2018 · 8 comments

Comments

@SalehHub
Copy link

SalehHub commented Mar 19, 2018

I tried to run the Example code and worked fine at first with yellow warring, but this issue occurred after updating Flutter to :
Flutter 0.2.3-pre.41 • channel master
Tool : Dart 2.0.0-dev.39.0.flutter-f1ebe2bd5c

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building MaterialSearch(dirty, state:
_MaterialSearchState#f2549):
type '(String, String) => bool' is not a subtype of type '(dynamic, String) => bool'

Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new

When the exception was thrown, this was the stack:
#0 _MaterialSearchState.build. (package:material_search/material_search.dart:145:20)
#1 WhereIterator.moveNext (dart:_internal/iterable.dart:439:11)
#2 new List.from (dart:core/runtime/libarray_patch.dart:58:17)
#3 Iterable.toList (dart:core/iterable.dart:413:16)
#4 _MaterialSearchState.build (package:material_search/material_search.dart:156:8)
#5 StatefulElement.build (package:flutter/src/widgets/framework.dart:3713:27)
#6 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3625:15)
#7 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#8 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#12 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#13 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#14 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#15 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#18 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#19 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#20 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#21 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#22 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#23 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#24 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#25 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#26 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
#27 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#28 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#29 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#30 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#31 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#32 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#33 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#34 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#35 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
#36 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#37 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#38 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#39 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#40 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#41 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#42 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#43 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#44 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#45 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#46 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#47 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#48 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#49 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#50 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#51 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#52 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#53 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#54 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#55 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#56 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#57 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#58 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#59 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#60 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#61 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#62 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#63 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#64 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
#65 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#66 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4738:32)
#67 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#68 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#69 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#70 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#71 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#72 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#73 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#74 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#75 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#76 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
#77 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#78 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#79 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#80 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#81 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#82 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#83 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#84 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#85 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#86 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
#87 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#88 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#89 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#90 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#91 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#92 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#93 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#94 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#95 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#96 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
#97 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#98 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#99 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#100 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#101 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#102 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#103 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#104 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#105 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#106 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#107 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#108 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#109 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#110 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#111 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#112 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
#113 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#114 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#115 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
#116 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#117 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#118 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
#119 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#120 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#121 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#122 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#123 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#124 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#125 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#126 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#127 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
#128 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#129 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#130 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#131 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#132 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#133 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#134 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#135 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#136 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#137 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#138 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#139 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#140 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#141 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#142 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#143 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#144 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#145 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#146 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
#147 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
#148 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
#149 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
#150 Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
#151 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4420:32)
#152 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4748:17)
#153 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#154 _TheatreElement.update (package:flutter/src/widgets/overlay.dart:507:16)
#155 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#156 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#157 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#158 StatefulElement.update (package:flutter/src/widgets/framework.dart:3782:5)
#159 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#160 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#161 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#162 ProxyElement.update (package:flutter/src/widgets/framework.dart:3892:5)
#163 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#164 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4640:14)
#165 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#166 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#167 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#168 StatefulElement.update (package:flutter/src/widgets/framework.dart:3782:5)
#169 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#170 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4640:14)
#171 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#172 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4640:14)
#173 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#174 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#175 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#176 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2225:33)
#177 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:621:20)
#178 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
#179 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
#180 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
#181 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
#182 _invoke (dart:ui/hooks.dart:120:13)
#183 _drawFrame (dart:ui/hooks.dart:109:3)
════════════════════════════════════════════════════════════════════════════════════════════════════
Another exception was thrown: type '(String, String) => bool' is not a subtype of type '(dynamic, String) => bool'

@SalehHub
Copy link
Author

SalehHub commented Mar 19, 2018

I solved the above issue by removing the filter part below

                filter: (String value, String criteria) {
                  return value.toLowerCase().trim()
                      .contains(new RegExp(r'' + criteria.toLowerCase().trim() + ''));
                },

but I got another issue when I try to select an item from the list, it says:

Another exception was thrown: type '(String) => void' is not a subtype of type '(dynamic) => void'

@ianldgs
Copy link
Owner

ianldgs commented Mar 23, 2018

Probably due to flutter's beta release. I'll check that.

@ianldgs
Copy link
Owner

ianldgs commented Mar 24, 2018

Oh, you are on master channel... For now I am keeping the lib compatible with the stable release, which is beta. This bug will be fixed when flutter make mark this release as stable.

@rodydavis
Copy link

I am getting this same error on Flutter 0.2.8 beta and Dart 2

@ianldgs
Copy link
Owner

ianldgs commented Apr 16, 2018

I'll fix that today. I am moving my development to master. A lot o fixes aren't on beta yet.

@ianldgs
Copy link
Owner

ianldgs commented Apr 16, 2018

Released 0.2.2.

@ianldgs ianldgs closed this as completed Apr 16, 2018
@rodydavis
Copy link

Thank you!

@Tokenyet
Copy link

Is there any article discussing about this issue? Recently, I made my own searchable component, and stuck with this issue unitl I found @ianldgs 's commit. Hope there is any explanation about what happened with genetic and dynamic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants