New store

This commit is contained in:
Christian Pauly 2020-01-26 11:17:54 +00:00
commit 46f7a947f5
19 changed files with 159 additions and 969 deletions

View file

@ -14,7 +14,6 @@ class AuthWebView extends StatelessWidget {
Widget build(BuildContext context) {
final String url = Matrix.of(context).client.homeserver +
"/_matrix/client/r0/auth/$authType/fallback/web?session=$session";
print(url);
return Scaffold(
appBar: AppBar(
title: Text(I18n.of(context).authentication),

View file

@ -85,9 +85,7 @@ class _ChatListState extends State<ChatList> {
void getSharedData() {
// For sharing or opening urls/text coming from outside the app while the app is in the memory
_intentDataStreamSubscription = ReceiveSharingIntent.getTextStream()
.listen(processSharedText, onError: (err) {
print("getLinkStream error: $err");
});
.listen(processSharedText, onError: (err) {});
// For sharing or opening urls/text coming from outside the app while the app is closed
ReceiveSharingIntent.getInitialText().then(processSharedText);
}

View file

@ -13,7 +13,6 @@ class ContentWebView extends StatelessWidget {
@override
Widget build(BuildContext context) {
final String url = content.getDownloadLink(Matrix.of(context).client);
print(url);
return Scaffold(
appBar: AppBar(
title: Text(

View file

@ -50,7 +50,6 @@ class _LoginState extends State<Login> {
}
try {
print("[Login] Check server...");
setState(() => loading = true);
if (!await matrix.client.checkServer(homeserver)) {
setState(
@ -63,7 +62,6 @@ class _LoginState extends State<Login> {
return setState(() => loading = false);
}
try {
print("[Login] Try to login...");
await matrix.client.login(
usernameController.text, passwordController.text,
initialDeviceDisplayName: matrix.widget.clientName);
@ -76,19 +74,14 @@ class _LoginState extends State<Login> {
}
if (!kIsWeb) {
try {
print("[Login] Setup Firebase...");
await matrix.setupFirebase();
} catch (exception) {
print("[Login] Failed to setup Firebase. Logout now...");
await matrix.client.logout();
matrix.clean();
setState(() => passwordError = exception.toString());
return setState(() => loading = false);
}
}
print("[Login] Store account and go to ChatListView");
await Matrix.of(context).saveAccount();
setState(() => loading = false);
await Navigator.of(context).pushAndRemoveUntil(
AppRoute.defaultRoute(context, ChatListView()), (r) => false);

View file

@ -76,7 +76,6 @@ class _SettingsState extends State<Settings> {
),
),
);
print(success);
if (success != false) {
Toast.show(
I18n.of(context).avatarHasBeenChanged,

View file

@ -58,7 +58,6 @@ class _SignUpState extends State<SignUp> {
}
try {
print("[Sign Up] Check server...");
setState(() => loading = true);
if (!await matrix.client.checkServer(homeserver)) {
setState(
@ -72,7 +71,6 @@ class _SignUpState extends State<SignUp> {
}
try {
print("[Sign Up] Check if username is available...");
await matrix.client.usernameAvailable(preferredUsername);
} on MatrixException catch (exception) {
setState(() => usernameError = exception.errorMessage);

View file

@ -39,7 +39,6 @@ class _SignUpPasswordState extends State<SignUpPassword> {
}
try {
print("[Sign Up] Create account...");
setState(() => loading = true);
Future<LoginState> waitForLogin =
matrix.client.onLoginStateChanged.stream.first;
@ -52,8 +51,6 @@ class _SignUpPasswordState extends State<SignUpPassword> {
await waitForLogin;
} on MatrixException catch (exception) {
if (exception.requireAdditionalAuthentication) {
print(exception.raw);
final List<String> stages = exception.authenticationFlows
.firstWhere((a) => !a.stages.contains("m.login.email.identity"))
.stages;
@ -90,7 +87,7 @@ class _SignUpPasswordState extends State<SignUpPassword> {
return setState(() => loading = false);
}
} catch (exception) {
print(exception);
debugPrint(exception);
setState(() => passwordError = exception.toString());
return setState(() => loading = false);
}