diff --git a/lib/modules/design_pattern_details/widgets/markdown_view.dart b/lib/modules/design_pattern_details/widgets/markdown_view.dart index b44a391..6d8ae7f 100644 --- a/lib/modules/design_pattern_details/widgets/markdown_view.dart +++ b/lib/modules/design_pattern_details/widgets/markdown_view.dart @@ -22,30 +22,33 @@ class MarkdownView extends ConsumerWidget { behavior: const ScrollBehavior(), child: SingleChildScrollView( padding: const EdgeInsets.all(LayoutConstants.paddingL), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - designPattern.description, - style: Theme.of(context).textTheme.titleMedium, - textAlign: TextAlign.justify, - overflow: TextOverflow.ellipsis, - maxLines: 99, - ), - const SizedBox(height: LayoutConstants.spaceL), - markdown.when( - data: (data) => RichMarkdownBody(data: data), - loading: () => Center( - child: CircularProgressIndicator( - backgroundColor: lightBackgroundColor, - valueColor: AlwaysStoppedAnimation( - Colors.black.withOpacity(0.65), + child: SelectionArea( + focusNode: FocusNode(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + designPattern.description, + style: Theme.of(context).textTheme.titleMedium, + textAlign: TextAlign.justify, + overflow: TextOverflow.ellipsis, + maxLines: 99, + ), + const SizedBox(height: LayoutConstants.spaceL), + markdown.when( + data: (data) => RichMarkdownBody(data: data), + loading: () => Center( + child: CircularProgressIndicator( + backgroundColor: lightBackgroundColor, + valueColor: AlwaysStoppedAnimation( + Colors.black.withOpacity(0.65), + ), ), ), + error: (_, __) => const Text('Oops, something went wrong...'), ), - error: (_, __) => const Text('Oops, something went wrong...'), - ), - ], + ], + ), ), ), ); diff --git a/lib/modules/design_pattern_details/widgets/rich_markdown_body.dart b/lib/modules/design_pattern_details/widgets/rich_markdown_body.dart index c77aa4b..dcb09e6 100644 --- a/lib/modules/design_pattern_details/widgets/rich_markdown_body.dart +++ b/lib/modules/design_pattern_details/widgets/rich_markdown_body.dart @@ -20,7 +20,6 @@ class RichMarkdownBody extends StatelessWidget { final fontSize = bodyMedium?.fontSize ?? 14.0; return MarkdownBody( - selectable: true, fitContent: false, styleSheet: MarkdownStyleSheet( h1: textTheme.headlineMedium, diff --git a/pubspec.yaml b/pubspec.yaml index 9dbfda9..4880084 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: faker: ^2.1.0 flutter: sdk: flutter - flutter_markdown: ^0.6.14 + flutter_markdown: ^0.7.3+1 flutter_riverpod: ^2.3.6 font_awesome_flutter: ^10.4.0 go_router: ^7.0.1