Оберните свой домашний дочерний виджет с помощью Directionality
, используя TextDirection.rtl
import 'package:flutter/material.dart';
class DrawerLayoutApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: "My Apps",
theme: new ThemeData(
fontFamily: "Vazir",
primaryColor: Color(0xff075e54),
accentColor: Color(0xff25d366),
primaryIconTheme: new IconThemeData(color: Colors.white)
),
home: new Directionality(textDirection: TextDirection.rtl, child: new DrawerLayoutAppBody())
);
}
}
class DrawerLayoutAppBody extends StatefulWidget {
@override
State<StatefulWidget> createState() => new DrawerLayoutAppBodyState();
}
class DrawerLayoutAppBodyState extends State<DrawerLayoutAppBody>{
TextStyle listTileTextStyle = new TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 18
);
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("برنامه های من")
),
drawer: new Drawer(
child: new ListView(
children: <Widget>[
new Container(
height: 120,
child: new DrawerHeader(
padding: EdgeInsets.zero,
child: new Container(
decoration: new BoxDecoration(
gradient: new LinearGradient(
colors: <Color>[
Theme.of(context).primaryColor,
const Color(0xff05433c),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter
)
),
)
)
),
new ListTile(
leading: new Icon(Icons.map, color: Colors.black),
title: new Text(
'گوگل مپ',
style: listTileTextStyle
),
onTap: (){
},
),
]
)
),
);
}
}