Jonatas

improve rtl support and prevent throw when locale is null

@@ -16,6 +16,7 @@ class MyApp extends StatelessWidget { @@ -16,6 +16,7 @@ class MyApp extends StatelessWidget {
16 return GetMaterialApp( 16 return GetMaterialApp(
17 debugShowCheckedModeBanner: false, 17 debugShowCheckedModeBanner: false,
18 enableLog: true, 18 enableLog: true,
  19 + // locale: Locale('PT'),
19 logWriterCallback: Logger.write, 20 logWriterCallback: Logger.write,
20 initialRoute: AppPages.INITIAL, 21 initialRoute: AppPages.INITIAL,
21 getPages: AppPages.routes, 22 getPages: AppPages.routes,
@@ -233,10 +233,10 @@ class GetMaterialApp extends StatelessWidget { @@ -233,10 +233,10 @@ class GetMaterialApp extends StatelessWidget {
233 ..addAll(navigatorObservers)), 233 ..addAll(navigatorObservers)),
234 builder: (context, child) { 234 builder: (context, child) {
235 return Directionality( 235 return Directionality(
236 - textDirection: rtlLanguages.contains(Get.locale.languageCode) 236 + textDirection: rtlLanguages.contains(Get.locale?.languageCode)
237 ? TextDirection.rtl 237 ? TextDirection.rtl
238 : TextDirection.ltr, 238 : TextDirection.ltr,
239 - child: builder(context, child), 239 + child: builder == null ? child : builder(context, child),
240 ); 240 );
241 }, 241 },
242 title: title ?? '', 242 title: title ?? '',