1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 21:09:21 +00:00
comunicmobile/lib/ui/dialogs/input_url_dialog.dart

28 lines
714 B
Dart
Raw Normal View History

2020-04-25 15:16:33 +00:00
import 'package:comunic/ui/dialogs/single_input_dialog.dart';
import 'package:comunic/utils/input_utils.dart';
import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart';
/// Ask the user to enter an URL
///
/// @author Pierre Hubert
/// Ask the user to enter an URL
Future<String?> showInputURLDialog({
required BuildContext context,
required String? title,
String? initialURL,
2020-04-25 15:16:33 +00:00
}) async {
return await showDialog(
context: context,
builder: (c) => SingleInputDialog(
title: title!,
2020-04-25 15:16:33 +00:00
icon: Icons.link,
initialValue: initialURL,
label: "http://...",
checkInput: (s) => validateUrl(s),
errorMessage: tr("Invalid URL!")!,
2020-04-25 15:16:33 +00:00
),
);
}