Commit 462b1b21 authored by Dio Maulana's avatar Dio Maulana

final desiign

parent ba68464a
...@@ -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,
......
...@@ -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,
}); });
} }
...@@ -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) ?? "";
}
...@@ -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'] ?? "",
); );
} }
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -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);
} }
class ConstantString { class ConstantString {
static String outletDistance = ''; static String outletDistance = '';
static String logoUrlHome = '';
static String logoUrlCamera = '';
} }
...@@ -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 {
......
...@@ -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,
......
...@@ -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;
} }
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment