Skip to content

Commit bc6fbee

Browse files
authored
Update platform_utils.dart
1 parent 44fd334 commit bc6fbee

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/src/utils/platform_utils.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,23 @@ class PlatformUtils {
4949
}
5050
}
5151
}
52+
static bool languageIsRTL(BuildContext context) {
53+
const rtlLanguages = [
54+
"ar",
55+
"arc",
56+
"dv",
57+
"fa",
58+
"ha",
59+
"he",
60+
"khw",
61+
"ks",
62+
"ku",
63+
"ps",
64+
"ur",
65+
"yi"
66+
];
67+
final language = Localizations.localeOf(context).languageCode.toLowerCase();
68+
69+
return rtlLanguages.contains(language);
70+
}
71+
}

0 commit comments

Comments
 (0)