Flutter RTL AppBar图标位置

问题描述 投票:0回答:1

我要求的是在appBar中添加一个图标,以便...我已经激活了本地化属性,所以我的应用程序是RTL Now

  localizationsDelegates: [
      GlobalMaterialLocalizations.delegate,
      GlobalWidgetsLocalizations.delegate,
    ],
    supportedLocales: [
      Locale("ar", "AR"), // OR Locale('ar', 'AE') OR Other RTL locales
    ],
    locale: Locale("ar", "AR"), // OR Locale('ar', 'AE') OR Other RTL locales

...问题是右侧的抽屉菜单图标是正确的...但是当我在appBar的主要属性中添加Icon时它不会转到左侧......但它取代了抽屉图标!!!

// AppBar

  appBar: new AppBar(

    leading: Icon(Icons.person,),

    title: new Text("الرئيسية",
      style: new TextStyle(fontFamily: 'RPT Bold',
      fontSize: 16.0,
        color: Colors.amber
      ),
    ),
    centerTitle: true,
    iconTheme: new IconThemeData(color: Colors.amber),
  ),

最好的祝福

android ios flutter flutter-layout appbar
1个回答
0
投票

automaticallyImplyLeading设为false:

appBar: new AppBar(
    automaticallyImplyLeading: false,
    leading: Icon(Icons.person,),
    title: new Text("الرئيسية",
   style: new TextStyle(fontFamily: 'RPT Bold',
   fontSize: 16.0,
     color: Colors.amber
   ),
 ),
 centerTitle: true,
 iconTheme: new IconThemeData(color: Colors.amber),
),
© www.soinside.com 2019 - 2024. All rights reserved.