Fix example error on 'Building adaptive apps' page #10769
Labels
e1-hours
Effort: < 8 hrs
fix.examples
Adds or changes example
from.page-issue
Reported in a reader-filed concern
p2-medium
Necessary but not urgent concern. Resolve when possible.
t.adaptive-apps
Relates to creating adaptive apps
Page URL
https://docs.flutter.dev/ui/layout/responsive/building-adaptive-apps/
Page source
https://github.com/flutter/website/tree/main/src/content/ui/layout/responsive/building-adaptive-apps.md
Describe the problem
Seems like old or wrong documentation
class TextStyles {
static const TextStyle raleway = TextStyle(
fontFamily: Fonts.raleway,
);
static TextStyle buttonText1 =
const TextStyle(fontWeight: FontWeight.bold, fontSize: 14);
static TextStyle buttonText2 =
const TextStyle(fontWeight: FontWeight.normal, fontSize: 11);
static TextStyle h1 =
const TextStyle(fontWeight: FontWeight.bold, fontSize: 22);
static TextStyle h2 =
const TextStyle(fontWeight: FontWeight.bold, fontSize: 16);
static TextStyle body1 = raleway.copyWith(color: const Color(0xFF42A5F5));
// etc
}
Expected fix
copyWith is not available for TextStyle
static TextStyle buttonText1 =
const TextStyle(fontWeight: FontWeight.bold, fontSize: 14);
constructor being called is not a const constructor.
Additional context
No response
I would like to fix this problem.
The text was updated successfully, but these errors were encountered: