From 78c1612eefab3612ae376aed43782dfb4cdc2aeb Mon Sep 17 00:00:00 2001 From: Calcitem Date: Wed, 30 Jun 2021 01:31:03 +0800 Subject: [PATCH] Fix #239: Menu UI problem with RTL --- src/ui/flutter_app/lib/widgets/home_drawer.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ui/flutter_app/lib/widgets/home_drawer.dart b/src/ui/flutter_app/lib/widgets/home_drawer.dart index 96719c72..40d9c9b7 100644 --- a/src/ui/flutter_app/lib/widgets/home_drawer.dart +++ b/src/ui/flutter_app/lib/widgets/home_drawer.dart @@ -22,6 +22,7 @@ import 'package:animated_text_kit/animated_text_kit.dart'; import 'package:flutter/material.dart'; import 'package:sanmill/common/config.dart'; import 'package:sanmill/generated/l10n.dart'; +import 'package:sanmill/l10n/resources.dart'; import 'package:sanmill/style/app_theme.dart'; import 'package:sanmill/widgets/game_settings_page.dart'; @@ -257,6 +258,8 @@ class _HomeDrawerState extends State { } Widget buildInkwell(DrawerListItem listItem) { + bool ltr = getBidirectionality(context) == Bidirectionality.leftToRight; + double radius = 28.0; var animatedBuilder = AnimatedBuilder( animation: widget.iconAnimationController!, builder: (BuildContext context, Widget? child) { @@ -274,10 +277,10 @@ class _HomeDrawerState extends State { decoration: BoxDecoration( color: AppTheme.drawerHighlightItemColor, borderRadius: new BorderRadius.only( - topLeft: Radius.circular(0), - topRight: Radius.circular(28), - bottomLeft: Radius.circular(0), - bottomRight: Radius.circular(28), + topLeft: Radius.circular(ltr ? 0 : radius), + topRight: Radius.circular(ltr ? radius : 0), + bottomLeft: Radius.circular(ltr ? 0 : radius), + bottomRight: Radius.circular(ltr ? radius : 0), ), ), ),