QOL: Add reset function to providers
This commit is contained in:
@@ -7,6 +7,11 @@ class AboutMihProvider extends ChangeNotifier {
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
|
||||
@@ -9,6 +9,12 @@ class MihAccessControllsProvider extends ChangeNotifier {
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
accessList = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,11 @@ class MihAuthenticationProvider extends ChangeNotifier {
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
|
||||
@@ -14,6 +14,13 @@ class MihBannerAdProvider extends ChangeNotifier {
|
||||
this.errorMessage = '',
|
||||
});
|
||||
|
||||
void reset() {
|
||||
bannerAd = null;
|
||||
isBannerAdLoaded = false;
|
||||
errorMessage = "";
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
bannerAd?.dispose();
|
||||
|
||||
@@ -9,6 +9,12 @@ class MihCalculatorProvider extends ChangeNotifier {
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
availableCurrencies = [];
|
||||
toolIndex = 0;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
|
||||
@@ -11,6 +11,13 @@ class MihCalendarProvider extends ChangeNotifier {
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
personalAppointments = null;
|
||||
businessAppointments = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
|
||||
@@ -1,18 +1,34 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class MihMineSweeperProvider extends ChangeNotifier {
|
||||
String difficulty;
|
||||
int toolIndex;
|
||||
int rowCount;
|
||||
int columnCount;
|
||||
int totalMines;
|
||||
|
||||
MihMineSweeperProvider({
|
||||
this.difficulty = "Normal",
|
||||
this.toolIndex = 0,
|
||||
this.rowCount = 10,
|
||||
this.columnCount = 10,
|
||||
this.totalMines = 15,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
difficulty = "Normal";
|
||||
toolIndex = 0;
|
||||
rowCount = 10;
|
||||
columnCount = 10;
|
||||
totalMines = 15;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setDifficulty(String difficulty) {
|
||||
this.difficulty = difficulty;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
|
||||
@@ -8,6 +8,12 @@ class MzansiAiProvider extends ChangeNotifier {
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
startUpQuestion = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
|
||||
@@ -26,6 +26,22 @@ class MzansiDirectoryProvider extends ChangeNotifier {
|
||||
this.businessTypeFilter = "",
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
userPosition = null;
|
||||
userLocation = "Unknown Location";
|
||||
personalSearch = true;
|
||||
bookmarkedBusinesses = [];
|
||||
businessDetailsMap = {};
|
||||
searchedBusinesses = null;
|
||||
selectedBusiness = null;
|
||||
searchedUsers = null;
|
||||
selectedUser = null;
|
||||
searchTerm = "";
|
||||
businessTypeFilter = "";
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
|
||||
@@ -41,6 +41,7 @@ class MzansiProfileProvider extends ChangeNotifier {
|
||||
businessUserSignatureUrl = null;
|
||||
businessUserSignature = null;
|
||||
userConsent = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPersonalHome(bool isPersonalHome) {
|
||||
|
||||
@@ -12,6 +12,12 @@ class MzansiWalletProvider extends ChangeNotifier {
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
loyaltyCards = [];
|
||||
favouriteCards = [];
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/patients.dart';
|
||||
|
||||
class PatientManagerProvider extends ChangeNotifier {
|
||||
int patientProfileIndex;
|
||||
int patientManagerIndex;
|
||||
bool personalMode;
|
||||
Patient? selectedPatient;
|
||||
|
||||
PatientManagerProvider({
|
||||
this.patientProfileIndex = 0,
|
||||
this.patientManagerIndex = 0,
|
||||
this.personalMode = true,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
patientProfileIndex = 0;
|
||||
patientManagerIndex = 0;
|
||||
personalMode = true;
|
||||
selectedPatient = null;
|
||||
}
|
||||
|
||||
void setPatientProfileIndex(int index) {
|
||||
patientProfileIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPatientManagerIndex(int index) {
|
||||
patientManagerIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPersonalMode(bool personalMode) {
|
||||
this.personalMode = personalMode;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSelectedPatient({required Patient? selectedPatient}) {
|
||||
this.selectedPatient = selectedPatient;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user