Merge branch 'dev' into 312-feature-integrate-google-maps-places-autocomplete-for-hub-address-validation

This commit is contained in:
Achintha Isuru
2026-01-30 12:31:27 -05:00
19 changed files with 161 additions and 91 deletions

View File

@@ -30,11 +30,21 @@ public final class GeneratedPluginRegistrant {
} catch (Exception e) {
Log.e(TAG, "Error registering plugin firebase_core, io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin", e);
}
try {
flutterEngine.getPlugins().add(new com.baseflow.geolocator.GeolocatorPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin geolocator_android, com.baseflow.geolocator.GeolocatorPlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e);
}
try {
flutterEngine.getPlugins().add(new com.baseflow.permissionhandler.PermissionHandlerPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin permission_handler_android, com.baseflow.permissionhandler.PermissionHandlerPlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
} catch (Exception e) {

View File

@@ -24,6 +24,18 @@
@import firebase_core;
#endif
#if __has_include(<geolocator_apple/GeolocatorPlugin.h>)
#import <geolocator_apple/GeolocatorPlugin.h>
#else
@import geolocator_apple;
#endif
#if __has_include(<permission_handler_apple/PermissionHandlerPlugin.h>)
#import <permission_handler_apple/PermissionHandlerPlugin.h>
#else
@import permission_handler_apple;
#endif
#if __has_include(<shared_preferences_foundation/SharedPreferencesPlugin.h>)
#import <shared_preferences_foundation/SharedPreferencesPlugin.h>
#else
@@ -36,6 +48,8 @@
[FLTFirebaseAppCheckPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAppCheckPlugin"]];
[FLTFirebaseAuthPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAuthPlugin"]];
[FLTFirebaseCorePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseCorePlugin"]];
[GeolocatorPlugin registerWithRegistrar:[registry registrarForPlugin:@"GeolocatorPlugin"]];
[PermissionHandlerPlugin registerWithRegistrar:[registry registrarForPlugin:@"PermissionHandlerPlugin"]];
[SharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"SharedPreferencesPlugin"]];
}

View File

@@ -8,11 +8,13 @@ import Foundation
import firebase_app_check
import firebase_auth
import firebase_core
import geolocator_apple
import shared_preferences_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseAppCheckPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAppCheckPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
}

View File

@@ -8,10 +8,16 @@
#include <firebase_auth/firebase_auth_plugin_c_api.h>
#include <firebase_core/firebase_core_plugin_c_api.h>
#include <geolocator_windows/geolocator_windows.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
FirebaseAuthPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi"));
FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
}

View File

@@ -5,6 +5,8 @@
list(APPEND FLUTTER_PLUGIN_LIST
firebase_auth
firebase_core
geolocator_windows
permission_handler_windows
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST

View File

@@ -1,9 +1,8 @@
import 'package:krow_data_connect/krow_data_connect.dart';
import 'package:krow_data_connect/krow_data_connect.dart' as dc;
import 'package:firebase_data_connect/firebase_data_connect.dart';
import 'package:krow_data_connect/src/session/staff_session_store.dart';
import '../../domain/repositories/availability_repository.dart';
import '../../domain/entities/day_availability.dart';
import '../../domain/entities/availability_slot.dart' as local_slot;
import 'package:krow_domain/krow_domain.dart';
/// Implementation of [AvailabilityRepository].
@@ -41,10 +40,10 @@ class AvailabilityRepositoryImpl implements AvailabilityRepository {
DateTime start, DateTime end) async {
// 1. Fetch Weekly Template from Backend
Map<DayOfWeek, Map<AvailabilitySlot, bool>> weeklyTemplate = {};
Map<dc.DayOfWeek, Map<dc.AvailabilitySlot, bool>> weeklyTemplate = {};
try {
final response = await ExampleConnector.instance
final response = await dc.ExampleConnector.instance
.getStaffAvailabilityStatsByStaffId(staffId: _currentStaffId)
.execute();
@@ -62,7 +61,7 @@ class AvailabilityRepositoryImpl implements AvailabilityRepository {
// The snippet showed `listStaffAvailabilityStats`.
// Let's try to infer from the code I saw earlier.
// `ExampleConnector.instance.listStaffAvailabilitiesByStaffId` was used.
// `dc.ExampleConnector.instance.listStaffAvailabilitiesByStaffId` was used.
// If that produced an error "Method not defined", I should fix it.
// But the error log didn't show "Method not defined" for `listStaffAvailabilitiesByStaffId`.
// It showed mismatch in return types of `getAvailability`.
@@ -92,7 +91,7 @@ class AvailabilityRepositoryImpl implements AvailabilityRepository {
// final slotEnum = _mapStringToSlotEnum(def['id']!);
// final isSlotAvailable = daySlotsMap[slotEnum] ?? false; // Default false if not set
return local_slot.AvailabilitySlot(
return AvailabilitySlot(
id: def['id']!,
label: def['label']!,
timeRange: def['timeRange']!,
@@ -141,7 +140,7 @@ class AvailabilityRepositoryImpl implements AvailabilityRepository {
}
final slots = _slotDefinitions.map((def) {
return local_slot.AvailabilitySlot(
return AvailabilitySlot(
id: def['id']!,
label: def['label']!,
timeRange: def['timeRange']!,
@@ -160,25 +159,25 @@ class AvailabilityRepositoryImpl implements AvailabilityRepository {
// --- Helpers ---
DayOfWeek _mapDateTimeToDayOfWeek(int weekday) {
switch (weekday) {
case DateTime.monday: return DayOfWeek.MONDAY;
case DateTime.tuesday: return DayOfWeek.TUESDAY;
case DateTime.wednesday: return DayOfWeek.WEDNESDAY;
case DateTime.thursday: return DayOfWeek.THURSDAY;
case DateTime.friday: return DayOfWeek.FRIDAY;
case DateTime.saturday: return DayOfWeek.SATURDAY;
case DateTime.sunday: return DayOfWeek.SUNDAY;
default: return DayOfWeek.MONDAY;
dc.DayOfWeek _mapDateTimeToDayOfWeek(DateTime date) {
switch (date.weekday) {
case DateTime.monday: return dc.DayOfWeek.MONDAY;
case DateTime.tuesday: return dc.DayOfWeek.TUESDAY;
case DateTime.wednesday: return dc.DayOfWeek.WEDNESDAY;
case DateTime.thursday: return dc.DayOfWeek.THURSDAY;
case DateTime.friday: return dc.DayOfWeek.FRIDAY;
case DateTime.saturday: return dc.DayOfWeek.SATURDAY;
case DateTime.sunday: return dc.DayOfWeek.SUNDAY;
default: return dc.DayOfWeek.MONDAY;
}
}
AvailabilitySlot _mapStringToSlotEnum(String id) {
dc.AvailabilitySlot _mapStringToSlotEnum(String id) {
switch (id.toLowerCase()) {
case 'morning': return AvailabilitySlot.MORNING;
case 'afternoon': return AvailabilitySlot.AFTERNOON;
case 'evening': return AvailabilitySlot.EVENING;
default: return AvailabilitySlot.MORNING;
case 'morning': return dc.AvailabilitySlot.MORNING;
case 'afternoon': return dc.AvailabilitySlot.AFTERNOON;
case 'evening': return dc.AvailabilitySlot.EVENING;
default: return dc.AvailabilitySlot.MORNING;
}
}
}

View File

@@ -1,32 +0,0 @@
import 'package:equatable/equatable.dart';
class AvailabilitySlot extends Equatable {
final String id;
final String label;
final String timeRange;
final bool isAvailable;
const AvailabilitySlot({
required this.id,
required this.label,
required this.timeRange,
this.isAvailable = false,
});
AvailabilitySlot copyWith({
String? id,
String? label,
String? timeRange,
bool? isAvailable,
}) {
return AvailabilitySlot(
id: id ?? this.id,
label: label ?? this.label,
timeRange: timeRange ?? this.timeRange,
isAvailable: isAvailable ?? this.isAvailable,
);
}
@override
List<Object?> get props => [id, label, timeRange, isAvailable];
}

View File

@@ -1,29 +0,0 @@
import 'package:equatable/equatable.dart';
import 'availability_slot.dart';
class DayAvailability extends Equatable {
final DateTime date;
final bool isAvailable;
final List<AvailabilitySlot> slots;
const DayAvailability({
required this.date,
this.isAvailable = false,
this.slots = const [],
});
DayAvailability copyWith({
DateTime? date,
bool? isAvailable,
List<AvailabilitySlot>? slots,
}) {
return DayAvailability(
date: date ?? this.date,
isAvailable: isAvailable ?? this.isAvailable,
slots: slots ?? this.slots,
);
}
@override
List<Object?> get props => [date, isAvailable, slots];
}

View File

@@ -1,4 +1,4 @@
import '../entities/day_availability.dart';
import 'package:krow_domain/krow_domain.dart';
abstract class AvailabilityRepository {
/// Fetches availability for a given date range (usually a week).

View File

@@ -1,5 +1,5 @@
import 'package:krow_core/core.dart';
import '../entities/day_availability.dart';
import 'package:krow_domain/krow_domain.dart';
import '../repositories/availability_repository.dart';
/// Use case to apply a quick-set availability pattern (e.g., "Weekdays", "All Week") to a week.

View File

@@ -1,5 +1,5 @@
import 'package:krow_core/core.dart';
import '../entities/day_availability.dart';
import 'package:krow_domain/krow_domain.dart';
import '../repositories/availability_repository.dart';
/// Use case to fetch availability for a specific week.

View File

@@ -1,5 +1,5 @@
import 'package:krow_core/core.dart';
import '../entities/day_availability.dart';
import 'package:krow_domain/krow_domain.dart';
import '../repositories/availability_repository.dart';
/// Use case to update the availability configuration for a specific day.

View File

@@ -1,5 +1,5 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../domain/entities/day_availability.dart';
import 'package:krow_domain/krow_domain.dart';
import '../../domain/usecases/apply_quick_set_usecase.dart';
import '../../domain/usecases/get_weekly_availability_usecase.dart';
import '../../domain/usecases/update_day_availability_usecase.dart';

View File

@@ -1,5 +1,5 @@
import 'package:equatable/equatable.dart';
import '../../domain/entities/day_availability.dart';
import 'package:krow_domain/krow_domain.dart';
abstract class AvailabilityEvent extends Equatable {
const AvailabilityEvent();

View File

@@ -1,5 +1,5 @@
import 'package:equatable/equatable.dart';
import '../../domain/entities/day_availability.dart';
import 'package:krow_domain/krow_domain.dart';
abstract class AvailabilityState extends Equatable {
const AvailabilityState();

View File

@@ -29,3 +29,5 @@ dependencies:
krow_core:
path: ../../../core
firebase_data_connect: ^0.2.2+2
geolocator: ^10.1.0
permission_handler: ^11.0.1

View File

@@ -493,6 +493,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.0"
geolocator:
dependency: transitive
description:
name: geolocator
sha256: f4efb8d3c4cdcad2e226af9661eb1a0dd38c71a9494b22526f9da80ab79520e5
url: "https://pub.dev"
source: hosted
version: "10.1.1"
geolocator_android:
dependency: transitive
description:
name: geolocator_android
sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d
url: "https://pub.dev"
source: hosted
version: "4.6.2"
geolocator_apple:
dependency: transitive
description:
name: geolocator_apple
sha256: dbdd8789d5aaf14cf69f74d4925ad1336b4433a6efdf2fce91e8955dc921bf22
url: "https://pub.dev"
source: hosted
version: "2.3.13"
geolocator_platform_interface:
dependency: transitive
description:
name: geolocator_platform_interface
sha256: "30cb64f0b9adcc0fb36f628b4ebf4f731a2961a0ebd849f4b56200205056fe67"
url: "https://pub.dev"
source: hosted
version: "4.2.6"
geolocator_web:
dependency: transitive
description:
name: geolocator_web
sha256: "102e7da05b48ca6bf0a5bda0010f886b171d1a08059f01bfe02addd0175ebece"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
geolocator_windows:
dependency: transitive
description:
name: geolocator_windows
sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6"
url: "https://pub.dev"
source: hosted
version: "0.2.5"
get_it:
dependency: transitive
description:
@@ -853,6 +901,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.0"
permission_handler:
dependency: transitive
description:
name: permission_handler
sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849"
url: "https://pub.dev"
source: hosted
version: "11.4.0"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc
url: "https://pub.dev"
source: hosted
version: "12.1.0"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023
url: "https://pub.dev"
source: hosted
version: "9.4.7"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24"
url: "https://pub.dev"
source: hosted
version: "0.1.3+5"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878
url: "https://pub.dev"
source: hosted
version: "4.3.0"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
url: "https://pub.dev"
source: hosted
version: "0.2.1"
petitparser:
dependency: transitive
description: