feat: integrate Google Maps Places Autocomplete for hub address validation and remove mock service
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
import 'package:krow_data_connect/krow_data_connect.dart';
|
|
||||||
import 'package:firebase_data_connect/firebase_data_connect.dart';
|
import 'package:firebase_data_connect/firebase_data_connect.dart';
|
||||||
import 'package:krow_data_connect/src/session/staff_session_store.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:krow_data_connect/krow_data_connect.dart';
|
||||||
import 'package:staff_home/src/domain/entities/shift.dart';
|
import 'package:staff_home/src/domain/entities/shift.dart';
|
||||||
import 'package:staff_home/src/domain/repositories/home_repository.dart';
|
import 'package:staff_home/src/domain/repositories/home_repository.dart';
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
|
|
||||||
extension TimestampExt on Timestamp {
|
extension TimestampExt on Timestamp {
|
||||||
DateTime toDate() {
|
DateTime toDate() {
|
||||||
|
|||||||
@@ -1,76 +0,0 @@
|
|||||||
import 'package:staff_home/src/domain/entities/shift.dart';
|
|
||||||
|
|
||||||
class MockService {
|
|
||||||
static final Shift _sampleShift1 = Shift(
|
|
||||||
id: '1',
|
|
||||||
title: 'Line Cook',
|
|
||||||
clientName: 'The Burger Joint',
|
|
||||||
hourlyRate: 22.50,
|
|
||||||
location: 'Downtown, NY',
|
|
||||||
locationAddress: '123 Main St, New York, NY 10001',
|
|
||||||
date: DateTime.now().toIso8601String(),
|
|
||||||
startTime: '16:00',
|
|
||||||
endTime: '22:00',
|
|
||||||
createdDate: DateTime.now()
|
|
||||||
.subtract(const Duration(hours: 2))
|
|
||||||
.toIso8601String(),
|
|
||||||
tipsAvailable: true,
|
|
||||||
mealProvided: true,
|
|
||||||
managers: [ShiftManager(name: 'John Doe', phone: '+1 555 0101')],
|
|
||||||
description: 'Help with dinner service. Must be experienced with grill.',
|
|
||||||
);
|
|
||||||
|
|
||||||
static final Shift _sampleShift2 = Shift(
|
|
||||||
id: '2',
|
|
||||||
title: 'Dishwasher',
|
|
||||||
clientName: 'Pasta Place',
|
|
||||||
hourlyRate: 18.00,
|
|
||||||
location: 'Brooklyn, NY',
|
|
||||||
locationAddress: '456 Bedford Ave, Brooklyn, NY 11211',
|
|
||||||
date: DateTime.now().add(const Duration(days: 1)).toIso8601String(),
|
|
||||||
startTime: '18:00',
|
|
||||||
endTime: '23:00',
|
|
||||||
createdDate: DateTime.now()
|
|
||||||
.subtract(const Duration(hours: 5))
|
|
||||||
.toIso8601String(),
|
|
||||||
tipsAvailable: false,
|
|
||||||
mealProvided: true,
|
|
||||||
);
|
|
||||||
|
|
||||||
static final Shift _sampleShift3 = Shift(
|
|
||||||
id: '3',
|
|
||||||
title: 'Bartender',
|
|
||||||
clientName: 'Rooftop Bar',
|
|
||||||
hourlyRate: 25.00,
|
|
||||||
location: 'Manhattan, NY',
|
|
||||||
locationAddress: '789 5th Ave, New York, NY 10022',
|
|
||||||
date: DateTime.now().add(const Duration(days: 2)).toIso8601String(),
|
|
||||||
startTime: '19:00',
|
|
||||||
endTime: '02:00',
|
|
||||||
createdDate: DateTime.now()
|
|
||||||
.subtract(const Duration(hours: 1))
|
|
||||||
.toIso8601String(),
|
|
||||||
tipsAvailable: true,
|
|
||||||
parkingAvailable: true,
|
|
||||||
description: 'High volume bar. Mixology experience required.',
|
|
||||||
);
|
|
||||||
|
|
||||||
Future<List<Shift>> getTodayShifts() async {
|
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
return [_sampleShift1];
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<List<Shift>> getTomorrowShifts() async {
|
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
return [_sampleShift2];
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<List<Shift>> getRecommendedShifts() async {
|
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
return [_sampleShift3, _sampleShift1, _sampleShift2];
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> createWorkerProfile(Map<String, dynamic> data) async {
|
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -179,8 +179,6 @@ class WorkerHomePage extends StatelessWidget {
|
|||||||
// Recommended Shifts
|
// Recommended Shifts
|
||||||
SectionHeader(
|
SectionHeader(
|
||||||
title: sectionsI18n.recommended_for_you,
|
title: sectionsI18n.recommended_for_you,
|
||||||
action: sectionsI18n.view_all,
|
|
||||||
onAction: () => Modular.to.pushShifts(tab: 'find'),
|
|
||||||
),
|
),
|
||||||
BlocBuilder<HomeCubit, HomeState>(
|
BlocBuilder<HomeCubit, HomeState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_modular/flutter_modular.dart';
|
import 'package:flutter_modular/flutter_modular.dart';
|
||||||
import 'package:staff_home/src/data/repositories/home_repository_impl.dart';
|
import 'package:staff_home/src/data/repositories/home_repository_impl.dart';
|
||||||
import 'package:staff_home/src/data/services/mock_service.dart';
|
|
||||||
import 'package:staff_home/src/domain/repositories/home_repository.dart';
|
import 'package:staff_home/src/domain/repositories/home_repository.dart';
|
||||||
import 'package:staff_home/src/presentation/blocs/home_cubit.dart';
|
import 'package:staff_home/src/presentation/blocs/home_cubit.dart';
|
||||||
import 'package:staff_home/src/presentation/pages/worker_home_page.dart';
|
import 'package:staff_home/src/presentation/pages/worker_home_page.dart';
|
||||||
@@ -14,9 +13,6 @@ import 'package:staff_home/src/presentation/pages/worker_home_page.dart';
|
|||||||
class StaffHomeModule extends Module {
|
class StaffHomeModule extends Module {
|
||||||
@override
|
@override
|
||||||
void binds(Injector i) {
|
void binds(Injector i) {
|
||||||
// Data layer - Mock service (will be replaced with real implementation)
|
|
||||||
i.addLazySingleton<MockService>(MockService.new);
|
|
||||||
|
|
||||||
// Repository
|
// Repository
|
||||||
i.addLazySingleton<HomeRepository>(
|
i.addLazySingleton<HomeRepository>(
|
||||||
() => HomeRepositoryImpl(),
|
() => HomeRepositoryImpl(),
|
||||||
|
|||||||
Reference in New Issue
Block a user