switch to new image api strat and fix onboarding cache strat
This commit is contained in:
parent
48b434dad9
commit
a5bdee892c
39 changed files with 540 additions and 791 deletions
|
|
@ -29,8 +29,15 @@ class AboutMihProvider extends ChangeNotifier {
|
|||
return success;
|
||||
}
|
||||
|
||||
Future<void> clearAboutMihCacheAndProvider() async {
|
||||
await _hiveData.clearAboutMIHCache();
|
||||
reset();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
userCount = null;
|
||||
businessCount = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ class MihMineSweeperProvider extends ChangeNotifier {
|
|||
int totalMines;
|
||||
List<MinesweeperPlayerScore>? leaderboard;
|
||||
List<MinesweeperPlayerScore>? myScoreboard;
|
||||
List<Future<String>> leaderboardUserPicturesUrl = [];
|
||||
|
||||
MihMineSweeperProvider({
|
||||
this.difficulty = "Easy",
|
||||
|
|
@ -72,10 +71,4 @@ class MihMineSweeperProvider extends ChangeNotifier {
|
|||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setLeaderboardUserPictures(
|
||||
{required List<Future<String>> leaderboardUserPicturesUrl}) {
|
||||
this.leaderboardUserPicturesUrl = leaderboardUserPicturesUrl;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,12 +13,9 @@ class MzansiDirectoryProvider extends ChangeNotifier {
|
|||
bool personalSearch;
|
||||
List<BookmarkedBusiness> bookmarkedBusinesses = [];
|
||||
List<Business>? favouriteBusinessesList;
|
||||
Map<String, Future<String>>? favBusImagesUrl;
|
||||
List<Business> searchedBusinesses = [];
|
||||
Map<String, Future<String>>? busSearchImagesUrl;
|
||||
Business? selectedBusiness;
|
||||
List<AppUser> searchedUsers = [];
|
||||
Map<String, Future<String>>? userSearchImagesUrl;
|
||||
AppUser? selectedUser;
|
||||
String searchTerm;
|
||||
String businessTypeFilter;
|
||||
|
|
@ -88,19 +85,15 @@ class MzansiDirectoryProvider extends ChangeNotifier {
|
|||
|
||||
void setFavouriteBusinesses({
|
||||
required List<Business> businesses,
|
||||
required Map<String, Future<String>> businessesImagesUrl,
|
||||
}) {
|
||||
favouriteBusinessesList = businesses;
|
||||
favBusImagesUrl = businessesImagesUrl;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSearchedBusinesses({
|
||||
required List<Business> searchedBusinesses,
|
||||
required Map<String, Future<String>> businessesImagesUrl,
|
||||
}) {
|
||||
this.searchedBusinesses = searchedBusinesses;
|
||||
busSearchImagesUrl = businessesImagesUrl;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
|
@ -111,10 +104,8 @@ class MzansiDirectoryProvider extends ChangeNotifier {
|
|||
|
||||
void setSearchedUsers({
|
||||
required List<AppUser> searchedUsers,
|
||||
required Map<String, Future<String>> userImagesUrl,
|
||||
}) {
|
||||
this.searchedUsers = searchedUsers;
|
||||
this.userSearchImagesUrl = userImagesUrl;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ class MzansiProfileProvider extends ChangeNotifier {
|
|||
}
|
||||
|
||||
Future<bool> syncWithMihServerData() async {
|
||||
await _hiveData.processModificationsQueue();
|
||||
bool success = await _hiveData.syncProfileDataWithServer();
|
||||
loadCachedProfileState();
|
||||
return success;
|
||||
|
|
@ -84,6 +85,24 @@ class MzansiProfileProvider extends ChangeNotifier {
|
|||
refreshIndicatorKey.currentState?.show();
|
||||
}
|
||||
|
||||
bool isLocalModificationsPending(){
|
||||
return _hiveData.isModificationsNotEmpty();
|
||||
}
|
||||
|
||||
Future<bool> addUserConsent(UserConsent newConsent) async {
|
||||
bool success = await _hiveData.addUserConsentLocally(newConsent);
|
||||
await _hiveData.queuAddConsentModification(newConsent);
|
||||
await _hiveData.processModificationsQueue();
|
||||
await _hiveData.syncProfileDataWithServer();
|
||||
loadCachedProfileState();
|
||||
return success;
|
||||
}
|
||||
|
||||
Future<void> clearProfileCacheAndProvider() async {
|
||||
await _hiveData.clearProfileCache();
|
||||
reset();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
personalHome = true;
|
||||
personalIndex = 0;
|
||||
|
|
@ -98,6 +117,10 @@ class MzansiProfileProvider extends ChangeNotifier {
|
|||
businessUserSignatureUrl = null;
|
||||
businessUserSignature = null;
|
||||
userConsent = null;
|
||||
employeeList = null;
|
||||
userSearchResults = [];
|
||||
personalLinks = [];
|
||||
businessLinks = [];
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,10 +64,16 @@ class MzansiWalletProvider extends ChangeNotifier {
|
|||
loadCachedWallet();
|
||||
}
|
||||
|
||||
Future<void> clearWalletCacheAndProvider() async {
|
||||
await _hiveData.clearWalletCache();
|
||||
reset();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
loyaltyCards = [];
|
||||
favouriteCards = [];
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue