Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
second_display
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
second_display
Commits
08befdc2
Commit
08befdc2
authored
Apr 07, 2022
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input base url
parent
d8305a3e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
input_base_url.dart
lib/ui/settings/input_base_url.dart
+71
-0
No files found.
lib/ui/settings/input_base_url.dart
0 → 100644
View file @
08befdc2
import
'package:flutter/material.dart'
;
import
'package:second_display/helper/config.dart'
;
import
'package:second_display/main.dart'
;
import
'package:second_display/ui/error.dart'
;
class
InputBaseUrl
extends
StatefulWidget
{
const
InputBaseUrl
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
InputBaseUrl
>
createState
()
=>
_InputBaseUrlState
();
}
class
_InputBaseUrlState
extends
State
<
InputBaseUrl
>
{
final
_baseUrlController
=
TextEditingController
();
late
String
urlBase
;
@override
void
initState
()
{
final
String
?
_baseUrls
=
prefs
.
getString
(
'base_url'
);
urlBase
=
_baseUrls
??
urlDefault
;
_baseUrlController
.
text
=
urlBase
;
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
"Base Url"
),
backgroundColor:
backgroundAppBar
,
),
body:
SingleChildScrollView
(
child:
Center
(
child:
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.5
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.5
,
// color: Colors.red,
child:
Column
(
children:
[
TextFormField
(
controller:
_baseUrlController
,
style:
const
TextStyle
(
color:
Colors
.
black
),
decoration:
InputDecoration
(
// border: InputBorder.none,
prefixIcon:
const
Icon
(
Icons
.
attach_money_rounded
,
color:
Colors
.
white30
,
),
hintText:
urlBase
,
hintStyle:
TextStyle
(
color:
Colors
.
black
.
withOpacity
(
0.8
)),
),
),
const
SizedBox
(
height:
30
,
),
ElevatedButton
.
icon
(
onPressed:
()
async
{
await
prefs
.
setString
(
'base_url'
,
_baseUrlController
.
text
);
Navigator
.
pushReplacement
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ErrorPage
()));
},
icon:
const
Icon
(
Icons
.
check
),
label:
const
Text
(
"Input base Url"
))
],
),
),
),
),
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment