NEW: MIH Access Controlls Provider Setup

This commit is contained in:
2025-10-21 15:42:38 +02:00
parent 926b749fa8
commit b0d38b4b11
11 changed files with 167 additions and 264 deletions

View File

@@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_objects/patient_access.dart';
class MihAccessControllsProvider extends ChangeNotifier {
int toolIndex;
List<PatientAccess>? accessList;
MihAccessControllsProvider({
this.toolIndex = 0,
});
void setToolIndex(int index) {
toolIndex = index;
}
void setAccessList(List<PatientAccess> accesses) {
accessList = accesses;
notifyListeners();
}
void editAccessItem(PatientAccess updatedAccess) {
if (accessList == null) return;
int index = accessList!.indexWhere((access) =>
access.app_id == updatedAccess.app_id &&
access.business_id == updatedAccess.business_id);
if (index != -1) {
accessList![index] = updatedAccess;
notifyListeners();
}
}
}