add project

This commit is contained in:
chanthasuon
2021-03-01 22:16:41 +07:00
commit 7fb3f2582e
70 changed files with 1812 additions and 0 deletions

View File

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