From 67ed39c4c35b06cde36026801bbf6a61f2b95be5 Mon Sep 17 00:00:00 2001 From: fuwa Date: Thu, 27 Jun 2019 00:57:51 +0000 Subject: [PATCH] animate height change --- cyberwow/lib/widget/synced.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cyberwow/lib/widget/synced.dart b/cyberwow/lib/widget/synced.dart index b9a2ff4..ecce72f 100644 --- a/cyberwow/lib/widget/synced.dart +++ b/cyberwow/lib/widget/synced.dart @@ -54,8 +54,9 @@ Widget buildSynced(BuildContext context, SyncedState state) { Expanded ( flex: 15, - child: SingleChildScrollView + child: AnimatedSwitcher ( + duration: Duration(milliseconds: 500), child: Text ( '${state.height}', @@ -66,6 +67,7 @@ Widget buildSynced(BuildContext context, SyncedState state) { fontWeight: FontWeight.bold, color: config.textColor, ), + key: ValueKey(state.height), ) ) ),