From 4600b12a7e1c5fa17de32b92e91e8512bc1ce168 Mon Sep 17 00:00:00 2001 From: Taha Tesser Date: Thu, 28 Sep 2023 11:50:06 +0300 Subject: [PATCH] Update `TextField.style` documentation for Material 3 (#135556) fixes [TextField uses bodyLarge instead of titleMedium as the documentation says ](https://github.com/flutter/flutter/issues/135411) --- packages/flutter/lib/src/material/input_decorator.dart | 1 - packages/flutter/lib/src/material/text_field.dart | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index e429eb8e77..80091f4264 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -2903,7 +2903,6 @@ class InputDecoration { /// {@endtemplate} final TextStyle? errorStyle; - /// The maximum number of lines the [errorText] can occupy. /// /// Defaults to null, which means that the [errorText] will be limited diff --git a/packages/flutter/lib/src/material/text_field.dart b/packages/flutter/lib/src/material/text_field.dart index e8ea428996..181be1a631 100644 --- a/packages/flutter/lib/src/material/text_field.dart +++ b/packages/flutter/lib/src/material/text_field.dart @@ -423,7 +423,12 @@ class TextField extends StatefulWidget { /// /// This text style is also used as the base style for the [decoration]. /// - /// If null, defaults to the `titleMedium` text style from the current [Theme]. + /// If null, [TextTheme.bodyLarge] will be used. When the text field is disabled, + /// [TextTheme.bodyLarge] with an opacity of 0.38 will be used instead. + /// + /// If null and [ThemeData.useMaterial3] is false, [TextTheme.titleMedium] will + /// be used. When the text field is disabled, [TextTheme.titleMedium] with + /// [ThemeData.disabledColor] will be used instead. final TextStyle? style; /// {@macro flutter.widgets.editableText.strutStyle}