-
Notifications
You must be signed in to change notification settings - Fork 63
Description
see https://api.flutter.dev/flutter/widgets/BuildContext/inheritFromWidgetOfExactType.html
This means that after upgrading to this version, compiling the app gives:
Target dart2js failed: Exception: /C:/ToolsJK/flutter/.pub-cache/hosted/pub.dartlang.org/dynamic_theme-1.0.1/lib/dynamic_theme.dart:25:20:
Error: The method 'ancestorStateOfType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/ToolsJK/flutter/packages/flutter/lib/src/widgets/framework.dart').
return context.ancestorStateOfType(const TypeMatcher());
^^^^^^^^^^^^^^^^^^^
Error: Compilation failed.
Workaround:
Try correcting the name to the name of an existing method, or defining a method named 'ancestorStateOfType'.
with block 4.0.0just change this in file .pub-cache/../dynamic_theme.dart:25:20
context.ancestorStateOfType()
on thatcontext.findAncestorStateOfType();
See also:
https://stackoverflow.com/questions/65749767/error-the-method-inheritfromwidgetofexacttype-isnt-defined-for-the-class-bu/66091525
https://stackoverflow.com/questions/65657716/error-the-method-ancestorstateoftype-isnt-defined-for-the-class-buildcontex