Skip to content
Snippets Groups Projects
Commit 7ca0e586 authored by igorwork's avatar igorwork Committed by Markin Igor
Browse files

Add config.

parent d7ede746
No related branches found
No related tags found
1 merge request!1Mobile app initial implementation.
const String APP_HOST = "https://demo1.vereign.com";
\ No newline at end of file
......@@ -5,6 +5,8 @@ import 'package:url_launcher/url_launcher.dart';
import 'dart:developer';
import 'dart:convert';
import '../config.dart';
class Home extends StatefulWidget {
Home({@required this.mode, @required this.invokerURL, @required this.setMode});
final String mode;
......@@ -19,12 +21,10 @@ String clientId = "222222";
String clientSecret = "22222222";
String redirectURL = "app://com.vereign.app/oauth2";
String authEndpoint = "https://gospodinbodurov.dev.vereign.com/api/oauth2/authorize";
String tokenEndpoint = "https://gospodinbodurov.dev.vereign.com/api/oauth2/token";
String authEndpoint = "$APP_HOST/api/oauth2/authorize";
String tokenEndpoint = "$APP_HOST/api/oauth2/token";
class _HomeState extends State<Home> {
final _links = ['vereign://app.vereign.com', 'vereign://app.vereign.com/oauth2', 'testredirect://app.vereign.com', 'https://igormarkin.dev.vereign.com', 'https://gospodinbodurov.dev.vereign.com'];
@override
initState() {
super.initState();
......@@ -84,7 +84,7 @@ class _HomeState extends State<Home> {
}
openVereign() {
FlutterWebBrowser.openWebPage(url: 'https://gospodinbodurov.dev.vereign.com', androidToolbarColor: Color(0xFFd51d32));
FlutterWebBrowser.openWebPage(url: APP_HOST, androidToolbarColor: Color(0xFFd51d32));
}
startOAuth() {
......@@ -115,14 +115,13 @@ class _HomeState extends State<Home> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
// children: _links.map((link) => _urlButton(context, link)).toList(),
children: <Widget>[
_urlButton(context, _links[0], "Open Dashboard", openVereign),
_urlButton(context, _links[1], "Authorize with Vereign", startOAuth),
_urlButton(context, "Open Dashboard", openVereign),
_urlButton(context, "Authorize with Vereign", startOAuth),
]
))));
}
Widget _urlButton(BuildContext context, String url, String title, listener) {
Widget _urlButton(BuildContext context, String title, listener) {
return Container(
padding: EdgeInsets.all(20.0),
child: FlatButton(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment