import 'dart:convert'; import 'package:discover_module/contacts_module/service.dart/service.dart'; import 'package:discover_module/contacts_module/storage_hive/aff_data/insert_aff.dart'; import 'package:flutter/cupertino.dart'; class AffiliationsProvider extends ChangeNotifier { final affapi = Callapi(); List affiliations1 = []; List allaffiliations1 = []; List get adddta => affiliations1; List get affiliationsAll => allaffiliations1; getAffiliationsdata(text) async { print("Affiliations_is: ${text}"); final affdata = await affapi.getaffiliationsdata(text); print("Affiliations_is after:$affdata "); // final Map jsonData = json.decode(affdata); // // final List affiliations = jsonData['Affiliations']; // print("Affiliations_is return:$jsonData "); affiliations1 = affdata; notifyListeners(); } getAllAffiliationsdata() async { print("Affiliations_is: "); final affdata = await affapi.getallaffiliationsdata(); print("Affiliations_is after:$affdata "); allaffiliations1 = affdata; notifyListeners(); } storeAff(row) async { final affdata = await affapi.getaffiliationsdata(row); print("Affiliations_MyStoringData:$affdata "); await addAffiliation(affdata); } }