From c244ed318996e35a24350e608b99b88394e812cc Mon Sep 17 00:00:00 2001 From: jawad Date: Wed, 9 Nov 2022 22:54:36 +0100 Subject: [PATCH] Small changes --- wallet/lib/model/favorites.dart | 2 +- wallet/lib/services/data_stores/local_data_store.dart | 2 +- .../third_party_services/database/dao/favorites_dao.dart | 7 +++++-- .../utils/dependency_injection/dependency_injection.dart | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/wallet/lib/model/favorites.dart b/wallet/lib/model/favorites.dart index d909c5d5eb..d3b314591b 100644 --- a/wallet/lib/model/favorites.dart +++ b/wallet/lib/model/favorites.dart @@ -10,4 +10,4 @@ class FavoritesModel { FavoritesModel({required this.id, required this.cookbookId, required this.type, required this.dateTime}); -} \ No newline at end of file +} diff --git a/wallet/lib/services/data_stores/local_data_store.dart b/wallet/lib/services/data_stores/local_data_store.dart index 578d64d6ff..abd1f3f146 100644 --- a/wallet/lib/services/data_stores/local_data_store.dart +++ b/wallet/lib/services/data_stores/local_data_store.dart @@ -8,12 +8,12 @@ import 'package:path_provider/path_provider.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:pylons_wallet/model/pick_image_model.dart'; import 'package:pylons_wallet/model/transaction_failure_model.dart'; -import 'package:pylons_wallet/services/third_party_services/database.dart'; import 'package:pylons_wallet/utils/failure/failure.dart'; import 'package:pylons_wallet/utils/permission_service.dart'; import 'package:shared_preferences/shared_preferences.dart'; import '../../generated/locale_keys.g.dart'; +import '../third_party_services/database/database.dart'; abstract class LocalDataSource { /// This method save stripe token in the local storage diff --git a/wallet/lib/services/third_party_services/database/dao/favorites_dao.dart b/wallet/lib/services/third_party_services/database/dao/favorites_dao.dart index 66bd567ee0..e8229410d0 100644 --- a/wallet/lib/services/third_party_services/database/dao/favorites_dao.dart +++ b/wallet/lib/services/third_party_services/database/dao/favorites_dao.dart @@ -5,11 +5,14 @@ import '../../../../model/favorites.dart'; @dao abstract class FavoritesDao { @Query('SELECT * FROM FavoritesModel ORDER BY dateTime DESC') - Future> getAllFailuresEntries(); + Future> getAll(); @insert Future insertFavorites(FavoritesModel favoritesModel); @Query('DELETE FROM FavoritesModel WHERE id = :id') Future delete(int id); -} \ No newline at end of file + + @Query('DELETE * FROM FavoritesModel') + Future deleteAll(int id); +} diff --git a/wallet/lib/utils/dependency_injection/dependency_injection.dart b/wallet/lib/utils/dependency_injection/dependency_injection.dart index 71ecf8fd2b..0cdfccae67 100644 --- a/wallet/lib/utils/dependency_injection/dependency_injection.dart +++ b/wallet/lib/utils/dependency_injection/dependency_injection.dart @@ -32,7 +32,6 @@ import 'package:pylons_wallet/services/repository/repository.dart'; import 'package:pylons_wallet/services/third_party_services/analytics_helper.dart'; import 'package:pylons_wallet/services/third_party_services/audio_player_helper.dart'; import 'package:pylons_wallet/services/third_party_services/crashlytics_helper.dart'; -import 'package:pylons_wallet/services/third_party_services/database.dart'; import 'package:pylons_wallet/services/third_party_services/firestore_helper.dart'; import 'package:pylons_wallet/services/third_party_services/network_info.dart'; import 'package:pylons_wallet/services/third_party_services/remote_config_service/remote_config_service.dart'; @@ -66,6 +65,8 @@ import 'package:transaction_signing_gateway/storage/flutter_secure_storage_data_ import 'package:transaction_signing_gateway/storage/shared_prefs_plain_data_store.dart'; import 'package:video_player/video_player.dart'; +import '../../services/third_party_services/database/database.dart'; + final sl = GetIt.instance; /// This method is used for initializing the dependencies