Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
Crm Attendance
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
Crm Attendance
Commits
462b1b21
Commit
462b1b21
authored
Jun 19, 2023
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final desiign
parent
ba68464a
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
764 additions
and
364 deletions
+764
-364
K2D-Bold.ttf
assets/fonts/k2d/K2D-Bold.ttf
+0
-0
K2D-Light.ttf
assets/fonts/k2d/K2D-Light.ttf
+0
-0
K2D-Medium.ttf
assets/fonts/k2d/K2D-Medium.ttf
+0
-0
K2D-Regular.ttf
assets/fonts/k2d/K2D-Regular.ttf
+0
-0
K2D-SemiBold.ttf
assets/fonts/k2d/K2D-SemiBold.ttf
+0
-0
api.dart
lib/api/api.dart
+9
-0
route_args.dart
lib/helper/arguments/route_args.dart
+12
-0
pref.dart
lib/helper/pref.dart
+9
-0
profile.dart
lib/models/profile.dart
+9
-0
absent_camera.dart
lib/page/absent_camera/absent_camera.dart
+318
-53
absent_success.dart
lib/page/absent_success/absent_success.dart
+172
-133
home.dart
lib/page/home/home.dart
+206
-168
colors.dart
lib/resource/colors.dart
+1
-0
constanta_string.dart
lib/resource/constanta_string.dart
+2
-0
font.dart
lib/resource/font.dart
+1
-0
routes.dart
lib/resource/routes.dart
+12
-10
size.dart
lib/resource/size.dart
+1
-0
pubspec.yaml
pubspec.yaml
+12
-0
No files found.
assets/fonts/k2d/K2D-Bold.ttf
0 → 100644
View file @
462b1b21
File added
assets/fonts/k2d/K2D-Light.ttf
0 → 100644
View file @
462b1b21
File added
assets/fonts/k2d/K2D-Medium.ttf
0 → 100644
View file @
462b1b21
File added
assets/fonts/k2d/K2D-Regular.ttf
0 → 100644
View file @
462b1b21
File added
assets/fonts/k2d/K2D-SemiBold.ttf
0 → 100644
View file @
462b1b21
File added
lib/api/api.dart
View file @
462b1b21
...
@@ -30,6 +30,7 @@ class Api {
...
@@ -30,6 +30,7 @@ class Api {
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
}
else
{
}
else
{
if
(
jsonObject
[
'status'
]
==
"ok"
)
{
if
(
jsonObject
[
'status'
]
==
"ok"
)
{
print
(
jsonObject
);
List
<
BranchModel
>
branchList
=
[];
List
<
BranchModel
>
branchList
=
[];
List
<
dynamic
>
branchs
=
jsonObject
[
'data'
][
'branch_list'
];
List
<
dynamic
>
branchs
=
jsonObject
[
'data'
][
'branch_list'
];
...
@@ -42,6 +43,10 @@ class Api {
...
@@ -42,6 +43,10 @@ class Api {
}
}
ConstantString
.
outletDistance
=
ConstantString
.
outletDistance
=
jsonObject
[
'data'
][
'max_distance'
].
toString
();
jsonObject
[
'data'
][
'max_distance'
].
toString
();
ConstantString
.
logoUrlHome
=
jsonObject
[
'data'
][
'logo_attendance_home'
];
ConstantString
.
logoUrlCamera
=
jsonObject
[
'data'
][
'logo_attendance_camera'
];
return
ApiResponse
(
return
ApiResponse
(
error:
false
,
error:
false
,
msg:
Strings
.
succesGetData
,
msg:
Strings
.
succesGetData
,
...
@@ -110,6 +115,7 @@ class Api {
...
@@ -110,6 +115,7 @@ class Api {
Map
<
String
,
dynamic
>
data
=
{
Map
<
String
,
dynamic
>
data
=
{
"branch_id"
:
branchId
,
"branch_id"
:
branchId
,
"nik"
:
nik
,
"nik"
:
nik
,
"brand_code"
:
brandCode
,
};
};
String
bodies
=
jsonEncode
(
data
);
String
bodies
=
jsonEncode
(
data
);
dynamic
jsonObject
=
dynamic
jsonObject
=
...
@@ -118,6 +124,7 @@ class Api {
...
@@ -118,6 +124,7 @@ class Api {
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
}
else
{
}
else
{
if
(
jsonObject
[
'status'
]
==
"ok"
)
{
if
(
jsonObject
[
'status'
]
==
"ok"
)
{
print
(
jsonObject
);
Map
<
String
,
dynamic
>
user
=
jsonObject
[
'data'
][
'user'
];
Map
<
String
,
dynamic
>
user
=
jsonObject
[
'data'
][
'user'
];
return
ApiResponse
(
return
ApiResponse
(
error:
false
,
error:
false
,
...
@@ -143,6 +150,7 @@ class Api {
...
@@ -143,6 +150,7 @@ class Api {
try
{
try
{
Map
<
String
,
dynamic
>
data
=
{
Map
<
String
,
dynamic
>
data
=
{
"branch_id"
:
branchId
,
"branch_id"
:
branchId
,
"brand_code"
:
brandCode
,
"nik"
:
nik
,
"nik"
:
nik
,
"shift_id"
:
shiftId
,
"shift_id"
:
shiftId
,
"user_lat"
:
position
.
latitude
,
"user_lat"
:
position
.
latitude
,
...
@@ -196,6 +204,7 @@ class Api {
...
@@ -196,6 +204,7 @@ class Api {
try
{
try
{
Map
<
String
,
dynamic
>
data
=
{
Map
<
String
,
dynamic
>
data
=
{
"branch_id"
:
branchId
,
"branch_id"
:
branchId
,
"brand_code"
:
brandCode
,
"nik"
:
nik
,
"nik"
:
nik
,
"user_lat"
:
position
.
latitude
,
"user_lat"
:
position
.
latitude
,
"user_long"
:
position
.
longitude
,
"user_long"
:
position
.
longitude
,
...
...
lib/helper/arguments/route_args.dart
View file @
462b1b21
...
@@ -9,13 +9,19 @@ class AbsentCameraArguments {
...
@@ -9,13 +9,19 @@ class AbsentCameraArguments {
final
ShiftModel
?
shiftModel
;
final
ShiftModel
?
shiftModel
;
final
ProfileModel
profile
;
final
ProfileModel
profile
;
final
String
nik
;
final
String
nik
;
final
String
shiftNameSelected
;
final
String
shiftStartTime
;
final
String
shiftEndTime
;
AbsentCameraArguments
({
AbsentCameraArguments
({
required
this
.
isIn
,
required
this
.
isIn
,
required
this
.
branchModel
,
required
this
.
branchModel
,
required
this
.
nik
,
required
this
.
nik
,
required
this
.
profile
,
required
this
.
profile
,
required
this
.
shiftStartTime
,
required
this
.
shiftEndTime
,
this
.
shiftModel
,
this
.
shiftModel
,
required
this
.
shiftNameSelected
,
});
});
}
}
...
@@ -34,11 +40,17 @@ class AbsentSuccessArguments {
...
@@ -34,11 +40,17 @@ class AbsentSuccessArguments {
final
ProfileModel
profil
;
final
ProfileModel
profil
;
final
String
nik
;
final
String
nik
;
final
bool
isIn
;
final
bool
isIn
;
final
String
shiftStart
;
final
String
shiftEnd
;
final
String
shiftName
;
AbsentSuccessArguments
({
AbsentSuccessArguments
({
required
this
.
absentSuccess
,
required
this
.
absentSuccess
,
required
this
.
profil
,
required
this
.
profil
,
required
this
.
nik
,
required
this
.
nik
,
required
this
.
isIn
,
required
this
.
isIn
,
required
this
.
shiftStart
,
required
this
.
shiftEnd
,
required
this
.
shiftName
,
});
});
}
}
lib/helper/pref.dart
View file @
462b1b21
...
@@ -3,6 +3,7 @@ import 'package:excelso_attendance/main.dart';
...
@@ -3,6 +3,7 @@ import 'package:excelso_attendance/main.dart';
const
String
_latitude
=
'laU'
;
const
String
_latitude
=
'laU'
;
const
String
_longitude
=
'loU'
;
const
String
_longitude
=
'loU'
;
const
String
_listAbsent
=
'listAbsent'
;
const
String
_listAbsent
=
'listAbsent'
;
const
String
_outletLogo
=
'_logo'
;
String
?
getLatitude
()
{
String
?
getLatitude
()
{
return
prefs
.
getString
(
_latitude
);
return
prefs
.
getString
(
_latitude
);
...
@@ -29,3 +30,11 @@ Future<void> setListAbsentUser(List<String> value) async {
...
@@ -29,3 +30,11 @@ Future<void> setListAbsentUser(List<String> value) async {
List
<
String
>
getListAbsentUser
()
{
List
<
String
>
getListAbsentUser
()
{
return
prefs
.
getStringList
(
_listAbsent
)
??
[];
return
prefs
.
getStringList
(
_listAbsent
)
??
[];
}
}
Future
<
void
>
setLogo
(
String
value
)
async
{
await
prefs
.
setString
(
_outletLogo
,
value
);
}
String
getLogo
(
)
{
return
prefs
.
getString
(
_outletLogo
)
??
""
;
}
lib/models/profile.dart
View file @
462b1b21
...
@@ -4,6 +4,9 @@ class ProfileModel {
...
@@ -4,6 +4,9 @@ class ProfileModel {
String
name
;
String
name
;
bool
attendanceIn
;
bool
attendanceIn
;
bool
attendanceOut
;
bool
attendanceOut
;
String
shiftSelectedName
;
String
shiftStart
;
String
shiftEnd
;
ProfileModel
({
ProfileModel
({
required
this
.
id
,
required
this
.
id
,
...
@@ -11,6 +14,9 @@ class ProfileModel {
...
@@ -11,6 +14,9 @@ class ProfileModel {
required
this
.
name
,
required
this
.
name
,
required
this
.
attendanceIn
,
required
this
.
attendanceIn
,
required
this
.
attendanceOut
,
required
this
.
attendanceOut
,
required
this
.
shiftSelectedName
,
required
this
.
shiftStart
,
required
this
.
shiftEnd
,
});
});
factory
ProfileModel
.
json
(
Map
<
String
,
dynamic
>
json
)
{
factory
ProfileModel
.
json
(
Map
<
String
,
dynamic
>
json
)
{
...
@@ -20,6 +26,9 @@ class ProfileModel {
...
@@ -20,6 +26,9 @@ class ProfileModel {
name:
json
[
'name'
],
name:
json
[
'name'
],
attendanceIn:
json
[
'today_attendance_in'
],
attendanceIn:
json
[
'today_attendance_in'
],
attendanceOut:
json
[
'today_attendance_out'
],
attendanceOut:
json
[
'today_attendance_out'
],
shiftSelectedName:
json
[
'shift_name'
]
??
""
,
shiftStart:
json
[
'shift_start'
]
??
""
,
shiftEnd:
json
[
'shift_end'
]
??
""
,
);
);
}
}
}
}
lib/page/absent_camera/absent_camera.dart
View file @
462b1b21
...
@@ -13,6 +13,7 @@ import 'package:excelso_attendance/models/absent.dart';
...
@@ -13,6 +13,7 @@ import 'package:excelso_attendance/models/absent.dart';
import
'package:excelso_attendance/models/branch.dart'
;
import
'package:excelso_attendance/models/branch.dart'
;
import
'package:excelso_attendance/models/profile.dart'
;
import
'package:excelso_attendance/models/profile.dart'
;
import
'package:excelso_attendance/models/shift.dart'
;
import
'package:excelso_attendance/models/shift.dart'
;
import
'package:excelso_attendance/resource/constanta_string.dart'
;
import
'package:excelso_attendance/resource/routes.dart'
;
import
'package:excelso_attendance/resource/routes.dart'
;
import
'package:excelso_attendance/resource/strings.dart'
;
import
'package:excelso_attendance/resource/strings.dart'
;
import
'package:flutter/foundation.dart'
show
kIsWeb
;
import
'package:flutter/foundation.dart'
show
kIsWeb
;
...
@@ -20,7 +21,6 @@ import 'dart:typed_data';
...
@@ -20,7 +21,6 @@ import 'dart:typed_data';
import
'package:camera/camera.dart'
;
import
'package:camera/camera.dart'
;
import
'package:excelso_attendance/helper/component/button.dart'
;
import
'package:excelso_attendance/helper/component/button.dart'
;
import
'package:excelso_attendance/helper/global_function/date_time.dart'
;
import
'package:excelso_attendance/resource/assets.dart'
;
import
'package:excelso_attendance/resource/assets.dart'
;
import
'package:excelso_attendance/resource/colors.dart'
;
import
'package:excelso_attendance/resource/colors.dart'
;
import
'package:excelso_attendance/resource/font.dart'
;
import
'package:excelso_attendance/resource/font.dart'
;
...
@@ -38,6 +38,9 @@ class AbsentCameraView extends StatefulWidget {
...
@@ -38,6 +38,9 @@ class AbsentCameraView extends StatefulWidget {
required
this
.
nik
,
required
this
.
nik
,
required
this
.
profile
,
required
this
.
profile
,
this
.
shiftModel
,
this
.
shiftModel
,
required
this
.
shiftNameSelected
,
required
this
.
shiftStartTime
,
required
this
.
shiftEndTime
,
});
});
final
bool
isIn
;
final
bool
isIn
;
...
@@ -45,6 +48,9 @@ class AbsentCameraView extends StatefulWidget {
...
@@ -45,6 +48,9 @@ class AbsentCameraView extends StatefulWidget {
final
ShiftModel
?
shiftModel
;
final
ShiftModel
?
shiftModel
;
final
ProfileModel
profile
;
final
ProfileModel
profile
;
final
String
nik
;
final
String
nik
;
final
String
shiftNameSelected
;
final
String
shiftStartTime
;
final
String
shiftEndTime
;
@override
@override
State
<
AbsentCameraView
>
createState
()
=>
_AbsentCameraViewState
();
State
<
AbsentCameraView
>
createState
()
=>
_AbsentCameraViewState
();
...
@@ -422,9 +428,19 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
...
@@ -422,9 +428,19 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
const
SizedBox
(
const
SizedBox
(
height:
15
,
height:
15
,
),
),
WidgetAbsentAndTime
(
// Expanded(
isIn:
widget
.
isIn
,
// child: WidgetAbsentAndTime(
outletName:
widget
.
branchModel
.
name
,
// isIn: widget.isIn,
// outletName: widget.branchModel.name,
// profile: widget.profile,
// nik: widget.nik,
// ),
// ),
InfoUserAttendance
(
widget:
widget
,
shift:
widget
.
shiftNameSelected
,
shiftStart:
widget
.
shiftStartTime
,
shiftEnd:
widget
.
shiftEndTime
,
),
),
const
Spacer
(),
const
Spacer
(),
(
pictureIsTaken
)
(
pictureIsTaken
)
...
@@ -479,7 +495,11 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
...
@@ -479,7 +495,11 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
profil:
widget
.
profile
,
profil:
widget
.
profile
,
nik:
widget
.
nik
,
nik:
widget
.
nik
,
isIn:
true
,
isIn:
true
,
),
shiftName:
widget
.
shiftNameSelected
,
shiftEnd:
widget
.
shiftEndTime
,
shiftStart:
widget
.
shiftStartTime
),
);
);
});
});
}
else
{
}
else
{
...
@@ -517,7 +537,11 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
...
@@ -517,7 +537,11 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
profil:
widget
.
profile
,
profil:
widget
.
profile
,
nik:
widget
.
nik
,
nik:
widget
.
nik
,
isIn:
false
,
isIn:
false
,
),
shiftName:
widget
.
shiftNameSelected
,
shiftEnd:
widget
.
shiftEndTime
,
shiftStart:
widget
.
shiftStartTime
),
);
);
});
});
}
}
...
@@ -1167,21 +1191,25 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
...
@@ -1167,21 +1191,25 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
}
}
}
}
class
WidgetAbsentAndTime
extends
StatefulWidget
{
class
InfoUserAttendance
extends
StatefulWidget
{
const
WidgetAbsentAndTime
({
const
InfoUserAttendance
({
Key
?
key
,
super
.
key
,
required
this
.
outletName
,
required
this
.
widget
,
required
this
.
isIn
,
required
this
.
shift
,
})
:
super
(
key:
key
);
required
this
.
shiftStart
,
required
this
.
shiftEnd
,
});
final
String
outletName
;
final
AbsentCameraView
widget
;
final
bool
isIn
;
final
String
shift
;
final
String
shiftStart
;
final
String
shiftEnd
;
@override
@override
State
<
WidgetAbsentAndTime
>
createState
()
=>
_WidgetAbsentAndTim
eState
();
State
<
InfoUserAttendance
>
createState
()
=>
_InfoUserAttendanc
eState
();
}
}
class
_
WidgetAbsentAndTimeState
extends
State
<
WidgetAbsentAndTim
e
>
{
class
_
InfoUserAttendanceState
extends
State
<
InfoUserAttendanc
e
>
{
Timer
?
_timer
;
Timer
?
_timer
;
@override
@override
...
@@ -1206,50 +1234,287 @@ class _WidgetAbsentAndTimeState extends State<WidgetAbsentAndTime> {
...
@@ -1206,50 +1234,287 @@ class _WidgetAbsentAndTimeState extends State<WidgetAbsentAndTime> {
margin:
EdgeInsets
.
symmetric
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppMargin
.
m20
,
horizontal:
AppMargin
.
m20
,
),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
AppPadding
.
p15
,
vertical:
AppPadding
.
p12
,
),
width:
double
.
infinity
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
1
2
),
borderRadius:
BorderRadius
.
circular
(
1
0
),
color:
Colors
.
white
,
color:
Colors
.
white
,
),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
AppPadding
.
p20
,
vertical:
AppPadding
.
p12
),
width:
double
.
infinity
,
height:
138
,
child:
Column
(
child:
Column
(
children:
[
Container
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
5
,
),
decoration:
BoxDecoration
(
border:
Border
(
bottom:
BorderSide
(
width:
0.8
,
color:
ColorManager
.
grey
.
withOpacity
(
0.2
),
),
),
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
children:
[
Image
(
(
ConstantString
.
logoUrlCamera
==
""
)
?
const
Image
(
width:
111
,
height:
43
,
image:
AssetImage
(
image:
AssetImage
(
Assets
.
excelsoLogoGreen
,
""
,
),
),
)
:
Image
(
width:
111
,
width:
111
,
height:
42
,
height:
43
,
image:
NetworkImage
(
ConstantString
.
logoUrlCamera
,
),
),
const
SizedBox
(
width:
40
,
),
),
Expanded
(
Expanded
(
child:
Text
(
child:
Text
(
"
${widget.outletName}
-
${DateFormatCustom.getLocalTime(
widget
.
widget
.
branchModel
.
name
,
timeZoneActive: true,
)}
"
,
style:
getSemiBoldStyle
(
style:
getSemiBoldStyle
(
color:
Colors
.
black
,
color:
Colors
.
black
,
fontSize:
FontSize
.
s16
,
fontSize:
FontSize
.
s16
,
),
),
maxLines:
3
,
textAlign:
TextAlign
.
end
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
textAlign:
TextAlign
.
center
,
),
)
],
),
),
Container
(
padding:
EdgeInsets
.
only
(
top:
AppPadding
.
p12
,
bottom:
AppPadding
.
p16
,
),
decoration:
BoxDecoration
(
border:
Border
(
bottom:
BorderSide
(
width:
0.8
,
color:
ColorManager
.
grey
.
withOpacity
(
0.2
),
),
),
),
),
Text
(
),
(
widget
.
isIn
)
?
"Absen Masuk"
:
"Absen Keluar"
,
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Expanded
(
child:
Text
(
widget
.
widget
.
profile
.
name
,
style:
getSemiBoldStyle
(
style:
getSemiBoldStyle
(
color:
Colors
.
black
,
fontSize:
FontSize
.
s14
,
fontFamily:
FontConstants
.
k2d
,
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
),
),
const
SizedBox
(
width:
30
,
),
const
Spacer
(),
Expanded
(
child:
Text
(
widget
.
widget
.
nik
,
style:
getSemiBoldStyle
(
color:
ColorManager
.
green2
,
fontSize:
FontSize
.
s14
,
fontFamily:
FontConstants
.
k2d
,
),
textAlign:
TextAlign
.
end
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
SizedBox
(
height:
AppMargin
.
m8
,
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Expanded
(
child:
Text
(
widget
.
shift
,
style:
getSemiBoldStyle
(
color:
Colors
.
black
,
fontSize:
FontSize
.
s14
,
fontFamily:
FontConstants
.
k2d
,
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
),
),
const
SizedBox
(
width:
20
,
),
Expanded
(
child:
Text
(
"
${widget.shiftStart}
-
${widget.shiftEnd}
"
,
style:
getRegularStyle
(
color:
Colors
.
black
,
fontSize:
FontSize
.
s12
,
fontFamily:
FontConstants
.
k2d
,
),
textAlign:
TextAlign
.
end
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
],
),
),
Container
(
margin:
EdgeInsets
.
only
(
top:
AppMargin
.
m10
,
),
child:
Text
(
(
widget
.
widget
.
isIn
)
?
"Absen Masuk"
:
"Absen Keluar"
,
style:
getMediumStyle
(
color:
Colors
.
black
,
color:
Colors
.
black
,
fontSize:
FontSize
.
s16
,
fontSize:
FontSize
.
s16
,
fontFamily:
FontConstants
.
poppins
,
fontFamily:
FontConstants
.
poppins
,
),
),
),
),
),
],
],
),
),
);
);
}
}
}
}
// class WidgetAbsentAndTime extends StatefulWidget {
// const WidgetAbsentAndTime({
// Key? key,
// required this.outletName,
// required this.isIn,
// required this.nik,
// required this.profile,
// }) : super(key: key);
// final String outletName;
// final bool isIn;
// final String nik;
// final ProfileModel profile;
// @override
// State<WidgetAbsentAndTime> createState() => _WidgetAbsentAndTimeState();
// }
// class _WidgetAbsentAndTimeState extends State<WidgetAbsentAndTime> {
// Timer? _timer;
// @override
// void initState() {
// super.initState();
// Timer.periodic(const Duration(seconds: 1), (timer) {
// _timer = timer;
// setState(() {});
// });
// }
// @override
// void dispose() {
// super.dispose();
// _timer?.cancel();
// }
// @override
// Widget build(BuildContext context) {
// return Container(
// margin: EdgeInsets.symmetric(
// horizontal: AppMargin.m20,
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white,
// ),
// padding: EdgeInsets.symmetric(
// horizontal: AppPadding.p20,
// vertical: AppPadding.p12,
// ),
// width: double.infinity,
// height: 160,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.min,
// children: [
// Image(
// image: AssetImage(
// Assets.excelsoLogoGreen,
// ),
// width: 100,
// height: 30,
// ),
// const SizedBox(
// height: 10,
// ),
// Text(
// "${widget.outletName} - ${DateFormatCustom.getLocalTime(
// timeZoneActive: true,
// )}",
// style: getSemiBoldStyle(
// color: Colors.black,
// fontSize: FontSize.s16,
// ),
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.center,
// ),
// Text(
// "[${widget.nik}] ${widget.profile.name}",
// style: getSemiBoldStyle(
// color: Colors.black,
// fontSize: FontSize.s14,
// fontFamily: FontConstants.poppins,
// ),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.center,
// ),
// // Expanded(
// // child: Text(
// // widget.nik,
// // style: getSemiBoldStyle(
// // color: Colors.black,
// // fontSize: FontSize.s16,
// // fontFamily: FontConstants.poppins,
// // ),
// // maxLines: 2,
// // overflow: TextOverflow.ellipsis,
// // textAlign: TextAlign.center,
// // ),
// // ),
// Text(
// (widget.isIn) ? "Absen Masuk" : "Absen Keluar",
// style: getSemiBoldStyle(
// color: Colors.black,
// fontSize: FontSize.s14,
// fontFamily: FontConstants.poppins,
// ),
// ),
// ],
// ),
// );
// }
// }
lib/page/absent_success/absent_success.dart
View file @
462b1b21
...
@@ -12,17 +12,24 @@ import 'package:excelso_attendance/resource/style.dart';
...
@@ -12,17 +12,24 @@ import 'package:excelso_attendance/resource/style.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
class
AbsentSuccessView
extends
StatelessWidget
{
class
AbsentSuccessView
extends
StatelessWidget
{
const
AbsentSuccessView
(
const
AbsentSuccessView
(
{
{
super
.
key
,
super
.
key
,
required
this
.
absentSuccess
,
required
this
.
absentSuccess
,
required
this
.
isIn
,
required
this
.
isIn
,
required
this
.
nik
,
required
this
.
nik
,
required
this
.
profil
});
required
this
.
profil
,
required
this
.
shiftStart
,
required
this
.
shiftEnd
,
required
this
.
shiftName
,
});
final
AbsentSuccessModel
absentSuccess
;
final
AbsentSuccessModel
absentSuccess
;
final
ProfileModel
profil
;
final
ProfileModel
profil
;
final
String
nik
;
final
String
nik
;
final
bool
isIn
;
final
bool
isIn
;
final
String
shiftStart
;
final
String
shiftEnd
;
final
String
shiftName
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
@@ -30,7 +37,14 @@ class AbsentSuccessView extends StatelessWidget {
...
@@ -30,7 +37,14 @@ class AbsentSuccessView extends StatelessWidget {
backgroundColor:
ColorManager
.
backgroundColor
,
backgroundColor:
ColorManager
.
backgroundColor
,
body:
ScreenResponsive
(
body:
ScreenResponsive
(
widget:
BodyWidget
(
widget:
BodyWidget
(
isIn:
isIn
,
profil:
profil
,
nik:
nik
,
absentSuccess:
absentSuccess
),
isIn:
isIn
,
profil:
profil
,
nik:
nik
,
absentSuccess:
absentSuccess
,
shiftEnd:
shiftEnd
,
shiftName:
shiftName
,
shiftStart:
shiftStart
,
),
widthScreen:
MediaQuery
.
of
(
context
).
size
.
width
,
widthScreen:
MediaQuery
.
of
(
context
).
size
.
width
,
),
),
);
);
...
@@ -44,12 +58,18 @@ class BodyWidget extends StatelessWidget {
...
@@ -44,12 +58,18 @@ class BodyWidget extends StatelessWidget {
required
this
.
profil
,
required
this
.
profil
,
required
this
.
nik
,
required
this
.
nik
,
required
this
.
absentSuccess
,
required
this
.
absentSuccess
,
required
this
.
shiftStart
,
required
this
.
shiftEnd
,
required
this
.
shiftName
,
});
});
final
bool
isIn
;
final
bool
isIn
;
final
ProfileModel
profil
;
final
ProfileModel
profil
;
final
String
nik
;
final
String
nik
;
final
AbsentSuccessModel
absentSuccess
;
final
AbsentSuccessModel
absentSuccess
;
final
String
shiftStart
;
final
String
shiftEnd
;
final
String
shiftName
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
@@ -144,174 +164,193 @@ Sukses''',
...
@@ -144,174 +164,193 @@ Sukses''',
),
),
),
),
Container
(
Container
(
width:
double
.
infinity
,
margin:
EdgeInsets
.
only
(
margin:
EdgeInsets
.
only
(
top:
38
,
top:
AppMargin
.
m20
,
left:
AppMargin
.
m20
,
left:
AppMargin
.
m20
,
right:
AppMargin
.
m20
,
right:
AppMargin
.
m20
,
),
),
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
all
(
AppPadding
.
p20
),
vertical:
AppPadding
.
p20
,
width:
double
.
infinity
,
horizontal:
25
,
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
1
6
),
borderRadius:
BorderRadius
.
circular
(
1
2
),
border:
Border
.
all
(
border:
Border
.
all
(
width:
0.2
,
width:
0.2
,
color:
Colors
.
grey
,
color:
ColorManager
.
grey
.
withOpacity
(
0.3
,
),
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colors
.
grey
.
withOpacity
(
0.3
),
blurRadius:
5
,
offset:
const
Offset
(
0.8
,
0.8
),
),
],
),
),
child:
Column
(
color:
ColorManager
.
backgroundColor
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
// boxShadow: [
mainAxisAlignment:
MainAxisAlignment
.
center
,
// BoxShadow(
children:
[
// color: Colors.grey.withOpacity(0.3),
// Text(
// blurRadius: 1,
// absentSuccess.branchCode,
// offset: const Offset(0.1, 0.1),
// style: getSemiBoldStyle(
// color: ColorManager.fontBlack,
// fontSize: FontSize.s20,
// fontFamily: FontConstants.montserrat,
// ),
// ),
// SizedBox(
// height: AppMargin.m10,
// ),
// ),
Row
(
// ],
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
),
crossAxisAlignment:
CrossAxisAlignment
.
center
,
child:
Center
(
children:
[
Expanded
(
child:
Text
(
child:
Text
(
profil
.
n
ame
,
absentSuccess
.
branchN
ame
,
style:
getMedium
Style
(
style:
getSemiBold
Style
(
color:
ColorManager
.
fontBlack
,
color:
ColorManager
.
fontBlack
,
fontSize:
FontSize
.
s16
,
fontSize:
FontSize
.
s16
,
fontFamily:
FontConstants
.
montserrat
,
),
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
textAlign:
TextAlign
.
start
,
),
),
),
),
Expanded
(
),
child:
Text
(
Container
(
nik
,
margin:
EdgeInsets
.
only
(
style:
getMediumStyle
(
top:
AppMargin
.
m8
,
left:
AppMargin
.
m20
,
right:
AppMargin
.
m20
,
),
padding:
EdgeInsets
.
all
(
AppPadding
.
p20
),
width:
double
.
infinity
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
width:
0.2
,
color:
ColorManager
.
grey
.
withOpacity
(
0.3
,
),
),
color:
ColorManager
.
backgroundColor
,
// boxShadow: [
// BoxShadow(
// color: Colors.grey.withOpacity(0.3),
// blurRadius: 1,
// offset: const Offset(0.1, 0.1),
// ),
// ],
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
DateFormatCustom
.
getDateLocal
(
fromApi:
true
,
apiDate:
absentSuccess
.
date
,
),
style:
getRegularStyle
(
color:
ColorManager
.
fontBlack
,
color:
ColorManager
.
fontBlack
,
fontSize:
FontSize
.
s16
,
fontSize:
FontSize
.
s14
,
fontFamily:
FontConstants
.
montserrat
,
fontFamily:
FontConstants
.
k2d
,
),
),
maxLines:
2
,
),
overflow:
TextOverflow
.
ellipsis
,
Text
(
textAlign:
TextAlign
.
end
,
"
${absentSuccess.time}
${absentSuccess.timeZone}
"
,
style:
getRegularStyle
(
color:
ColorManager
.
fontBlack
,
fontSize:
FontSize
.
s14
,
fontFamily:
FontConstants
.
k2d
,
),
),
)
)
],
],
),
),
),
SizedBox
(
height:
AppMargin
.
m8
,
),
Container
(
Container
(
margin:
EdgeInsets
.
only
(
margin:
EdgeInsets
.
symmetric
(
top:
AppMargin
.
m1
0
,
horizontal:
AppMargin
.
m2
0
,
),
),
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
AppPadding
.
p20
,
horizontal:
AppPadding
.
p12
,
vertical:
AppPadding
.
p12
,
vertical:
AppPadding
.
p20
,
),
),
width:
double
.
infinity
,
width:
double
.
infinity
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
const
Color
(
0xffE7E7E7
).
withOpacity
(
0.5
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
border:
Border
.
all
(
width:
0.2
,
width:
0.2
,
color:
ColorManager
.
grey
.
withOpacity
(
0.8
),
color:
ColorManager
.
grey
.
withOpacity
(
0.3
,
),
),
),
child:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
only
(
bottom:
AppPadding
.
p12
,
),
width:
double
.
infinity
,
decoration:
BoxDecoration
(
border:
Border
(
bottom:
BorderSide
(
width:
1
,
color:
ColorManager
.
grey
.
withOpacity
(
0.3
,
),
),
),
),
borderRadius:
BorderRadius
.
circular
(
9
),
),
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
children:
[
Text
(
Text
(
absentSuccess
.
branchN
ame
,
profil
.
n
ame
,
style:
getSemiBoldStyle
(
style:
getSemiBoldStyle
(
color:
Color
Manager
.
fontB
lack
,
color:
Color
s
.
b
lack
,
fontSize:
FontSize
.
s16
,
fontSize:
FontSize
.
s16
,
fontFamily:
FontConstants
.
k2d
,
),
),
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
maxLines:
2
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
const
SizedBox
(
SizedBox
(
height:
4
,
height:
AppMargin
.
m8
,
),
),
Text
(
Text
(
"
${absentSuccess.time}
${absentSuccess.timeZone}
"
,
nik
,
style:
getMediumStyle
(
style:
getMediumStyle
(
color:
ColorManager
.
fontBlack
,
color:
ColorManager
.
green2
,
fontSize:
FontSize
.
s20
,
fontSize:
FontSize
.
s16
,
fontFamily:
FontConstants
.
k2d
,
),
),
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
maxLines:
2
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
const
SizedBox
(
],
height:
4
,
),
),
Text
(
DateFormatCustom
.
getDateLocal
(
fromApi:
true
,
apiDate:
absentSuccess
.
date
,
),
),
Container
(
padding:
EdgeInsets
.
only
(
top:
AppPadding
.
p12
,
bottom:
AppPadding
.
p20
,
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Expanded
(
child:
Text
(
shiftName
,
style:
getRegularStyle
(
style:
getRegularStyle
(
color:
ColorManager
.
fontBlack
,
color:
ColorManager
.
fontBlack
,
fontSize:
FontSize
.
s16
,
fontSize:
FontSize
.
s12
,
fontFamily:
FontConstants
.
k2d
,
),
),
textAlign:
TextAlign
.
center
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
),
// child: Row(
SizedBox
(
// children: [
width:
AppMargin
.
m10
,
// const Spacer(),
// Text(
// DateFormatCustom.getDateLocal(
// fromApi: true,
// apiDate: absentSuccess.date,
// ),
// style: getRegularStyle(
// color: ColorManager.fontBlack,
// fontSize: 16,
// fontFamily: FontConstants.montserrat,
// ),
// )
// ],
// ),
),
),
// Container(
Expanded
(
// margin: EdgeInsets.only(
child:
Text
(
// top: AppMargin.m16,
"
$shiftStart
-
$shiftEnd
"
,
// left: AppMargin.m16,
style:
getRegularStyle
(
// right: AppMargin.m16,
color:
ColorManager
.
fontBlack
,
// ),
fontSize:
FontSize
.
s12
,
// child: CustomButton(
fontFamily:
FontConstants
.
k2d
,
// text: "Kembali ke Beranda",
),
// onTap: () {
textAlign:
TextAlign
.
end
,
// Navigator.pushNamedAndRemoveUntil(
),
// context,
),
// Routes.onBoarding,
],
// (route) => false,
),
// );
)
// },
// ),
// )
],
],
),
),
),
),
...
...
lib/page/home/home.dart
View file @
462b1b21
...
@@ -4,6 +4,7 @@ import 'dart:async';
...
@@ -4,6 +4,7 @@ import 'dart:async';
import
'package:excelso_attendance/api/api.dart'
;
import
'package:excelso_attendance/api/api.dart'
;
import
'package:excelso_attendance/helper/arguments/route_args.dart'
;
import
'package:excelso_attendance/helper/arguments/route_args.dart'
;
import
'package:excelso_attendance/helper/component/button.dart'
;
import
'package:excelso_attendance/helper/component/button.dart'
;
import
'package:excelso_attendance/helper/component/text_field.dart'
;
// import 'package:excelso_attendance/helper/component/text_field.dart';
// import 'package:excelso_attendance/helper/component/text_field.dart';
import
'package:excelso_attendance/helper/global_function/date_time.dart'
;
import
'package:excelso_attendance/helper/global_function/date_time.dart'
;
import
'package:excelso_attendance/helper/modal_dialog.dart'
;
import
'package:excelso_attendance/helper/modal_dialog.dart'
;
...
@@ -60,11 +61,12 @@ class BodyWidget extends StatefulWidget {
...
@@ -60,11 +61,12 @@ class BodyWidget extends StatefulWidget {
}
}
class
_BodyWidgetState
extends
State
<
BodyWidget
>
{
class
_BodyWidgetState
extends
State
<
BodyWidget
>
{
//
final TextEditingController nikController = TextEditingController();
final
TextEditingController
nikController
=
TextEditingController
();
int
selectedOutlet
=
0
;
int
selectedOutlet
=
0
;
String
nikUser
=
// String nikUser =
(
getListAbsentUser
().
isEmpty
)
?
""
:
getListAbsentUser
().
last
;
// (getListAbsentUser().isEmpty) ? "" : getListAbsentUser().last;
String
nikUser
=
""
;
TextEditingController
?
textEditingController
;
TextEditingController
?
textEditingController
;
List
<
String
>
dataUserAbsent
=
getListAbsentUser
();
List
<
String
>
dataUserAbsent
=
getListAbsentUser
();
...
@@ -89,11 +91,19 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -89,11 +91,19 @@ class _BodyWidgetState extends State<BodyWidget> {
),
),
),
),
child:
Center
(
child:
Center
(
child:
Image
(
child:
(
ConstantString
.
logoUrlHome
==
""
)
?
const
Image
(
width:
36
,
width:
36
,
height:
36
,
height:
36
,
image:
AssetImage
(
image:
AssetImage
(
Assets
.
excelsoLogo
,
""
,
),
)
:
Image
(
width:
36
,
height:
36
,
image:
NetworkImage
(
ConstantString
.
logoUrlHome
,
),
),
),
),
),
),
...
@@ -178,159 +188,167 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -178,159 +188,167 @@ class _BodyWidgetState extends State<BodyWidget> {
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Container
(
// Container(
margin:
EdgeInsets
.
only
(
// margin: EdgeInsets.only(
bottom:
AppMargin
.
m12
,
// bottom: AppMargin.m12,
),
// ),
child:
Text
(
// child: Text(
"NIK"
,
// "NIK",
style:
getSemiBoldStyle
(
// style: getSemiBoldStyle(
color:
Colors
.
black
,
// color: Colors.black,
fontSize:
16
,
// fontSize: 16,
),
// ),
),
// ),
),
// ),
Autocomplete
(
InputTextField
(
optionsBuilder:
(
TextEditingValue
textEditingValue
)
{
controller:
nikController
,
if
(
textEditingValue
.
text
.
isEmpty
)
{
labelText:
"NIK"
,
return
const
Iterable
<
String
>.
empty
();
borderSideActive:
true
,
}
else
{
return
dataUserAbsent
.
where
(
(
data
)
=>
data
.
toLowerCase
().
contains
(
textEditingValue
.
text
.
toLowerCase
()),
);
}
},
onSelected:
((
selected
)
{
setState
(()
{
nikUser
=
selected
;
});
}),
initialValue:
TextEditingValue
(
text:
(
getListAbsentUser
().
isEmpty
)
?
""
:
getListAbsentUser
().
last
),
optionsViewBuilder:
(
c
,
onSelected
,
options
)
{
List
<
String
>
listNik
=
options
.
toList
();
return
Container
(
margin:
const
EdgeInsets
.
only
(
right:
70
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
5
),
color:
ColorManager
.
backgroundColor
,
border:
Border
.
all
(
width:
0.2
,
color:
Colors
.
grey
,
),
boxShadow:
[
BoxShadow
(
color:
Colors
.
grey
.
withOpacity
(
0.3
),
blurRadius:
2
,
offset:
const
Offset
(
5
,
5
),
),
]),
child:
ListView
.
builder
(
padding:
EdgeInsets
.
zero
,
itemCount:
listNik
.
length
,
itemBuilder:
((
context
,
index
)
{
return
GestureDetector
(
onTap:
()
{
onSelected
(
listNik
[
index
]);
},
child:
Container
(
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
6
,
vertical:
3
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
AppPadding
.
p10
,
vertical:
AppPadding
.
p14
,
),
decoration:
BoxDecoration
(
border:
(
index
+
1
!=
listNik
.
length
)
?
Border
(
bottom:
BorderSide
(
width:
0.5
,
color:
ColorManager
.
grey
.
withOpacity
(
0.8
),
),
)
:
null
,
),
child:
Text
(
listNik
[
index
],
style:
getRegularStyle
(
color:
Colors
.
black
,
fontSize:
20
,
fontFamily:
FontConstants
.
poppins
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
),
),
);
}),
),
);
},
fieldViewBuilder:
(
c
,
controller
,
focusNode
,
onEditingComplete
)
{
textEditingController
=
controller
;
return
TextField
(
onChanged:
(
teks
)
{
setState
(()
{
nikUser
=
teks
;
});
},
controller:
textEditingController
,
focusNode:
focusNode
,
onEditingComplete:
()
{
setState
(()
{
if
(
focusNode
.
hasFocus
)
{
focusNode
.
unfocus
();
}
});
},
decoration:
InputDecoration
(
hintText:
"NIK"
,
hintText:
"NIK"
,
hintStyle:
getRegularStyle
(
color:
Colors
.
grey
,
),
enabledBorder:
OutlineInputBorder
(
borderSide:
BorderSide
(
width:
0.4
,
color:
ColorManager
.
grey
,
),
borderRadius:
BorderRadius
.
circular
(
5
),
),
focusedBorder:
OutlineInputBorder
(
borderSide:
BorderSide
(
width:
0.4
,
color:
ColorManager
.
grey
),
borderRadius:
BorderRadius
.
circular
(
5
),
),
disabledBorder:
OutlineInputBorder
(
borderSide:
BorderSide
(
width:
0.4
,
color:
ColorManager
.
grey
),
borderRadius:
BorderRadius
.
circular
(
5
),
),
suffixIcon:
(
textEditingController
!.
text
.
isNotEmpty
)
?
IconButton
(
onPressed:
()
{
setState
(()
{
textEditingController
!.
clear
();
});
},
icon:
const
Icon
(
Icons
.
dangerous
,
color:
Colors
.
grey
,
),
)
)
:
null
,
// Autocomplete(
),
// optionsBuilder: (TextEditingValue textEditingValue) {
);
// if (textEditingValue.text.isEmpty) {
},
// return const Iterable<String>.empty();
),
// } else {
// return dataUserAbsent.where(
// (data) => data.toLowerCase().contains(
// textEditingValue.text.toLowerCase()),
// );
// }
// },
// onSelected: ((selected) {
// setState(() {
// nikUser = selected;
// });
// }),
// // initialValue: TextEditingValue(
// // text: (getListAbsentUser().isEmpty)
// // ? ""
// // : getListAbsentUser().last,
// // ),
// optionsViewBuilder: (c, onSelected, options) {
// List<String> listNik = options.toList();
// return Container(
// margin: const EdgeInsets.only(
// right: 70,
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(5),
// color: ColorManager.backgroundColor,
// border: Border.all(
// width: 0.2,
// color: Colors.grey,
// ),
// boxShadow: [
// BoxShadow(
// color: Colors.grey.withOpacity(0.3),
// blurRadius: 2,
// offset: const Offset(5, 5),
// ),
// ]),
// child: ListView.builder(
// padding: EdgeInsets.zero,
// itemCount: listNik.length,
// itemBuilder: ((context, index) {
// return GestureDetector(
// onTap: () {
// onSelected(listNik[index]);
// },
// child: Container(
// margin: const EdgeInsets.symmetric(
// horizontal: 6, vertical: 3),
// padding: EdgeInsets.symmetric(
// horizontal: AppPadding.p10,
// vertical: AppPadding.p14,
// ),
// decoration: BoxDecoration(
// border: (index + 1 != listNik.length)
// ? Border(
// bottom: BorderSide(
// width: 0.5,
// color: ColorManager.grey
// .withOpacity(0.8),
// ),
// )
// : null,
// ),
// child: Text(
// listNik[index],
// style: getRegularStyle(
// color: Colors.black,
// fontSize: 20,
// fontFamily: FontConstants.poppins,
// ),
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// ),
// ),
// );
// }),
// ),
// );
// },
// fieldViewBuilder:
// (c, controller, focusNode, onEditingComplete) {
// textEditingController = controller;
// return TextField(
// onChanged: (teks) {
// setState(() {
// nikUser = teks;
// });
// },
// controller: textEditingController,
// focusNode: focusNode,
// onEditingComplete: () {
// setState(() {
// if (focusNode.hasFocus) {
// focusNode.unfocus();
// }
// });
// },
// decoration: InputDecoration(
// hintText: "NIK",
// hintStyle: getRegularStyle(
// color: Colors.grey,
// ),
// enabledBorder: OutlineInputBorder(
// borderSide: BorderSide(
// width: 0.4,
// color: ColorManager.grey,
// ),
// borderRadius: BorderRadius.circular(5),
// ),
// focusedBorder: OutlineInputBorder(
// borderSide: BorderSide(
// width: 0.4, color: ColorManager.grey),
// borderRadius: BorderRadius.circular(5),
// ),
// disabledBorder: OutlineInputBorder(
// borderSide: BorderSide(
// width: 0.4, color: ColorManager.grey),
// borderRadius: BorderRadius.circular(5),
// ),
// suffixIcon:
// (textEditingController!.text.isNotEmpty)
// ? IconButton(
// onPressed: () {
// setState(() {
// textEditingController!.clear();
// nikUser = "";
// });
// },
// icon: const Icon(
// Icons.dangerous,
// color: Colors.grey,
// ),
// )
// : null,
// ),
// );
// },
// ),
],
],
),
),
),
),
...
@@ -346,7 +364,7 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -346,7 +364,7 @@ class _BodyWidgetState extends State<BodyWidget> {
child:
CustomButton
(
child:
CustomButton
(
text:
"Masuk"
,
text:
"Masuk"
,
onTap:
()
{
onTap:
()
{
if
(
nik
User
.
isEmpty
)
{
if
(
nik
Controller
.
text
.
isEmpty
)
{
EasyLoading
.
showToast
(
EasyLoading
.
showToast
(
"Silakan isi NIK terlebih dahulu"
,
"Silakan isi NIK terlebih dahulu"
,
);
);
...
@@ -360,7 +378,7 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -360,7 +378,7 @@ class _BodyWidgetState extends State<BodyWidget> {
shiftList:
widget
.
shiftList
,
shiftList:
widget
.
shiftList
,
branchModel:
branchModel:
widget
.
nearestBranch
[
selectedOutlet
],
widget
.
nearestBranch
[
selectedOutlet
],
nik:
nik
User
,
nik:
nik
Controller
.
text
,
);
);
});
});
}
}
...
@@ -374,7 +392,7 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -374,7 +392,7 @@ class _BodyWidgetState extends State<BodyWidget> {
child:
CustomButton
(
child:
CustomButton
(
text:
"Keluar"
,
text:
"Keluar"
,
onTap:
()
async
{
onTap:
()
async
{
if
(
nik
User
.
isEmpty
)
{
if
(
nik
Controller
.
text
.
isEmpty
)
{
EasyLoading
.
showToast
(
EasyLoading
.
showToast
(
"Silakan isi NIK terlebih dahulu"
,
"Silakan isi NIK terlebih dahulu"
,
);
);
...
@@ -385,7 +403,7 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -385,7 +403,7 @@ class _BodyWidgetState extends State<BodyWidget> {
);
);
Api
.
getUserProfile
(
Api
.
getUserProfile
(
widget
.
nearestBranch
[
selectedOutlet
].
id
,
widget
.
nearestBranch
[
selectedOutlet
].
id
,
nik
User
,
nik
Controller
.
text
,
).
then
((
apiResponse
)
{
).
then
((
apiResponse
)
{
EasyLoading
.
dismiss
();
EasyLoading
.
dismiss
();
if
(
apiResponse
.
error
)
{
if
(
apiResponse
.
error
)
{
...
@@ -430,7 +448,12 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -430,7 +448,12 @@ class _BodyWidgetState extends State<BodyWidget> {
branchModel:
widget
branchModel:
widget
.
nearestBranch
[
selectedOutlet
],
.
nearestBranch
[
selectedOutlet
],
profile:
profileUser
,
profile:
profileUser
,
nik:
nikUser
,
nik:
nikController
.
text
,
shiftNameSelected:
profileUser
.
shiftSelectedName
,
shiftStartTime:
profileUser
.
shiftStart
,
shiftEndTime:
profileUser
.
shiftEnd
,
),
),
);
);
},
},
...
@@ -449,7 +472,11 @@ class _BodyWidgetState extends State<BodyWidget> {
...
@@ -449,7 +472,11 @@ class _BodyWidgetState extends State<BodyWidget> {
branchModel:
branchModel:
widget
.
nearestBranch
[
selectedOutlet
],
widget
.
nearestBranch
[
selectedOutlet
],
profile:
profileUser
,
profile:
profileUser
,
nik:
nikUser
,
nik:
nikController
.
text
,
shiftNameSelected:
profileUser
.
shiftSelectedName
,
shiftStartTime:
profileUser
.
shiftStart
,
shiftEndTime:
profileUser
.
shiftEnd
,
),
),
);
);
}
}
...
@@ -1092,6 +1119,12 @@ class _WidgetSelectShiftState extends State<WidgetSelectShift> {
...
@@ -1092,6 +1119,12 @@ class _WidgetSelectShiftState extends State<WidgetSelectShift> {
shiftModel:
widget
.
shiftList
[
selectedShift
!],
shiftModel:
widget
.
shiftList
[
selectedShift
!],
profile:
profileUser
,
profile:
profileUser
,
nik:
widget
.
nik
,
nik:
widget
.
nik
,
shiftNameSelected:
widget
.
shiftList
[
selectedShift
!].
name
,
shiftStartTime:
widget
.
shiftList
[
selectedShift
!].
startTime
,
shiftEndTime:
widget
.
shiftList
[
selectedShift
!].
endTime
,
),
),
);
);
},
},
...
@@ -1112,6 +1145,11 @@ class _WidgetSelectShiftState extends State<WidgetSelectShift> {
...
@@ -1112,6 +1145,11 @@ class _WidgetSelectShiftState extends State<WidgetSelectShift> {
shiftModel:
widget
.
shiftList
[
selectedShift
!],
shiftModel:
widget
.
shiftList
[
selectedShift
!],
profile:
profileUser
,
profile:
profileUser
,
nik:
widget
.
nik
,
nik:
widget
.
nik
,
shiftNameSelected:
widget
.
shiftList
[
selectedShift
!].
name
,
shiftStartTime:
widget
.
shiftList
[
selectedShift
!].
startTime
,
shiftEndTime:
widget
.
shiftList
[
selectedShift
!].
endTime
,
),
),
);
);
}
}
...
...
lib/resource/colors.dart
View file @
462b1b21
...
@@ -8,5 +8,6 @@ class ColorManager {
...
@@ -8,5 +8,6 @@ class ColorManager {
static
Color
grey
=
const
Color
(
0xff595959
);
static
Color
grey
=
const
Color
(
0xff595959
);
static
Color
softGreen
=
const
Color
(
0xffA4D8C8
);
static
Color
softGreen
=
const
Color
(
0xffA4D8C8
);
static
Color
green
=
const
Color
(
0xff3CA786
);
static
Color
green
=
const
Color
(
0xff3CA786
);
static
Color
green2
=
const
Color
(
0xff219653
);
static
Color
fontBlack
=
const
Color
(
0xff444444
);
static
Color
fontBlack
=
const
Color
(
0xff444444
);
}
}
lib/resource/constanta_string.dart
View file @
462b1b21
class
ConstantString
{
class
ConstantString
{
static
String
outletDistance
=
''
;
static
String
outletDistance
=
''
;
static
String
logoUrlHome
=
''
;
static
String
logoUrlCamera
=
''
;
}
}
lib/resource/font.dart
View file @
462b1b21
...
@@ -4,6 +4,7 @@ class FontConstants {
...
@@ -4,6 +4,7 @@ class FontConstants {
static
const
String
openSans
=
"Open Sans"
;
static
const
String
openSans
=
"Open Sans"
;
static
const
String
montserrat
=
"Montserrat"
;
static
const
String
montserrat
=
"Montserrat"
;
static
const
String
poppins
=
"Poppins"
;
static
const
String
poppins
=
"Poppins"
;
static
const
String
k2d
=
"K2D"
;
}
}
class
FontWeightManager
{
class
FontWeightManager
{
...
...
lib/resource/routes.dart
View file @
462b1b21
...
@@ -46,6 +46,9 @@ class RouteGenerator {
...
@@ -46,6 +46,9 @@ class RouteGenerator {
shiftModel:
args
.
shiftModel
,
shiftModel:
args
.
shiftModel
,
profile:
args
.
profile
,
profile:
args
.
profile
,
nik:
args
.
nik
,
nik:
args
.
nik
,
shiftNameSelected:
args
.
shiftNameSelected
,
shiftStartTime:
args
.
shiftStartTime
,
shiftEndTime:
args
.
shiftEndTime
,
),
),
nameRoute:
Routes
.
absentCamera
,
nameRoute:
Routes
.
absentCamera
,
routeSettings:
routeSettings
,
routeSettings:
routeSettings
,
...
@@ -59,6 +62,9 @@ class RouteGenerator {
...
@@ -59,6 +62,9 @@ class RouteGenerator {
profil:
args
.
profil
,
profil:
args
.
profil
,
nik:
args
.
nik
,
nik:
args
.
nik
,
isIn:
args
.
isIn
,
isIn:
args
.
isIn
,
shiftEnd:
args
.
shiftEnd
,
shiftStart:
args
.
shiftStart
,
shiftName:
args
.
shiftName
,
),
),
nameRoute:
Routes
.
absentSuccess
,
nameRoute:
Routes
.
absentSuccess
,
routeSettings:
routeSettings
,
routeSettings:
routeSettings
,
...
@@ -107,6 +113,9 @@ class RouteGenerator {
...
@@ -107,6 +113,9 @@ class RouteGenerator {
shiftModel:
args
.
shiftModel
,
shiftModel:
args
.
shiftModel
,
profile:
args
.
profile
,
profile:
args
.
profile
,
nik:
args
.
nik
,
nik:
args
.
nik
,
shiftNameSelected:
args
.
shiftNameSelected
,
shiftStartTime:
args
.
shiftStartTime
,
shiftEndTime:
args
.
shiftEndTime
,
),
),
transitionDuration:
Duration
.
zero
,
transitionDuration:
Duration
.
zero
,
reverseTransitionDuration:
Duration
.
zero
,
reverseTransitionDuration:
Duration
.
zero
,
...
@@ -146,22 +155,15 @@ class RouteGenerator {
...
@@ -146,22 +155,15 @@ class RouteGenerator {
profil:
args
.
profil
,
profil:
args
.
profil
,
nik:
args
.
nik
,
nik:
args
.
nik
,
isIn:
args
.
isIn
,
isIn:
args
.
isIn
,
shiftEnd:
args
.
shiftEnd
,
shiftStart:
args
.
shiftStart
,
shiftName:
args
.
shiftName
,
),
),
transitionDuration:
Duration
.
zero
,
transitionDuration:
Duration
.
zero
,
reverseTransitionDuration:
Duration
.
zero
,
reverseTransitionDuration:
Duration
.
zero
,
// settings: RouteSettings(
// settings: RouteSettings(
// name: nameRoute.replaceFirst("/", ""), arguments: args),
// name: nameRoute.replaceFirst("/", ""), arguments: args),
);
);
}
else
if
(
nameRoute
==
Routes
.
notFoundPage
)
{
ErrorWidgetArguments
args
=
routeSettings
!.
arguments
as
ErrorWidgetArguments
;
return
PageRouteBuilder
(
pageBuilder:
(
context
,
a
,
b
)
=>
ErrorWidgetView
(
messageError:
args
.
errorMessage
,
),
transitionDuration:
Duration
.
zero
,
reverseTransitionDuration:
Duration
.
zero
,
);
}
else
{
}
else
{
return
PageRouteBuilder
(
return
PageRouteBuilder
(
pageBuilder:
(
context
,
a
,
b
)
=>
target
,
pageBuilder:
(
context
,
a
,
b
)
=>
target
,
...
...
lib/resource/size.dart
View file @
462b1b21
...
@@ -15,6 +15,7 @@ class AppPadding {
...
@@ -15,6 +15,7 @@ class AppPadding {
static
double
p12
=
12
;
static
double
p12
=
12
;
static
double
p14
=
14
;
static
double
p14
=
14
;
static
double
p15
=
15
;
static
double
p15
=
15
;
static
double
p16
=
16
;
static
double
p20
=
20
;
static
double
p20
=
20
;
}
}
...
...
pubspec.yaml
View file @
462b1b21
...
@@ -93,6 +93,18 @@ flutter:
...
@@ -93,6 +93,18 @@ flutter:
weight
:
600
weight
:
600
-
asset
:
assets/fonts/poppins/Poppins-Bold.ttf
-
asset
:
assets/fonts/poppins/Poppins-Bold.ttf
weight
:
700
weight
:
700
-
family
:
K2D
fonts
:
-
asset
:
assets/fonts/k2d/K2D-Light.ttf
weight
:
300
-
asset
:
assets/fonts/k2d/K2D-Regular.ttf
weight
:
400
-
asset
:
assets/fonts/k2d/K2D-Medium.ttf
weight
:
500
-
asset
:
assets/fonts/k2d/K2D-SemiBold.ttf
weight
:
600
-
asset
:
assets/fonts/k2d/K2D-Bold.ttf
weight
:
700
# The following line ensures that the Material Icons font is
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# included with your application, so that you can use the icons in
...
...
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