Search code examples
flutterflutter-layoutflutter-dependenciesdesktop-applicationflutter-web

My view change when i change my local english to arabic how can i stop this?


My view change when change my language english to arabic how can i prevent this.

   EasyLocalization(
    supportedLocales: [
      Locale('en', 'US'),
      Locale('ar', 'SA'),
      Locale('en', 'GB'),
    ],
    path: 'assets/lang',
    child: MyApp(),
  ));

Solution

  • You can use your own builder for MaterialApp to force LTR directionality.

    MaterialApp(
      builder: (context, child) {
        return Directionality(
          textDirection: TextDirection.ltr,
          child: child!,
        );
      },
    )