Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: flip arrow in iOS navigation tile for RTL languages #192

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/src/tiles/platforms/ios_settings_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ class IOSSettingsTileState extends State<IOSSettingsTile> {
data: IconTheme.of(context)
.copyWith(color: theme.themeData.leadingIconsColor),
child: Icon(
CupertinoIcons.chevron_forward,
PlatformUtils.languageIsRTL(context)
? CupertinoIcons.chevron_back
: CupertinoIcons.chevron_forward,
size: 18 * scaleFactor,
),
),
Expand Down
20 changes: 20 additions & 0 deletions lib/src/utils/platform_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,24 @@ class PlatformUtils {
return DevicePlatform.windows;
}
}

static bool languageIsRTL(BuildContext context) {
const rtlLanguages = [
"ar",
"arc",
"dv",
"fa",
"ha",
"he",
"khw",
"ks",
"ku",
"ps",
"ur",
"yi"
];
final language = Localizations.localeOf(context).languageCode.toLowerCase();

return rtlLanguages.contains(language);
}
}
Loading