Compare commits
10 Commits
1f0d67379f
...
add-homepa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69a3e1965c | ||
|
|
680dc463ea | ||
|
|
f2c6b222cc | ||
|
|
0daef445a2 | ||
|
|
50cacf159f | ||
|
|
a91f039dfc | ||
|
|
ce0b753da5 | ||
|
|
9cff5e1db8 | ||
|
|
17f451edb6 | ||
|
|
87163441ad |
BIN
images/alert_badge.png
Normal file
|
After Width: | Height: | Size: 432 B |
BIN
images/avatar_c.png
Normal file
|
After Width: | Height: | Size: 885 B |
BIN
images/card_bg_1.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
images/divider.png
Normal file
|
After Width: | Height: | Size: 332 B |
BIN
images/finger_tap.png
Normal file
|
After Width: | Height: | Size: 597 B |
BIN
images/finger_tap_botnav.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
images/finger_tap_orange_botnav.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
images/home_orange.png
Normal file
|
After Width: | Height: | Size: 393 B |
BIN
images/person.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
images/person_available_grey.png
Normal file
|
After Width: | Height: | Size: 450 B |
BIN
images/person_delete_grey.png
Normal file
|
After Width: | Height: | Size: 477 B |
BIN
images/person_grey.png
Normal file
|
After Width: | Height: | Size: 429 B |
BIN
images/task.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
images/task_pending_grey.png
Normal file
|
After Width: | Height: | Size: 467 B |
@@ -8,8 +8,11 @@ class Constant {
|
|||||||
static double designWidthPhone = 390;
|
static double designWidthPhone = 390;
|
||||||
|
|
||||||
// color theme
|
// color theme
|
||||||
|
static Color textTrueBlack = const Color(0xff000000);
|
||||||
static Color textBlack = const Color(0xff212B36);
|
static Color textBlack = const Color(0xff212B36);
|
||||||
|
static Color textDarkGrey = const Color(0xff637381);
|
||||||
static Color textLightGrey = const Color(0xff919EAB);
|
static Color textLightGrey = const Color(0xff919EAB);
|
||||||
|
static Color textOrange = const Color(0xffF15A29);
|
||||||
|
|
||||||
// size convertion
|
// size convertion
|
||||||
static double getActualXPhone({
|
static double getActualXPhone({
|
||||||
@@ -34,6 +37,14 @@ class Constant {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static TextStyle titleH1_500_18({required BuildContext context}) {
|
||||||
|
return TextStyle(
|
||||||
|
fontSize: Constant.getActualYPhone(context: context, y: 18),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontFamily: 'Public Sans'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
static TextStyle titleH2_600({required BuildContext context}) {
|
static TextStyle titleH2_600({required BuildContext context}) {
|
||||||
return TextStyle(
|
return TextStyle(
|
||||||
fontSize: Constant.getActualYPhone(context: context, y: 12),
|
fontSize: Constant.getActualYPhone(context: context, y: 12),
|
||||||
@@ -41,10 +52,59 @@ class Constant {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static TextStyle titleH2_600_14({required BuildContext context}) {
|
||||||
|
return TextStyle(
|
||||||
|
fontSize: Constant.getActualYPhone(context: context, y: 14),
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontFamily: 'Public Sans'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TextStyle titleH2_700({required BuildContext context}) {
|
||||||
|
return TextStyle(
|
||||||
|
fontFamily: 'Quicksand',
|
||||||
|
fontSize: Constant.getActualYPhone(context: context, y: 14),
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static TextStyle logintitle_700({required BuildContext context}) {
|
static TextStyle logintitle_700({required BuildContext context}) {
|
||||||
return TextStyle(
|
return TextStyle(
|
||||||
fontSize: Constant.getActualYPhone(context: context, y: 15),
|
fontSize: Constant.getActualYPhone(context: context, y: 15),
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static TextStyle time_700({required BuildContext context}) {
|
||||||
|
return TextStyle(
|
||||||
|
fontSize: Constant.getActualYPhone(context: context, y: 28),
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontFamily: 'Quicksand',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TextStyle subtitle_600_14({required BuildContext context}) {
|
||||||
|
return TextStyle(
|
||||||
|
fontSize: Constant.getActualYPhone(context: context, y: 14),
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TextStyle subtitle_500_12({required BuildContext context}) {
|
||||||
|
return TextStyle(
|
||||||
|
fontSize: Constant.getActualYPhone(context: context, y: 12),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TextStyle date_600({required BuildContext context}) {
|
||||||
|
return TextStyle(
|
||||||
|
fontSize: Constant.getActualYPhone(context: context, y: 16),
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontFamily: 'Quicksand',
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:absensi_sas_flutter/screen/homepage/homepage_screen.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../test_flutter_map.dart';
|
import '../test_flutter_map.dart';
|
||||||
import '../screen/login/login_screen.dart';
|
import '../screen/login/login_screen.dart';
|
||||||
@@ -6,6 +7,7 @@ import '../screen/splash/splash_screen.dart';
|
|||||||
const loginRoute = "/loginRoute";
|
const loginRoute = "/loginRoute";
|
||||||
const splashRoute = "/splashRoute";
|
const splashRoute = "/splashRoute";
|
||||||
const testFlutterMapRoute = "/testFlutterMapRoute";
|
const testFlutterMapRoute = "/testFlutterMapRoute";
|
||||||
|
const homepageRoute = "/homepageRoute";
|
||||||
|
|
||||||
class AppRoute {
|
class AppRoute {
|
||||||
static Route<dynamic> generateRoute(RouteSettings settings) {
|
static Route<dynamic> generateRoute(RouteSettings settings) {
|
||||||
@@ -43,6 +45,17 @@ class AppRoute {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// homepage
|
||||||
|
if (settings.name == homepageRoute) {
|
||||||
|
return MaterialPageRoute(builder: (context) {
|
||||||
|
return MediaQuery(
|
||||||
|
data: MediaQuery.of(context)
|
||||||
|
.copyWith(textScaleFactor: 1.0, padding: EdgeInsets.all(0)),
|
||||||
|
child: HomepageScreen(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return MaterialPageRoute(builder: (context) {
|
return MaterialPageRoute(builder: (context) {
|
||||||
return MediaQuery(
|
return MediaQuery(
|
||||||
data: MediaQuery.of(context)
|
data: MediaQuery.of(context)
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:intl/date_symbol_data_local.dart';
|
||||||
import '../app/route.dart';
|
import '../app/route.dart';
|
||||||
// import '../test_map.dart';
|
// import '../test_map.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await initializeDateFormatting('id_ID', null);
|
||||||
runApp(const ProviderScope(child: MyApp()));
|
runApp(const ProviderScope(child: MyApp()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +27,7 @@ class MyApp extends StatelessWidget {
|
|||||||
primarySwatch: Colors.orange,
|
primarySwatch: Colors.orange,
|
||||||
),
|
),
|
||||||
// home: TestMap(),
|
// home: TestMap(),
|
||||||
initialRoute: loginRoute,
|
initialRoute: homepageRoute,
|
||||||
// initialRoute: testFlutterMapRoute,
|
// initialRoute: testFlutterMapRoute,
|
||||||
onGenerateRoute: AppRoute.generateRoute,
|
onGenerateRoute: AppRoute.generateRoute,
|
||||||
);
|
);
|
||||||
|
|||||||
623
lib/screen/homepage/homepage_screen.dart
Normal file
@@ -0,0 +1,623 @@
|
|||||||
|
import 'package:absensi_sas_flutter/app/constant.dart';
|
||||||
|
import 'package:absensi_sas_flutter/screen/widget/real_date.dart';
|
||||||
|
import 'package:absensi_sas_flutter/screen/widget/real_time.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class HomepageScreen extends StatelessWidget {
|
||||||
|
const HomepageScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||||
|
floatingActionButton: Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 100),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 100),
|
||||||
|
child: FittedBox(
|
||||||
|
child: FloatingActionButton(
|
||||||
|
onPressed: () {},
|
||||||
|
backgroundColor: Color(0xFFFFFFFF),
|
||||||
|
shape: CircleBorder(),
|
||||||
|
child: Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 50),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 50),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage(
|
||||||
|
'images/finger_tap_orange_botnav.png'), // Ganti dengan path gambar Anda
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomNavigationBar: Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 390),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 84),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFFFFFFF),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
offset: Offset(0, -1),
|
||||||
|
blurRadius: 8,
|
||||||
|
spreadRadius: -8,
|
||||||
|
color: Color.fromRGBO(0, 0, 0, 0.10),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Image(
|
||||||
|
image: AssetImage('images/home_orange.png'),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Beranda',
|
||||||
|
style: Constant.subtitle_500_12(context: context).copyWith(
|
||||||
|
color: Constant.textOrange,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Image(
|
||||||
|
image: AssetImage('images/person_grey.png'),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Profile',
|
||||||
|
style: Constant.subtitle_500_12(context: context).copyWith(
|
||||||
|
color: Constant.textLightGrey,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: SafeArea(
|
||||||
|
child: Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 390),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 844),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
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),
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage('images/avatar_c.png'),
|
||||||
|
)),
|
||||||
|
title: Text(
|
||||||
|
"Stephen Kusumo",
|
||||||
|
style: Constant.titleH1_700(context: context)
|
||||||
|
..copyWith(
|
||||||
|
color: Constant.textBlack,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: Text(
|
||||||
|
"Step@example.com",
|
||||||
|
style:
|
||||||
|
Constant.subtitle_500_12(context: context).copyWith(
|
||||||
|
color: Constant.textLightGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
trailing: Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 36),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 36),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
color: Colors.white,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
offset: Offset(0, 12),
|
||||||
|
blurRadius: 24,
|
||||||
|
color: Color.fromRGBO(145, 158, 171, 0.12),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {},
|
||||||
|
icon: Container(
|
||||||
|
width:
|
||||||
|
Constant.getActualXPhone(context: context, x: 20),
|
||||||
|
height:
|
||||||
|
Constant.getActualYPhone(context: context, y: 20),
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage('images/alert_badge.png'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 44),
|
||||||
|
),
|
||||||
|
|
||||||
|
//Card Time
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: Constant.getActualXPhone(context: context, x: 33),
|
||||||
|
right: Constant.getActualXPhone(context: context, x: 27),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 330),
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 200),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(40),
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage(
|
||||||
|
'images/card_bg_1.png'), // Ganti dengan path gambar Anda
|
||||||
|
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
|
||||||
|
RealTimeFormattedDate(),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 8),
|
||||||
|
),
|
||||||
|
|
||||||
|
//Time
|
||||||
|
RealTimeClock(), // Menampilkan waktu real-time menggunakan RealTimeClock
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 20),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment
|
||||||
|
.center, // Menengahkan secara horizontal
|
||||||
|
children: [
|
||||||
|
Spacer(), // Spasi di sebelah kiri "Check In"
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
'images/finger_tap.png', // Path gambar untuk "Check In"
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 22),
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 22),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 8),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'--:--',
|
||||||
|
style: TextStyle(
|
||||||
|
// Atur gaya teks '--:--' sesuai kebutuhan
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Clock In',
|
||||||
|
style:
|
||||||
|
Constant.titleH2_700(context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textLightGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 96),
|
||||||
|
), // Jarak antara "Check In" dan "Check Out"
|
||||||
|
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
'images/finger_tap.png', // Path gambar untuk "Check Out"
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 22),
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 22),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 8),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'--:--',
|
||||||
|
style: TextStyle(
|
||||||
|
// Atur gaya teks '--:--' sesuai kebutuhan
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Clock Out',
|
||||||
|
style:
|
||||||
|
Constant.titleH2_700(context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textLightGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Spacer(), // Spasi di sebelah kanan "Check Out"
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 16),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 56),
|
||||||
|
),
|
||||||
|
|
||||||
|
//Menu Cuti Lembur
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: Constant.getActualXPhone(context: context, x: 33),
|
||||||
|
right: Constant.getActualXPhone(context: context, x: 27),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
width: Constant.getActualXPhone(context: context, x: 330),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
//Menu Cuti
|
||||||
|
Container(
|
||||||
|
width:
|
||||||
|
Constant.getActualXPhone(context: context, x: 98),
|
||||||
|
// color: Colors.amber,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Color.fromRGBO(145, 158, 171, 0.20),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
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),
|
||||||
|
image: AssetImage('images/person.png'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 8),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Cuti',
|
||||||
|
style:
|
||||||
|
Constant.titleH2_600_14(context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textDarkGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
width:
|
||||||
|
Constant.getActualXPhone(context: context, x: 18),
|
||||||
|
),
|
||||||
|
|
||||||
|
//Menu Lembur
|
||||||
|
Container(
|
||||||
|
width:
|
||||||
|
Constant.getActualXPhone(context: context, x: 98),
|
||||||
|
// color: Colors.amber,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Color.fromRGBO(145, 158, 171, 0.20),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
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),
|
||||||
|
image: AssetImage('images/task.png'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 8),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Lembur',
|
||||||
|
style:
|
||||||
|
Constant.titleH2_600_14(context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textDarkGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(context: context, y: 56),
|
||||||
|
),
|
||||||
|
|
||||||
|
//Menu Rekap Presensi
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
right: Constant.getActualXPhone(context: context, x: 27),
|
||||||
|
left: Constant.getActualXPhone(context: context, x: 33),
|
||||||
|
),
|
||||||
|
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(
|
||||||
|
color: Constant.textTrueBlack,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height:
|
||||||
|
Constant.getActualYPhone(context: context, y: 20),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
color: Colors.white, // Set background color to #FFF
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Color.fromRGBO(145, 158, 171, 0.20),
|
||||||
|
blurRadius: 2,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'24 hari',
|
||||||
|
style: Constant.subtitle_600_14(
|
||||||
|
context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textOrange,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 4),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Image(
|
||||||
|
image: AssetImage(
|
||||||
|
'images/person_available_grey.png'),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 4),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Kehadiran',
|
||||||
|
style: Constant.subtitle_500_12(
|
||||||
|
context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textDarkGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Image(
|
||||||
|
image: AssetImage('images/divider.png'),
|
||||||
|
),
|
||||||
|
|
||||||
|
//Tidak Hadir
|
||||||
|
Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'2 hari',
|
||||||
|
style: Constant.subtitle_600_14(
|
||||||
|
context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textOrange,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 4),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Image(
|
||||||
|
image: AssetImage(
|
||||||
|
'images/person_delete_grey.png'),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 4),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Tidak Hadir',
|
||||||
|
style: Constant.subtitle_500_12(
|
||||||
|
context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textDarkGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Image(
|
||||||
|
image: AssetImage('images/divider.png'),
|
||||||
|
),
|
||||||
|
|
||||||
|
//Tidak Hadir
|
||||||
|
Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'5 hari',
|
||||||
|
style: Constant.subtitle_600_14(
|
||||||
|
context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textOrange,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 4),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Image(
|
||||||
|
image: AssetImage(
|
||||||
|
'images/task_pending_grey.png'),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 4),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Lembur',
|
||||||
|
style: Constant.subtitle_500_12(
|
||||||
|
context: context)
|
||||||
|
.copyWith(
|
||||||
|
color: Constant.textDarkGrey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
38
lib/screen/widget/real_date.dart
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
|
||||||
|
import 'package:absensi_sas_flutter/app/constant.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
class RealTimeFormattedDate extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_RealTimeFormattedDateState createState() => _RealTimeFormattedDateState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RealTimeFormattedDateState extends State<RealTimeFormattedDate> {
|
||||||
|
late Stream<DateTime> _clockStream;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_clockStream = Stream<DateTime>.periodic(Duration(seconds: 1), (i) => DateTime.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return StreamBuilder<DateTime>(
|
||||||
|
stream: _clockStream,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.hasData) {
|
||||||
|
String formattedDate = DateFormat('EEEE, d MMMM y', 'id_ID').format(snapshot.data!);
|
||||||
|
return Text(
|
||||||
|
formattedDate,
|
||||||
|
style: Constant.date_600(context: context).copyWith(
|
||||||
|
color: Constant.textBlack),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Text('Loading...');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
39
lib/screen/widget/real_time.dart
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
import 'package:absensi_sas_flutter/app/constant.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
class RealTimeClock extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_RealTimeClockState createState() => _RealTimeClockState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RealTimeClockState extends State<RealTimeClock> {
|
||||||
|
late Stream<DateTime> _clockStream;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_clockStream = Stream<DateTime>.periodic(Duration(seconds: 1), (i) => DateTime.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return StreamBuilder<DateTime>(
|
||||||
|
stream: _clockStream,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.hasData) {
|
||||||
|
String formattedTime = DateFormat('HH:mm:ss').format(snapshot.data!);
|
||||||
|
return Text(
|
||||||
|
formattedTime,
|
||||||
|
style: Constant.time_700(context: context).copyWith(
|
||||||
|
color: Constant.textBlack,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Text('Loading...');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -337,13 +337,13 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.2"
|
version: "4.0.2"
|
||||||
intl:
|
intl:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: intl
|
name: intl
|
||||||
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.19.0"
|
version: "0.17.0"
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
|
|||||||
# https://github.com/flutter/flutter/issues/57146.
|
# https://github.com/flutter/flutter/issues/57146.
|
||||||
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
|
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
|
||||||
|
|
||||||
|
# Set fallback configurations for older versions of the flutter tool.
|
||||||
|
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
|
||||||
|
set(FLUTTER_TARGET_PLATFORM "windows-x64")
|
||||||
|
endif()
|
||||||
|
|
||||||
# === Flutter Library ===
|
# === Flutter Library ===
|
||||||
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
|
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
|
||||||
|
|
||||||
@@ -92,7 +97,7 @@ add_custom_command(
|
|||||||
COMMAND ${CMAKE_COMMAND} -E env
|
COMMAND ${CMAKE_COMMAND} -E env
|
||||||
${FLUTTER_TOOL_ENVIRONMENT}
|
${FLUTTER_TOOL_ENVIRONMENT}
|
||||||
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
|
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
|
||||||
windows-x64 $<CONFIG>
|
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
add_custom_target(flutter_assemble DEPENDS
|
add_custom_target(flutter_assemble DEPENDS
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ bool FlutterWindow::OnCreate() {
|
|||||||
this->Show();
|
this->Show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Flutter can complete the first frame before the "show window" callback is
|
||||||
|
// registered. The following call ensures a frame is pending to ensure the
|
||||||
|
// window is shown. It is a no-op if the first frame hasn't completed yet.
|
||||||
|
flutter_controller_->ForceRedraw();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||