From 3a2424cda3b519b11345b9689818c789a6905ad1 Mon Sep 17 00:00:00 2001 From: Pualoo Date: Wed, 23 Feb 2022 14:33:08 -0300 Subject: [PATCH] fix: DocBanner overflow issue#354 --- .../stack_page/doc/widget/banner.dart | 67 ++++++++++--------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/banner.dart b/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/banner.dart index 89cb0e713a..a377bdfba1 100644 --- a/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/banner.dart +++ b/frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/banner.dart @@ -16,43 +16,44 @@ class DocBanner extends StatelessWidget { @override Widget build(BuildContext context) { final theme = context.watch(); - // [[Row]] CrossAxisAlignment vs mainAxisAlignment - // https://stackoverflow.com/questions/53850149/flutter-crossaxisalignment-vs-mainaxisalignment return ConstrainedBox( constraints: const BoxConstraints(minHeight: 60), child: Container( + width: double.infinity, color: theme.main1, - child: Row( - children: [ - FlowyText.medium(LocaleKeys.deletePagePrompt_text.tr(), color: Colors.white), - const HSpace(20), - BaseStyledButton( - minWidth: 160, - minHeight: 40, - contentPadding: EdgeInsets.zero, - bgColor: Colors.transparent, - hoverColor: theme.main2, - downColor: theme.main1, - outlineColor: Colors.white, - borderRadius: Corners.s8Border, - child: FlowyText.medium(LocaleKeys.deletePagePrompt_restore.tr(), color: Colors.white, fontSize: 14), - onPressed: onRestore), - const HSpace(20), - BaseStyledButton( - minWidth: 220, - minHeight: 40, - contentPadding: EdgeInsets.zero, - bgColor: Colors.transparent, - hoverColor: theme.main2, - downColor: theme.main1, - outlineColor: Colors.white, - borderRadius: Corners.s8Border, - child: FlowyText.medium(LocaleKeys.deletePagePrompt_deletePermanent.tr(), - color: Colors.white, fontSize: 14), - onPressed: onDelete), - ], - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, + child: FittedBox( + alignment: Alignment.center, + fit: BoxFit.scaleDown, + child: Row( + children: [ + FlowyText.medium(LocaleKeys.deletePagePrompt_text.tr(), color: Colors.white), + const HSpace(20), + BaseStyledButton( + minWidth: 160, + minHeight: 40, + contentPadding: EdgeInsets.zero, + bgColor: Colors.transparent, + hoverColor: theme.main2, + downColor: theme.main1, + outlineColor: Colors.white, + borderRadius: Corners.s8Border, + child: FlowyText.medium(LocaleKeys.deletePagePrompt_restore.tr(), color: Colors.white, fontSize: 14), + onPressed: onRestore), + const HSpace(20), + BaseStyledButton( + minWidth: 220, + minHeight: 40, + contentPadding: EdgeInsets.zero, + bgColor: Colors.transparent, + hoverColor: theme.main2, + downColor: theme.main1, + outlineColor: Colors.white, + borderRadius: Corners.s8Border, + child: FlowyText.medium(LocaleKeys.deletePagePrompt_deletePermanent.tr(), + color: Colors.white, fontSize: 14), + onPressed: onDelete), + ], + ), ), ), );