import 'package:discover_module/service.dart/service.dart'; 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(); } } }