Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conduct tracker UI clean architecture #13

Merged
merged 4 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contacts_app/.dart_tool/package_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
"languageVersion": "2.19"
}
],
"generated": "2024-12-25T05:25:15.542922Z",
"generated": "2024-12-25T13:42:55.063839Z",
"generator": "pub",
"generatorVersion": "3.6.0",
"flutterRoot": "file:///C:/Users/butte/OneDrive/Documents/flutter",
Expand Down
2 changes: 1 addition & 1 deletion contacts_app/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"contacts_service","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\contacts_service-0.6.3\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_apple-9.1.4\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"contacts_service","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\contacts_service-0.6.3\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_android-10.3.6\\\\","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[{"name":"permission_handler_windows","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_windows-0.1.3\\\\","native_build":true,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"contacts_service","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]}],"date_created":"2024-12-25 13:25:15.639258","version":"3.27.1","swift_package_manager_enabled":false}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"contacts_service","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\contacts_service-0.6.3\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_apple-9.1.4\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"contacts_service","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\contacts_service-0.6.3\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_android-10.3.6\\\\","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[{"name":"permission_handler_windows","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_windows-0.1.3\\\\","native_build":true,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"contacts_service","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]}],"date_created":"2024-12-25 21:42:55.183003","version":"3.27.1","swift_package_manager_enabled":false}
2 changes: 1 addition & 1 deletion firebase_project_1/.dart_tool/package_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
"languageVersion": "2.19"
}
],
"generated": "2024-12-25T05:25:17.098860Z",
"generated": "2024-12-25T13:42:56.972169Z",
"generator": "pub",
"generatorVersion": "3.6.0",
"flutterRoot": "file:///C:/Users/butte/OneDrive/Documents/flutter",
Expand Down
2 changes: 1 addition & 1 deletion firebase_project_1/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"cloud_firestore","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\cloud_firestore-4.14.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_auth-4.16.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_core-2.24.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"cloud_firestore","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\cloud_firestore-4.14.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_auth-4.16.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_core-2.24.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.9\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"cloud_firestore","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\cloud_firestore-4.14.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_auth-4.16.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_core-2.24.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"cloud_firestore","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\cloud_firestore-4.14.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_auth-4.16.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_core-2.24.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.3.0\\\\","native_build":false,"dependencies":[]}],"web":[{"name":"cloud_firestore_web","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\cloud_firestore_web-3.9.0\\\\","dependencies":["firebase_core_web"]},{"name":"firebase_auth_web","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_auth_web-5.8.13\\\\","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_core_web-2.10.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"cloud_firestore","dependencies":["cloud_firestore_web","firebase_core"]},{"name":"cloud_firestore_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2024-12-25 13:25:17.258997","version":"3.27.1","swift_package_manager_enabled":false}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"cloud_firestore","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\cloud_firestore-4.14.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_auth-4.16.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_core-2.24.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"cloud_firestore","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\cloud_firestore-4.14.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_auth-4.16.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_core-2.24.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.9\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"cloud_firestore","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\cloud_firestore-4.14.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_auth-4.16.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_core-2.24.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"cloud_firestore","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\cloud_firestore-4.14.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_auth-4.16.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_core-2.24.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.3.0\\\\","native_build":false,"dependencies":[]}],"web":[{"name":"cloud_firestore_web","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\cloud_firestore_web-3.9.0\\\\","dependencies":["firebase_core_web"]},{"name":"firebase_auth_web","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_auth_web-5.8.13\\\\","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","path":"C:\\\\Users\\\\butte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\firebase_core_web-2.10.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"cloud_firestore","dependencies":["cloud_firestore_web","firebase_core"]},{"name":"cloud_firestore_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2024-12-25 21:42:57.120002","version":"3.27.1","swift_package_manager_enabled":false}
2 changes: 1 addition & 1 deletion firebase_project_2/.dart_tool/package_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@
"languageVersion": "2.19"
}
],
"generated": "2024-12-25T05:25:20.221695Z",
"generated": "2024-12-25T13:43:00.326167Z",
"generator": "pub",
"generatorVersion": "3.6.0",
"flutterRoot": "file:///C:/Users/butte/OneDrive/Documents/flutter",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:flutter/material.dart';

class Conduct {
final String id;
final String conductName;
Expand All @@ -6,18 +8,73 @@ class Conduct {
final String startTime;
final String endTime;
final List<String> participants;
final List<String> nonParticipants; // Add this
final List<String> nonParticipants;
final Map<String, String> soldierReason;

Conduct({
const Conduct({
required this.id,
required this.conductName,
required this.conductType,
required this.startDate,
required this.startTime,
required this.endTime,
required this.participants,
required this.nonParticipants, // Add this
required this.nonParticipants,
required this.soldierReason,
});

static IconData getIconForConductType(String conductType) {
switch (conductType.toLowerCase()) {
case 'run':
return Icons.directions_run_rounded;
case 's&p':
return Icons.fitness_center_rounded;
case 'imt':
return Icons.gps_fixed_rounded;
case 'atp':
return Icons.adjust_rounded;
case 'ippt':
return Icons.military_tech_rounded;
case 'soc':
return Icons.park_rounded;
case 'metabolic circuit':
return Icons.flash_on_rounded;
case 'combat circuit':
return Icons.shield_rounded;
case 'route march':
return Icons.hiking_rounded;
case 'outfield':
return Icons.forest_rounded;
default:
return Icons.event_rounded;
}
}

Map<String, dynamic> toMap() {
return {
'id': id,
'conductName': conductName,
'conductType': conductType,
'startDate': startDate,
'startTime': startTime,
'endTime': endTime,
'participants': participants,
'nonParticipants': nonParticipants,
'soldierReason': soldierReason,
};
}

factory Conduct.fromMap(Map<String, dynamic> map) {
return Conduct(
id: map['id'] ?? '',
conductName: map['conductName'] ?? '',
conductType: map['conductType'] ?? '',
startDate: map['startDate'] ?? '',
startTime: map['startTime'] ?? '',
endTime: map['endTime'] ?? '',
participants: List<String>.from(map['participants'] ?? []),
nonParticipants: List<String>.from(map['nonParticipants'] ?? []),
soldierReason: Map<String, String>.from(map['soldierReason'] ?? {}),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ class FilterParticipantsUseCase {
final Map<String, List<String>> conductTypeRestrictions = {
'run': ['Ex RMJ', 'Ex Lower Limb', 'LD'],
'route march': [
'Ex RMJ', 'Ex Heavy Loads', 'Ex Lower Limbs', 'LD',
'Ex RMJ', 'Ex Heavy Loads', 'Ex Lower Limb', 'LD',
'Ex Uniform', 'Ex Boots', 'Ex FLEGs',
],
'ippt': [
'Ex Upper Limb', 'LD', 'Ex Lower Limb', 'Ex RMJ',
'Ex Pushup', 'Ex Situp'
],
'outfield': [
'Ex Sunlight', 'Ex grass', 'Ex Outfield',
'Ex Sunlight', 'Ex Grass', 'Ex Outfield',
'Ex Uniform', 'Ex Boots'
],
'metabolic circuit': [
Expand Down
Loading