Skip to content

NavigationRail Ink is in the wrong position in RTL when extended is true #134361

@mahmoud-eslami

Description

@mahmoud-eslami

Is there an existing issue for this?

Steps to reproduce

  1. Change Localization of the application to an RTL locale, for example Locale("fa")
  2. Use NavigationRail widget

Expected results

Expect Highlight Ink to show in focus, pressed state and in RTL layouts in the correct position.

Actual results

Highlight Ink in focus and pressed state is not in the correct position.

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 MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const HomeWidget(),
    );
  }
}

class HomeWidget extends StatefulWidget {
  const HomeWidget({super.key});

  @override
  State<HomeWidget> createState() => _HomeWidgetState();
}

class _HomeWidgetState extends State<HomeWidget> {
  int index = 0;
  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        Directionality(
          textDirection: TextDirection.rtl,
          child: NavigationRail(
            extended: true,
            destinations: const [
              NavigationRailDestination(
                icon: Icon(Icons.abc),
                label: Text("1"),
              ),
              NavigationRailDestination(
                icon: Icon(Icons.ac_unit_outlined),
                label: Text("2"),
              ),
              NavigationRailDestination(
                icon: Icon(Icons.access_alarms_outlined),
                label: Text("3"),
              ),
            ],
            selectedIndex: index,
            onDestinationSelected: (value) => setState(() {
              index = value;
            }),
          ),
        ),
      ],
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration Screenshot 2023-09-10 at 1 27 40 AM Screenshot 2023-09-10 at 1 27 43 AM
bug.mov

Metadata

Metadata

Assignees

Labels

a: internationalizationSupporting other languages or locales. (aka i18n)f: material designflutter/packages/flutter/material repository.found in release: 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14frameworkflutter/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-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