You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/api/gaz_cylinder_size_api_clien...

22 lines
666 B
Dart

import 'dart:convert';
import 'package:http/http.dart';
import '../controllers/api_routes/urls.dart';
import '../models/lookup.dart';
import 'api_client.dart';
class GazCylinderSizeApiClient{
static final GazCylinderSizeApiClient _instance = GazCylinderSizeApiClient._internal();
GazCylinderSizeApiClient._internal();
factory GazCylinderSizeApiClient() => _instance;
Future getData() async {
Response response= await ApiClient().getJsonForResponse("${URLs.host1}${URLs.getGasCylinderSize}");
var categoriesListJson = json.decode(response.body);
return categoriesListJson['data'].map<Lookup>((item) => Lookup.fromJson(item)).toList();
}
}