Compile error when trying to use Animator in Flutter

Issue

Compiler message:

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/animator-0.1.4/lib/animator.dart:457:7: Error: No named parameter with the name 'blocs'.
      blocs: [_animatorBloc],
      ^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/states_rebuilder-1.15.0/lib/src/state_with_mixin_builder.dart:142:3: Context: Found this candidate, but the arguments don't match.   StateWithMixinBuilder({   ^^^^^^^^^^^^^^^^^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/animator-0.1.4/lib/animator.dart:494:27: Error: Method not found: 'StatesRebuilder.addToListeners'.
          StatesRebuilder.addToListeners(
                          ^^^^^^^^^^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/animator-0.1.4/lib/animator.dart:559:27: Error: Method not found: 'StatesRebuilder.removeFromListeners'.
          StatesRebuilder.removeFromListeners(b, widget.name, "$hashCode");
                          ^^^^^^^^^^^^^^^^^^^

Solution

Fix by adding statebuilder package in pubsec.yml file

states_rebuilder: 1.3.2

Answered By – Redwan

Answer Checked By – Jay B. (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *