1
1
import 'package:easy_localization/easy_localization.dart' ;
2
2
import 'package:flutter/material.dart' ;
3
3
import 'package:flutter/services.dart' ;
4
+ import 'package:flutter_markdown/flutter_markdown.dart' ;
4
5
import 'package:obtainium/components/generated_form_modal.dart' ;
5
6
import 'package:obtainium/custom_errors.dart' ;
6
7
import 'package:obtainium/main.dart' ;
@@ -12,6 +13,7 @@ import 'package:obtainium/providers/source_provider.dart';
12
13
import 'package:url_launcher/url_launcher_string.dart' ;
13
14
import 'package:webview_flutter/webview_flutter.dart' ;
14
15
import 'package:provider/provider.dart' ;
16
+ import 'package:markdown/markdown.dart' as md;
15
17
16
18
class AppPage extends StatefulWidget {
17
19
const AppPage ({super .key, required this .appId});
@@ -221,24 +223,41 @@ class _AppPageState extends State<AppPage> {
221
223
if (app? .app.additionalSettings['about' ] is String &&
222
224
app? .app.additionalSettings['about' ].isNotEmpty)
223
225
Column (
226
+ mainAxisSize: MainAxisSize .min,
224
227
children: [
225
228
const SizedBox (
226
229
height: 48 ,
227
230
),
228
231
GestureDetector (
229
- onLongPress: () {
230
- Clipboard .setData (ClipboardData (
231
- text: app? .app.additionalSettings['about' ] ?? '' ));
232
- ScaffoldMessenger .of (context).showSnackBar (SnackBar (
233
- content: Text (tr ('copiedToClipboard' )),
234
- ));
235
- },
236
- child: Text (
237
- app? .app.additionalSettings['about' ],
238
- textAlign: TextAlign .center,
239
- style: const TextStyle (fontStyle: FontStyle .italic),
240
- ),
241
- )
232
+ onLongPress: () {
233
+ Clipboard .setData (ClipboardData (
234
+ text: app? .app.additionalSettings['about' ] ?? '' ));
235
+ ScaffoldMessenger .of (context).showSnackBar (SnackBar (
236
+ content: Text (tr ('copiedToClipboard' )),
237
+ ));
238
+ },
239
+ child: Markdown (
240
+ physics: NeverScrollableScrollPhysics (),
241
+ shrinkWrap: true ,
242
+ styleSheet: MarkdownStyleSheet (
243
+ blockquoteDecoration:
244
+ BoxDecoration (color: Theme .of (context).cardColor),
245
+ textAlign: WrapAlignment .center),
246
+ data: app? .app.additionalSettings['about' ],
247
+ onTapLink: (text, href, title) {
248
+ if (href != null ) {
249
+ launchUrlString (href,
250
+ mode: LaunchMode .externalApplication);
251
+ }
252
+ },
253
+ extensionSet: md.ExtensionSet (
254
+ md.ExtensionSet .gitHubFlavored.blockSyntaxes,
255
+ [
256
+ md.EmojiSyntax (),
257
+ ...md.ExtensionSet .gitHubFlavored.inlineSyntaxes
258
+ ],
259
+ ),
260
+ ))
242
261
],
243
262
),
244
263
],
0 commit comments