From d7b513acc359aaab790ab8f4e7a1e566820add93 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 26 Nov 2019 13:30:56 +0800 Subject: [PATCH] only show count above some threshold --- cyberwow/lib/widget/synced.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cyberwow/lib/widget/synced.dart b/cyberwow/lib/widget/synced.dart index c308ac9..e239e99 100644 --- a/cyberwow/lib/widget/synced.dart +++ b/cyberwow/lib/widget/synced.dart @@ -145,13 +145,15 @@ Widget syncInfo(BuildContext context, SyncedState state) => rpcView(context, 'sy Widget getTransactionPool(BuildContext context, SyncedState state) { final pool = state.getTransactionPool; - final subTitle = pool.isEmpty ? '' : ' ‹${pool.length}›'; + const minimalLength = 6; + final subTitle = pool.length < minimalLength ? '' : ' ‹${pool.length}›'; return rpcView(context, 'tx pool' + subTitle, pool); } Widget getConnections(BuildContext context, SyncedState state) { final peers = state.getConnections; - final subTitle = peers.isEmpty ? '' : ' ‹${peers.length}›'; + const minimalLength = 6; + final subTitle = peers.length < minimalLength ? '' : ' ‹${peers.length}›'; return rpcView(context, 'peers' + subTitle, peers); }