Make markdown images clickable (full screen)

This commit is contained in:
John Wesley 2024-05-29 11:06:30 -04:00
parent 7ed1afbfdd
commit 332d4298ff
1 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart' as mdf;
import 'package:interstellar/src/models/image.dart';
import 'package:interstellar/src/widgets/image.dart';
import 'package:interstellar/src/widgets/open_webpage.dart';
import './markdown_mention.dart';
@ -26,6 +28,18 @@ class Markdown extends StatelessWidget {
openWebpage(context, Uri.parse(href));
}
},
imageBuilder: (uri, title, alt) {
return AdvancedImage(
ImageModel(
src: uri.toString(),
altText: alt,
blurHash: null,
blurHashWidth: null,
blurHashHeight: null,
),
openTitle: title ?? '',
);
},
inlineSyntaxes: [
SubscriptMarkdownSyntax(),
SuperscriptMarkdownSyntax(),