Skip to content

InputDecorator does not apply errorStyle to error #174784

@bleroux

Description

@bleroux

Steps to reproduce

  1. Run the code sample
  2. Observe the style of the error message for both input decorators.

Expected results

Both error messages have the same style:

Image

Actual results

The style of the error message of the first decorator is not red and the font size is not correct:

Image

Code sample

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

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: const Scaffold(
        body: Padding(
          padding: EdgeInsets.all(8.0),
          child: Column(
            spacing: 8.0,
            children: [
              InputDecorator(
                decoration: InputDecoration(
                  labelText: 'Name (decorator using error)',
                  filled: true,
                  // Using error to customize the Text's semanticsLabel.
                  error: Text('Enter text', semanticsLabel: 'Enter text in Name edit box'),
                ),
              ),
              InputDecorator(
                decoration: InputDecoration(
                  labelText: 'Name (decorator using errorText)',
                  filled: true,
                  errorText: 'Enter text',
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
Flutter (Channel [user-branch], 3.36.0-1.0.pre-367, on Ubuntu 24.04.2 LTS 6.8.0-79-generic, locale fr_FR.UTF-8)

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.found in release: 3.35Found to occur in 3.35found in release: 3.36Found to occur in 3.36frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input team

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions