Flutter flips most of a layout for you when the locale is Arabic. The rest you find by using the app. This post lists the RTL and localisation problems that show up in a real Flutter project with Arabic as the default language, with the code that handles each one. The project is a 37-screen real estate app, and some of the fixes are workarounds, which is stated where it applies.
1. Locale lives in one place
The app keeps one Locale in a ChangeNotifier, starts with Arabic, and MaterialApp.router reads it:
Locale _locale = const Locale('ar'); void setLanguage(String code) { final next = Locale(code); if (next == _locale) return; _locale = next; notifyListeners(); } MaterialApp.router( locale: state.locale, supportedLocales: const [Locale('ar'), Locale('en')], localizationsDelegates: kGlobalDelegates, routerConfig: appRouter, ) kGlobalDelegates includes GlobalMaterialLocalizations, GlobalWidgetsLocalizations and GlobalCupertinoLocalizations. Without those, built-in widgets such as date pickers and text selection menus will not be localised or laid out for RTL.
2. Strings that cannot go missing
Most UI text uses a helper that holds both languages on the same line:
String t(String ar, String en) => isAr ? ar : en; String get navHome => t('الرئيسية', 'Home'); String get searchBtn => t('ابحث', 'Search'); A missing English string is impossible, because the getter does not compile without it. The cost is that this does not scale to a third language, and translators cannot work from a file. If you expect more languages, use ARB files and flutter gen-l10n. The project has the generated AppLocalizations configured as well, but most screens use t().
3. Arrows and chevrons
This is the first thing that looks wrong in RTL. "Back" should point right in Arabic. Flutter mirrors AppBar back buttons, but icons you place yourself are not mirrored unless the icon is built for it. This project handles it by choosing the icon by hand. In the tour booking calendar (tour_sheet.dart), the month "previous" button uses chevron_right_rounded and "next" uses chevron_left_rounded:
IconButton( onPressed: () => setState(() { _month = DateTime(_month.year, _month.month - 1, 1); }), icon: const Icon(Icons.chevron_right_rounded), ), // ... month title ... IconButton( onPressed: () => setState(() { _month = DateTime(_month.year, _month.month + 1, 1); }), icon: const Icon(Icons.chevron_left_rounded), ), That is correct for Arabic and wrong for English, since the screen does not branch on the language. It is a known limitation of this approach. The better fix is to use Directionality.of(context) to flip the icon, or Icon widgets with matchTextDirection on a custom icon. Whichever you choose, test both languages, because this kind of bug does not show in one.
4. left and right in Positioned
The photo carousel on property cards places its arrows with Positioned(left: 8) and Positioned(right: 8). A Positioned is not direction-aware. In RTL, left is still the physical left. That is fine for a photo carousel, where the arrows are physical controls. For anything that should follow reading direction, use PositionedDirectional(start: 8).
A search for EdgeInsets.only(left, Alignment.centerLeft and Positioned(left in the codebase turns up about six hits. Each one should be checked: is this physical, or should it follow the language? The project uses EdgeInsetsDirectional in a few places and does not do it everywhere.
5. Measuring text needs the right direction
The property description folds after five lines. To know whether it needs folding, the code measures it with a TextPainter:
final tp = TextPainter( text: TextSpan(text: desc, style: style), textDirection: en ? TextDirection.ltr : TextDirection.rtl, ); tp.layout(maxWidth: constraints.maxWidth); final canFold = tp.height > 14 * 1.8 * 5; If you skip textDirection, Flutter will not build the painter. If you pass the wrong one, the line count for mixed Arabic and English text can be off.
6. One font for both scripts
The theme sets Cairo as the font family, bundled as an asset, with all weights from 200 to 900 mapped to the same font file:
fonts: - family: Cairo fonts: - asset: assets/fonts/Cairo.ttf weight: 400 - asset: assets/fonts/Cairo.ttf weight: 700 Cairo has both Arabic and Latin glyphs, so mixed strings such as an English brand name inside an Arabic sentence share one font.
7. What is not covered
- Numbers are not formatted with
intlNumberFormatper locale. Prices go through a hand-writtenformatEgphelper inmodels.dartthat adds thousands separators with a regular expression. - There is no bidirectional-text handling beyond what Flutter does by default.
- The English app name differs from the Arabic one in the UI strings. Brand names should be decided once.
The project
The code above comes from Sakan, an Arabic-first and English real estate app for the Egyptian market, built with Flutter for Android, iOS and web. Live demo: https://9mohamedezzat.github.io/sakan/
The full source is $19 on Whop, sample-data only: https://whop.com/sakan-flutter-templates/
The first post in this series covers the structure and the data layer: https://dev.to/mohamedsalman_dev/building-an-arabic-first-flutter-app-rtl-37-screens-and-a-repository-boundary-1dpm

