DiscoverModule/lib/provider_class/affiliationsprovider.dart

41 lines
1.2 KiB
Dart
Raw Normal View History

2024-08-30 12:24:54 +00:00
import 'dart:convert';
2024-07-05 08:48:29 +00:00
import 'package:discover_module/model_class/affiliations.dart';
2024-08-30 12:24:54 +00:00
import 'package:discover_module/model_class/section.dart';
2024-07-05 08:48:29 +00:00
import 'package:discover_module/service.dart/service.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;
2024-08-30 12:24:54 +00:00
getAffiliationsdata(text) async {
print("Affiliations_is: ${text}");
final affdata = await affapi.getaffiliationsdata(text);
2024-07-05 08:48:29 +00:00
print("Affiliations_is after:$affdata ");
2024-08-30 12:24:54 +00:00
// final Map<String, dynamic> jsonData = json.decode(affdata);
// // final List<dynamic> affiliations = jsonData['Affiliations'];
// print("Affiliations_is return:$jsonData ");
2024-07-05 08:48:29 +00:00
affiliations1 = affdata;
2024-08-30 12:24:54 +00:00
// print("Affiliations_is return:$affiliations1 ");
2024-07-05 08:48:29 +00:00
notifyListeners();
}
getAllAffiliationsdata() async {
print("Affiliations_is: ");
final affdata = await affapi.getallaffiliationsdata();
print("Affiliations_is after:$affdata ");
allaffiliations1 = affdata;
notifyListeners();
}
}