DiscoverModule/lib/contacts_module/provider_class/location_provider.dart

23 lines
662 B
Dart

import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/loc_data/crud_loc.dart';
import 'package:flutter/cupertino.dart';
class LocationProvider extends ChangeNotifier {
final apicall = Callapi();
List loclist = [];
List get locationlist => loclist;
locationinfo(text) async {
print("Location_Text");
final publication_result = await apicall.getlocationsdata(text);
loclist = publication_result;
notifyListeners();
}
storeLoc(row) async {
final publicationResult = await apicall.getlocationsdata(row);
await addLoc(publicationResult);
}
}