Migrate athentication from webview to deep linking

This commit is contained in:
Yegor Vialov
2019-10-20 16:45:44 +00:00
parent 085aead36b
commit 520fd6bc38
7 changed files with 41 additions and 40 deletions

View File

@ -27,6 +27,7 @@ import 'package:share/receive_share_state.dart';
import 'package:share/share.dart';
import 'plugins/dynamic_multi_column_layout.dart';
import 'plugins/spoiler_card.dart';
import 'package:uni_links/uni_links.dart';
import 'utils/logger.dart';
@ -185,24 +186,6 @@ class HAClientApp extends StatelessWidget {
),
"/log-view": (context) => LogViewPage(title: "Log"),
"/whats-new": (context) => WhatsNewPage(),
"/login": (context) => WebviewScaffold(
url: "${ConnectionManager().oauthUrl}",
appBar: new AppBar(
leading: IconButton(
icon: Icon(Icons.help),
onPressed: () => Launcher.launchURLInCustomTab(context: context, url: "http://ha-client.homemade.systems/docs#authentication")
),
title: new Text("Login with HA"),
actions: <Widget>[
FlatButton(
child: Text("Manual", style: TextStyle(color: Colors.white)),
onPressed: () {
eventBus.fire(ShowPageEvent(path: "/connection-settings", goBackFirst: true));
},
)
],
),
),
"/webview": (context) => WebviewScaffold(
url: "${(ModalRoute.of(context).settings.arguments as Map)['url']}",
appBar: new AppBar(