From a61506965faa2f7ebdaf4c9717d0f86c6d75e84c Mon Sep 17 00:00:00 2001 From: Matthias Ngeo Date: Wed, 13 Nov 2024 15:16:08 +0800 Subject: [PATCH] whoops --- forui/lib/src/widgets/tile/tile_content.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/forui/lib/src/widgets/tile/tile_content.dart b/forui/lib/src/widgets/tile/tile_content.dart index d887e9982..2e9b3dda2 100644 --- a/forui/lib/src/widgets/tile/tile_content.dart +++ b/forui/lib/src/widgets/tile/tile_content.dart @@ -28,6 +28,8 @@ class FTileContent extends StatelessWidget { @override Widget build(BuildContext context) { + final ltr = Directionality.maybeOf(context) == TextDirection.ltr; + final tile = FTileData.maybeOf(context)!; final FTileData(style: tileStyle, :enabled, :hovered, :focused) = tile; @@ -53,7 +55,9 @@ class FTileContent extends StatelessWidget { children: [ if (prefixIcon case final prefixIcon?) Padding( - padding: EdgeInsets.only(right: contentStyle.prefixIconSpacing), + padding: ltr + ? EdgeInsets.only(right: contentStyle.prefixIconSpacing) + : EdgeInsets.only(left: contentStyle.prefixIconSpacing), child: FIconStyleData( style: style.prefixIconStyle, child: prefixIcon, @@ -62,7 +66,9 @@ class FTileContent extends StatelessWidget { else const SizedBox(), Padding( - padding: EdgeInsets.only(right: contentStyle.middleSpacing), + padding: ltr + ? EdgeInsets.only(right: contentStyle.middleSpacing) + : EdgeInsets.only(left: contentStyle.middleSpacing), child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, @@ -107,7 +113,9 @@ class FTileContent extends StatelessWidget { const SizedBox(), if (suffixIcon case final suffixIcon?) Padding( - padding: EdgeInsets.only(left: contentStyle.suffixIconSpacing), + padding: ltr + ? EdgeInsets.only(left: contentStyle.suffixIconSpacing) + : EdgeInsets.only(right: contentStyle.suffixIconSpacing), child: FIconStyleData( style: style.suffixIconStyle, child: suffixIcon,