Make image inside markdown fullscreenable
This commit is contained in:
parent
9e27380985
commit
4a5bb17afb
|
@ -1,6 +1,7 @@
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
|
import 'package:lemmur/pages/media_view.dart';
|
||||||
import 'package:markdown/markdown.dart' as md;
|
import 'package:markdown/markdown.dart' as md;
|
||||||
|
|
||||||
import '../url_launcher.dart';
|
import '../url_launcher.dart';
|
||||||
|
@ -24,13 +25,20 @@ class MarkdownText extends StatelessWidget {
|
||||||
),
|
),
|
||||||
)));
|
)));
|
||||||
},
|
},
|
||||||
imageBuilder: (uri, title, alt) => CachedNetworkImage(
|
imageBuilder: (uri, title, alt) => InkWell(
|
||||||
imageUrl: uri.toString(),
|
onTap: () {
|
||||||
errorWidget: (context, url, error) => Row(
|
Navigator.of(context).push(MaterialPageRoute(
|
||||||
children: [
|
builder: (context) => MediaViewPage(uri.toString()),
|
||||||
Icon(Icons.warning),
|
));
|
||||||
Text("couldn't load image, ${error.toString()}")
|
},
|
||||||
],
|
child: CachedNetworkImage(
|
||||||
|
imageUrl: uri.toString(),
|
||||||
|
errorWidget: (context, url, error) => Row(
|
||||||
|
children: [
|
||||||
|
Icon(Icons.warning),
|
||||||
|
Text("couldn't load image, ${error.toString()}")
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue