|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
|
|
|
import 'package:flutter_linkify/flutter_linkify.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:fluffychat/utils/url_launcher.dart';
|
|
|
|
|
import 'package:fluffychat/widgets/adaptive_dialogs/adaptive_dialog_action.dart';
|
|
|
|
|
|
|
|
|
|
enum OkCancelResult { ok, cancel }
|
|
|
|
@ -25,7 +27,17 @@ Future<OkCancelResult?> showOkCancelAlertDialog({
|
|
|
|
|
),
|
|
|
|
|
content: ConstrainedBox(
|
|
|
|
|
constraints: const BoxConstraints(maxWidth: 256),
|
|
|
|
|
child: message == null ? null : Text(message),
|
|
|
|
|
child: message == null
|
|
|
|
|
? null
|
|
|
|
|
: SelectableLinkify(
|
|
|
|
|
text: message,
|
|
|
|
|
linkStyle: TextStyle(
|
|
|
|
|
color: Theme.of(context).colorScheme.primary,
|
|
|
|
|
decorationColor: Theme.of(context).colorScheme.primary,
|
|
|
|
|
),
|
|
|
|
|
options: const LinkifyOptions(humanize: false),
|
|
|
|
|
onOpen: (url) => UrlLauncher(context, url.url).launchUrl(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
actions: [
|
|
|
|
|
AdaptiveDialogAction(
|
|
|
|
@ -65,7 +77,17 @@ Future<OkCancelResult?> showOkAlertDialog({
|
|
|
|
|
),
|
|
|
|
|
content: ConstrainedBox(
|
|
|
|
|
constraints: const BoxConstraints(maxWidth: 256),
|
|
|
|
|
child: message == null ? null : Text(message),
|
|
|
|
|
child: message == null
|
|
|
|
|
? null
|
|
|
|
|
: SelectableLinkify(
|
|
|
|
|
text: message,
|
|
|
|
|
linkStyle: TextStyle(
|
|
|
|
|
color: Theme.of(context).colorScheme.primary,
|
|
|
|
|
decorationColor: Theme.of(context).colorScheme.primary,
|
|
|
|
|
),
|
|
|
|
|
options: const LinkifyOptions(humanize: false),
|
|
|
|
|
onOpen: (url) => UrlLauncher(context, url.url).launchUrl(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
actions: [
|
|
|
|
|
AdaptiveDialogAction(
|
|
|
|
|