Flutter 颤振将抽屉内容从右向左放置
亲爱的Flutter开发者 如何从右到左放置我的抽屉内容,包括帐户信息。结果包括图片,您可以看到文本在左侧,但我想将它们至少放在右侧或中间。 谢谢 我的代码如下:Flutter 颤振将抽屉内容从右向左放置,flutter,right-to-left,drawer,Flutter,Right To Left,Drawer,亲爱的Flutter开发者 如何从右到左放置我的抽屉内容,包括帐户信息。结果包括图片,您可以看到文本在左侧,但我想将它们至少放在右侧或中间。 谢谢 我的代码如下: endDrawer: Drawer( child: new Column( textDirection: TextDirection.rtl, children: <Widget> [ Padding(
endDrawer: Drawer(
child: new Column(
textDirection: TextDirection.rtl,
children: <Widget> [
Padding(
padding:
const EdgeInsets.only(top: 22.0, left: 42.0, right: 42.0),
),
new UserAccountsDrawerHeader(
currentAccountPicture: new CircleAvatar (
backgroundColor: Colors.blue,
child: Image.asset("assets/img/logo.png"),
),
accountName: Text("عنوان",style: TextStyle(
fontFamily: "Bahij",
fontSize: 14,
),textAlign: TextAlign.center,),
accountEmail:
Text("ایمیل آدرس[![enter image description here][1]][1]" ,style: TextStyle(
fontFamily: "Bahij",
fontSize: 14,
),textAlign: TextAlign.center,textDirection: TextDirection.rtl),
)
]
)
),
endDrawer:Drawer(
子:新列(
textDirection:textDirection.rtl,
儿童:[
填充物(
衬垫:
仅限常数边集(顶部:22.0,左侧:42.0,右侧:42.0),
),
新用户帐户DrawerHeader(
currentAccountPicture:新CircleAvatar(
背景颜色:Colors.blue,
子项:Image.asset(“assets/img/logo.png”),
),
账户名称:Text(“عنوان”),样式:TextStyle(
fontFamily:“Bahij”,
尺寸:14,
),textAlign:textAlign.center,),
帐户电子邮件:
文本(“输入图像描述][1]][1]”,样式:TextStyle(
fontFamily:“Bahij”,
尺寸:14,
),textAlign:textAlign.center,textDirection:textDirection.rtl),
)
]
)
),
您可以使用方向性小部件包装您的抽屉
方向性(
textDirection:isRtl?textDirection.rtl:textDirection.ltr,
孩子:你的抽屉,
)
您可以使用方向性小部件包装您的抽屉
方向性(
textDirection:isRtl?textDirection.rtl:textDirection.ltr,
孩子:你的抽屉,
)
如果你想本地化你的应用程序,你应该像这样编写MaterialApp小部件:
MaterialApp(
debugShowCheckedModeBanner: false,
title: 'my app',
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
Locale(
"languageCode", "countryCode"
),
],
locale: Locale(
"languageCode", "countryCode"
),
theme: mainThemeData,
home: AppSplash(),
)
使用您的语言和国家代码更改countryCode和languageCode如果您想本地化您的应用程序,您应该这样编写MaterialApp小部件:
MaterialApp(
debugShowCheckedModeBanner: false,
title: 'my app',
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
Locale(
"languageCode", "countryCode"
),
],
locale: Locale(
"languageCode", "countryCode"
),
theme: mainThemeData,
home: AppSplash(),
)
使用您的语言和国家代码更改countryCode和languageCode,波斯语使用
languageCode:“fa”
和countryCode:“IR”
波斯语使用languageCode:“fa”
和countryCode:“IR”
亲爱的Ahmed我是一名新加入Flitter的人,你能详细描述一下我在哪里可以使用你的代码吗?MaterialApp构造函数中基本上有一个builder参数,所以你可以这样做MaterialApp(标题:“Flitter Demo”,主题:appTheme,builder:_builder,routes:Navigation.routes,)代码>生成器就是我上面提供的代码亲爱的艾哈迈德,我是颤振新手,你能详细描述一下我在哪里可以使用你的代码吗?基本上MaterialApp构造函数中有一个生成器参数,所以你可以这样做MaterialApp(标题:“颤振演示”,主题:appTheme,生成器:_生成器,路由:Navigation.routes,)代码>而生成器就是我上面提供的代码