1
0
Fork 0
forked from Nexus/nexus

Add room details dialog

Fixes #20
This commit is contained in:
Henry Hiles 2026-05-26 15:31:37 -04:00
commit e69f04f6e7
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
7 changed files with 105 additions and 41 deletions

View file

@ -0,0 +1,23 @@
import "package:flutter/material.dart";
import "package:flutter_linkify/flutter_linkify.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:nexus/helpers/launch_helper.dart";
class LinkifiedText extends ConsumerWidget {
final String text;
final int? maxLines;
final TextStyle? style;
const LinkifiedText(this.text, {this.maxLines, this.style, super.key});
@override
Widget build(BuildContext context, WidgetRef ref) => Linkify(
text: text,
maxLines: maxLines,
style: style,
options: LinkifyOptions(humanize: false),
onOpen: (link) =>
ref.watch(LaunchHelper.provider).launchUrl(Uri.parse(link.url)),
linkStyle: TextStyle(color: Theme.of(context).colorScheme.primary),
overflow: maxLines == null ? null : TextOverflow.ellipsis,
);
}