Fix: RTL issues (#2060)
* fix: RTL issues * fix: removed unused imports * dart formatting --------- Co-authored-by: CatHood0 <santiagowmar@gmail.com>pull/2061/head v10.0.7
parent
6ecd377b26
commit
2818d0fce0
3 changed files with 55 additions and 5 deletions
@ -0,0 +1,25 @@ |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter/widgets.dart'; |
||||
|
||||
bool isRTLLanguage(Locale locale) { |
||||
final rtlLanguages = [ |
||||
'ar', // Arabic |
||||
'dv', // Divehi (Maldivian) |
||||
'fa', // Persian (Farsi) |
||||
'ha', // Hausa (in Ajami script) |
||||
'he', // Hebrew |
||||
'khw', // Khowar (in Arabic script) |
||||
'ks', // Kashmiri (in Arabic script) |
||||
'ku', // Kurdish (Sorani) |
||||
'ps', // Pashto |
||||
'ur', // Urdu |
||||
'yi', // Yiddish |
||||
'sd', // Sindhi |
||||
'ug', // Uyghur |
||||
]; |
||||
return rtlLanguages.contains(locale.languageCode); |
||||
} |
||||
|
||||
bool isRTL(BuildContext context) { |
||||
return isRTLLanguage(Localizations.localeOf(context)); |
||||
} |
Loading…
Reference in new issue