Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
medapp_eksad
Project
Project
Details
Activity
Releases
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
qorri_di
medapp_eksad
Commits
5acb8eac
Commit
5acb8eac
authored
Aug 30, 2022
by
Budi Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kerangka
parent
2aaaf004
Pipeline
#399
failed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
163 additions
and
1 deletion
+163
-1
appbar_home.dart
lib/appbar/appbar_home.dart
+87
-0
homepage.dart
lib/homepage.dart
+36
-1
button_appbar.dart
lib/widget/button_appbar.dart
+40
-0
No files found.
lib/appbar/appbar_home.dart
0 → 100644
View file @
5acb8eac
import
'package:flutter/material.dart'
;
import
'package:medapp_eksad/widget/button_appbar.dart'
;
AppBar
AppbarHomeLarge
(
Size
screenSize
,
BuildContext
context
,
Color
home
,
Color
aboutUs
,
Color
ourServices
,
Color
career
,
Color
contactUs
)
{
return
AppBar
(
backgroundColor:
Colors
.
white
,
toolbarHeight:
100
,
leadingWidth:
screenSize
.
width
*
0.3
,
leading:
Row
(
children:
[
Container
(
width:
screenSize
.
width
*
0.1
,
),
IconButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/'
);
},
icon:
const
Image
(
image:
AssetImage
(
'assets/logo/protalent.png'
),
width:
500
,
height:
200
,
),
iconSize:
190
,
),
],
),
title:
Row
(
children:
[
ButtonAppbar_baru
(
arah:
'/'
,
menu:
'Home'
,
warna:
home
),
const
Spacer
(
flex:
1
,
),
ButtonAppbar_baru
(
arah:
'/'
,
menu:
'About Us'
,
warna:
aboutUs
),
const
Spacer
(
flex:
1
,
),
ButtonAppbar_baru
(
arah:
'/service'
,
menu:
'Our Services'
,
warna:
ourServices
),
const
Spacer
(
flex:
1
,
),
ButtonAppbar_baru
(
arah:
'/career'
,
menu:
'Career'
,
warna:
career
),
const
Spacer
(
flex:
1
,
),
ButtonAppbar_baru
(
arah:
'/contact'
,
menu:
'Contact Us'
,
warna:
contactUs
),
const
Spacer
(
flex:
2
,
),
TextButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/login'
);
},
child:
const
Text
(
'Login'
,
style:
TextStyle
(
fontSize:
19
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
black
),
),
),
Container
(
width:
screenSize
.
width
*
0.006
,
),
ElevatedButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/register'
);
},
style:
ElevatedButton
.
styleFrom
(
primary:
const
Color
(
0xff1e5ea8
),
fixedSize:
const
Size
(
130
,
45
),
onPrimary:
Colors
.
red
,
),
child:
const
Text
(
'Register'
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
19
,
fontWeight:
FontWeight
.
w500
),
),
),
const
Spacer
(
flex:
5
,
),
],
),
);
}
\ No newline at end of file
lib/homepage.dart
View file @
5acb8eac
import
'package:flutter/material.dart'
;
import
'package:medapp_eksad/appbar/appbar_home.dart'
;
import
'package:medapp_eksad/widget/responsive.dart'
;
class
HomePage
extends
StatefulWidget
{
...
...
@@ -9,9 +11,42 @@ class HomePage extends StatefulWidget {
}
class
_HomePageState
extends
State
<
HomePage
>
{
final
GlobalKey
<
ScaffoldState
>
_scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
@override
Widget
build
(
BuildContext
context
)
{
return
Container
();
var
screenSize
=
MediaQuery
.
of
(
context
).
size
;
return
Scaffold
(
key:
_scaffoldKey
,
appBar:
ResponsiveWidget
.
isSmallScreen
(
context
)
?
AppBarKecil
()
:
AppbarHomeLarge
(
screenSize
,
context
,
Colors
.
blue
,
Colors
.
blue
,
Colors
.
black
,
Colors
.
black
,
Colors
.
black
),
body:
ListView
(
),
);
}
AppBar
AppBarKecil
()
{
return
AppBar
(
leading:
IconButton
(
onPressed:
()
=>
_scaffoldKey
.
currentState
!.
openDrawer
(),
icon:
Icon
(
Icons
.
list_outlined
,
size:
30
,
color:
Colors
.
black
,),),
backgroundColor:
Colors
.
white
,
centerTitle:
true
,
title:
Container
(
child:
SizedBox
(
height:
50
,
width:
150
,
child:
Image
.
asset
(
"assets/logo/logo_protalent.png"
),
),
),
// ),
);
}
}
lib/widget/button_appbar.dart
0 → 100644
View file @
5acb8eac
import
'package:flutter/material.dart'
;
class
ButtonAppbar_baru
extends
StatelessWidget
{
const
ButtonAppbar_baru
(
{
Key
?
key
,
required
this
.
arah
,
required
this
.
menu
,
required
this
.
warna
})
:
super
(
key:
key
);
final
String
menu
;
final
String
arah
;
final
Color
warna
;
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
child:
TextButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
arah
);
},
style:
ButtonStyle
(
foregroundColor:
MaterialStateProperty
.
resolveWith
<
Color
>(
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
hovered
))
// ignore: curly_braces_in_flow_control_structures
return
Colors
.
blue
;
return
warna
;
// null throus error in flutter 2.2+.
}),
),
child:
Text
(
menu
,
style:
const
TextStyle
(
fontSize:
18
,
letterSpacing:
1.1
,
fontWeight:
FontWeight
.
w500
,
),
),
),
);
}
}
\ No newline at end of file
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