import 'package:flutter_service/config/DiConfig.dart'; import 'package:flutter_service/model/CategoryResponse.dart'; Future> getAllCategoryService() async { String url = "http://computer-api.osa.cubetiqs.com/api/frontend/categories"; List r = await getDioInstance().get(url).then((value) { List result = value.data['data'] as List; return result.map((e) => CategoryResponse.fromResponse(e)).toList(); }).catchError((onError) { print(onError); return null; }); return r; }