feat: Nicer registration form

This commit is contained in:
Krille Fear 2021-10-30 14:06:10 +02:00
commit 661b740f57
6 changed files with 241 additions and 119 deletions

View file

@ -5,6 +5,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:matrix/matrix.dart';
import 'uia_request_manager.dart';
extension LocalizedExceptionExtension on Object {
String toLocalizedString(BuildContext context) {
if (this is MatrixException) {
@ -48,6 +50,7 @@ extension LocalizedExceptionExtension on Object {
if (this is MatrixConnectionException || this is SocketException) {
return L10n.of(context).noConnectionToTheServer;
}
if (this is UiaException) return toString();
Logs().w('Something went wrong: ', this);
return L10n.of(context).oopsSomethingWentWrong;
}