6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit ca01bed9
Changed files
comwell_key_app/assets/translations/da-DK.json | 2 +- comwell_key_app/assets/translations/en-US.json | 4 +- comwell_key_app/lib/home/bloc/home_bloc.dart | 76 ++++++++++++---------- comwell_key_app/lib/home/bloc/home_event.dart | 6 +- comwell_key_app/lib/home/bloc/home_state.dart | 71 +++++++++++--------- .../lib/home/components/housekeeping_button.dart | 19 ++++-- comwell_key_app/lib/home/home_page.dart | 21 +++--- comwell_key_app/lib/home/home_repository.dart | 35 ++++++++-- .../lib/housekeeping/housekeeping_cubit.dart | 7 +- .../lib/housekeeping/housekeeping_page.dart | 15 ++++- .../lib/housekeeping/housekeeping_repository.dart | 12 ++++ comwell_key_app/lib/utils/secure_storage.dart | 4 +- .../test/home_test/home_bloc_test.mocks.dart | 20 ++++++ 13 files changed, 197 insertions(+), 95 deletions(-)
Diff
diff --git a/comwell_key_app/assets/translations/da-DK.json b/comwell_key_app/assets/translations/da-DK.json
index fabb3350..34dd6408 100644
--- a/comwell_key_app/assets/translations/da-DK.json
+++ b/comwell_key_app/assets/translations/da-DK.json
@@ -121,5 +121,5 @@
"housekeeping_page_service_cleaning_subtitle": "Der bliver gjort rent mellem 11 og 14",
"housekeeping_page_supplies": "Forsyninger",
"home_page_housekeeping_button_title": "Bestil housekeeping",
- "home_page_housekeeping_button_subtitle": "Dagen før housekeeping ønskes."
+ "home_page_housekeeping_button_subtitle": "Ønsker du ekstra rengøring eller opfyldning på værelset, kan du altid bestille det her - uden omkostninger"
}
\ No newline at end of file
diff --git a/comwell_key_app/assets/translations/en-US.json b/comwell_key_app/assets/translations/en-US.json
index 874cf473..1a09c942 100644
--- a/comwell_key_app/assets/translations/en-US.json
+++ b/comwell_key_app/assets/translations/en-US.json
@@ -120,5 +120,7 @@
"housekeeping_page_service_title_soap": "Trash removal",
"housekeeping_page_service_cleaning_subtitle": "Cleaning is between 11 and 14",
"housekeeping_page_supplies": "Supplies",
- "housekeeping_page_cleaning": "Cleaning"
+ "housekeeping_page_cleaning": "Cleaning",
+ "home_page_housekeeping_button_title": "Order housekeeping",
+ "home_page_housekeeping_button_subtitle": "Order here"
}
\ No newline at end of file
diff --git a/comwell_key_app/lib/home/bloc/home_bloc.dart b/comwell_key_app/lib/home/bloc/home_bloc.dart
index 312a2cd5..3e8311a3 100644
--- a/comwell_key_app/lib/home/bloc/home_bloc.dart
+++ b/comwell_key_app/lib/home/bloc/home_bloc.dart
@@ -5,86 +5,96 @@ import 'package:seos_mobile_keys_plugin/app_usage_api.dart';
import 'package:comwell_key_app/home/home_repository.dart';
part 'home_event.dart';
+
part 'home_state.dart';
class HomeBloc extends Bloc<HomeEvent, HomeState> {
final HomeRepository homeRepository;
- HomeBloc({required this.homeRepository}) : super(const HomeState.unknown()) {
+
+ HomeBloc({required this.homeRepository}) : super(HomeState.initial()) {
on<HomeInitialEvent>((event, emit) async {
- emit(const HomeState.setupStarted());
+ emit(state.setupStarted());
+ await checkIfHouseKeepingOrdered(emit);
try {
if (kIsWeb) {
- emit(const HomeState.setupComplete());
+ emit(state.setupComplete());
return;
}
- bool isEndPointSetup = await homeRepository.startMobilePlugin();
- if(isEndPointSetup) {
- emit(const HomeState.setupComplete());
+ final isEndPointSetup = await homeRepository.startMobilePlugin();
+ if (isEndPointSetup) {
+ emit(state.setupComplete());
} else {
- emit(const HomeState.mobilePluginStarted());
- SetupEndpoint();
+ emit(state.mobilePluginStarted());
+ SetupEndpoint();
}
} catch (_) {
- emit(const HomeState.setupError());
+ emit(state.setupError());
}
});
on<SetupEndpoint>((event, emit) async {
- emit(const HomeState.setupStarted());
+ emit(state.setupStarted());
try {
if (kIsWeb) {
- emit(const HomeState.setupComplete());
+ emit(state.setupComplete());
return;
}
await homeRepository.setupEndpoint();
- emit(const HomeState.setupComplete());
+ emit(state.setupComplete());
} catch (_) {
- emit(const HomeState.setupError());
+ emit(state.setupError());
}
});
on<SearchForKeysEvent>((event, emit) async {
if (kIsWeb) {
- emit(const HomeState.invalidOrNoKey());
+ emit(state.invalidOrNoKey());
return;
}
// this is set because there is a bit and issue with updating the endpoint first and second time it is run! will fix this later and remove it
- if(event.endpointNeedsUpdate) {
+ if (event.endpointNeedsUpdate) {
await homeRepository.updateEndpoint();
}
//await homeRepository.updateEndpoint();
- List<MobileKeysKey?>? keys = await homeRepository.refreshKeys();
- if (keys != null) {
- if (keys.length == 1) {
- emit(HomeState.validKey(key: keys[0]!));
- } else if (keys.length > 1) {
- emit(const HomeState.multipleKeys(keys: List<MobileKeysKey>));
- } else {
- emit(const HomeState.invalidOrNoKey());
- }
+ final List<MobileKeysKey> keys = await homeRepository.refreshKeys();
+ if (keys.length == 1) {
+ emit(state.validKey(keys[0]));
+ } else if (keys.length > 1) {
+ emit(state.multipleKeys(keys));
} else {
- emit(const HomeState.invalidOrNoKey());
+ emit(state.invalidOrNoKey());
}
});
on<ProvisionKeyEvent>((event, emit) async {
if (kIsWeb) {
- emit(const HomeState.keyProvisioned());
+ emit(state.keyProvisioned());
return;
}
try {
- await homeRepository.provisionKey(event.bookingId, forceProvision: true);
-
- emit(const HomeState.keyProvisioned());
+ await homeRepository.provisionKey(event.bookingId,
+ forceProvision: true);
+
+ emit(state.keyProvisioned());
} catch (_) {
- emit(const HomeState.setupError());
+ emit(state.setupError());
}
});
+
+ on<CheckIfHouseKeepingOrdered>((event, emit) async {
+ await checkIfHouseKeepingOrdered(emit);
+ });
}
-}
+ Future<void> checkIfHouseKeepingOrdered(Emitter<HomeState> emit) async {
+ final isHouseKeepingOrdered = await homeRepository.isHousesKeepingOrdered();
+ if (isHouseKeepingOrdered) {
+ emit(state.houseKeepingOrdered());
+ }
+ }
+}
- /* if (isEndpointSetup) {
+/* if (isEndpointSetup) {
List<MobileKeysKey?>? keys = await homeRepository.refreshKeys();
if(keys != null) {
if(keys.length == 1) {
@@ -99,4 +109,4 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> {
}
} else {
emit(CodeNotRedeemed());
- } */
\ No newline at end of file
+ } */
diff --git a/comwell_key_app/lib/home/bloc/home_event.dart b/comwell_key_app/lib/home/bloc/home_event.dart
index 3609ae9a..abe8244e 100644
--- a/comwell_key_app/lib/home/bloc/home_event.dart
+++ b/comwell_key_app/lib/home/bloc/home_event.dart
@@ -20,12 +20,11 @@ final class CodeEnteredEvent extends HomeEvent {
final class SearchForKeysEvent extends HomeEvent {
final bool endpointNeedsUpdate;
+
const SearchForKeysEvent({this.endpointNeedsUpdate = false});
@override
List<Object> get props => [];
-
-
}
final class SetupEndpoint extends HomeEvent {}
@@ -39,6 +38,7 @@ final class KeySelectedEvent extends HomeEvent {
List<Object> get props => [key];
}
+final class CheckIfHouseKeepingOrdered extends HomeEvent {}
final class ProvisionKeyEvent extends HomeEvent {
final String bookingId;
@@ -47,4 +47,4 @@ final class ProvisionKeyEvent extends HomeEvent {
@override
List<Object> get props => [bookingId];
-}
\ No newline at end of file
+}
diff --git a/comwell_key_app/lib/home/bloc/home_state.dart b/comwell_key_app/lib/home/bloc/home_state.dart
index 856e0912..72c47e12 100644
--- a/comwell_key_app/lib/home/bloc/home_state.dart
+++ b/comwell_key_app/lib/home/bloc/home_state.dart
@@ -1,35 +1,48 @@
part of 'home_bloc.dart';
+class HomeState extends Equatable {
+
+ final bool isHouseKeepingOrdered;
+ final HomeStatus status;
+ final MobileKeysKey? key;
+ final List<MobileKeysKey> keys;
+
+ const HomeState._({required this.status, required this.key, required this.keys, required this.isHouseKeepingOrdered});
+
+ HomeState.initial() : this._(status: HomeStatus.unknown, key: null, keys: [], isHouseKeepingOrdered: false);
+ HomeState setupStarted() => copyWith(status: HomeStatus.setupStarted);
+ HomeState setupComplete() => copyWith(status: HomeStatus.setupComplete);
+ HomeState mobilePluginStarted() => copyWith(status: HomeStatus.mobilePluginStarted);
+ HomeState invalidOrNoKey() => copyWith(status: HomeStatus.invalidOrNoKey);
+ HomeState keyProvisioned() => copyWith(status: HomeStatus.keyProvisioned);
+ HomeState multipleKeys(List<MobileKeysKey> keys) => copyWith(status: HomeStatus.multipleKeys, keys: keys);
+ HomeState setupNotComplete() => copyWith(status: HomeStatus.setupNotComplete);
+ HomeState setupError() => copyWith(status: HomeStatus.setupError);
+ HomeState validKey(MobileKeysKey key) => copyWith(status: HomeStatus.validKey, key: key);
+ HomeState houseKeepingOrdered() => copyWith(status: HomeStatus.houseKeepingOrdered, isHouseKeepingOrdered: true);
+ HomeState main() => copyWith(status: HomeStatus.main);
+ @override
+ List<Object?> get props => [status];
-final class HomeState extends Equatable {
- const HomeState._({
- this.status = HomeStatus.unknown,
- this.key,
- this.keys
-
- });
-
-
-const HomeState.unknown() : this._(status: HomeStatus.unknown);
-const HomeState.setupStarted() : this._(status: HomeStatus.setupStarted);
-const HomeState.setupComplete() : this._(status: HomeStatus.setupComplete);
-const HomeState.mobilePluginStarted() : this._(status: HomeStatus.mobilePluginStarted);
-const HomeState.invalidOrNoKey() : this._(status: HomeStatus.invalidOrNoKey);
-const HomeState.keyProvisioned() : this._(status: HomeStatus.keyProvisioned);
-const HomeState.multipleKeys({required keys}) : this._(status: HomeStatus.multipleKeys);
-const HomeState.setupNotComplete() : this._(status: HomeStatus.setupNotComplete);
-const HomeState.setupError() : this._(status: HomeStatus.setupError);
-const HomeState.validKey({required key}) : this._(status: HomeStatus.validKey);
-
-
-final HomeStatus status;
-final MobileKeysKey? key;
-final List<MobileKeysKey>? keys;
-
+ HomeState copyWith({
+ HomeStatus? status,
+ MobileKeysKey? key,
+ List<MobileKeysKey>? keys,
+ bool? isHouseKeepingOrdered,
+ }) {
+ return HomeState._(
+ status: status ?? this.status,
+ key: key ?? this.key,
+ keys: keys ?? this.keys,
+ isHouseKeepingOrdered: isHouseKeepingOrdered ?? this.isHouseKeepingOrdered,
+ );
+ }
@override
- List<Object?> get props => [status];
+ String toString() {
+ return "HomeState(status=$status, key=$key, keys=$keys, isHouseKeepingOrdered=$isHouseKeepingOrdered)";
+ }
}
enum HomeStatus {
@@ -38,12 +51,12 @@ enum HomeStatus {
setupComplete,
setupError,
setupNotComplete,
- firstLaunch,
+ firstLaunch,
mobilePluginStarted,
multipleKeys,
validKey,
invalidOrNoKey,
- main,
+ main,
keyProvisioned,
+ houseKeepingOrdered
}
-
diff --git a/comwell_key_app/lib/home/components/housekeeping_button.dart b/comwell_key_app/lib/home/components/housekeeping_button.dart
index 956713bc..7985cf05 100644
--- a/comwell_key_app/lib/home/components/housekeeping_button.dart
+++ b/comwell_key_app/lib/home/components/housekeeping_button.dart
@@ -1,20 +1,25 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import '../../routing/app_routes.dart';
import '../../themes/dark_theme.dart';
+import '../bloc/home_bloc.dart';
class HousekeepingButton extends StatelessWidget {
const HousekeepingButton({super.key});
@override
Widget build(BuildContext context) {
+ final bloc = context.read<HomeBloc>();
return InkWell(
borderRadius: BorderRadius.circular(10),
- onTap: () {
- context.pushNamed(AppRoutes.houseKeeping.name);
+ onTap: () async {
+ if (bloc.state.isHouseKeepingOrdered) return;
+ await context.pushNamed(AppRoutes.houseKeeping.name);
+ bloc.add(CheckIfHouseKeepingOrdered());
},
child: Container(
decoration: BoxDecoration(
@@ -53,13 +58,19 @@ class HousekeepingButton extends StatelessWidget {
Text(
"home_page_housekeeping_button_subtitle".tr(),
maxLines: 1,
- style: Theme.of(context).textTheme.headlineSmall?.copyWith(color: Colors.grey),
+ style: Theme.of(context)
+ .textTheme
+ .headlineSmall
+ ?.copyWith(color: Colors.grey),
),
],
),
),
const SizedBox(width: 12),
- SvgPicture.asset("assets/icons/arrow-left.svg")
+ if (bloc.state.isHouseKeepingOrdered == true)
+ SvgPicture.asset("assets/icons/ic_checkmark.svg")
+ else
+ SvgPicture.asset("assets/icons/arrow-left.svg")
],
),
),
diff --git a/comwell_key_app/lib/home/home_page.dart b/comwell_key_app/lib/home/home_page.dart
index 59bd99a1..1978fba3 100644
--- a/comwell_key_app/lib/home/home_page.dart
+++ b/comwell_key_app/lib/home/home_page.dart
@@ -29,28 +29,29 @@ class _HomeWidget extends State<HomeWidget> {
final theme = Theme.of(context);
return BlocConsumer<HomeBloc, HomeState>(
listener: (context, state) {
- if (state == const HomeState.mobilePluginStarted()) {
+ if (state.status == HomeStatus.mobilePluginStarted) {
context.read<HomeBloc>().add(SetupEndpoint());
}
- if (state == const HomeState.setupError()) {
+ if (state.status == HomeStatus.setupError) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Failed to start Mobile Keys Plugin')));
context.read<HomeBloc>().add(SetupEndpoint());
}
- if (state == const HomeState.setupComplete()) {
+ if (state.status == HomeStatus.setupComplete) {
context.read<HomeBloc>().add(const ProvisionKeyEvent("Hotel123"));
}
- if (state == const HomeState.keyProvisioned()) {
+ if (state.status == HomeStatus.keyProvisioned) {
context.read<HomeBloc>().add(const SearchForKeysEvent());
}
},
builder: (context, state) {
- if (state == const HomeState.unknown()) {
+ if (state.status == HomeStatus.unknown) {
context.read<HomeBloc>().add(HomeInitialEvent());
}
- if (state == const HomeState.invalidOrNoKey()) {
+ if (state.status == HomeStatus.invalidOrNoKey) {
//context.read<HomeBloc>().add(const ProvisionKeyEvent("Hotel123"));
}
+ //print("qqq state: $state");
return Scaffold(
extendBodyBehindAppBar: true,
backgroundColor: sandColor[40],
@@ -70,7 +71,7 @@ class _HomeWidget extends State<HomeWidget> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Spacer(),
- if (state.status == HomeStatus.invalidOrNoKey )
+ if (state.status == HomeStatus.invalidOrNoKey)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: ElevatedButton(
@@ -120,9 +121,9 @@ class _HomeWidget extends State<HomeWidget> {
),
const Text('Rooms'),
const SizedBox(height: 12),
- const Padding(
- padding: EdgeInsets.symmetric(horizontal: 16.0),
- child: HousekeepingButton(),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16.0),
+ child: HousekeepingButton(key: ValueKey(state.isHouseKeepingOrdered)),
),
const SizedBox(height: 12),
ElevatedButton(
diff --git a/comwell_key_app/lib/home/home_repository.dart b/comwell_key_app/lib/home/home_repository.dart
index 00e5e68a..7f3dceea 100644
--- a/comwell_key_app/lib/home/home_repository.dart
+++ b/comwell_key_app/lib/home/home_repository.dart
@@ -1,3 +1,4 @@
+import 'package:comwell_key_app/housekeeping/housekeeping_repository.dart';
import 'package:comwell_key_app/services/api.dart';
import 'package:comwell_key_app/utils/secure_storage.dart';
import 'package:comwell_key_app/utils/singleton.dart';
@@ -29,10 +30,10 @@ class HomeRepository {
}
}
- Future<List<MobileKeysKey?>>? refreshKeys() async {
+ Future<List<MobileKeysKey>> refreshKeys() async {
try {
//await updateEndpoint();
- List<MobileKeysKey> listOfKeys =
+ final List<MobileKeysKey> listOfKeys =
await _seosMobileKeysPlugin.listMobileKeys();
await secureStorage.write(constants.hasKey, DateTime.now().toString());
return listOfKeys;
@@ -41,6 +42,23 @@ class HomeRepository {
}
}
+ Future<bool> isHousesKeepingOrdered() async {
+ final lastOrderedValue = await secureStorage.read(HouseKeepingRepository.houseKeepingLastOrderedKey);
+ print("lastOrderedValue: $lastOrderedValue");
+ if (lastOrderedValue != null) {
+ return true;
+ final lastOrdered =
+ DateTime.fromMillisecondsSinceEpoch(int.parse(lastOrderedValue));
+ final dayOfLastOrder = lastOrdered.day;
+ final dayOfToday = DateTime.now().day;
+ final timeOfToday = DateTime.now().hour;
+
+ return dayOfToday > dayOfLastOrder &&
+ timeOfToday > 2; // If it's after 3am on the day after the order
+ }
+ return false;
+ }
+
Future<void> setupEndpoint() async {
try {
final Response<dynamic> code = await api.createEndpointRegistration();
@@ -52,12 +70,14 @@ class HomeRepository {
}
}
- Future<void> provisionKey(String bookingId,
- {bool forceProvision = false}) async {
+ Future<void> provisionKey(
+ String bookingId, {
+ bool forceProvision = false,
+ }) async {
try {
- String? hasKey = await secureStorage.read(constants.hasKey);
+ final String? hasKey = await secureStorage.read(constants.hasKey);
if (hasKey != null) {
- DateTime hasKeyDate = DateTime.parse(hasKey);
+ final DateTime hasKeyDate = DateTime.parse(hasKey);
if (DateTime.now().difference(hasKeyDate).inDays < 1) {
return;
}
@@ -84,7 +104,8 @@ class HomeRepository {
try {
await _seosMobileKeysPlugin.startUp(mobileKeysOptions);
- bool isendpointSetup = await _seosMobileKeysPlugin.isEndpointSetup();
+ final bool isendpointSetup =
+ await _seosMobileKeysPlugin.isEndpointSetup();
if (isendpointSetup) {
updateEndpoint();
return true;
diff --git a/comwell_key_app/lib/housekeeping/housekeeping_cubit.dart b/comwell_key_app/lib/housekeeping/housekeeping_cubit.dart
index 2100dcf1..41dbf1c6 100644
--- a/comwell_key_app/lib/housekeeping/housekeeping_cubit.dart
+++ b/comwell_key_app/lib/housekeeping/housekeeping_cubit.dart
@@ -2,8 +2,10 @@ import 'package:bloc/bloc.dart';
import 'package:comwell_key_app/housekeeping/housekeeping_state.dart';
import 'components/housekeeping_service.dart';
+import 'housekeeping_repository.dart';
class HouseKeepingCubit extends Cubit<HouseKeepingState> {
+ final houseKeepingRepository = HouseKeepingRepository();
HouseKeepingCubit() : super(HouseKeepingState.initial());
final Iterable<HouseKeepingService> servicesSupplies = [
@@ -33,8 +35,7 @@ class HouseKeepingCubit extends Cubit<HouseKeepingState> {
}
}
- void onOrderHousekeepingClicked() async {
- await Future.delayed(const Duration(seconds: 2));
- // TODO upload selected services
+ Future<void> onOrderHousekeepingClicked() async {
+ await houseKeepingRepository.saveHouseKeepingOrdered();
}
}
diff --git a/comwell_key_app/lib/housekeeping/housekeeping_page.dart b/comwell_key_app/lib/housekeeping/housekeeping_page.dart
index 4099925a..7c1ef992 100644
--- a/comwell_key_app/lib/housekeeping/housekeeping_page.dart
+++ b/comwell_key_app/lib/housekeeping/housekeeping_page.dart
@@ -5,12 +5,18 @@ import 'package:comwell_key_app/housekeeping/housekeeping_state.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
import '../common/components/comwell_app_bar.dart';
-class HousekeepingPage extends StatelessWidget {
+class HousekeepingPage extends StatefulWidget {
const HousekeepingPage({super.key});
+ @override
+ State<HousekeepingPage> createState() => _HousekeepingPageState();
+}
+
+class _HousekeepingPageState extends State<HousekeepingPage> {
@override
Widget build(BuildContext context) {
return BlocProvider(
@@ -35,7 +41,12 @@ class HousekeepingPage extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(16.0),
child: ElevatedButton(
- onPressed: cubit.onOrderHousekeepingClicked,
+ onPressed: () async {
+ await cubit.onOrderHousekeepingClicked();
+ if (mounted) {
+ context.pop();
+ }
+ },
style: const ButtonStyle(
backgroundColor:
WidgetStatePropertyAll(Color(0xffAA8D65)),
diff --git a/comwell_key_app/lib/housekeeping/housekeeping_repository.dart b/comwell_key_app/lib/housekeeping/housekeeping_repository.dart
new file mode 100644
index 00000000..3dda548a
--- /dev/null
+++ b/comwell_key_app/lib/housekeeping/housekeeping_repository.dart
@@ -0,0 +1,12 @@
+import '../utils/secure_storage.dart';
+
+class HouseKeepingRepository {
+ final secureStorage = SecureStorage();
+
+ Future<void> saveHouseKeepingOrdered() async {
+ //await secureStorage.delete(houseKeepingLastOrderedKey);
+ await secureStorage.write(houseKeepingLastOrderedKey, DateTime.now().millisecondsSinceEpoch.toString());
+ }
+
+ static const houseKeepingLastOrderedKey = 'housekeeping_last_ordered';
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/utils/secure_storage.dart b/comwell_key_app/lib/utils/secure_storage.dart
index 34664da3..2091d759 100644
--- a/comwell_key_app/lib/utils/secure_storage.dart
+++ b/comwell_key_app/lib/utils/secure_storage.dart
@@ -3,7 +3,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
class SecureStorage {
final FlutterSecureStorage _storage = const FlutterSecureStorage();
- Future<String?>? read(String key) async {
+ Future<String?> read(String key) async {
return await _storage.read(key: key);
}
@@ -22,4 +22,4 @@ class SecureStorage {
Future<void> write(String key, String value) async {
await _storage.write(key: key, value: value);
}
-}
\ No newline at end of file
+}
diff --git a/comwell_key_app/test/home_test/home_bloc_test.mocks.dart b/comwell_key_app/test/home_test/home_bloc_test.mocks.dart
index 97776b5d..1fb43ebb 100644
--- a/comwell_key_app/test/home_test/home_bloc_test.mocks.dart
+++ b/comwell_key_app/test/home_test/home_bloc_test.mocks.dart
@@ -9,6 +9,7 @@ import 'package:comwell_key_app/home/home_repository.dart' as _i4;
import 'package:comwell_key_app/services/api.dart' as _i2;
import 'package:comwell_key_app/utils/secure_storage.dart' as _i3;
import 'package:mockito/mockito.dart' as _i1;
+import 'package:seos_mobile_keys_plugin/app_usage_api.dart' as _i6;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
@@ -89,6 +90,25 @@ class MockHomeRepository extends _i1.Mock implements _i4.HomeRepository {
returnValue: _i5.Future<bool>.value(false),
) as _i5.Future<bool>);
+ @override
+ _i5.Future<List<_i6.MobileKeysKey>> refreshKeys() => (super.noSuchMethod(
+ Invocation.method(
+ #refreshKeys,
+ [],
+ ),
+ returnValue:
+ _i5.Future<List<_i6.MobileKeysKey>>.value(<_i6.MobileKeysKey>[]),
+ ) as _i5.Future<List<_i6.MobileKeysKey>>);
+
+ @override
+ _i5.Future<bool> isHousesKeepingOrdered() => (super.noSuchMethod(
+ Invocation.method(
+ #isHousesKeepingOrdered,
+ [],
+ ),
+ returnValue: _i5.Future<bool>.value(false),
+ ) as _i5.Future<bool>);
+
@override
_i5.Future<void> setupEndpoint() => (super.noSuchMethod(
Invocation.method(