feat: open links better
This commit is contained in:
parent
0ae0d6cbc8
commit
955210a8e5
7 changed files with 127 additions and 47 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:flutter_matrix_html/flutter_html.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../utils/url_launcher.dart';
|
||||
|
||||
import 'matrix.dart';
|
||||
|
||||
|
|
@ -42,12 +42,8 @@ class HtmlMessage extends StatelessWidget {
|
|||
),
|
||||
shrinkToFit: true,
|
||||
maxLines: maxLines,
|
||||
onLinkTap: (String url) {
|
||||
if (url == null || url.isEmpty) {
|
||||
return;
|
||||
}
|
||||
launch(url);
|
||||
},
|
||||
onLinkTap: (url) => UrlLauncher(context, url).launchUrl(),
|
||||
onPillTap: (url) => UrlLauncher(context, url).launchUrl(),
|
||||
getMxcUrl: (String mxc, double width, double height) {
|
||||
final ratio = MediaQuery.of(context).devicePixelRatio;
|
||||
return Uri.parse(mxc)?.getThumbnail(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue