Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions lib/modules/design_pattern_details/widgets/markdown_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: <Widget>[
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<Color>(
Colors.black.withOpacity(0.65),
child: SelectionArea(
focusNode: FocusNode(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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<Color>(
Colors.black.withOpacity(0.65),
),
),
),
error: (_, __) => const Text('Oops, something went wrong...'),
),
error: (_, __) => const Text('Oops, something went wrong...'),
),
],
],
),
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down