QOL: Add reset function to providers
This commit is contained in:
@@ -7,6 +7,11 @@ class AboutMihProvider extends ChangeNotifier {
|
|||||||
this.toolIndex = 0,
|
this.toolIndex = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
toolIndex = 0;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
void setToolIndex(int index) {
|
void setToolIndex(int index) {
|
||||||
toolIndex = index;
|
toolIndex = index;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ class MihAccessControllsProvider extends ChangeNotifier {
|
|||||||
this.toolIndex = 0,
|
this.toolIndex = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
toolIndex = 0;
|
||||||
|
accessList = null;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
void setToolIndex(int index) {
|
void setToolIndex(int index) {
|
||||||
toolIndex = index;
|
toolIndex = index;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,11 @@ class MihAuthenticationProvider extends ChangeNotifier {
|
|||||||
this.toolIndex = 0,
|
this.toolIndex = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
toolIndex = 0;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
void setToolIndex(int index) {
|
void setToolIndex(int index) {
|
||||||
toolIndex = index;
|
toolIndex = index;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ class MihBannerAdProvider extends ChangeNotifier {
|
|||||||
this.errorMessage = '',
|
this.errorMessage = '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
bannerAd = null;
|
||||||
|
isBannerAdLoaded = false;
|
||||||
|
errorMessage = "";
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
bannerAd?.dispose();
|
bannerAd?.dispose();
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ class MihCalculatorProvider extends ChangeNotifier {
|
|||||||
this.toolIndex = 0,
|
this.toolIndex = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
availableCurrencies = [];
|
||||||
|
toolIndex = 0;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
void setToolIndex(int index) {
|
void setToolIndex(int index) {
|
||||||
toolIndex = index;
|
toolIndex = index;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ class MihCalendarProvider extends ChangeNotifier {
|
|||||||
this.toolIndex = 0,
|
this.toolIndex = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
toolIndex = 0;
|
||||||
|
personalAppointments = null;
|
||||||
|
businessAppointments = null;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
void setToolIndex(int index) {
|
void setToolIndex(int index) {
|
||||||
toolIndex = index;
|
toolIndex = index;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|||||||
@@ -1,18 +1,34 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
class MihMineSweeperProvider extends ChangeNotifier {
|
class MihMineSweeperProvider extends ChangeNotifier {
|
||||||
|
String difficulty;
|
||||||
int toolIndex;
|
int toolIndex;
|
||||||
int rowCount;
|
int rowCount;
|
||||||
int columnCount;
|
int columnCount;
|
||||||
int totalMines;
|
int totalMines;
|
||||||
|
|
||||||
MihMineSweeperProvider({
|
MihMineSweeperProvider({
|
||||||
|
this.difficulty = "Normal",
|
||||||
this.toolIndex = 0,
|
this.toolIndex = 0,
|
||||||
this.rowCount = 10,
|
this.rowCount = 10,
|
||||||
this.columnCount = 10,
|
this.columnCount = 10,
|
||||||
this.totalMines = 15,
|
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) {
|
void setToolIndex(int index) {
|
||||||
toolIndex = index;
|
toolIndex = index;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|||||||
@@ -8,6 +8,12 @@ class MzansiAiProvider extends ChangeNotifier {
|
|||||||
this.toolIndex = 0,
|
this.toolIndex = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
toolIndex = 0;
|
||||||
|
startUpQuestion = null;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
void setToolIndex(int index) {
|
void setToolIndex(int index) {
|
||||||
toolIndex = index;
|
toolIndex = index;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|||||||
@@ -26,6 +26,22 @@ class MzansiDirectoryProvider extends ChangeNotifier {
|
|||||||
this.businessTypeFilter = "",
|
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) {
|
void setToolIndex(int index) {
|
||||||
toolIndex = index;
|
toolIndex = index;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ class MzansiProfileProvider extends ChangeNotifier {
|
|||||||
businessUserSignatureUrl = null;
|
businessUserSignatureUrl = null;
|
||||||
businessUserSignature = null;
|
businessUserSignature = null;
|
||||||
userConsent = null;
|
userConsent = null;
|
||||||
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setPersonalHome(bool isPersonalHome) {
|
void setPersonalHome(bool isPersonalHome) {
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ class MzansiWalletProvider extends ChangeNotifier {
|
|||||||
this.toolIndex = 0,
|
this.toolIndex = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
toolIndex = 0;
|
||||||
|
loyaltyCards = [];
|
||||||
|
favouriteCards = [];
|
||||||
|
}
|
||||||
|
|
||||||
void setToolIndex(int index) {
|
void setToolIndex(int index) {
|
||||||
toolIndex = index;
|
toolIndex = index;
|
||||||
notifyListeners();
|
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