From 749a1a47fbaf2c7c28904828dd5ac466d295de4e Mon Sep 17 00:00:00 2001 From: nyne Date: Sun, 25 May 2025 20:33:31 +0800 Subject: [PATCH] Fix dialog content overflow. Close #363 --- lib/components/message.dart | 46 +++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/lib/components/message.dart b/lib/components/message.dart index 1a67f61..9c27e24 100644 --- a/lib/components/message.dart +++ b/lib/components/message.dart @@ -290,28 +290,30 @@ class ContentDialog extends StatelessWidget { @override Widget build(BuildContext context) { - var content = Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - title != null - ? Appbar( - leading: IconButton( - icon: const Icon(Icons.close), - onPressed: dismissible ? context.pop : null, - ), - title: Text(title!), - backgroundColor: Colors.transparent, - ) - : const SizedBox.shrink(), - this.content, - const SizedBox(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: actions, - ).paddingRight(12), - const SizedBox(height: 16), - ], + var content = SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + title != null + ? Appbar( + leading: IconButton( + icon: const Icon(Icons.close), + onPressed: dismissible ? context.pop : null, + ), + title: Text(title!), + backgroundColor: Colors.transparent, + ) + : const SizedBox.shrink(), + this.content, + const SizedBox(height: 16), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: actions, + ).paddingRight(12), + const SizedBox(height: 16), + ], + ), ); return Dialog( shape: RoundedRectangleBorder(