Compare commits

..

6 Commits

Author SHA1 Message Date
60f863962b revert b94b246731b755ceb0138acab7e1a02d220aefd3
revert Merge pull request 'Feature_Login' (#1) from Feature_Login into main

Reviewed-on: #1
2025-04-22 12:37:25 +00:00
b94b246731 Merge pull request 'Feature_Login' (#1) from Feature_Login into main
Reviewed-on: #1
2025-04-22 12:16:08 +00:00
753bfcad8a feat: Implement API service for project and employee management
- Added `ApiService` class for handling API requests related to projects and employees.
- Implemented methods to fetch projects and employees by project ID with JWT authentication.
- Enhanced `AuthService` to store JWT and refresh tokens upon user login.
- Updated `LocalStorage` to manage JWT and refresh tokens.
- Created models for `AttendanceModel`, `EmployeeModel`, and `ProjectModel` to structure data.
- Introduced `AttendanceScreen` for displaying attendance data with a new UI layout.
- Removed deprecated `attendance_screen.dart` and replaced it with `attendanceScreen.dart`.
- Updated routing to reflect the new attendance screen structure.
- Integrated geolocation and permission handling plugins for enhanced functionality.
- Updated dependencies in `pubspec.yaml` and `pubspec.lock` for new packages.
2025-04-21 17:45:54 +05:30
23cfebfc37 Update dependencies, improve login functionality, and enhance .gitignore
- Updated Android Gradle plugin version to 8.2.1
- Added new entries to .gitignore for better file management
- Changed dummy email and password in LoginController for testing
- Updated AuthService to handle login via API with improved error handling
- Modified User model to use username instead of email
- Enhanced login screen UI with better structure and design
- Registered new plugins in GeneratedPluginRegistrant.swift
- Updated package versions in pubspec.yaml and pubspec.lock
2025-04-17 17:47:34 +05:30
99902e743c Flutter application
- Created generated_plugin_registrant.cc and generated_plugin_registrant.h to manage plugin registration.
- Added generated_plugins.cmake for plugin configuration in CMake.
- Implemented CMakeLists.txt for the Windows runner, defining build settings and dependencies.
- Created Runner.rc for application resources including versioning and icons.
- Developed flutter_window.cpp and flutter_window.h to manage the Flutter window lifecycle.
- Implemented main.cpp as the entry point for the Windows application.
- Added resource.h for resource definitions.
- Included app icon in resources.
- Created runner.exe.manifest for application settings.
- Developed utils.cpp and utils.h for console management and command line argument handling.
- Implemented win32_window.cpp and win32_window.h for high DPI-aware window management.
2025-04-17 12:30:38 +05:30
54f0157576 revert 4b6f2bd86c8c8c9fb81edfbc8b9086e627037c71
revert added code, for adding the new cleaned code
2025-04-17 05:09:34 +00:00
223 changed files with 1384 additions and 6089 deletions

1
.gitignore vendored
View File

@ -9,7 +9,6 @@
.history
.svn/
migrate_working_dir/
android/app/.cxx/
# IntelliJ related
*.iml

View File

@ -1,4 +1,4 @@
# maxdash
# marco
A new Flutter project.

View File

@ -6,7 +6,7 @@ plugins {
}
android {
namespace = "com.example.maxdash"
namespace = "com.example.marco"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
@ -21,7 +21,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.maxdash"
applicationId = "com.example.marco"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion

View File

@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="Marco"
android:label="marco"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity

View File

@ -1,4 +1,4 @@
package com.example.maxdash
package com.example.marco
import io.flutter.embedding.android.FlutterActivity

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- <item android:drawable="?android:colorBackground" /> -->
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -18,7 +18,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.2.1" apply false
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

BIN
assets/logo/logo_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/logo/logo_light.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -368,7 +368,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.maxdash;
PRODUCT_BUNDLE_IDENTIFIER = com.example.marco;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
@ -384,7 +384,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.maxdash.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.example.marco.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -401,7 +401,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.maxdash.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.example.marco.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@ -416,7 +416,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.maxdash.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.example.marco.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@ -547,7 +547,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.maxdash;
PRODUCT_BUNDLE_IDENTIFIER = com.example.marco;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -569,7 +569,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.maxdash;
PRODUCT_BUNDLE_IDENTIFIER = com.example.marco;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Maxdash</string>
<string>Marco</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@ -13,7 +13,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>maxdash</string>
<string>marco</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>

View File

@ -1,28 +0,0 @@
import 'package:http/http.dart' as http;
import 'package:shared_preferences/shared_preferences.dart';
class ApiClient {
static final ApiClient instance = ApiClient('http://10.0.2.2:5032/api');
final String _baseUrl;
ApiClient(this._baseUrl);
Future<http.Response> get(String endpoint) async {
final prefs = await SharedPreferences.getInstance();
final token = prefs.getString('auth_token');
if (token == null) {
throw Exception('No token found. User might not be logged in.');
}
final url = '$_baseUrl/$endpoint';
print("Url received: $url");
final headers = {
'Authorization': 'Bearer $token',
'Content-Type': 'application/json',
};
return await http.get(Uri.parse(url), headers: headers);
}
}

View File

@ -1,22 +0,0 @@
import 'dart:convert';
import 'package:maxdash/api/api_client.dart';
class ApiService {
final ApiClient _apiClient = ApiClient.instance;
Future<dynamic> getProjectSummaries() async {
try {
final response = await _apiClient.get('project/list');
if (response.statusCode == 200) {
// print('Response body: ${response.body}'); // Parsed JSON
return jsonDecode(response.body);
} else {
throw Exception('Failed to load project summaries: ${response.statusCode}');
}
} catch (e) {
throw Exception('Error in getProjectSummaries: $e');
}
}
}

View File

@ -8,5 +8,5 @@ class AppConstant {
static int iOSAppVersion = 1;
static String version = "1.0.0";
static String get appName => 'MaxDash';
static String get appName => 'Marco';
}

View File

@ -1,118 +0,0 @@
import 'package:flutter/material.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
class CalendarController extends MyController {
late DataSource events;
final List<CalendarView> allowedViews = <CalendarView>[CalendarView.day, CalendarView.week, CalendarView.workWeek, CalendarView.month, CalendarView.schedule];
List<Appointment> appointmentCollection = <Appointment>[];
DateTime? selectedDate;
late Color selectedColor = Colors.red;
late TextEditingController titleTE, descriptionTE, locationTE;
List<Color> colorCollection = [
Colors.red,
Colors.blue,
Colors.green,
Colors.yellow,
Colors.pink,
Colors.purple,
Colors.brown,
Colors.orange,
Colors.teal,
Colors.indigo,
];
@override
void onInit() {
events = addAppointments();
selectedColor = colorCollection[0];
titleTE = TextEditingController(text: 'Title');
descriptionTE = TextEditingController(text: 'Description');
locationTE = TextEditingController(text: 'Location');
super.onInit();
}
void onSelectedColor(value) {
selectedColor = value;
update();
}
DataSource addAppointments() {
final DateTime today = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, DateTime.now().hour);
appointmentCollection
.add(Appointment(startTime: today.add(Duration(hours: 2)), endTime: today.add(Duration(hours: 3)), subject: 'Team Sync', color: Colors.blue));
appointmentCollection.add(Appointment(
startTime: today.add(Duration(days: 1, hours: 4)), endTime: today.add(Duration(days: 1, hours: 5)), subject: 'Product Demo', color: Colors.orange));
appointmentCollection.add(Appointment(
startTime: today.add(Duration(days: 2, hours: 6)),
endTime: today.add(Duration(days: 2, hours: 7)),
subject: 'Conference Call',
color: Colors.blueAccent));
appointmentCollection.add(Appointment(
startTime: today.add(Duration(days: 3, hours: 1)), endTime: today.add(Duration(days: 3, hours: 2)), subject: 'Workshop', color: Colors.yellow));
appointmentCollection.add(Appointment(
startTime: today.add(Duration(days: 4, hours: 9)),
endTime: today.add(Duration(days: 4, hours: 10)),
subject: 'Strategic Planning',
color: Colors.purpleAccent));
return DataSource(appointmentCollection);
}
void dragEnd(AppointmentDragEndDetails appointmentDragEndDetails) {
Appointment detail = appointmentDragEndDetails.appointment as Appointment;
Duration duration = detail.endTime.difference(detail.startTime);
DateTime start = DateTime(appointmentDragEndDetails.droppingTime!.year, appointmentDragEndDetails.droppingTime!.month,
appointmentDragEndDetails.droppingTime!.day, appointmentDragEndDetails.droppingTime!.hour, 0, 0);
final List<Appointment> appointment = <Appointment>[];
events.appointments!.remove(appointmentDragEndDetails.appointment);
events.notifyListeners(CalendarDataSourceAction.remove, <dynamic>[appointmentDragEndDetails.appointment]);
Appointment app = Appointment(
subject: detail.subject,
color: detail.color,
startTime: start,
endTime: start.add(duration),
);
appointment.add(app);
events.appointments!.add(appointment[0]);
events.notifyListeners(CalendarDataSourceAction.add, appointment);
}
void addEvent() {
final DateTime today = selectedDate ?? DateTime.now();
Appointment appointment = Appointment(
startTime: today,
endTime: today.add(Duration(hours: 1)),
color: selectedColor,
subject: descriptionTE.text,
);
appointmentCollection.add(appointment);
titleTE.clear();
descriptionTE.clear();
locationTE.clear();
events = DataSource(appointmentCollection);
update();
}
void onSelectDate(CalendarSelectionDetails calendarSelectionDetails) {
selectedDate = calendarSelectionDetails.date;
}
}
class DataSource extends CalendarDataSource {
DataSource(List<Appointment> source) {
appointments = source;
}
}

View File

@ -1,53 +0,0 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/model/chat_model.dart';
class ChatController extends MyController {
List<ChatModel> chat = [];
List<ChatModel> searchChat = [];
ChatModel? selectChat;
TextEditingController messageController = TextEditingController();
ScrollController? scrollController;
@override
void onInit() {
ChatModel.dummyList.then((value) {
chat = value;
searchChat = value;
selectChat = chat[0];
update();
});
scrollController = ScrollController();
super.onInit();
}
void onChangeChat(ChatModel selectSingleChat) {
selectChat = selectSingleChat;
update();
}
void onSearchChat(String query) {
final input = query.toLowerCase();
searchChat = chat.where((chat) => chat.firstName.toLowerCase().contains(input) || chat.messages.lastOrNull!.message.toLowerCase().contains(input)).toList();
update();
}
void sendMessage() {
if (messageController.value.text.isNotEmpty && selectChat != null) {
selectChat!.messages.add(ChatMessageModel(-1, messageController.text, DateTime.now(), true, ""));
messageController.clear();
scrollToBottom(isDelayed: true);
update();
}
}
scrollToBottom({bool isDelayed = false}) {
final int delay = isDelayed ? 400 : 0;
Future.delayed(Duration(milliseconds: delay), () {
scrollController!
.animateTo(scrollController!.position.maxScrollExtent, duration: const Duration(milliseconds: 500), curve: Curves.easeInOutCubicEmphasized);
});
}
}

View File

@ -1,86 +0,0 @@
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_form_validator.dart';
enum Status {
online,
offline,
draft;
const Status();
}
enum Category {
fashion,
grocery,
vegetables,
fruits,
electronics,
kids;
const Category();
}
class AddProductController extends MyController {
List<PlatformFile> files = [];
MyFormValidator basicValidator = MyFormValidator();
Status selectedGender = Status.online;
@override
void onInit() {
super.onInit();
basicValidator.addField(
'name',
label: "Product Name",
required: true,
controller: TextEditingController(),
);
basicValidator.addField(
'shop_name',
label: "shop_name",
required: true,
controller: TextEditingController(),
);
basicValidator.addField(
'description',
label: "description",
required: true,
controller: TextEditingController(),
);
basicValidator.addField(
'tags',
label: "Tags",
required: true,
controller: TextEditingController(),
);
}
bool showOnline = true;
void setOnlineType(bool value) {
showOnline = value;
update();
}
final List<String> categories = [];
void onChangeGender(Status? value) {
selectedGender = value ?? selectedGender;
update();
}
Future<void> pickFile() async {
var result = await FilePicker.platform.pickFiles();
if (result?.files[0] != null) {
files.add(result!.files[0]);
}
update();
}
void removeFile(PlatformFile file) {
files.remove(file);
update();
}
}

View File

@ -1,20 +0,0 @@
import 'package:get/get.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/model/customer.dart';
class CustomerController extends MyController {
List<Customer> customers = [];
@override
void onInit() {
super.onInit();
Customer.dummyList.then((value) {
customers = value;
update();
});
}
void goToDashboard() {
Get.toNamed('/dashboard/ecommerce');
}
}

View File

@ -1,20 +0,0 @@
import 'package:get/get.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/model/product_model.dart';
class ProductController extends MyController {
List<Product> product = [];
@override
void onInit() {
Product.dummyList.then((value) {
product = value;
update();
});
super.onInit();
}
void createProduct() {
Get.toNamed('/app/ecommerce/add_product');
}
}

View File

@ -1,79 +0,0 @@
import 'package:maxdash/controller/my_controller.dart';
class ProductDetailController extends MyController {
String selectedImage = "assets/dummy/single_product/single_product_1.png";
final Map<String, dynamic> product = {
"product_id": "12345",
"name": "Slim Fit Denim Jacket",
"description": "A stylish slim fit denim jacket for men. Perfect for casual outings and layering.",
"category": "Jackets",
"brand": "DenimCo",
"size": [
"S",
"M",
"L",
"XL",
],
"color": [
"Blue",
"Black",
"Grey",
],
"material": "Denim (100% Cotton)",
"price": 59.99,
"currency": "USD",
"available_stock": {
"S": 15,
"M": 20,
"L": 10,
"XL": 5,
},
"images": [
"assets/dummy/single_product/single_product_1.png",
"assets/dummy/single_product/single_product_2.png",
"assets/dummy/single_product/single_product_3.png",
"assets/dummy/single_product/single_product_4.png",
"assets/dummy/single_product/single_product_5.png",
"assets/dummy/single_product/single_product_6.png",
],
"rating": 4.5,
"reviews": [
{
"user": "john_doe",
"rating": 5,
"comment": "Great fit and quality! Really happy with this jacket.",
},
{
"user": "jane_smith",
"rating": 4,
"comment": "Good jacket but I wish it came in a larger size.",
}
],
"release_date": "2024-09-15",
"shipping_details": {
"weight": "1.2 kg",
"dimensions": "40 x 30 x 5 cm",
"shipping_cost": 4.99,
"delivery_time": "3-5 business days",
},
"discounts": {
"current_discount": 10,
"discount_type": "percentage",
"start_date": "2024-11-01",
"end_date": "2024-11-30",
},
"tags": [
"Casual",
"Men",
"Slim Fit",
"Denim",
"Jacket",
]
};
void onChangeImage(String image) {
selectedImage = image;
update();
}
}

View File

@ -1,19 +0,0 @@
import 'package:flutter_lucide/flutter_lucide.dart';
import 'package:maxdash/controller/my_controller.dart';
class FileManagerController extends MyController {
List<Map<String, dynamic>> indexFiles = [
{"name": "Documents", "icon": LucideIcons.folder},
{"name": "Photos", "icon": LucideIcons.image},
{"name": "Videos", "icon": LucideIcons.video},
{"name": "Shared", "icon": LucideIcons.users},
{"name": "Downloads", "icon": LucideIcons.download},
{"name": "Trash", "icon": LucideIcons.trash_2},
{"name": "Music", "icon": LucideIcons.music},
{"name": "Projects", "icon": LucideIcons.briefcase},
{"name": "Archives", "icon": LucideIcons.archive},
{"name": "Receipts", "icon": LucideIcons.file_text},
{"name": "Favorites", "icon": LucideIcons.star},
{"name": "Notes", "icon": LucideIcons.file_text}
];
}

View File

@ -1,75 +0,0 @@
import 'package:appflowy_board/appflowy_board.dart';
import 'package:flutter/material.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/images.dart';
class KanBanBoardController extends MyController {
final AppFlowyBoardController boardData = AppFlowyBoardController(
onMoveGroup: (fromGroupId, fromIndex, toGroupId, toIndex) {
debugPrint('Move item from $fromIndex to $toIndex');
},
onMoveGroupItem: (groupId, fromIndex, toIndex) {
debugPrint('Move $groupId:$fromIndex to $groupId:$toIndex');
},
onMoveGroupItemToGroup: (fromGroupId, fromIndex, toGroupId, toIndex) {
debugPrint('Move $fromGroupId:$fromIndex to $toGroupId:$toIndex');
},
);
late AppFlowyBoardScrollController boardController;
@override
void onInit() {
super.onInit();
final group1 = AppFlowyGroupData(
id: "Pending",
items: [
TextItem("10 Oct 2024", "Update Home Page UI", "Alice", Images.avatars[0]),
TextItem("12 Oct 2024", "Create Product Feature List", "Bob", Images.avatars[1]),
TextItem("15 Oct 2024", "Design Login Flow", "Clara", Images.avatars[2]),
],
name: 'Pending',
);
final group2 = AppFlowyGroupData(
id: "Ongoing",
items: [
TextItem("5 Nov 2024", "Refactor API Endpoints", "Daniel", Images.avatars[3]),
TextItem("10 Nov 2024", "Implement Push Notifications", "Eva", Images.avatars[4]),
],
name: 'Ongoing',
);
final group3 = AppFlowyGroupData(
id: "Completed",
items: [
TextItem("3 Oct 2024", "Develop Admin Dashboard", "Felix", Images.avatars[5]),
TextItem("8 Oct 2024", "Setup Continuous Integration", "Grace", Images.avatars[6]),
TextItem("14 Oct 2024", "Design Mobile App Icons", "Harry", Images.avatars[7]),
TextItem("18 Oct 2024", "Create User Guide", "Ivy", Images.avatars[8]),
],
name: 'Completed',
);
final group4 = AppFlowyGroupData(
id: "On Hold",
items: [
TextItem("1 Nov 2024", "Design Marketing Website", "Jack", Images.avatars[9]),
],
name: 'On Hold',
);
boardData.addGroup(group1);
boardData.addGroup(group2);
boardData.addGroup(group3);
boardData.addGroup(group4);
}
}
class TextItem extends AppFlowyGroupItem {
final String date, title, name, image;
TextItem(this.date, this.title, this.name, this.image);
@override
String get id => title;
}

View File

@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/services/auth_service.dart';
import 'package:maxdash/helpers/widgets/my_form_validator.dart';
import 'package:maxdash/helpers/widgets/my_validators.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/services/auth_service.dart';
import 'package:marco/helpers/widgets/my_form_validator.dart';
import 'package:marco/helpers/widgets/my_validators.dart';
class ForgotPasswordController extends MyController {
MyFormValidator basicValidator = MyFormValidator();

View File

@ -1,24 +1,54 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:maxdash/helpers/services/auth_service.dart';
import 'package:maxdash/helpers/widgets/my_form_validator.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/services/auth_service.dart';
import 'package:marco/helpers/widgets/my_form_validator.dart';
import 'package:marco/helpers/widgets/my_validators.dart';
class LoginController extends GetxController {
class LoginController extends MyController {
MyFormValidator basicValidator = MyFormValidator();
bool showPassword = false;
bool showPassword = false, isChecked = false;
final String _dummyEmail = "demo@example.com";
final String _dummyPassword = "1234567";
@override
void onInit() {
basicValidator.addField('username', required: true, label: "Username", controller: TextEditingController());
basicValidator.addField('password', required: true, label: "Password", controller: TextEditingController());
basicValidator.addField('email', required: true, label: "Email", validators: [MyEmailValidator()], controller: TextEditingController(text: _dummyEmail));
basicValidator.addField('password',
required: true, label: "Password", validators: [MyLengthValidator(min: 6, max: 10)], controller: TextEditingController(text: _dummyPassword));
super.onInit();
}
void onChangeCheckBox(bool? value) {
isChecked = value ?? isChecked;
update();
}
void onChangeShowPassword() {
showPassword = !showPassword;
update();
}
Future<void> onLogin() async {
if (basicValidator.validateForm()) {
update();
var errors = await AuthService.loginUser(basicValidator.getData());
if (errors != null) {
basicValidator.addErrors(errors);
basicValidator.validateForm();
basicValidator.clearErrors();
} else {
String nextUrl = Uri.parse(ModalRoute.of(Get.context!)?.settings.name ?? "").queryParameters['next'] ?? "/home";
Get.toNamed(nextUrl);
}
update();
}
}
void goToForgotPassword() {
Get.toNamed('/auth/forgot_password');
}
@ -26,47 +56,4 @@ class LoginController extends GetxController {
void gotoRegister() {
Get.offAndToNamed('/auth/register_account');
}
Future<void> onLogin() async {
if (basicValidator.validateForm()) {
final data = basicValidator.getData();
// Log the data being sent
print('Sending login request with data: $data');
// Show a loading dialog
Get.dialog(
Center(child: CircularProgressIndicator()),
barrierDismissible: false,
);
try {
// Call the AuthService to perform the login
final errors = await AuthService.loginUser(data);
print('Login errors: $errors');
// Close the loading dialog
Get.back();
if (errors != null) {
// Display errors if login fails
print('Login failed with errors: $errors');
basicValidator.addErrors(errors);
basicValidator.validateForm();
basicValidator.clearErrors();
} else {
// Navigate to the home screen on successful login
print('Login successful. Navigating to home...');
Get.offAllNamed('/home');
}
} catch (e) {
// Close the loading dialog in case of an exception
Get.back();
// Show a generic error message
print('Unexpected error: $e');
Get.snackbar('Error', 'An unexpected error occurred. Please try again.');
}
}
}
}

View File

@ -1,10 +1,10 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_form_validator.dart';
import 'package:maxdash/helpers/widgets/my_validators.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/widgets/my_form_validator.dart';
import 'package:marco/helpers/widgets/my_validators.dart';
import 'package:maxdash/helpers/services/auth_service.dart';
import 'package:marco/helpers/services/auth_service.dart';
class RegisterAccountController extends MyController {
MyFormValidator basicValidator = MyFormValidator();

View File

@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/services/auth_service.dart';
import 'package:maxdash/helpers/widgets/my_form_validator.dart';
import 'package:maxdash/helpers/widgets/my_validators.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/services/auth_service.dart';
import 'package:marco/helpers/widgets/my_form_validator.dart';
import 'package:marco/helpers/widgets/my_validators.dart';
class ResetPasswordController extends MyController {
MyFormValidator basicValidator = MyFormValidator();

View File

@ -1,6 +1,6 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/model/chart_model.dart';
import 'package:maxdash/model/visitor_by_channels_model.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/model/chart_model.dart';
import 'package:marco/model/visitor_by_channels_model.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
class AnalyticsController extends MyController {

View File

@ -0,0 +1,42 @@
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/widgets/my_text_utils.dart';
import 'package:marco/model/chart_model.dart';
import 'package:marco/model/job_recent_application_model.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
class AttendanceController extends MyController {
int isSelectedListingPerformanceTime = 0;
List<ChartSampleData>? chartData;
TooltipBehavior? columnToolTip;
List<JobRecentApplicationModel> recentApplication = [];
List<String> dummyTexts = List.generate(12, (index) => MyTextUtils.getDummyText(60));
@override
void onInit() {
chartData = <ChartSampleData>[
ChartSampleData(x: 'Jan', y: 4, secondSeriesYValue: 8),
ChartSampleData(x: 'Feb', y: 9, secondSeriesYValue: 7),
ChartSampleData(x: 'Mar', y: 6, secondSeriesYValue: 5),
ChartSampleData(x: 'Apr', y: 8, secondSeriesYValue: 3),
ChartSampleData(x: 'May', y: 7, secondSeriesYValue: 9),
ChartSampleData(x: 'Jun', y: 10, secondSeriesYValue: 6),
ChartSampleData(x: 'Jul', y: 5, secondSeriesYValue: 4),
ChartSampleData(x: 'Aug', y: 3, secondSeriesYValue: 2),
ChartSampleData(x: 'Sep', y: 6, secondSeriesYValue: 10),
ChartSampleData(x: 'Oct', y: 4, secondSeriesYValue: 8),
ChartSampleData(x: 'Nov', y: 9, secondSeriesYValue: 6),
ChartSampleData(x: 'Dec', y: 7, secondSeriesYValue: 5),
];
columnToolTip = TooltipBehavior(enable: true);
JobRecentApplicationModel.dummyList.then((value) {
recentApplication = value.sublist(0, 5);
update();
});
super.onInit();
}
void onSelectListingPerformanceTimeToggle(index) {
isSelectedListingPerformanceTime = index;
update();
}
}

View File

@ -1,6 +1,6 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/model/chart_model.dart';
import 'package:maxdash/model/lead_report_model.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/model/chart_model.dart';
import 'package:marco/model/lead_report_model.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
class CrmController extends MyController {

View File

@ -1,6 +1,6 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/model/chart_model.dart';
import 'package:maxdash/model/coin_growth_model.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/model/chart_model.dart';
import 'package:marco/model/coin_growth_model.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
class CryptoController extends MyController {

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/model/chart_model.dart';
import 'package:maxdash/model/product_order_modal.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/model/chart_model.dart';
import 'package:marco/model/product_order_modal.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
class EcommerceController extends MyController {

View File

@ -1,7 +1,7 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_text_utils.dart';
import 'package:maxdash/model/chart_model.dart';
import 'package:maxdash/model/job_recent_application_model.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/widgets/my_text_utils.dart';
import 'package:marco/model/chart_model.dart';
import 'package:marco/model/job_recent_application_model.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
class JobController extends MyController {

View File

@ -1,16 +1,13 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/model/chart_model.dart';
import 'package:maxdash/model/project_summary_model.dart';
import 'package:maxdash/model/task_list_model.dart';
import 'package:maxdash/model/ProjectSummaryApiModel.dart';
import 'package:maxdash/api/api_service.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/model/chart_model.dart';
import 'package:marco/model/project_summary_model.dart';
import 'package:marco/model/task_list_model.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
class ProjectController extends MyController {
TooltipBehavior? tooltipBehavior;
List<TaskListModel> task = [];
List<ProjectSummaryModel> projectSummary = []; // Dummy data (local)
List<ProjectSummaryApiModel> projectSummaryApiList = []; // API data
List<ProjectSummaryModel> projectSummary = [];
List<ChartSampleData>? chartData;
@override
@ -23,11 +20,6 @@ class ProjectController extends MyController {
projectSummary = value.sublist(0, 5);
update();
});
// Fetch project summary from API
fetchProjectSummariesFromApi();
// Dummy chart data
chartData = <ChartSampleData>[
ChartSampleData(x: 'Jan', y: 10, secondSeriesYValue: 8, thirdSeriesYValue: 12),
ChartSampleData(x: 'Feb', y: 5, secondSeriesYValue: 6, thirdSeriesYValue: 7),
@ -51,19 +43,4 @@ class ProjectController extends MyController {
task.isSelectTask = !task.isSelectTask;
update();
}
Future<void> fetchProjectSummariesFromApi() async {
try {
final response = await ApiService().getProjectSummaries();
if (response != null && response is List) {
projectSummaryApiList = response
.map<ProjectSummaryApiModel>((json) => ProjectSummaryApiModel.fromJson(json))
.toList();
update();
}
} catch (e) {
print('Error loading API project summaries: $e');
}
}
}

View File

@ -1,6 +1,6 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/model/chart_model.dart';
import 'package:maxdash/model/recent_order_model.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/model/chart_model.dart';
import 'package:marco/model/recent_order_model.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
class SalesController extends MyController {

View File

@ -1,7 +1,7 @@
import 'dart:async';
import 'package:get/get.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
class ComingSoonController extends MyController {
Timer? countdownTimer;

View File

@ -1,5 +1,5 @@
import 'package:get/get.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
class Error404Controller extends MyController {
void goToDashboardScreen() {

View File

@ -1,5 +1,5 @@
import 'package:get/get.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
class Error500Controller extends MyController {
void goToDashboardScreen() {

View File

@ -1,5 +1,5 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_text_utils.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/widgets/my_text_utils.dart';
class FaqsController extends MyController {
final List<bool> dataExpansionPanel = [true, false, false, false, false, false];

View File

@ -1,4 +1,4 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
class PricingController extends MyController {
bool isMonth = false;

View File

@ -1,6 +1,6 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_text_utils.dart';
import 'package:maxdash/model/time_line.dart';
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 = [];

View File

@ -1,157 +0,0 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/extensions/date_time_extension.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
enum Gender {
male,
female,
none;
const Gender();
}
enum TextFieldBorderType { outline, underline, none }
class BasicInputController extends MyController {
bool filled = false;
bool disabled = true;
bool readOnly = false;
bool helperText = false;
bool pilled = false;
bool inlineText = false;
bool prefixIcon = false;
bool suffixIcon = false;
FloatingLabelBehavior floatingLabelBehavior = FloatingLabelBehavior.always;
TextFieldBorderType borderType = TextFieldBorderType.outline;
DateTime? selectedDate;
TimeOfDay? selectedTime;
DateTimeRange? selectedDateTimeRange;
DateTime? selectedDateTime;
Gender selectedGender = Gender.male;
void onChangeLabelType(FloatingLabelBehavior value) {
floatingLabelBehavior = value;
update();
}
OutlineInputBorder? get inputBorder {
if (borderType == TextFieldBorderType.underline) {
return null;
}
if (borderType == TextFieldBorderType.none) {
return OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(pilled ? 30 : 8)),
borderSide: BorderSide.none);
}
return OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(pilled ? 30 : 8)),
);
}
void onChangedFilledChecked(bool? value) {
filled = value ?? filled;
update();
}
void onChangedDisabledChecked(bool? value) {
disabled = value ?? disabled;
update();
}
void onChangedReadOnlyChecked(bool? value) {
readOnly = value ?? readOnly;
update();
}
void onChangedHelperTextChecked(bool? value) {
helperText = value ?? helperText;
update();
}
void onChangedPilledChecked(bool? value) {
pilled = value ?? pilled;
update();
}
void onChangedInlineTextChecked(bool? value) {
inlineText = value ?? inlineText;
update();
}
void onChangedPrefixIconChecked(bool? value) {
prefixIcon = value ?? prefixIcon;
update();
}
void onChangedSuffixIconChecked(bool? value) {
suffixIcon = value ?? suffixIcon;
update();
}
void onChangeBorderType(TextFieldBorderType value) {
borderType = value;
if (borderType == TextFieldBorderType.none) {
filled = true;
}
update();
}
Future<void> pickDate() async {
final DateTime? picked = await showDatePicker(
context: Get.context!,
initialDate: selectedDate ?? DateTime.now(),
firstDate: DateTime(2015, 8),
lastDate: DateTime(2101));
if (picked != null && picked != selectedDate) {
selectedDate = picked;
update();
}
}
Future<void> pickTime() async {
final TimeOfDay? picked = await showTimePicker(
context: Get.context!, initialTime: selectedTime ?? TimeOfDay.now());
if (picked != null && picked != selectedTime) {
selectedTime = picked;
update();
}
}
Future<void> pickDateRange() async {
final DateTimeRange? picked = await showDateRangePicker(
context: Get.context!,
initialEntryMode: DatePickerEntryMode.input,
firstDate: DateTime(2015, 8),
lastDate: DateTime(2101));
if (picked != null && picked != selectedDateTimeRange) {
selectedDateTimeRange = picked;
update();
}
}
Future<void> pickDateTime() async {
final DateTime? pickedDate = await showDatePicker(
context: Get.context!,
initialDate: selectedDate ?? DateTime.now(),
firstDate: DateTime(2015, 8),
lastDate: DateTime(2101));
if (pickedDate != null) {
final TimeOfDay? pickedTime = await showTimePicker(
context: Get.context!, initialTime: selectedTime ?? TimeOfDay.now());
if (pickedTime != null) {
selectedDateTime = pickedDate.applied(pickedTime);
update();
}
}
}
void onChangeGender(Gender? value) {
selectedGender = value ?? selectedGender;
update();
}
}

View File

@ -1,39 +0,0 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_text_utils.dart';
enum Gender {
male,
female,
none;
const Gender();
}
class CustomOptionController extends MyController {
int selectRadioButton = 0;
int customRadioButton = 0;
int customImageRadioButton = 0;
Gender selectedGender = Gender.male;
List<String> dummyTexts = List.generate(
12, (index) => MyTextUtils.getDummyText(60, withEmoji: true));
void onChangeCustomButton(id) {
customRadioButton = id ?? customRadioButton;
update();
}
void onChangeCustomImageRadioButton(id) {
customImageRadioButton = id ?? customImageRadioButton;
update();
}
void onSelectButton(id) {
selectRadioButton = id ?? selectRadioButton;
update();
}
void onChangeGender(Gender? value) {
selectedGender = value ?? selectedGender;
update();
}
}

View File

@ -1,6 +0,0 @@
import 'package:flutter_quill/flutter_quill.dart';
import 'package:maxdash/controller/my_controller.dart';
class EditorController extends MyController {
QuillController quillController = QuillController.basic();
}

View File

@ -1,27 +0,0 @@
import 'package:file_picker/file_picker.dart';
import 'package:maxdash/controller/my_controller.dart';
class FileUploadController extends MyController {
List<PlatformFile> files = [];
List<PlatformFile> multipleFiles = [];
bool selectMultipleFile = false;
FileType type = FileType.any;
Future<void> pickFiles() async {
var result = await FilePicker.platform.pickFiles(allowMultiple: selectMultipleFile, type: type);
if (result?.files.isNotEmpty ?? false) {
files.addAll(result!.files);
}
update();
}
void onSelectMultipleFile(value) {
selectMultipleFile = value ?? selectMultipleFile;
update();
}
void removeFile(PlatformFile file) {
files.remove(file);
update();
}
}

View File

@ -1,3 +0,0 @@
import 'package:maxdash/controller/my_controller.dart';
class MaskController extends MyController {}

View File

@ -1,13 +0,0 @@
import 'package:maxdash/controller/my_controller.dart';
class SliderController extends MyController {
double labelSliderValue = 50;
double tickSliderValue = 0;
double dividerSliderValue = 50;
DateTime yearValue = DateTime(2017, 01, 01);
DateTime hourValue = DateTime(2020, 01, 01, 13, 00, 00);
DateTime dateValue = DateTime(2016, 1, 01);
double stepSliderValue = 0;
}

View File

@ -1,51 +0,0 @@
import 'package:maxdash/controller/forms/basic_input_controller.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_field_validator.dart';
import 'package:maxdash/helpers/widgets/my_form_validator.dart';
import 'package:maxdash/helpers/widgets/my_validators.dart';
import 'package:flutter/material.dart';
class GenderValidator extends MyFieldValidatorRule<Gender> {
@override
String? validate(Gender? value, bool required, Map<String, dynamic> data) {
return null;
}
}
class ValidationController extends MyController {
MyFormValidator basicValidator = MyFormValidator();
ValidationController() {
basicValidator.addField('full_name',
required: true,
label: "Full Name",
controller: TextEditingController());
basicValidator.addField('email',
required: true,
label: "Email",
validators: [MyEmailValidator()],
controller: TextEditingController());
basicValidator.addField('password',
required: true,
label: "Password",
validators: [MyLengthValidator(min: 6, max: 10)],
controller: TextEditingController());
basicValidator.addField(
'gender',
required: true,
label: "Gender",
validators: [GenderValidator()],
);
}
void onSubmitBasicForm() {
basicValidator.validateForm();
}
void onResetBasicForm() {
basicValidator.resetForm();
}
}

View File

@ -1,3 +1,3 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
class AuthLayout2Controller extends MyController {}

View File

@ -1,7 +1,7 @@
import 'dart:async';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_text_utils.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/widgets/my_text_utils.dart';
import 'package:flutter/material.dart';
class AuthLayoutController extends MyController {

View File

@ -1,4 +1,4 @@
import 'package:maxdash/helpers/theme/theme_customizer.dart';
import 'package:marco/helpers/theme/theme_customizer.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

View File

@ -1,5 +1,5 @@
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:maxdash/helpers/theme/theme_customizer.dart';
import 'package:marco/helpers/theme/theme_customizer.dart';
abstract class MyController extends GetxController {
@override

View File

@ -1,10 +1,10 @@
import 'dart:math';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/extensions/string.dart';
import 'package:maxdash/helpers/widgets/my_text_utils.dart';
import 'package:maxdash/model/visitor_by_channels_model.dart';
import 'package:maxdash/view/other/basic_table_screen.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/extensions/string.dart';
import 'package:marco/helpers/widgets/my_text_utils.dart';
import 'package:marco/model/visitor_by_channels_model.dart';
import 'package:marco/view/other/basic_table_screen.dart';
import 'package:flutter/material.dart';
class BasicTableController extends MyController {

View File

@ -1,5 +1,5 @@
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
class GoogleMapScreenController extends MyController {
late GoogleMapController mapController;

View File

@ -1,6 +1,6 @@
import 'dart:async';
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:syncfusion_flutter_maps/maps.dart';

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/model/chart_model.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/model/chart_model.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
import 'dart:ui' as ui;

View File

@ -1,4 +1,4 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
class ButtonsController extends MyController {
List<bool> selected = List.filled(3, false);

View File

@ -1,7 +1,7 @@
import 'dart:async';
import 'package:carousel_slider/carousel_controller.dart';
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:flutter/material.dart';
class CarouselsController extends MyController {

View File

@ -1,5 +1,5 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_text_utils.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/widgets/my_text_utils.dart';
class DialogsController extends MyController {
List<String> dummyTexts =

View File

@ -1,7 +1,7 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_text_utils.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/widgets/my_text_utils.dart';
import 'package:flutter/material.dart';
import 'package:maxdash/model/drag_n_drop_model.dart';
import 'package:marco/model/drag_n_drop_model.dart';
class DragNDropController extends MyController {
List<DragNDropModel> dragNDrop = [];

View File

@ -1,3 +1,3 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
class LoadersController extends MyController {}

View File

@ -1,5 +1,5 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_text_utils.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/widgets/my_text_utils.dart';
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';

View File

@ -1,10 +1,10 @@
import 'dart:async';
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/extensions/string.dart';
import 'package:maxdash/helpers/theme/admin_theme.dart';
import 'package:maxdash/helpers/widgets/my_button.dart';
import 'package:maxdash/helpers/widgets/my_spacing.dart';
import 'package:maxdash/helpers/widgets/my_text.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/extensions/string.dart';
import 'package:marco/helpers/theme/admin_theme.dart';
import 'package:marco/helpers/widgets/my_button.dart';
import 'package:marco/helpers/widgets/my_spacing.dart';
import 'package:marco/helpers/widgets/my_text.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_lucide/flutter_lucide.dart';

View File

@ -1,5 +1,5 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:maxdash/helpers/widgets/my_text_utils.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:marco/helpers/widgets/my_text_utils.dart';
import 'package:flutter/material.dart';
class TabsController extends MyController {

View File

@ -1,4 +1,4 @@
import 'package:maxdash/controller/my_controller.dart';
import 'package:marco/controller/my_controller.dart';
import 'package:flutter/material.dart';
class ToastMessageController extends MyController {

View File

@ -1,5 +1,5 @@
import 'package:maxdash/helpers/services/localizations/language.dart';
import 'package:maxdash/helpers/theme/app_notifier.dart';
import 'package:marco/helpers/services/localizations/language.dart';
import 'package:marco/helpers/theme/app_notifier.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

View File

@ -1,5 +1,5 @@
import 'dart:ui';
import 'package:maxdash/helpers/services/localizations/translator.dart';
import 'package:marco/helpers/services/localizations/translator.dart';
extension StringUtil on String {
Color get toColor {

View File

@ -1,46 +1,22 @@
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:shared_preferences/shared_preferences.dart';
import 'package:marco/helpers/services/storage/local_storage.dart';
import 'package:marco/model/user.dart';
class AuthService {
static const String baseUrl = 'https://api.marcoaiot.com/api';
static bool isLoggedIn = false;
static Future<Map<String, String>?> loginUser(Map<String, dynamic> data) async {
try {
print('Sending login request with data: $data');
static User get dummyUser => User(-1, "demo@example.com", "Denish", "Navadiya");
// Make the API call
final response = await http.post(
Uri.parse('$baseUrl/Auth/login'),
headers: {'Content-Type': 'application/json'},
body: jsonEncode(data),
);
print('Response received: ${response.body}');
if (response.statusCode == 200) {
final responseData = jsonDecode(response.body);
// Extract the token from the "data" field
final token = responseData['data']?['token']; // Adjust based on your API response
if (token != null) {
// Save the token locally
final prefs = await SharedPreferences.getInstance();
await prefs.setString('auth_token', token);
isLoggedIn = true;
return null; // No errors
} else {
return {'error': 'Token not found in response'};
}
} else {
final responseData = jsonDecode(response.body);
return {'error': responseData['message'] ?? 'Invalid response from server'};
}
} catch (e) {
print('Unexpected error: $e');
return {'error': 'Unexpected error: $e'};
static Future<Map<String, String>?> loginUser(
Map<String, dynamic> data) async {
await Future.delayed(Duration(seconds: 1));
if (data['email'] != dummyUser.email) {
return {"email": "This email is not registered"};
} else if (data['password'] != "1234567") {
return {"password": "Password is incorrect"};
}
isLoggedIn = true;
await LocalStorage.setLoggedInUser(true);
return null;
}
}
}

View File

@ -1,5 +1,5 @@
import 'package:maxdash/helpers/services/storage/local_storage.dart';
import 'package:maxdash/helpers/theme/theme_customizer.dart';
import 'package:marco/helpers/services/storage/local_storage.dart';
import 'package:marco/helpers/theme/theme_customizer.dart';
import 'package:flutter/material.dart';
class Language {

View File

@ -1,7 +1,7 @@
import 'dart:convert';
import 'dart:developer';
import 'package:maxdash/helpers/services/localizations/language.dart';
import 'package:marco/helpers/services/localizations/language.dart';
import 'package:flutter/services.dart';
import 'package:get/get_utils/src/extensions/string_extensions.dart';
import 'package:shared_preferences/shared_preferences.dart';

View File

@ -1,6 +1,6 @@
import 'package:maxdash/helpers/services/auth_service.dart';
import 'package:maxdash/helpers/services/localizations/language.dart';
import 'package:maxdash/helpers/theme/theme_customizer.dart';
import 'package:marco/helpers/services/auth_service.dart';
import 'package:marco/helpers/services/localizations/language.dart';
import 'package:marco/helpers/theme/theme_customizer.dart';
import 'package:shared_preferences/shared_preferences.dart';
class LocalStorage {

View File

@ -11,6 +11,6 @@ class UrlService {
static getCurrentUrl() {
var path = Uri.base.path;
return path.replaceAll('maxdash/web/', '');
return path.replaceAll('marco/web/', '');
}
}

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:maxdash/helpers/theme/theme_customizer.dart';
import 'package:marco/helpers/theme/theme_customizer.dart';
enum LeftBarThemeType { light, dark }

View File

@ -1,8 +1,8 @@
import 'package:maxdash/helpers/services/localizations/language.dart';
import 'package:maxdash/helpers/services/storage/local_storage.dart';
import 'package:maxdash/helpers/theme/app_theme.dart';
import 'package:maxdash/helpers/theme/theme_customizer.dart';
import 'package:maxdash/helpers/widgets/my.dart';
import 'package:marco/helpers/services/localizations/language.dart';
import 'package:marco/helpers/services/storage/local_storage.dart';
import 'package:marco/helpers/theme/app_theme.dart';
import 'package:marco/helpers/theme/theme_customizer.dart';
import 'package:marco/helpers/widgets/my.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

View File

@ -6,13 +6,13 @@
* */
import 'dart:io';
import 'dart:math';
import 'package:maxdash/helpers/theme/admin_theme.dart';
import 'package:maxdash/helpers/theme/theme_customizer.dart';
import 'package:maxdash/helpers/widgets/my.dart';
import 'package:maxdash/helpers/widgets/my_breadcrumb_item.dart';
import 'package:maxdash/helpers/widgets/my_constant.dart';
import 'package:maxdash/helpers/widgets/my_screen_media.dart';
import 'package:maxdash/helpers/widgets/my_text_style.dart';
import 'package:marco/helpers/theme/admin_theme.dart';
import 'package:marco/helpers/theme/theme_customizer.dart';
import 'package:marco/helpers/widgets/my.dart';
import 'package:marco/helpers/widgets/my_breadcrumb_item.dart';
import 'package:marco/helpers/widgets/my_constant.dart';
import 'package:marco/helpers/widgets/my_screen_media.dart';
import 'package:marco/helpers/widgets/my_text_style.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
@ -230,7 +230,7 @@ class AppStyle {
containerRadius: AppStyle.containerRadius.medium,
cardRadius: AppStyle.cardRadius.medium,
buttonRadius: AppStyle.buttonRadius.medium,
defaultBreadCrumbItem: MyBreadcrumbItem(name: 'MaxDash', route: '/client/home'),
defaultBreadCrumbItem: MyBreadcrumbItem(name: 'Marco', route: '/client/home'),
));
bool isMobile = true;
try {

View File

@ -1,12 +1,12 @@
import 'dart:convert';
import 'package:maxdash/helpers/services/json_decoder.dart';
import 'package:maxdash/helpers/services/localizations/language.dart';
import 'package:maxdash/helpers/services/localizations/translator.dart';
import 'package:maxdash/helpers/services/navigation_services.dart';
import 'package:maxdash/helpers/theme/admin_theme.dart';
import 'package:maxdash/helpers/theme/app_notifier.dart';
import 'package:maxdash/helpers/theme/app_theme.dart';
import 'package:marco/helpers/services/json_decoder.dart';
import 'package:marco/helpers/services/localizations/language.dart';
import 'package:marco/helpers/services/localizations/translator.dart';
import 'package:marco/helpers/services/navigation_services.dart';
import 'package:marco/helpers/theme/admin_theme.dart';
import 'package:marco/helpers/theme/app_notifier.dart';
import 'package:marco/helpers/theme/app_theme.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

View File

@ -1,7 +1,7 @@
import 'package:maxdash/helpers/theme/admin_theme.dart';
import 'package:maxdash/helpers/theme/app_theme.dart';
import 'package:maxdash/helpers/widgets/my_dashed_divider.dart';
import 'package:maxdash/helpers/widgets/my_navigation_mixin.dart';
import 'package:marco/helpers/theme/admin_theme.dart';
import 'package:marco/helpers/theme/app_theme.dart';
import 'package:marco/helpers/widgets/my_dashed_divider.dart';
import 'package:marco/helpers/widgets/my_navigation_mixin.dart';
import 'package:flutter/material.dart';
mixin UIMixin {

View File

@ -1,4 +1,4 @@
import 'package:maxdash/helpers/extensions/date_time_extension.dart';
import 'package:marco/helpers/extensions/date_time_extension.dart';
class Utils {
static getDateStringFromDateTime(DateTime dateTime,

Some files were not shown because too many files have changed in this diff Show More