From 54ff3cf83ce65368af1bdc4eedf2f253e6be3e78 Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 31 Mar 2020 20:51:24 +0800 Subject: [PATCH] rework resyncing state --- cyberwow/lib/widget/resyncing.dart | 80 ++++++++++++++++-------------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/cyberwow/lib/widget/resyncing.dart b/cyberwow/lib/widget/resyncing.dart index dc6f20a..78ab660 100644 --- a/cyberwow/lib/widget/resyncing.dart +++ b/cyberwow/lib/widget/resyncing.dart @@ -25,49 +25,53 @@ import '../state.dart'; import '../config.dart' as config; Widget build(BuildContext context, ReSyncingState state) { + final progressWidget = + [ + Spacer + ( + flex: 3, + ), + LinearProgressIndicator(), + Spacer + ( + flex: 2, + ), + Expanded + ( + flex: 5, + child: Text + ( + state.stdout.last, + style: Theme.of(context).textTheme.body1, + ) + ), + ]; + return Scaffold ( - // appBar: AppBar - // ( - // // title: Text(widget.title), - // title: Text('CyberWOW'), - // ), body: Container ( - // padding: const EdgeInsets.all(10.0), - child: Align + padding: const EdgeInsets.all(10.0), + child: Column ( - alignment: Alignment.topLeft, - child: Column - ( - mainAxisAlignment: MainAxisAlignment.center, - children: - [ - Spacer - ( - flex: 1, - ), - Expanded - ( - flex: 1, - child: SingleChildScrollView - ( - scrollDirection: Axis.vertical, - reverse: true, - child: Text - ( - state.stdout.last, - style: Theme.of(context).textTheme.body1, - ) - ) - ), - Spacer - ( - flex: 1, - ), - ], - ), + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: + [ + Spacer + ( + flex: 10, + ), + ] + + progressWidget + + [ + Spacer + ( + flex: 10, + ), + ] ), - ), + ) ); } +