Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Mobile App
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
561e49f9
Commit
561e49f9
authored
5 years ago
by
Markin Igor
Browse files
Options
Downloads
Patches
Plain Diff
Show dropdown with envs in dev mode.
parent
4583da61
Branches
Branches containing commit
No related tags found
1 merge request
!1
Mobile app initial implementation.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/src/screens/home.dart
+66
-9
66 additions, 9 deletions
lib/src/screens/home.dart
with
66 additions
and
9 deletions
lib/src/screens/home.dart
+
66
−
9
View file @
561e49f9
...
@@ -17,7 +17,30 @@ class Home extends StatefulWidget {
...
@@ -17,7 +17,30 @@ class Home extends StatefulWidget {
_HomeState
createState
()
=
>
_HomeState
();
_HomeState
createState
()
=
>
_HomeState
();
}
}
const
hosts
=
[
'https://rosengeorgiev.dev.vereign.com'
,
'https://borisdimitrov.dev.vereign.com'
,
'https://app.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'
,
'https://igormarkin.dev.vereign.com'
,
'https://mikhaildorokhovich.dev.vereign.com'
,
'https://sashailieva.dev.vereign.com'
,
'https://alexanderholodov.dev.vereign.com'
,
'https://olguncengiz.dev.vereign.com'
,
'https://viktorpopov.dev.vereign.com'
,
'https://kalincanov.dev.vereign.com'
,
'https://alexeykuklin.dev.vereign.com'
];
class
_HomeState
extends
State
<
Home
>
{
class
_HomeState
extends
State
<
Home
>
{
String
_host
=
Config
.
appFlavor
==
Flavor
.
DEVELOPMENT
?
hosts
[
0
]
:
APP_HOST
;
@override
@override
initState
()
{
initState
()
{
super
.
initState
();
super
.
initState
();
...
@@ -77,7 +100,7 @@ class _HomeState extends State<Home> {
...
@@ -77,7 +100,7 @@ class _HomeState extends State<Home> {
}
}
openVereign
()
{
openVereign
()
{
FlutterWebBrowser
.
openWebPage
(
url:
APP_HOST
,
androidToolbarColor:
Color
(
0xFFd51d32
));
FlutterWebBrowser
.
openWebPage
(
url:
_host
,
androidToolbarColor:
Color
(
0xFFd51d32
));
}
}
startOAuth
()
{
startOAuth
()
{
...
@@ -100,29 +123,63 @@ class _HomeState extends State<Home> {
...
@@ -100,29 +123,63 @@ class _HomeState extends State<Home> {
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
var
children
=
<
Widget
>[
_urlButton
(
context
,
"Open Dashboard"
,
openVereign
),
_urlButton
(
context
,
"Authorize with Vereign"
,
startOAuth
)
];
if
(
Config
.
appFlavor
==
Flavor
.
DEVELOPMENT
)
{
children
.
add
(
wrapInContainer
(
DropdownButton
<
String
>(
value:
_host
,
onChanged:
(
String
newValue
)
{
setState
(()
{
_host
=
newValue
;
});
},
items:
hosts
.
map
<
DropdownMenuItem
<
String
>>((
String
value
)
{
return
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
),
);
})
.
toList
(),
)
)
);
}
return
Scaffold
(
return
Scaffold
(
body:
SafeArea
(
body:
SafeArea
(
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
children:
<
Widget
>[
children:
children
_urlButton
(
context
,
"Open Dashboard"
,
openVereign
),
_urlButton
(
context
,
"Authorize with Vereign"
,
startOAuth
),
]
))));
))));
}
}
Widget
_urlButton
(
BuildContext
context
,
String
title
,
listener
)
{
Widget
wrapInContainer
(
Widget
widget
)
{
return
Container
(
return
Container
(
padding:
EdgeInsets
.
all
(
20.0
),
padding:
EdgeInsets
.
all
(
20.0
),
child:
FlatButton
(
child:
widget
,
);
}
Widget
_urlButton
(
BuildContext
context
,
String
title
,
listener
)
{
return
wrapInContainer
(
FlatButton
(
color:
Theme
.
of
(
context
)
.
primaryColor
,
color:
Theme
.
of
(
context
)
.
primaryColor
,
textColor:
Colors
.
white
,
textColor:
Colors
.
white
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
50.0
,
vertical:
15.0
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
50.0
,
vertical:
15.0
),
child:
Text
(
title
),
child:
Text
(
title
),
onPressed:
listener
onPressed:
listener
));
)
);
}
}
}
}
\ No newline at end of file
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