From 251ce41d36558ddbc828e60e688e9b1bbf4d2c92 Mon Sep 17 00:00:00 2001 From: 21pages Date: Mon, 5 Dec 2022 09:33:01 +0800 Subject: [PATCH] fix menu padding mistake Signed-off-by: 21pages --- flutter/lib/common/widgets/peer_tab_page.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index 01e3939ee..5a498a1c4 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -29,6 +29,10 @@ class _TabEntry { _TabEntry(this.name, this.widget, this.load); } +EdgeInsets? _menuPadding() { + return isDesktop ? kDesktopMenuPadding : null; +} + class _PeerTabPageState extends State with SingleTickerProviderStateMixin { late final RxInt tabHiddenFlag; @@ -38,25 +42,25 @@ class _PeerTabPageState extends State _TabEntry( 'Recent Sessions', RecentPeersView( - menuPadding: kDesktopMenuPadding, + menuPadding: _menuPadding(), ), bind.mainLoadRecentPeers), _TabEntry( 'Favorites', FavoritePeersView( - menuPadding: kDesktopMenuPadding, + menuPadding: _menuPadding(), ), bind.mainLoadFavPeers), _TabEntry( 'Discovered', DiscoveredPeersView( - menuPadding: kDesktopMenuPadding, + menuPadding: _menuPadding(), ), bind.mainDiscover), _TabEntry( 'Address Book', - const AddressBook( - menuPadding: kDesktopMenuPadding, + AddressBook( + menuPadding: _menuPadding(), ), () => {}), ];