Skip to content

TextField/TextFormField labelText and hintText should be right-aligned with TextDirection.rtl #41324

Closed
flutter/packages
#12607

Description

@mohamed-reda

There is forgotten attribute write for the labelText of(TextFormField or TextField) from right to left.
I tried with textAlign, textDirection. Although, it works with hintText and the user input, it doesn't work with the labelText.

Screenshot
textfield.txt

TextFormField(
        textAlign: Language.lang  == 'NotArabic'  ?TextAlign.left:TextAlign.right,
        validator: (value) {
          return Validators().validateEmail(value);
        },
        controller: _emailController,
        decoration: new InputDecoration(
            hintStyle: new TextStyle(color: Colors.grey[500],),
            labelStyle: new TextStyle(color: Colors.grey[900],),
            hintText: 'hint Email',
            labelText: 'label Email',
            fillColor: Colors.white70),
        textDirection:
            Language.lang == 'NotArabic' ? TextDirection.ltr : TextDirection.rtl,
      ) 

Activity

  1. added
    a: internationalizationSupporting other languages or locales. (aka i18n)
    a: text inputEntering text in a text field or keyboard related problems
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: new featureNothing broken; request for a new capability
    on Sep 26, 2019
  2. janmoppel commented on Sep 26, 2019

    @janmoppel

    Hello @mohamed-reda !

    Thank you for posting an issue.
    Can you please also attach the flutter doctor -v command output?

    Thank you.

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 26, 2019
  4. mohamed-reda commented on Nov 2, 2019

    @mohamed-reda
    Author

    flutter doctor print :

    C:\src\flutter\bin\flutter.bat doctor --verbose
    [√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 6.1.7601], locale ar-EG)
    • Flutter version 1.9.1+hotfix.6 at C:\src\flutter
    • Framework revision 68587a0 (7 weeks ago), 2019-09-13 19:46:58 -0700
    • Engine revision b863200
    • Dart version 2.5.0

    [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\AboReda\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

    [√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

    [√] IntelliJ IDEA Community Edition (version 2019.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1.1
    • Flutter plugin version 35.3.3
    • Dart plugin version 191.7141.49

    [√] VS Code (version 1.38.1)
    • VS Code at C:\Users\AboReda\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.4.1

    [√] Connected device (1 available)
    • Infinix X5515 • 0350225897007314 • android-arm • Android 8.1.0 (API 27)

    • No issues found!
    Process finished with exit code 0

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 2, 2019
  6. added and removed
    team-designOwned by Design Languages team
    triaged-designTriaged by Design Languages team
    on Dec 11, 2024
  7. victorsanni commented on Jan 23, 2025

    @victorsanni
    Contributor
  8. added
    P2Important issues not at the top of the work list
    on Jan 23, 2025
  9. changed the title [-]view labelText of the TextField from right to left[/-] [+]TextField/TextFormField labelText and hintText do not respect TextDirection.rtl[/+] on Jan 24, 2025
  10. victorsanni commented on Jan 24, 2025

    @victorsanni
    Contributor

    Reproducible using the code sample below.

    Sample code
    import 'package:flutter/material.dart';
    
    void main() => runApp(TextLabelRtlApp());
    
    class TextLabelRtlApp extends StatelessWidget {
      const TextLabelRtlApp({super.key});
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          home: Scaffold(
            appBar: AppBar(
              title: Text('RTL TextFormField'),
            ),
            body: Center(
              child: TextField(
                decoration: InputDecoration(
                  hintText: 'hint text',
                  labelText: 'label text',
                ),
                textDirection: TextDirection.rtl,
              ),
            ),
          ),
        );
      }
    }
    textformfield.rtl.mov
  11. changed the title [-]TextField/TextFormField labelText and hintText do not respect TextDirection.rtl[/-] [+]TextField/TextFormField labelText and hintText should be right-aligned with TextDirection.rtl[/+] on Jan 24, 2025
  12. Mairramer commented on Feb 16, 2026

    @Mairramer
    Contributor

    @victorsanni I’ve implemented a solution that resolves a few inconsistencies and improves InputDecoration consistency across dependent widgets.

  13. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  14. github-actions commented on Oct 9, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)a: text inputEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions