Time when trying to import fl_chart.dart it through this error
: Error: 'TextScaler' isn't a type. base_chart_painter.dart:31 final TextScaler textScaler; ^^^^^^^^^^ : Error: The getter 'textScaler' isn't defined for the class 'MediaQueryData'. line_chart_renderer.dart:27
how can i solve this error
TextScaler
was introduced in Flutter 3.16.0 to replace all textScaleFactor
https://docs.flutter.dev/release/breaking-changes/deprecate-textscalefactor
The package author should have updated the package's sdk constraint to flutter: ^3.16.0
to support the new TextScaler
.
You could either update your flutter sdk to 3.16.0 up or use an older version of the package which does not introduce the new TextScaler
.
Update: check out the github issue here