Skip to content

InputDecoration.errorMaxLines's documentation does not match behavior #155626

@Craftplacer

Description

@Craftplacer

Steps to reproduce

  1. Use a TextField
  2. Add errorText
  3. Don't define errorMaxLines in TextField.decoration

Expected results

Not providing a value will wrap the error text by default.

Actual results

Error text is truncated.

Code sample

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

void main() {
  runApp(
    const MaterialApp(
      home: const HomePage(),
    ),
  );
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(32.0),
          child: TextField(
            decoration: InputDecoration(
              errorText: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.',
            ),
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

image

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.26.0-1.0.pre.170, on Void Linux 6.6.51_1, locale en_US.UTF-8)
    • Flutter version 3.26.0-1.0.pre.170 on channel master at $HOME/.local/lib/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 38105edec4 (4 days ago), 2024-09-20 13:04:24 -0400
    • Engine revision 76b7abb5c8
    • Dart version 3.6.0 (build 3.6.0-269.0.dev)
    • DevTools version 2.40.0-dev.1

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at $HOME/.local/lib/android-sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: $HOME/.local/share/JetBrains/Toolbox/apps/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /usr/bin/chromium

[✓] Linux toolchain - develop for Linux desktop
    • clang version 17.0.6
    • cmake version 3.30.1
    • ninja version 1.11.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2024.1)
    • Android Studio at $HOME/.local/share/JetBrains/Toolbox/apps/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 17.0.11+0-17.0.11b1207.24-11852314)

[✓] IntelliJ IDEA Community Edition (version 2024.2)
    • IntelliJ at $HOME/.local/share/JetBrains/Toolbox/apps/intellij-idea-community-edition
    • Flutter plugin version 81.1.3
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Void Linux 6.6.51_1
    • Chrome (web)    • chrome • web-javascript • Chromium 129.0.6668.58

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

• No issues found!

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listd: api docsIssues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.found in release: 3.24Found to occur in 3.24found in release: 3.26Found to occur in 3.26frameworkflutter/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 teamtriaged-text-inputTriaged 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