Skip to content

TextField uses bodyLarge instead of titleMedium as the documentation says #135411

@mfrischbutter

Description

@mfrischbutter

Is there an existing issue for this?

Steps to reproduce

  1. Create TextField
  2. Edit titleMedium in the Theme
  3. The input of the TextField does not change.

Documentation of the style property of the TextField Widget

  /// The style to use for the text being edited.
  ///
  /// 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].
  final TextStyle? style;

Expected results

The style of the TextField should be defaulted to titleMedium from the theme.

Actual results

The TextField is actually using bodyLarge from the theme.

Code sample

Code sample
return Theme(
        data: ThemeData(
            useMaterial3: true,
            textTheme: const TextTheme(
              titleMedium: TextStyle(
                fontSize: 10,
                color: Colors.red,
              ),
            )),
        child: const TextField(),
      );

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4 22F66 darwin-arm64, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.82.2)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

Labels

a: text inputEntering text in a text field or keyboard related problemsd: api docsIssues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.found in release: 3.13Found to occur in 3.13found in release: 3.15Found to occur in 3.15has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages team

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions