From 0c54f2dcd4474b63db4c517b0e7332cbd3ab51e9 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Mon, 6 Feb 2023 10:26:24 +0600 Subject: [PATCH] fix(track_tile): track action popup not showing on narrow screens --- .../adaptive/adaptive_popup_menu_button.dart | 43 +++---------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/lib/components/shared/adaptive/adaptive_popup_menu_button.dart b/lib/components/shared/adaptive/adaptive_popup_menu_button.dart index 71425a4b..b6af5350 100644 --- a/lib/components/shared/adaptive/adaptive_popup_menu_button.dart +++ b/lib/components/shared/adaptive/adaptive_popup_menu_button.dart @@ -35,43 +35,12 @@ class Action extends StatelessWidget { ), ); } - if (backgroundColor == null) { - return PlatformTextButton( - style: TextButton.styleFrom( - foregroundColor: - backgroundColor ?? PlatformTextTheme.of(context).body?.color, - backgroundColor: backgroundColor, - padding: const EdgeInsets.all(20), - ), - onPressed: onPressed, - child: Row( - children: [ - icon, - const SizedBox(width: 10), - text, - ], - ), - ); - } - return Padding( - padding: const EdgeInsets.all(8.0), - child: PlatformFilledButton( - style: TextButton.styleFrom( - foregroundColor: - backgroundColor ?? PlatformTextTheme.of(context).body?.color, - backgroundColor: backgroundColor, - padding: const EdgeInsets.all(20), - ), - onPressed: onPressed, - child: Row( - children: [ - icon, - const SizedBox(width: 10), - text, - ], - ), - ), + return PlatformListTile( + tileColor: backgroundColor, + onTap: onPressed, + leading: icon, + title: text, ); } } @@ -103,7 +72,7 @@ class AdaptiveActions extends HookWidget { children: actions .map( (action) => SizedBox( - width: 250, + width: 200, child: Row( children: [ Expanded(child: action),