chore: Update adaptive dialogs

This commit is contained in:
Christian Pauly 2020-11-23 08:06:15 +01:00
commit 8de1960a54
3 changed files with 6 additions and 3 deletions

View file

@ -14,17 +14,20 @@ import 'package:url_launcher/url_launcher.dart';
class HomeserverPicker extends StatelessWidget {
Future<void> _setHomeserverAction(BuildContext context) async {
const prefix = 'https://';
final homeserver = await showTextInputDialog(
title: L10n.of(context).enterYourHomeserver,
context: context,
textFields: [
DialogTextField(
hintText: AppConfig.defaultHomeserver,
prefixText: prefix,
keyboardType: TextInputType.url,
)
],
);
if (homeserver?.single?.isEmpty ?? true) return;
_checkHomeserverAction(homeserver.single, context);
_checkHomeserverAction(prefix + homeserver.single, context);
}
void _checkHomeserverAction(String homeserver, BuildContext context) async {