Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL Support #10

Closed
aminsamad opened this issue Jul 25, 2022 · 2 comments
Closed

RTL Support #10

aminsamad opened this issue Jul 25, 2022 · 2 comments

Comments

@aminsamad
Copy link

No description provided.

@SviatManiuk
Copy link
Contributor

Hello!

After careful consideration, we have decided not to add RTL support. The same behavior can be achieved using the TabController.initialIndex property:

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: DefaultTabController(
        length: 3,
        initialIndex: 2,
        child: Scaffold(
          body: SafeArea(
            child: Stack(
              children: [
                SegmentedTabControl(
                  height: 46,
                  tabs: [
                    SegmentTab(
                      label: 'LIBRARY[',
                    ),
                    SegmentTab(
                      label: 'ACCOUNT',
                    ),
                    SegmentTab(
                      label: 'HOME',
                    ),
                  ],
                ),
                Padding(
                  padding: EdgeInsets.only(top: 46),
                  child: TabBarView(
                    physics: BouncingScrollPhysics(),
                    children: [
                      Center(
                        child: Text('LIBRARY PAGE'),
                      ),
                      Center(
                        child: Text('ACCOUNT PAGE'),
                      ),
                      Center(
                        child: Text('HOME PAGE'),
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

@melek-hedhili
Copy link

melek-hedhili commented Sep 27, 2024

I've been using the SegmentedTabControl widget and encountered some issues related to RTL support:

1- Swiping Direction Reversal: Even when using TabController.initialIndex to set the initial selected tab in RTL mode, the swiping direction remains inconsistent. Users expect to swipe left to move to the previous tab and right to move to the next tab, regardless of the reading direction.

2- Tab Press Functionality: Additionally, the tab press functionality can be unpredictable in RTL mode. Pressing a tab might result in selecting an unexpected tab due to the reversed layout.

i've already created a PR for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants