skip to Main Content

I am using latest version of flutter, with latest version of Xcode, with latest version of android studio. I also have charts_flutter: ^0.12.0 but I am getting the error :

Launching lib/main.dart on iPhone 15 Pro Max in debug mode...
Xcode build done.                                            3,9s
Failed to build iOS app
Error (Xcode): ../.pub-cache/hosted/pub.dev/charts_flutter-0.12.0/lib/src/behaviors/legend/legend_entry_layout.dart:134:45: 
Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro Max.

I tried flutter upgrade, flutter doctor, but everything is right and up to date.
I do not understand why I have an error, and therefore do not know how to solve it after many stack overflow posts.

2

Answers


  1. The error you are getting is due to using of an old package. the last version of that package was released 2 years ago and in 2 years flutter changed very rapidly and the text theme property bodyText2 has been removed in the latest version of the flutter which you can now use bodyMedium in palce of bodyText2 and as this error is in the package either change the package and use a new one. or open the file which is causing the issue and change the bodyText2 property to bodyMedium. you can read about other removed text theme properties here

    Login or Signup to reply.
  2. You can use Use 3.0.0-beta.2 for fix

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search