Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion lib/helpers/dart_syntax_highlighter.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart'
show BuildContext, Color, TextSpan, TextStyle, Theme;
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:flutter_markdown_selectionarea/flutter_markdown_selectionarea.dart';
import 'package:highlight/highlight.dart';

class DartSyntaxHighlighter extends SyntaxHighlighter {
Expand Down
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
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:flutter_markdown_selectionarea/flutter_markdown_selectionarea.dart';

import '../../../constants/constants.dart';
import '../../../helpers/dart_syntax_highlighter.dart';
Expand All @@ -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_selectionarea: ^0.6.14+3
flutter_riverpod: ^2.3.6
font_awesome_flutter: ^10.4.0
go_router: ^7.0.1
Expand Down