samples icon indicating copy to clipboard operation
samples copied to clipboard

Platform Design App. Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.

Open ruslanvs opened this issue 6 years ago • 4 comments

Platform Design App does not build with Error: The getter 'bodyText2' isn't defined for the class 'TextTheme' in file widgets.dart.

The app builds when 'bodyText2' in 'color: Theme.of(context).textTheme.bodyText2.color,' is replaced with 'body2'. I'll issue a PR.

ruslanvs avatar May 10 '20 20:05 ruslanvs

PR: https://github.com/flutter/samples/pull/437

ruslanvs avatar May 10 '20 20:05 ruslanvs

@ruslanvs, thanks for filing an issue to go along with your PR! It really helps us keeps things straight.

Quick question: which version of Flutter are you building with? The most recent stable release, 1.17, includes an update to the Material text styles that renamed both body1 and body2:

https://github.com/flutter/flutter/blob/e8a987e1086912d91deb957d330981322abdc544/packages/flutter/lib/src/material/text_theme.dart#L171

Is it possible you're using an older version?

redbrogdon avatar May 11 '20 21:05 redbrogdon

Thanks for responding, @RedBrogdon, sorry I could not come back promptly. Yes, the error went away after updating Flutter.

ruslanvs avatar May 16 '20 03:05 ruslanvs

use 3.0.0-beta.2

AndreyMolochko avatar Sep 22 '24 05:09 AndreyMolochko