[Homepage] 10. fix style homepage for android device

This commit is contained in:
Stephen
2024-01-12 17:27:28 +07:00
parent 680dc463ea
commit 69a3e1965c

View File

@@ -17,10 +17,7 @@ class HomepageScreen extends StatelessWidget {
child: FloatingActionButton(
onPressed: () {},
backgroundColor: Color(0xFFFFFFFF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
8.0), // Sesuaikan radius sesuai keinginan Anda
),
shape: CircleBorder(),
child: Container(
width: Constant.getActualXPhone(context: context, x: 50),
height: Constant.getActualYPhone(context: context, y: 50),
@@ -30,9 +27,6 @@ class HomepageScreen extends StatelessWidget {
'images/finger_tap_orange_botnav.png'), // Ganti dengan path gambar Anda
),
),
// width: Constant.getActualXPhone(context: context, x: 70),
// height: Constant.getActualYPhone(context: context, y: 70),
// child: Image.asset('images/finger_tap_orange_botnav.png')
),
),
),
@@ -91,13 +85,24 @@ class HomepageScreen extends StatelessWidget {
),
),
body: SafeArea(
child: Container(
width: Constant.getActualXPhone(context: context, x: 390),
height: Constant.getActualYPhone(context: context, y: 844),
child: Column(
children: [
Container(
Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(context: context, y: 58),
left: Constant.getActualXPhone(context: context, x: 33),
right: Constant.getActualXPhone(context: context, x: 27),
),
child: Container(
child: ListTile(
leading: Container(
width: Constant.getActualXPhone(context: context, x: 36),
height: Constant.getActualYPhone(context: context, y: 36),
width:
Constant.getActualXPhone(context: context, x: 36),
height:
Constant.getActualYPhone(context: context, y: 36),
child: Image(
image: AssetImage('images/avatar_c.png'),
)),
@@ -110,7 +115,8 @@ class HomepageScreen extends StatelessWidget {
),
subtitle: Text(
"Step@example.com",
style: Constant.subtitle_500_12(context: context).copyWith(
style:
Constant.subtitle_500_12(context: context).copyWith(
color: Constant.textLightGrey,
),
),
@@ -132,29 +138,16 @@ class HomepageScreen extends StatelessWidget {
child: IconButton(
onPressed: () {},
icon: Container(
width: Constant.getActualXPhone(context: context, x: 20),
height: Constant.getActualYPhone(context: context, y: 20),
width:
Constant.getActualXPhone(context: context, x: 20),
height:
Constant.getActualYPhone(context: context, y: 20),
child: Image(
image: AssetImage('images/alert_badge.png'),
),
),
),
// child: ElevatedButton(
// onPressed: () {
// // Action to be performed on button press
// },
// child: Container(
// width: Constant.getActualXPhone(context: context, x: 20),
// height: Constant.getActualYPhone(context: context, y: 20),
// decoration: BoxDecoration(
// image: DecorationImage(
// image: AssetImage(
// 'images/alert_badge.png', // Ganti dengan path gambar Anda
// ),
// ),
// ),
// ),
// ),
),
),
),
),
@@ -169,9 +162,6 @@ class HomepageScreen extends StatelessWidget {
left: Constant.getActualXPhone(context: context, x: 33),
right: Constant.getActualXPhone(context: context, x: 27),
),
child: Container(
child: Card(
elevation: 16,
child: Container(
width: Constant.getActualXPhone(context: context, x: 330),
height: Constant.getActualYPhone(context: context, y: 200),
@@ -180,35 +170,35 @@ class HomepageScreen extends StatelessWidget {
image: DecorationImage(
image: AssetImage(
'images/card_bg_1.png'), // Ganti dengan path gambar Anda
fit: BoxFit.cover, // Sesuaikan cara gambar ditampilkan
fit: BoxFit.fill, // Sesuaikan cara gambar ditampilkan
),
),
child: Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(context: context, y: 16),
left: Constant.getActualXPhone(context: context, x: 25),
right: Constant.getActualXPhone(context: context, x: 25),
),
child: Container(
width: Constant.getActualXPhone(context: context, x: 280),
height:
Constant.getActualYPhone(context: context, y: 150),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Date
Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(
context: context, y: 16),
left: Constant.getActualXPhone(
context: context, x: 83.5),
right: Constant.getActualXPhone(
context: context, x: 83.5),
),
child: RealTimeFormattedDate(),
),
RealTimeFormattedDate(),
SizedBox(
height:
Constant.getActualYPhone(context: context, y: 8),
height: Constant.getActualYPhone(
context: context, y: 8),
),
//Time
RealTimeClock(), // Menampilkan waktu real-time menggunakan RealTimeClock
SizedBox(
height:
Constant.getActualYPhone(context: context, y: 20),
height: Constant.getActualYPhone(
context: context, y: 20),
),
Row(
mainAxisAlignment: MainAxisAlignment
@@ -236,7 +226,8 @@ class HomepageScreen extends StatelessWidget {
),
Text(
'Clock In',
style: Constant.titleH2_700(context: context)
style:
Constant.titleH2_700(context: context)
.copyWith(
color: Constant.textLightGrey,
),
@@ -270,7 +261,8 @@ class HomepageScreen extends StatelessWidget {
),
Text(
'Clock Out',
style: Constant.titleH2_700(context: context)
style:
Constant.titleH2_700(context: context)
.copyWith(
color: Constant.textLightGrey,
),
@@ -282,8 +274,8 @@ class HomepageScreen extends StatelessWidget {
),
SizedBox(
height:
Constant.getActualYPhone(context: context, y: 16),
height: Constant.getActualYPhone(
context: context, y: 16),
),
],
),
@@ -303,54 +295,47 @@ class HomepageScreen extends StatelessWidget {
right: Constant.getActualXPhone(context: context, x: 27),
),
child: Container(
width: Constant.getActualXPhone(context: context, x: 330),
child: Row(
children: [
//Menu Cuti
SizedBox(
Container(
width:
Constant.getActualXPhone(context: context, x: 98),
child: ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateColor.resolveWith(
(st) => Colors.white,
// color: Colors.amber,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Color.fromRGBO(145, 158, 171, 0.20),
),
shape: MaterialStateProperty.all<
RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16.0),
],
),
),
elevation: MaterialStatePropertyAll(4),
shadowColor: MaterialStateProperty.all<Color>(
Color.fromRGBO(145, 158, 171, 0.16)),
),
onPressed: () {},
child: Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(
context: context, y: 8),
bottom: Constant.getActualYPhone(
context: context, y: 8),
left: Constant.getActualXPhone(
context: context, x: 12),
right: Constant.getActualXPhone(
context: context, x: 12),
top: Constant.getActualYPhone(
context: context, y: 8),
bottom: Constant.getActualYPhone(
context: context, y: 8),
),
child: InkWell(
onTap: () {},
child: Column(
children: [
Container(
child: Image(
width: Constant.getActualXPhone(
context: context, x: 50),
height: Constant.getActualYPhone(
context: context, y: 50),
decoration: BoxDecoration(
// color: Colors.green,
image: DecorationImage(
// fit: BoxFit.contain,
image: AssetImage('images/person.png'),
),
),
),
SizedBox(
height: Constant.getActualYPhone(
context: context, y: 8),
@@ -366,58 +351,52 @@ class HomepageScreen extends StatelessWidget {
],
),
),
)),
),
),
SizedBox(
width: Constant.getActualXPhone(context: context, x: 18),
width:
Constant.getActualXPhone(context: context, x: 18),
),
//Menu Lembur
SizedBox(
Container(
width:
Constant.getActualXPhone(context: context, x: 98),
child: ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateColor.resolveWith(
(st) => Colors.white,
// color: Colors.amber,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Color.fromRGBO(145, 158, 171, 0.20),
),
shape: MaterialStateProperty.all<
RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16.0),
],
),
),
elevation: MaterialStatePropertyAll(4),
shadowColor: MaterialStateProperty.all<Color>(
Color.fromRGBO(145, 158, 171, 0.16)),
),
onPressed: () {},
child: Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(
context: context, y: 8),
bottom: Constant.getActualYPhone(
context: context, y: 8),
left: Constant.getActualXPhone(
context: context, x: 12),
right: Constant.getActualXPhone(
context: context, x: 12),
top: Constant.getActualYPhone(
context: context, y: 8),
bottom: Constant.getActualYPhone(
context: context, y: 8),
),
child: InkWell(
onTap: () {},
child: Column(
children: [
Container(
child: Image(
width: Constant.getActualXPhone(
context: context, x: 50),
height: Constant.getActualYPhone(
context: context, y: 50),
decoration: BoxDecoration(
// color: Colors.green,
image: DecorationImage(
// fit: BoxFit.contain,
image: AssetImage('images/task.png'),
),
),
),
SizedBox(
height: Constant.getActualYPhone(
context: context, y: 8),
@@ -433,7 +412,8 @@ class HomepageScreen extends StatelessWidget {
],
),
),
)),
),
),
],
),
),
@@ -449,19 +429,21 @@ class HomepageScreen extends StatelessWidget {
right: Constant.getActualXPhone(context: context, x: 27),
left: Constant.getActualXPhone(context: context, x: 33),
),
child: SizedBox(
child: Container(
width: Constant.getActualXPhone(context: context, x: 330),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Rekap Presensi Bulan Ini',
style: Constant.titleH1_500_18(context: context).copyWith(
style:
Constant.titleH1_500_18(context: context).copyWith(
color: Constant.textTrueBlack,
),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 20),
height:
Constant.getActualYPhone(context: context, y: 20),
),
Container(
decoration: BoxDecoration(
@@ -477,14 +459,14 @@ class HomepageScreen extends StatelessWidget {
),
child: Padding(
padding: EdgeInsets.only(
top:
Constant.getActualYPhone(context: context, y: 12),
bottom:
Constant.getActualYPhone(context: context, y: 12),
left:
Constant.getActualXPhone(context: context, x: 24),
right:
Constant.getActualXPhone(context: context, x: 24),
top: Constant.getActualYPhone(
context: context, y: 12),
bottom: Constant.getActualYPhone(
context: context, y: 12),
left: Constant.getActualXPhone(
context: context, x: 24),
right: Constant.getActualXPhone(
context: context, x: 24),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -635,6 +617,7 @@ class HomepageScreen extends StatelessWidget {
],
),
),
),
);
}
}