DiscoverModule/lib/contacts_module/provider_class/engagement_provider.dart

80 lines
1.8 KiB
Dart
Raw Permalink Normal View History

2024-10-07 12:41:28 +00:00
import 'package:discover_module/contacts_module/service.dart/service.dart';
2024-08-13 10:46:26 +00:00
import 'package:flutter/cupertino.dart';
class EnagagementProvider extends ChangeNotifier {
final callapi = Callapi();
List enagement = [];
List get engagementdata => enagement;
List enagementhcpname = [];
List get engagementhcppname => enagementhcpname;
List enagementhcpmain = [];
List get enagementhcppmain => enagementhcpmain;
List enagementhcprel = [];
List get enagementhcpprel => enagementhcprel;
List enagementhcplevel = [];
List get enagementhcpplevel => enagementhcplevel;
getengagementdata() async {
final engdata = await callapi.getEngdata();
enagement = engdata;
notifyListeners();
}
gethcpname() async {
if (enagementhcpname.isNotEmpty) {
enagementhcpname.clear();
}
for (var hname in engagementdata) {
enagementhcpname.add(hname['hcpname']);
//print("checkin_eng: ${hname['hcpname']}");
notifyListeners();
}
}
getmaintherepeutic() async {
if (enagementhcpmain.isNotEmpty) {
enagementhcpmain.clear();
}
for (var hname in engagementdata) {
enagementhcpmain.add(hname['main thereutic area']);
//print("checkin_eng: ${hname['hcpname']}");
notifyListeners();
}
}
getrelationship() async {
if (enagementhcprel.isNotEmpty) {
enagementhcprel.clear();
}
for (var hname in engagementdata) {
enagementhcprel.add(hname['relationship with chiesi']);
//print("checkin_eng: ${hname['hcpname']}");
notifyListeners();
}
}
getrelationlevel() async {
if (enagementhcplevel.isNotEmpty) {
enagementhcplevel.clear();
}
for (var hname in engagementdata) {
enagementhcplevel.add(hname['level of engagement']);
//print("checkin_eng: ${hname['hcpname']}");
notifyListeners();
}
}
}