Skip to content

InputDecorator helper text color does not default to hint color with M3 (it did with M2) #138213

@bleroux

Description

@bleroux

Is there an existing issue for this?

Steps to reproduce

Run the provided code sample.

Expected results

As with Material 2, the expected helper text color should defaults to the hint color.

Capture d’écran du 2023-11-10 11-03-05

Actual results

With Material 3, the helper text color defaults to onSurfaceVariant, as a result the hint and the helper does not have the same color.

Capture d’écran du 2023-11-10 11-01-08

The InputDecorator M3 migration was done in #107943

Code sample

Code sample
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    final ThemeData theme =
        ThemeData(hintColor: Colors.blue[500], useMaterial3: true);
    return MaterialApp(
      theme: theme,
      home: const Scaffold(
        body: TextField(
          decoration: InputDecoration(
            hintText: 'Hint',
            helperText: 'helper text',
          ),
        ),
      ),
    );
  }
}

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.14.0-6.0.pre.1585, on Ubuntu 23.04 6.2.0-36-generic, locale fr_FR.UTF-8)
    ! Flutter version 3.14.0-6.0.pre.1585 on channel [user-branch] at /home/bruno/Nevercode/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    • Upstream repository [email protected]:NevercodeHQ/flutter.git
    • FLUTTER_GIT_URL = [email protected]:NevercodeHQ/flutter.git
    • Framework revision 19b034a964 (il y a 4 jours), 2023-11-06 15:07:09 +0100
    • Engine revision b020893cba
    • Dart version 3.3.0 (build 3.3.0-113.0.dev)
    • DevTools version 2.30.0-dev.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform
      update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /media/oldhome/Android/Sdk
    • Platform android-33-ext5, build-tools 33.0.2
    • ANDROID_HOME = /media/oldhome/Android/Sdk
    • Java binary at: /media/oldhome/Produits/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 15.0.7
    • cmake version 3.25.1
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[✓] Android Studio (version 2021.3)
    • Android Studio at /media/oldhome/Produits/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version unknown)
    • VS Code at /snap/code/current
    • Flutter extension version 3.76.0
    ✗ Unable to determine VS Code version.

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 23.04 6.2.0-36-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 117.0.5938.88

[✓] Network resources
    • All expected network resources are available.

Metadata

Metadata

Assignees

Labels

a: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.found in release: 3.13Found to occur in 3.13found in release: 3.17Found to occur in 3.17has 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