refactor: MVC sign up view

This commit is contained in:
Christian Pauly 2021-04-12 17:31:53 +02:00
commit 6b9f1476db
7 changed files with 121 additions and 80 deletions

View file

@ -43,10 +43,13 @@ class Matrix extends StatefulWidget {
final BuildContext context;
final Client testClient;
Matrix({
this.child,
@required this.apl,
@required this.context,
this.testClient,
Key key,
}) : super(key: key);
@ -66,6 +69,8 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
BackgroundPush _backgroundPush;
bool get testMode => widget.testClient != null;
Map<String, dynamic> get shareContent => _shareContent;
set shareContent(Map<String, dynamic> content) {
_shareContent = content;
@ -256,7 +261,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
});
});
}
client = FluffyClient();
client = widget.testClient ?? FluffyClient();
LoadingDialog.defaultTitle = L10n.of(context).loadingPleaseWait;
LoadingDialog.defaultBackLabel = L10n.of(context).close;
LoadingDialog.defaultOnError = (Object e) => e.toLocalizedString(context);