Fix web registration

This commit is contained in:
Christian Pauly 2020-02-17 14:07:57 +01:00
parent 8afa93e805
commit 604ed00592
2 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,8 @@
import 'package:fluffychat/components/matrix.dart';
import 'package:fluffychat/i18n/i18n.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:webview_flutter/webview_flutter.dart';
class AuthWebView extends StatelessWidget {
@ -14,6 +16,7 @@ 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";
if (kIsWeb) launch(url);
return Scaffold(
appBar: AppBar(
title: Text(I18n.of(context).authentication),
@ -29,10 +32,12 @@ class AuthWebView extends StatelessWidget {
children: <Widget>[
LinearProgressIndicator(),
Expanded(
child: WebView(
initialUrl: url,
javascriptMode: JavascriptMode.unrestricted,
),
child: kIsWeb
? Center(child: Icon(Icons.link))
: WebView(
initialUrl: url,
javascriptMode: JavascriptMode.unrestricted,
),
),
],
),

View File

@ -124,8 +124,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "806f6449fcbd6735d62fd5ab7333607512557803"
resolved-ref: "806f6449fcbd6735d62fd5ab7333607512557803"
ref: b7dea7c6a5634f68816be9323ce78669b7d0ff0f
resolved-ref: b7dea7c6a5634f68816be9323ce78669b7d0ff0f
url: "https://gitlab.com/famedly/famedlysdk.git"
source: git
version: "0.0.1"
@ -274,7 +274,7 @@ packages:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
version: "0.16.0"
intl_translation:
dependency: "direct main"
description: