Jonatas

improve rtl support and prevent throw when locale is null

... ... @@ -16,6 +16,7 @@ class MyApp extends StatelessWidget {
return GetMaterialApp(
debugShowCheckedModeBanner: false,
enableLog: true,
// locale: Locale('PT'),
logWriterCallback: Logger.write,
initialRoute: AppPages.INITIAL,
getPages: AppPages.routes,
... ...
... ... @@ -233,10 +233,10 @@ class GetMaterialApp extends StatelessWidget {
..addAll(navigatorObservers)),
builder: (context, child) {
return Directionality(
textDirection: rtlLanguages.contains(Get.locale.languageCode)
textDirection: rtlLanguages.contains(Get.locale?.languageCode)
? TextDirection.rtl
: TextDirection.ltr,
child: builder(context, child),
child: builder == null ? child : builder(context, child),
);
},
title: title ?? '',
... ...