import'dart:convert';import'package:http/http.dart'ashttp;import'package:flutter/foundation.dart';import'package:miapp_flutter/environments/archivo.dart';classCategoryApi{finalStringapiUrl='categoria';// Método para obtener las categoríasFuture<Map<String,dynamic>>getCategories()async{Stringurl='${apiApp}/$apiUrl?offset=0&max=100';if(kDebugMode){print('Url -> $url');}try{finalresponse=awaithttp.get(Uri.parse(url));// Verifica el estado de la respuestaif(response.statusCode==200){return{'statusCode':response.statusCode,'body':response.body,};}else{return{'statusCode':response.statusCode,'body':'Error: ${response.reasonPhrase}',};}}catch(e){return{'statusCode':501,'body':'Error: $e',};}}}