Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Mobile App
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
Mobile App
Commits
cc6814df
Commit
cc6814df
authored
5 years ago
by
Markin Igor
Browse files
Options
Downloads
Patches
Plain Diff
Pass host from third-party app.
parent
4882815c
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Mobile app initial implementation.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/src/app.dart
+4
-2
4 additions, 2 deletions
lib/src/app.dart
lib/src/screens/home.dart
+12
-4
12 additions, 4 deletions
lib/src/screens/home.dart
with
16 additions
and
6 deletions
lib/src/app.dart
+
4
−
2
View file @
cc6814df
...
...
@@ -20,6 +20,7 @@ class _AppState extends State<App> {
// Url of the app which invoked OAuth
String
_invokerURL
;
String
_host
;
@override
initState
()
{
...
...
@@ -53,11 +54,11 @@ class _AppState extends State<App> {
}
updateAppMode
(
Uri
uri
)
{
log
(
"Uri
$uri
"
);
if
(
uri
?.
path
==
"/authorize"
)
{
setState
(()
{
_appMode
=
"oauth"
;
_invokerURL
=
uri
.
queryParameters
[
"invokerUrl"
];
_host
=
uri
.
queryParameters
[
"host"
];
});
}
else
{
setState
(()
{
...
...
@@ -87,7 +88,8 @@ class _AppState extends State<App> {
body:
Home
(
mode:
_appMode
,
invokerURL:
_invokerURL
,
setMode:
setMode
setMode:
setMode
,
host:
_host
)
),
);
...
...
This diff is collapsed.
Click to expand it.
lib/src/screens/home.dart
+
12
−
4
View file @
cc6814df
...
...
@@ -8,9 +8,10 @@ import 'dart:convert';
import
'../../config.dart'
;
class
Home
extends
StatefulWidget
{
Home
({
@required
this
.
mode
,
@required
this
.
invokerURL
,
@required
this
.
setMode
});
Home
({
@required
this
.
mode
,
@required
this
.
invokerURL
,
@required
this
.
setMode
,
@required
this
.
host
});
final
String
mode
;
final
String
invokerURL
;
final
String
host
;
final
void
Function
(
String
)
setMode
;
@override
...
...
@@ -18,12 +19,12 @@ class Home extends StatefulWidget {
}
const
hosts
=
[
'https://demo1.vereign.com'
,
'https://demo2.vereign.com'
,
'https://rosengeorgiev.dev.vereign.com'
,
'https://borisdimitrov.dev.vereign.com'
,
'https://integration.vereign.com'
,
'https://staging.vereign.com'
,
'https://demo1.vereign.com'
,
'https://demo2.vereign.com'
,
'https://damyanmitev.dev.vereign.com'
,
'https://gospodinbodurov.dev.vereign.com'
,
'https://alexeylunin.dev.vereign.com'
,
...
...
@@ -83,14 +84,21 @@ class _HomeState extends State<Home> {
// this method IS called when parent widget passes new "props"
// unlike React, this method IS called _before_ the build
// unlike React, this method ISN'T called after setState()
if
(
widget
.
host
!=
oldWidget
.
host
&&
widget
.
host
!=
null
)
{
setState
(()
{
_host
=
widget
.
host
;
});
}
if
(
widget
.
mode
!=
oldWidget
.
mode
)
{
showMode
(
widget
.
mode
);
}
super
.
didUpdateWidget
(
oldWidget
);
}
showMode
(
mode
)
{
log
(
mode
);
if
(
mode
==
"app"
)
{
openVereign
();
}
else
if
(
mode
==
"oauth"
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment