Skip to content

Under Directionality and Align, with the numbers used for Text, the order of the text displayed will be wrong #92462

@hatano0x06

Description

@hatano0x06

Steps to Reproduce

  1. flutter run

Expected results:

name : 3333
name : 3333
name : 3333
3333 : name
3333 : name

name : aaaa
name : aaaa
name : aaaa
aaaa : name
aaaa : name

Actual results:

name : 3333
name : 3333
name : 3333
name : 3333
name : 3333

name : aaaa
name : aaaa
name : aaaa
aaaa : name
aaaa : name

Sample Code

class SamplePage extends StatefulWidget {

  SamplePage(): super();

  @override
  SamplePageState createState() => SamplePageState();
}

class SamplePageState extends State<SamplePage> with WidgetsBindingObserver {

  @override
  void initState(){
    super.initState();
  }

  Widget build(BuildContext context){
    
    Widget bodyScaffold = Directionality(
      textDirection: TextDirection.rtl, 
      child: Scaffold(
        body: Container(
          padding : EdgeInsets.only(top: 200),
          child   : Column(
            children: [
              Text("name" + ":" + "3333"),
              Align( 
                alignment : Alignment.centerRight, 
                child     : Text("name" + ":" + "3333"),
              ),
              Align( 
                alignment : Alignment.centerLeft, 
                child     : Text("name" + ":" + "3333"),
              ),
              Align( 
                alignment : Alignment.centerRight, 
                child     : Text("3333" + ":" + "name"),
              ),
              Align( 
                alignment : Alignment.centerLeft, 
                child     : Text("3333" + ":" + "name"),
              ),

              SizedBox(height: 50,),

              Text("name" + ":" + "aaaa"),
              Align( 
                alignment : Alignment.centerRight, 
                child     : Text("name" + ":" + "aaaa"),
              ),
              Align( 
                alignment : Alignment.centerLeft, 
                child     : Text("name" + ":" + "aaaa"),
              ),
              Align( 
                alignment : Alignment.centerRight, 
                child     : Text("aaaa" + ":" + "name"),
              ),
              Align( 
                alignment : Alignment.centerLeft, 
                child     : Text("aaaa" + ":" + "name"),
              ),

            ]
          )
        ),
      ),
    );

    return bodyScaffold;
  }
}

flutter doctor -v

[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19043.1288], locale ja-JP)
    • Flutter version 2.5.3 at C:\Users\81708\Desktop\develop\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (10 days ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\81708\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java      
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)    
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\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.10+0-b96-7249189)

[√] VS Code (version 1.61.2)
    • VS Code at C:\Users\81708\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.27.0

[√] Connected device (3 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)            • chrome        • web-javascript • Google Chrome 95.0.4638.54
    • Edge (web)              • edge          • web-javascript • Microsoft Edge 95.0.1020.30

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions