Refactor employee model imports and restructure employee-related files
- Updated import paths for employee model files to reflect new directory structure. - Deleted obsolete models: JobRecentApplicationModel, LeadReportModel, Product, ProductOrderModal, ProjectSummaryModel, RecentOrderModel, TaskListModel, TimeLineModel, User, VisitorByChannelsModel. - Introduced new AttendanceLogModel, AttendanceLogViewModel, AttendanceModel, TaskModel, TaskListModel, EmployeeInfo, and EmployeeModel with comprehensive fields and JSON serialization methods. - Enhanced data handling in attendance and task management features.
This commit is contained in:
parent
c69e0d5221
commit
91184b48bb
@ -9,12 +9,12 @@ import 'package:marco/helpers/services/app_logger.dart';
|
|||||||
import 'package:marco/helpers/services/api_service.dart';
|
import 'package:marco/helpers/services/api_service.dart';
|
||||||
import 'package:marco/helpers/widgets/my_image_compressor.dart';
|
import 'package:marco/helpers/widgets/my_image_compressor.dart';
|
||||||
|
|
||||||
import 'package:marco/model/attendance_model.dart';
|
import 'package:marco/model/attendance/attendance_model.dart';
|
||||||
import 'package:marco/model/project_model.dart';
|
import 'package:marco/model/project_model.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
import 'package:marco/model/attendance_log_model.dart';
|
import 'package:marco/model/attendance/attendance_log_model.dart';
|
||||||
import 'package:marco/model/regularization_log_model.dart';
|
import 'package:marco/model/regularization_log_model.dart';
|
||||||
import 'package:marco/model/attendance_log_view_model.dart';
|
import 'package:marco/model/attendance/attendance_log_view_model.dart';
|
||||||
|
|
||||||
import 'package:marco/controller/project_controller.dart';
|
import 'package:marco/controller/project_controller.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:marco/helpers/services/app_logger.dart';
|
import 'package:marco/helpers/services/app_logger.dart';
|
||||||
import 'package:marco/helpers/services/api_service.dart';
|
import 'package:marco/helpers/services/api_service.dart';
|
||||||
import 'package:marco/model/project_model.dart';
|
import 'package:marco/model/project_model.dart';
|
||||||
import 'package:marco/model/daily_task_model.dart';
|
import 'package:marco/model/dailyTaskPlaning/daily_task_model.dart';
|
||||||
|
|
||||||
class DailyTaskController extends GetxController {
|
class DailyTaskController extends GetxController {
|
||||||
List<ProjectModel> projects = [];
|
List<ProjectModel> projects = [];
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:marco/helpers/services/app_logger.dart';
|
import 'package:marco/helpers/services/app_logger.dart';
|
||||||
import 'package:marco/helpers/services/api_service.dart';
|
import 'package:marco/helpers/services/api_service.dart';
|
||||||
import 'package:marco/model/attendance_model.dart';
|
import 'package:marco/model/attendance/attendance_model.dart';
|
||||||
import 'package:marco/model/project_model.dart';
|
import 'package:marco/model/project_model.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
import 'package:marco/model/employees/employee_details_model.dart';
|
import 'package:marco/model/employees/employee_details_model.dart';
|
||||||
import 'package:marco/controller/project_controller.dart';
|
import 'package:marco/controller/project_controller.dart';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:marco/helpers/services/app_logger.dart';
|
import 'package:marco/helpers/services/app_logger.dart';
|
||||||
import 'package:marco/helpers/services/api_service.dart';
|
import 'package:marco/helpers/services/api_service.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
import 'package:marco/helpers/widgets/my_snackbar.dart';
|
import 'package:marco/helpers/widgets/my_snackbar.dart';
|
||||||
import 'package:marco/controller/directory/directory_controller.dart';
|
import 'package:marco/controller/directory/directory_controller.dart';
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import 'package:marco/controller/expense/expense_screen_controller.dart';
|
|||||||
import 'package:marco/helpers/services/api_service.dart';
|
import 'package:marco/helpers/services/api_service.dart';
|
||||||
import 'package:marco/helpers/services/app_logger.dart';
|
import 'package:marco/helpers/services/app_logger.dart';
|
||||||
import 'package:marco/helpers/widgets/my_snackbar.dart';
|
import 'package:marco/helpers/widgets/my_snackbar.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
import 'package:marco/model/expense/expense_type_model.dart';
|
import 'package:marco/model/expense/expense_type_model.dart';
|
||||||
import 'package:marco/model/expense/payment_types_model.dart';
|
import 'package:marco/model/expense/payment_types_model.dart';
|
||||||
import 'package:mime/mime.dart';
|
import 'package:mime/mime.dart';
|
||||||
|
@ -2,7 +2,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:marco/helpers/services/api_service.dart';
|
import 'package:marco/helpers/services/api_service.dart';
|
||||||
import 'package:marco/helpers/services/app_logger.dart';
|
import 'package:marco/helpers/services/app_logger.dart';
|
||||||
import 'package:marco/model/expense/expense_detail_model.dart';
|
import 'package:marco/model/expense/expense_detail_model.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class ExpenseDetailController extends GetxController {
|
class ExpenseDetailController extends GetxController {
|
||||||
|
@ -6,7 +6,7 @@ import 'package:marco/model/expense/expense_list_model.dart';
|
|||||||
import 'package:marco/model/expense/payment_types_model.dart';
|
import 'package:marco/model/expense/payment_types_model.dart';
|
||||||
import 'package:marco/model/expense/expense_type_model.dart';
|
import 'package:marco/model/expense/expense_type_model.dart';
|
||||||
import 'package:marco/model/expense/expense_status_model.dart';
|
import 'package:marco/model/expense/expense_status_model.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
import 'package:marco/helpers/widgets/my_snackbar.dart';
|
import 'package:marco/helpers/widgets/my_snackbar.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
import 'package:marco/controller/my_controller.dart';
|
|
||||||
import 'package:marco/helpers/widgets/my_text_utils.dart';
|
|
||||||
import 'package:marco/model/time_line.dart';
|
|
||||||
|
|
||||||
class TimeLineController extends MyController {
|
|
||||||
List<TimeLineModel> timeline = [];
|
|
||||||
List<String> dummyTexts = List.generate(12, (index) => MyTextUtils.getDummyText(60));
|
|
||||||
|
|
||||||
@override
|
|
||||||
void onInit() {
|
|
||||||
TimeLineModel.dummyList.then((value) {
|
|
||||||
timeline = value.sublist(0, 6);
|
|
||||||
update();
|
|
||||||
});
|
|
||||||
super.onInit();
|
|
||||||
}
|
|
||||||
}
|
|
@ -5,7 +5,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
import 'package:marco/helpers/services/app_logger.dart';
|
import 'package:marco/helpers/services/app_logger.dart';
|
||||||
import 'package:marco/helpers/services/permission_service.dart';
|
import 'package:marco/helpers/services/permission_service.dart';
|
||||||
import 'package:marco/model/user_permission.dart';
|
import 'package:marco/model/user_permission.dart';
|
||||||
import 'package:marco/model/employee_info.dart';
|
import 'package:marco/model/employees/employee_info.dart';
|
||||||
import 'package:marco/model/projects_model.dart';
|
import 'package:marco/model/projects_model.dart';
|
||||||
|
|
||||||
class PermissionController extends GetxController {
|
class PermissionController extends GetxController {
|
||||||
|
@ -5,7 +5,7 @@ import 'package:marco/helpers/widgets/my_form_validator.dart';
|
|||||||
import 'package:marco/helpers/widgets/my_snackbar.dart';
|
import 'package:marco/helpers/widgets/my_snackbar.dart';
|
||||||
import 'package:marco/model/project_model.dart';
|
import 'package:marco/model/project_model.dart';
|
||||||
import 'package:marco/model/dailyTaskPlaning/daily_task_planing_model.dart';
|
import 'package:marco/model/dailyTaskPlaning/daily_task_planing_model.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
|
|
||||||
class DailyTaskPlaningController extends GetxController {
|
class DailyTaskPlaningController extends GetxController {
|
||||||
List<ProjectModel> projects = [];
|
List<ProjectModel> projects = [];
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
import 'package:marco/controller/my_controller.dart';
|
|
||||||
import 'package:marco/helpers/widgets/my_text_utils.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:marco/model/drag_n_drop_model.dart';
|
|
||||||
|
|
||||||
class DragNDropController extends MyController {
|
|
||||||
List<DragNDropModel> dragNDrop = [];
|
|
||||||
final scrollController = ScrollController();
|
|
||||||
final gridViewKey = GlobalKey();
|
|
||||||
List<String> dummyTexts = List.generate(12, (index) => MyTextUtils.getDummyText(60));
|
|
||||||
|
|
||||||
@override
|
|
||||||
void onInit() {
|
|
||||||
DragNDropModel.dummyList.then((value) {
|
|
||||||
dragNDrop = value;
|
|
||||||
update();
|
|
||||||
});
|
|
||||||
super.onInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
void onReorder(int oldIndex, int newIndex) {
|
|
||||||
final item = dragNDrop.removeAt(oldIndex);
|
|
||||||
dragNDrop.insert(newIndex, item);
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
class ApiEndpoints {
|
class ApiEndpoints {
|
||||||
// static const String baseUrl = "https://stageapi.marcoaiot.com/api";
|
static const String baseUrl = "https://stageapi.marcoaiot.com/api";
|
||||||
static const String baseUrl = "https://api.marcoaiot.com/api";
|
// static const String baseUrl = "https://api.marcoaiot.com/api";
|
||||||
|
|
||||||
// Dashboard Module API Endpoints
|
// Dashboard Module API Endpoints
|
||||||
static const String getDashboardAttendanceOverview = "/dashboard/attendance-overview";
|
static const String getDashboardAttendanceOverview = "/dashboard/attendance-overview";
|
||||||
|
@ -4,7 +4,7 @@ import 'package:http/http.dart' as http;
|
|||||||
|
|
||||||
import 'package:marco/helpers/services/app_logger.dart';
|
import 'package:marco/helpers/services/app_logger.dart';
|
||||||
import 'package:marco/model/user_permission.dart';
|
import 'package:marco/model/user_permission.dart';
|
||||||
import 'package:marco/model/employee_info.dart';
|
import 'package:marco/model/employees/employee_info.dart';
|
||||||
import 'package:marco/model/projects_model.dart';
|
import 'package:marco/model/projects_model.dart';
|
||||||
import 'package:marco/helpers/services/storage/local_storage.dart';
|
import 'package:marco/helpers/services/storage/local_storage.dart';
|
||||||
import 'package:marco/helpers/services/auth_service.dart';
|
import 'package:marco/helpers/services/auth_service.dart';
|
||||||
|
@ -5,7 +5,7 @@ import 'package:marco/controller/project_controller.dart';
|
|||||||
import 'package:marco/helpers/services/auth_service.dart';
|
import 'package:marco/helpers/services/auth_service.dart';
|
||||||
import 'package:marco/helpers/services/localizations/language.dart';
|
import 'package:marco/helpers/services/localizations/language.dart';
|
||||||
import 'package:marco/helpers/theme/theme_customizer.dart';
|
import 'package:marco/helpers/theme/theme_customizer.dart';
|
||||||
import 'package:marco/model/employee_info.dart';
|
import 'package:marco/model/employees/employee_info.dart';
|
||||||
import 'package:marco/model/user_permission.dart';
|
import 'package:marco/model/user_permission.dart';
|
||||||
|
|
||||||
class LocalStorage {
|
class LocalStorage {
|
||||||
|
@ -7,7 +7,7 @@ import 'package:marco/helpers/utils/base_bottom_sheet.dart';
|
|||||||
import 'package:marco/helpers/widgets/my_text.dart';
|
import 'package:marco/helpers/widgets/my_text.dart';
|
||||||
import 'package:marco/helpers/widgets/my_spacing.dart';
|
import 'package:marco/helpers/widgets/my_spacing.dart';
|
||||||
import 'package:marco/helpers/widgets/my_snackbar.dart';
|
import 'package:marco/helpers/widgets/my_snackbar.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
import 'package:marco/model/directory/contact_bucket_list_model.dart';
|
import 'package:marco/model/directory/contact_bucket_list_model.dart';
|
||||||
|
|
||||||
class EditBucketBottomSheet {
|
class EditBucketBottomSheet {
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:marco/helpers/services/json_decoder.dart';
|
|
||||||
import 'package:marco/model/identifier_model.dart';
|
|
||||||
|
|
||||||
class DragNDropModel extends IdentifierModel {
|
|
||||||
final String name, image, userName, contactNumber;
|
|
||||||
|
|
||||||
DragNDropModel(super.id, this.name, this.image, this.userName, this.contactNumber);
|
|
||||||
|
|
||||||
static DragNDropModel fromJSON(Map<String, dynamic> json) {
|
|
||||||
JSONDecoder decoder = JSONDecoder(json);
|
|
||||||
|
|
||||||
String name = decoder.getString('name');
|
|
||||||
String image = decoder.getString('image');
|
|
||||||
String userName = decoder.getString('user_name');
|
|
||||||
String contactNumber = decoder.getString('contact_number');
|
|
||||||
|
|
||||||
return DragNDropModel(decoder.getId, name, image, userName, contactNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<DragNDropModel> listFromJSON(List<dynamic> list) {
|
|
||||||
return list.map((e) => DragNDropModel.fromJSON(e)).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<DragNDropModel>? _dummyList;
|
|
||||||
|
|
||||||
static Future<List<DragNDropModel>> get dummyList async {
|
|
||||||
if (_dummyList == null) {
|
|
||||||
dynamic data = json.decode(await getData());
|
|
||||||
_dummyList = listFromJSON(data);
|
|
||||||
}
|
|
||||||
return _dummyList!;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<String> getData() async {
|
|
||||||
return await rootBundle.loadString('assets/data/drag_n_drop_data.json');
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:marco/helpers/widgets/my_spacing.dart';
|
import 'package:marco/helpers/widgets/my_spacing.dart';
|
||||||
import 'package:marco/helpers/widgets/my_text.dart';
|
import 'package:marco/helpers/widgets/my_text.dart';
|
||||||
import 'package:marco/helpers/utils/base_bottom_sheet.dart';
|
import 'package:marco/helpers/utils/base_bottom_sheet.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
|
|
||||||
class ReusableEmployeeSelectorBottomSheet extends StatelessWidget {
|
class ReusableEmployeeSelectorBottomSheet extends StatelessWidget {
|
||||||
final TextEditingController searchController;
|
final TextEditingController searchController;
|
||||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:marco/helpers/widgets/my_spacing.dart';
|
import 'package:marco/helpers/widgets/my_spacing.dart';
|
||||||
import 'package:marco/helpers/widgets/my_text.dart';
|
import 'package:marco/helpers/widgets/my_text.dart';
|
||||||
import 'package:marco/helpers/widgets/my_text_style.dart';
|
import 'package:marco/helpers/widgets/my_text_style.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
import 'package:marco/helpers/utils/base_bottom_sheet.dart';
|
import 'package:marco/helpers/utils/base_bottom_sheet.dart';
|
||||||
|
|
||||||
class EmployeeSelectorBottomSheet extends StatefulWidget {
|
class EmployeeSelectorBottomSheet extends StatefulWidget {
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:marco/helpers/services/json_decoder.dart';
|
|
||||||
import 'package:marco/model/identifier_model.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
class JobRecentApplicationModel extends IdentifierModel {
|
|
||||||
final String candidate, category, designation, mail, location, type;
|
|
||||||
final DateTime date;
|
|
||||||
|
|
||||||
JobRecentApplicationModel(super.id, this.candidate, this.category, this.designation, this.mail, this.location, this.type, this.date);
|
|
||||||
|
|
||||||
static JobRecentApplicationModel fromJSON(Map<String, dynamic> json) {
|
|
||||||
JSONDecoder decoder = JSONDecoder(json);
|
|
||||||
|
|
||||||
String candidate = decoder.getString('candidate');
|
|
||||||
String category = decoder.getString('category');
|
|
||||||
String designation = decoder.getString('designation');
|
|
||||||
String mail = decoder.getString('mail');
|
|
||||||
String location = decoder.getString('location');
|
|
||||||
String type = decoder.getString('type');
|
|
||||||
DateTime date = decoder.getDateTime('date');
|
|
||||||
|
|
||||||
return JobRecentApplicationModel(decoder.getId, candidate, category, designation, mail, location, type, date);
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<JobRecentApplicationModel> listFromJSON(List<dynamic> list) {
|
|
||||||
return list.map((e) => JobRecentApplicationModel.fromJSON(e)).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<JobRecentApplicationModel>? _dummyList;
|
|
||||||
|
|
||||||
static Future<List<JobRecentApplicationModel>> get dummyList async {
|
|
||||||
if (_dummyList == null) {
|
|
||||||
dynamic data = json.decode(await getData());
|
|
||||||
_dummyList = listFromJSON(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _dummyList!;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<String> getData() async {
|
|
||||||
return await rootBundle.loadString('assets/data/job_recent_application.json');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:marco/helpers/services/json_decoder.dart';
|
|
||||||
import 'package:marco/model/identifier_model.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
class LeadReportModel extends IdentifierModel {
|
|
||||||
final String firstName, email, phoneNumber, companyName, status, location;
|
|
||||||
final DateTime date;
|
|
||||||
final int amount;
|
|
||||||
|
|
||||||
LeadReportModel(super.id, this.firstName, this.email, this.phoneNumber, this.companyName, this.status, this.location, this.date, this.amount);
|
|
||||||
|
|
||||||
static LeadReportModel fromJSON(Map<String, dynamic> json) {
|
|
||||||
JSONDecoder decoder = JSONDecoder(json);
|
|
||||||
|
|
||||||
String firstName = decoder.getString('first_name');
|
|
||||||
String email = decoder.getString('email');
|
|
||||||
String phoneNumber = decoder.getString('phone_number');
|
|
||||||
String companyName = decoder.getString('company_name');
|
|
||||||
String status = decoder.getString('status');
|
|
||||||
String location = decoder.getString('location');
|
|
||||||
DateTime date = decoder.getDateTime('date');
|
|
||||||
int amount = decoder.getInt('amount');
|
|
||||||
|
|
||||||
return LeadReportModel(decoder.getId, firstName, email, phoneNumber, companyName, status, location, date, amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<LeadReportModel> listFromJSON(List<dynamic> list) {
|
|
||||||
return list.map((e) => LeadReportModel.fromJSON(e)).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<LeadReportModel>? _dummyList;
|
|
||||||
|
|
||||||
static Future<List<LeadReportModel>> get dummyList async {
|
|
||||||
if (_dummyList == null) {
|
|
||||||
dynamic data = json.decode(await getData());
|
|
||||||
_dummyList = listFromJSON(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _dummyList!;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<String> getData() async {
|
|
||||||
return await rootBundle.loadString('assets/data/leads_report_data.json');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:marco/helpers/services/json_decoder.dart';
|
|
||||||
import 'package:marco/model/identifier_model.dart';
|
|
||||||
|
|
||||||
class Product extends IdentifierModel {
|
|
||||||
final String name, description, image, category, sku;
|
|
||||||
final double price, rating;
|
|
||||||
final int stock, ordersCount, ratingCount;
|
|
||||||
final DateTime createdAt;
|
|
||||||
|
|
||||||
Product(super.id, this.name, this.description, this.image, this.category, this.sku, this.price, this.rating, this.stock, this.ordersCount, this.ratingCount,
|
|
||||||
this.createdAt);
|
|
||||||
|
|
||||||
static Product fromJSON(Map<String, dynamic> json) {
|
|
||||||
JSONDecoder decoder = JSONDecoder(json);
|
|
||||||
|
|
||||||
String name = decoder.getString('name');
|
|
||||||
String description = decoder.getString('description');
|
|
||||||
String image = decoder.getString('image');
|
|
||||||
String category = decoder.getString('category');
|
|
||||||
String sku = decoder.getString('sku');
|
|
||||||
double price = decoder.getDouble('price');
|
|
||||||
double rating = decoder.getDouble('rating');
|
|
||||||
int stock = decoder.getInt('stock');
|
|
||||||
int ordersCount = decoder.getInt('order_counts');
|
|
||||||
int ratingCount = decoder.getInt('rating_count');
|
|
||||||
DateTime createdAt = decoder.getDateTime('created_at');
|
|
||||||
|
|
||||||
return Product(decoder.getId, name, description, image, category, sku, price, rating, stock, ordersCount, ratingCount, createdAt);
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<Product> listFromJSON(List<dynamic> list) {
|
|
||||||
return list.map((e) => Product.fromJSON(e)).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Dummy
|
|
||||||
|
|
||||||
static List<Product>? _dummyList;
|
|
||||||
|
|
||||||
static Future<List<Product>> get dummyList async {
|
|
||||||
if (_dummyList == null) {
|
|
||||||
dynamic data = json.decode(await getData());
|
|
||||||
_dummyList = listFromJSON(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _dummyList!.sublist(0, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<String> getData() async {
|
|
||||||
return await rootBundle.loadString('assets/data/product_data.json');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:marco/helpers/services/json_decoder.dart';
|
|
||||||
import 'package:marco/model/identifier_model.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
class ProductOrderModal extends IdentifierModel {
|
|
||||||
final String orderId, customerName, location, payment, status;
|
|
||||||
final int quantity, price;
|
|
||||||
final DateTime orderDate;
|
|
||||||
|
|
||||||
ProductOrderModal(super.id, this.orderId, this.customerName, this.location, this.payment, this.status, this.quantity, this.price, this.orderDate);
|
|
||||||
|
|
||||||
static ProductOrderModal fromJSON(Map<String, dynamic> json) {
|
|
||||||
JSONDecoder decoder = JSONDecoder(json);
|
|
||||||
|
|
||||||
String orderId = decoder.getString('order_id');
|
|
||||||
String customerName = decoder.getString('customer_name');
|
|
||||||
String location = decoder.getString('location');
|
|
||||||
String payment = decoder.getString('payments');
|
|
||||||
String status = decoder.getString('status');
|
|
||||||
int quantity = decoder.getInt('quantity');
|
|
||||||
int price = decoder.getInt('price');
|
|
||||||
DateTime orderDate = decoder.getDateTime('order_date');
|
|
||||||
|
|
||||||
return ProductOrderModal(decoder.getId, orderId, customerName, location, payment, status, quantity, price, orderDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<ProductOrderModal> listFromJSON(List<dynamic> list) {
|
|
||||||
return list.map((e) => ProductOrderModal.fromJSON(e)).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<ProductOrderModal>? _dummyList;
|
|
||||||
|
|
||||||
static Future<List<ProductOrderModal>> get dummyList async {
|
|
||||||
if (_dummyList == null) {
|
|
||||||
dynamic data = json.decode(await getData());
|
|
||||||
_dummyList = listFromJSON(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _dummyList!;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<String> getData() async {
|
|
||||||
return await rootBundle.loadString('assets/data/product_order.json');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:marco/helpers/services/json_decoder.dart';
|
|
||||||
import 'package:marco/model/identifier_model.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
class ProjectSummaryModel extends IdentifierModel {
|
|
||||||
final String title, assignTo, priority, status;
|
|
||||||
final DateTime date;
|
|
||||||
|
|
||||||
ProjectSummaryModel(
|
|
||||||
super.id,
|
|
||||||
this.title,
|
|
||||||
this.assignTo,
|
|
||||||
this.priority,
|
|
||||||
this.status,
|
|
||||||
this.date,
|
|
||||||
);
|
|
||||||
|
|
||||||
static ProjectSummaryModel fromJSON(Map<String, dynamic> json) {
|
|
||||||
JSONDecoder decoder = JSONDecoder(json);
|
|
||||||
|
|
||||||
String title = decoder.getString('title');
|
|
||||||
String assignTo = decoder.getString('assign_to');
|
|
||||||
String priority = decoder.getString('priority');
|
|
||||||
String status = decoder.getString('status');
|
|
||||||
DateTime date = decoder.getDateTime('date');
|
|
||||||
|
|
||||||
return ProjectSummaryModel(decoder.getId, title, assignTo, priority, status, date);
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<ProjectSummaryModel> listFromJSON(List<dynamic> list) {
|
|
||||||
return list.map((e) => ProjectSummaryModel.fromJSON(e)).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<ProjectSummaryModel>? _dummyList;
|
|
||||||
|
|
||||||
static Future<List<ProjectSummaryModel>> get dummyList async {
|
|
||||||
if (_dummyList == null) {
|
|
||||||
dynamic data = json.decode(await getData());
|
|
||||||
_dummyList = listFromJSON(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _dummyList!;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<String> getData() async {
|
|
||||||
return await rootBundle.loadString('assets/data/project_summary.json');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:marco/helpers/services/json_decoder.dart';
|
|
||||||
import 'package:marco/model/identifier_model.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
class RecentOrderModel extends IdentifierModel {
|
|
||||||
final String productName, customer, status;
|
|
||||||
final int quantity, price;
|
|
||||||
final DateTime orderDate;
|
|
||||||
|
|
||||||
RecentOrderModel(
|
|
||||||
super.id,
|
|
||||||
this.productName,
|
|
||||||
this.customer,
|
|
||||||
this.status,
|
|
||||||
this.quantity,
|
|
||||||
this.price,
|
|
||||||
this.orderDate,
|
|
||||||
);
|
|
||||||
|
|
||||||
static RecentOrderModel fromJSON(Map<String, dynamic> json) {
|
|
||||||
JSONDecoder decoder = JSONDecoder(json);
|
|
||||||
|
|
||||||
String productName = decoder.getString('product_name');
|
|
||||||
String customer = decoder.getString('customer');
|
|
||||||
String status = decoder.getString('status');
|
|
||||||
int quantity = decoder.getInt('quantity');
|
|
||||||
int price = decoder.getInt('price');
|
|
||||||
DateTime orderDate = decoder.getDateTime('order_date');
|
|
||||||
|
|
||||||
return RecentOrderModel(decoder.getId, productName, customer, status, quantity, price, orderDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<RecentOrderModel> listFromJSON(List<dynamic> list) {
|
|
||||||
return list.map((e) => RecentOrderModel.fromJSON(e)).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<RecentOrderModel>? _dummyList;
|
|
||||||
|
|
||||||
static Future<List<RecentOrderModel>> get dummyList async {
|
|
||||||
if (_dummyList == null) {
|
|
||||||
dynamic data = json.decode(await getData());
|
|
||||||
_dummyList = listFromJSON(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _dummyList!;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<String> getData() async {
|
|
||||||
return await rootBundle.loadString('assets/data/recent_order.json');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:marco/helpers/services/json_decoder.dart';
|
|
||||||
import 'package:marco/model/identifier_model.dart';
|
|
||||||
|
|
||||||
class TimeLineModel extends IdentifierModel {
|
|
||||||
final String firstName, lastName, email;
|
|
||||||
|
|
||||||
TimeLineModel(super.id, this.firstName, this.lastName, this.email);
|
|
||||||
|
|
||||||
static TimeLineModel fromJSON(Map<String, dynamic> json) {
|
|
||||||
JSONDecoder decoder = JSONDecoder(json);
|
|
||||||
|
|
||||||
String firstName = decoder.getString('first_name');
|
|
||||||
String lastName = decoder.getString('last_name');
|
|
||||||
String email = decoder.getString('email');
|
|
||||||
|
|
||||||
return TimeLineModel(decoder.getId, firstName, lastName, email);
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<TimeLineModel> listFromJSON(List<dynamic> list) {
|
|
||||||
return list.map((e) => TimeLineModel.fromJSON(e)).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<TimeLineModel>? _dummyList;
|
|
||||||
|
|
||||||
static Future<List<TimeLineModel>> get dummyList async {
|
|
||||||
if (_dummyList == null) {
|
|
||||||
dynamic data = json.decode(await getData());
|
|
||||||
_dummyList = listFromJSON(data);
|
|
||||||
}
|
|
||||||
return _dummyList!;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<String> getData() async {
|
|
||||||
return await rootBundle.loadString('assets/data/time_line.json');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
import 'package:marco/model/identifier_model.dart';
|
|
||||||
|
|
||||||
class User extends IdentifierModel {
|
|
||||||
final String username, firstName, lastName;
|
|
||||||
|
|
||||||
User(super.id, this.username, this.firstName, this.lastName);
|
|
||||||
|
|
||||||
String get name => "$firstName $lastName";
|
|
||||||
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:marco/helpers/services/json_decoder.dart';
|
|
||||||
import 'package:marco/model/identifier_model.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
class VisitorByChannelsModel extends IdentifierModel {
|
|
||||||
final String channel;
|
|
||||||
final int session, targetReached;
|
|
||||||
final double bounceRate, pagePerSession;
|
|
||||||
final DateTime sessionDuration;
|
|
||||||
|
|
||||||
VisitorByChannelsModel(super.id, this.channel, this.session, this.targetReached, this.bounceRate, this.pagePerSession, this.sessionDuration);
|
|
||||||
|
|
||||||
static VisitorByChannelsModel fromJSON(Map<String, dynamic> json) {
|
|
||||||
JSONDecoder decoder = JSONDecoder(json);
|
|
||||||
|
|
||||||
String channel = decoder.getString('channel');
|
|
||||||
int session = decoder.getInt('session');
|
|
||||||
int targetReached = decoder.getInt('target_reached');
|
|
||||||
double bounceRate = decoder.getDouble('bounce_rate');
|
|
||||||
double pagePerSession = decoder.getDouble('page_per_session');
|
|
||||||
DateTime sessionDuration = decoder.getDateTime('session_duration');
|
|
||||||
|
|
||||||
return VisitorByChannelsModel(decoder.getId, channel, session, targetReached, bounceRate, pagePerSession, sessionDuration);
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<VisitorByChannelsModel> listFromJSON(List<dynamic> list) {
|
|
||||||
return list.map((e) => VisitorByChannelsModel.fromJSON(e)).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<VisitorByChannelsModel>? _dummyList;
|
|
||||||
|
|
||||||
static Future<List<VisitorByChannelsModel>> get dummyList async {
|
|
||||||
if (_dummyList == null) {
|
|
||||||
dynamic data = json.decode(await getData());
|
|
||||||
_dummyList = listFromJSON(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _dummyList!;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<String> getData() async {
|
|
||||||
return await rootBundle.loadString('assets/data/visitors_by_channels_data.json');
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,7 +10,7 @@ import 'package:marco/helpers/widgets/avatar.dart';
|
|||||||
import 'package:marco/controller/project_controller.dart';
|
import 'package:marco/controller/project_controller.dart';
|
||||||
import 'package:marco/helpers/widgets/my_custom_skeleton.dart';
|
import 'package:marco/helpers/widgets/my_custom_skeleton.dart';
|
||||||
import 'package:marco/view/employees/employee_detail_screen.dart';
|
import 'package:marco/view/employees/employee_detail_screen.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
import 'package:marco/helpers/utils/launcher_utils.dart';
|
import 'package:marco/helpers/utils/launcher_utils.dart';
|
||||||
import 'package:marco/view/employees/assign_employee_bottom_sheet.dart';
|
import 'package:marco/view/employees/assign_employee_bottom_sheet.dart';
|
||||||
import 'package:marco/controller/permission_controller.dart';
|
import 'package:marco/controller/permission_controller.dart';
|
||||||
|
@ -19,7 +19,7 @@ import 'package:marco/helpers/widgets/expense_detail_helpers.dart';
|
|||||||
import 'package:marco/helpers/widgets/my_spacing.dart';
|
import 'package:marco/helpers/widgets/my_spacing.dart';
|
||||||
import 'package:marco/helpers/widgets/my_text.dart';
|
import 'package:marco/helpers/widgets/my_text.dart';
|
||||||
import 'package:marco/helpers/services/storage/local_storage.dart';
|
import 'package:marco/helpers/services/storage/local_storage.dart';
|
||||||
import 'package:marco/model/employee_info.dart';
|
import 'package:marco/model/employees/employee_info.dart';
|
||||||
import 'package:timeline_tile/timeline_tile.dart';
|
import 'package:timeline_tile/timeline_tile.dart';
|
||||||
class ExpenseDetailScreen extends StatefulWidget {
|
class ExpenseDetailScreen extends StatefulWidget {
|
||||||
final String expenseId;
|
final String expenseId;
|
||||||
|
@ -6,7 +6,7 @@ import 'package:marco/helpers/utils/date_time_utils.dart';
|
|||||||
import 'package:marco/helpers/widgets/my_spacing.dart';
|
import 'package:marco/helpers/widgets/my_spacing.dart';
|
||||||
import 'package:marco/helpers/widgets/my_text.dart';
|
import 'package:marco/helpers/widgets/my_text.dart';
|
||||||
import 'package:marco/helpers/widgets/my_text_style.dart';
|
import 'package:marco/helpers/widgets/my_text_style.dart';
|
||||||
import 'package:marco/model/employee_model.dart';
|
import 'package:marco/model/employees/employee_model.dart';
|
||||||
import 'package:marco/model/expense/employee_selector_for_filter_bottom_sheet.dart';
|
import 'package:marco/model/expense/employee_selector_for_filter_bottom_sheet.dart';
|
||||||
|
|
||||||
class ExpenseFilterBottomSheet extends StatelessWidget {
|
class ExpenseFilterBottomSheet extends StatelessWidget {
|
||||||
|
@ -4,7 +4,7 @@ import 'package:marco/controller/layout/layout_controller.dart';
|
|||||||
import 'package:marco/helpers/widgets/my_responsive.dart';
|
import 'package:marco/helpers/widgets/my_responsive.dart';
|
||||||
import 'package:marco/helpers/widgets/my_text.dart';
|
import 'package:marco/helpers/widgets/my_text.dart';
|
||||||
import 'package:marco/helpers/services/storage/local_storage.dart';
|
import 'package:marco/helpers/services/storage/local_storage.dart';
|
||||||
import 'package:marco/model/employee_info.dart';
|
import 'package:marco/model/employees/employee_info.dart';
|
||||||
import 'package:marco/helpers/services/api_endpoints.dart';
|
import 'package:marco/helpers/services/api_endpoints.dart';
|
||||||
import 'package:marco/images.dart';
|
import 'package:marco/images.dart';
|
||||||
import 'package:marco/controller/project_controller.dart';
|
import 'package:marco/controller/project_controller.dart';
|
||||||
|
@ -12,7 +12,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/route_manager.dart';
|
import 'package:get/route_manager.dart';
|
||||||
import 'package:flutter_lucide/flutter_lucide.dart';
|
import 'package:flutter_lucide/flutter_lucide.dart';
|
||||||
import 'package:marco/helpers/services/storage/local_storage.dart';
|
import 'package:marco/helpers/services/storage/local_storage.dart';
|
||||||
import 'package:marco/model/employee_info.dart';
|
import 'package:marco/model/employees/employee_info.dart';
|
||||||
import 'package:marco/helpers/widgets/avatar.dart';
|
import 'package:marco/helpers/widgets/avatar.dart';
|
||||||
|
|
||||||
typedef LeftbarMenuFunction = void Function(String key);
|
typedef LeftbarMenuFunction = void Function(String key);
|
||||||
|
@ -13,7 +13,7 @@ import 'package:marco/widgets/custom_pop_menu.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_lucide/flutter_lucide.dart';
|
import 'package:flutter_lucide/flutter_lucide.dart';
|
||||||
import 'package:marco/helpers/services/storage/local_storage.dart';
|
import 'package:marco/helpers/services/storage/local_storage.dart';
|
||||||
import 'package:marco/model/employee_info.dart';
|
import 'package:marco/model/employees/employee_info.dart';
|
||||||
import 'package:marco/helpers/widgets/avatar.dart';
|
import 'package:marco/helpers/widgets/avatar.dart';
|
||||||
|
|
||||||
class TopBar extends StatefulWidget {
|
class TopBar extends StatefulWidget {
|
||||||
|
@ -7,7 +7,7 @@ import 'package:marco/helpers/widgets/my_card.dart';
|
|||||||
import 'package:marco/helpers/widgets/my_spacing.dart';
|
import 'package:marco/helpers/widgets/my_spacing.dart';
|
||||||
import 'package:marco/helpers/widgets/my_text.dart';
|
import 'package:marco/helpers/widgets/my_text.dart';
|
||||||
import 'package:flutter_lucide/flutter_lucide.dart';
|
import 'package:flutter_lucide/flutter_lucide.dart';
|
||||||
import 'package:marco/model/employee_info.dart';
|
import 'package:marco/model/employees/employee_info.dart';
|
||||||
import 'package:marco/helpers/widgets/avatar.dart';
|
import 'package:marco/helpers/widgets/avatar.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:marco/controller/auth/mpin_controller.dart';
|
import 'package:marco/controller/auth/mpin_controller.dart';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user