From 41777c707ffae1f2ecbcd79886917448dbec5764 Mon Sep 17 00:00:00 2001 From: yosokim Date: Mon, 31 Oct 2022 16:17:02 +0800 Subject: [PATCH] fix: menu use flex expanded wrapper --- lib/pages/entry_point.dart | 49 ++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/lib/pages/entry_point.dart b/lib/pages/entry_point.dart index c219d94..8b219b7 100644 --- a/lib/pages/entry_point.dart +++ b/lib/pages/entry_point.dart @@ -316,7 +316,6 @@ class _PointerPageViewState extends State { ), child: Container( width: double.infinity, - height: 80, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12), @@ -324,34 +323,28 @@ class _PointerPageViewState extends State { padding: const EdgeInsets.symmetric( vertical: 12.0, ), - child: GridView.builder( - itemCount: tabs.length, - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 4, - crossAxisSpacing: 10, - mainAxisSpacing: 10, - // childAspectRatio: 0.75, - ), - itemBuilder: (context, index) { - var curr = tabs[index]; - return Column( - children: [ - Image.asset( - "assets/stay/logo/$curr.png", - width: 32, - height: 32, - fit: BoxFit.cover, - ), - const SizedBox(height: 4.2), - Text( - curr, - style: const TextStyle( - fontSize: 14.0, + child: Flex( + direction: Axis.horizontal, + children: tabs.map((e) => Expanded( + flex: 1, + child: Column( + children: [ + Image.asset( + "assets/stay/logo/$e.png", + width: 32, + height: 32, + fit: BoxFit.cover, ), - ), - ], - ); - }, + const SizedBox(height: 4.2), + Text( + e, + style: const TextStyle( + fontSize: 14.0, + ), + ), + ], + ), + )).toList(), ), ), ),