From 0388e512999690bb701427583d0fb43ab84fa76a Mon Sep 17 00:00:00 2001 From: open-trade Date: Mon, 30 Nov 2020 21:14:23 +0800 Subject: [PATCH] padding --- flutter_hbb/lib/home_page.dart | 60 ++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/flutter_hbb/lib/home_page.dart b/flutter_hbb/lib/home_page.dart index b15d101ca..a9e1da622 100644 --- a/flutter_hbb/lib/home_page.dart +++ b/flutter_hbb/lib/home_page.dart @@ -212,35 +212,37 @@ class _HomePageState extends State { final cards = []; var peers = FFI.peers(); peers.forEach((p) { - cards.add(Card( - child: GestureDetector( - onTap: () => connect('${p.id}'), - onLongPressStart: (details) { - var x = details.globalPosition.dx; - var y = details.globalPosition.dy; - () async { - var value = await showMenu( - context: context, - position: RelativeRect.fromLTRB(x, y, x, y), - items: [ - PopupMenuItem( - child: Text('Remove'), value: 'remove'), - ], - elevation: 8, - ); - if (value == 'remove') { - setState(() => FFI.setByName('remove', '${p.id}')); - } - }(); - }, - child: ListTile( - subtitle: Text('${p.username}@${p.hostname}'), - title: Text('${p.id}'), - leading: Container( - padding: const EdgeInsets.all(6), - child: getPlatformImage('${p.platform}'), - color: str2color('${p.id}${p.platform}', 0x77)), - )))); + cards.add(Padding( + padding: EdgeInsets.symmetric(horizontal: 12), + child: Card( + child: GestureDetector( + onTap: () => connect('${p.id}'), + onLongPressStart: (details) { + var x = details.globalPosition.dx; + var y = details.globalPosition.dy; + () async { + var value = await showMenu( + context: context, + position: RelativeRect.fromLTRB(x, y, x, y), + items: [ + PopupMenuItem( + child: Text('Remove'), value: 'remove'), + ], + elevation: 8, + ); + if (value == 'remove') { + setState(() => FFI.setByName('remove', '${p.id}')); + } + }(); + }, + child: ListTile( + subtitle: Text('${p.username}@${p.hostname}'), + title: Text('${p.id}'), + leading: Container( + padding: const EdgeInsets.all(6), + child: getPlatformImage('${p.platform}'), + color: str2color('${p.id}${p.platform}', 0x77)), + ))))); }); return Wrap(children: cards); }