Sunday, January 14, 2024
HomeiOS Developmentandroid - flutter appbar not supporting RTL

android – flutter appbar not supporting RTL


You could use the Directionality widget.
To make use of Directionality within the AppBar, see the next code:

 PreferredSize(
        preferredSize: Dimension(width, peak),
        youngster: Directionality(
         // ----right or left---
          textDirection: TextDirection.rtl,
          youngster: AppBar(
            // automaticallyImplyLeading: false,
            elevation: 0.5,
            centerTitle: true,
            title: ValueListenableBuilder(
              valueListenable: globals.selectedBarIndex,
              builder: (context, worth, Widget? youngster) {
                return Textual content(globals.navBarItems[globals.selectedBarIndex.value].textual content);
              },
            ),
            main: IconButton(
              onPressed: _handleMenuButtonPressed,
              icon: ValueListenableBuilder<AdvancedDrawerValue>(
                valueListenable: widget.advancedDrawerController,
                builder: (_, worth, __) {
                  return AnimatedSwitcher(
                    length: const Length(milliseconds: 250),
                    youngster: Icon(
                      worth.seen ? Icons.clear : Icons.menu,
                      key: ValueKey<bool>(worth.seen),
                    ),
                  );
                },
              ),
            ),
          ),
        ),
      ),



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments