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

final desiign

parent ba68464a
......@@ -30,6 +30,7 @@ class Api {
return ApiResponse(error: true, msg: Strings.cantConnectToServer);
} else {
if (jsonObject['status'] == "ok") {
print(jsonObject);
List<BranchModel> branchList = [];
List<dynamic> branchs = jsonObject['data']['branch_list'];
......@@ -42,6 +43,10 @@ class Api {
}
ConstantString.outletDistance =
jsonObject['data']['max_distance'].toString();
ConstantString.logoUrlHome =
jsonObject['data']['logo_attendance_home'];
ConstantString.logoUrlCamera =
jsonObject['data']['logo_attendance_camera'];
return ApiResponse(
error: false,
msg: Strings.succesGetData,
......@@ -110,6 +115,7 @@ class Api {
Map<String, dynamic> data = {
"branch_id": branchId,
"nik": nik,
"brand_code": brandCode,
};
String bodies = jsonEncode(data);
dynamic jsonObject =
......@@ -118,6 +124,7 @@ class Api {
return ApiResponse(error: true, msg: Strings.cantConnectToServer);
} else {
if (jsonObject['status'] == "ok") {
print(jsonObject);
Map<String, dynamic> user = jsonObject['data']['user'];
return ApiResponse(
error: false,
......@@ -143,6 +150,7 @@ class Api {
try {
Map<String, dynamic> data = {
"branch_id": branchId,
"brand_code": brandCode,
"nik": nik,
"shift_id": shiftId,
"user_lat": position.latitude,
......@@ -196,6 +204,7 @@ class Api {
try {
Map<String, dynamic> data = {
"branch_id": branchId,
"brand_code": brandCode,
"nik": nik,
"user_lat": position.latitude,
"user_long": position.longitude,
......
......@@ -9,13 +9,19 @@ class AbsentCameraArguments {
final ShiftModel? shiftModel;
final ProfileModel profile;
final String nik;
final String shiftNameSelected;
final String shiftStartTime;
final String shiftEndTime;
AbsentCameraArguments({
required this.isIn,
required this.branchModel,
required this.nik,
required this.profile,
required this.shiftStartTime,
required this.shiftEndTime,
this.shiftModel,
required this.shiftNameSelected,
});
}
......@@ -34,11 +40,17 @@ class AbsentSuccessArguments {
final ProfileModel profil;
final String nik;
final bool isIn;
final String shiftStart;
final String shiftEnd;
final String shiftName;
AbsentSuccessArguments({
required this.absentSuccess,
required this.profil,
required this.nik,
required this.isIn,
required this.shiftStart,
required this.shiftEnd,
required this.shiftName,
});
}
......@@ -3,6 +3,7 @@ import 'package:excelso_attendance/main.dart';
const String _latitude = 'laU';
const String _longitude = 'loU';
const String _listAbsent = 'listAbsent';
const String _outletLogo = '_logo';
String? getLatitude() {
return prefs.getString(_latitude);
......@@ -29,3 +30,11 @@ Future<void> setListAbsentUser(List<String> value) async {
List<String> getListAbsentUser() {
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 {
String name;
bool attendanceIn;
bool attendanceOut;
String shiftSelectedName;
String shiftStart;
String shiftEnd;
ProfileModel({
required this.id,
......@@ -11,6 +14,9 @@ class ProfileModel {
required this.name,
required this.attendanceIn,
required this.attendanceOut,
required this.shiftSelectedName,
required this.shiftStart,
required this.shiftEnd,
});
factory ProfileModel.json(Map<String, dynamic> json) {
......@@ -20,6 +26,9 @@ class ProfileModel {
name: json['name'],
attendanceIn: json['today_attendance_in'],
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 {
static Color grey = const Color(0xff595959);
static Color softGreen = const Color(0xffA4D8C8);
static Color green = const Color(0xff3CA786);
static Color green2 = const Color(0xff219653);
static Color fontBlack = const Color(0xff444444);
}
class ConstantString {
static String outletDistance = '';
static String logoUrlHome = '';
static String logoUrlCamera = '';
}
......@@ -4,6 +4,7 @@ class FontConstants {
static const String openSans = "Open Sans";
static const String montserrat = "Montserrat";
static const String poppins = "Poppins";
static const String k2d = "K2D";
}
class FontWeightManager {
......
......@@ -46,6 +46,9 @@ class RouteGenerator {
shiftModel: args.shiftModel,
profile: args.profile,
nik: args.nik,
shiftNameSelected: args.shiftNameSelected,
shiftStartTime: args.shiftStartTime,
shiftEndTime: args.shiftEndTime,
),
nameRoute: Routes.absentCamera,
routeSettings: routeSettings,
......@@ -59,6 +62,9 @@ class RouteGenerator {
profil: args.profil,
nik: args.nik,
isIn: args.isIn,
shiftEnd: args.shiftEnd,
shiftStart: args.shiftStart,
shiftName: args.shiftName,
),
nameRoute: Routes.absentSuccess,
routeSettings: routeSettings,
......@@ -107,6 +113,9 @@ class RouteGenerator {
shiftModel: args.shiftModel,
profile: args.profile,
nik: args.nik,
shiftNameSelected: args.shiftNameSelected,
shiftStartTime: args.shiftStartTime,
shiftEndTime: args.shiftEndTime,
),
transitionDuration: Duration.zero,
reverseTransitionDuration: Duration.zero,
......@@ -146,22 +155,15 @@ class RouteGenerator {
profil: args.profil,
nik: args.nik,
isIn: args.isIn,
shiftEnd: args.shiftEnd,
shiftStart: args.shiftStart,
shiftName: args.shiftName,
),
transitionDuration: Duration.zero,
reverseTransitionDuration: Duration.zero,
// settings: RouteSettings(
// 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 {
return PageRouteBuilder(
pageBuilder: (context, a, b) => target,
......
......@@ -15,6 +15,7 @@ class AppPadding {
static double p12 = 12;
static double p14 = 14;
static double p15 = 15;
static double p16 = 16;
static double p20 = 20;
}
......
......@@ -93,6 +93,18 @@ flutter:
weight: 600
- asset: assets/fonts/poppins/Poppins-Bold.ttf
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
# 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