step 19 : icon aplikasi, setting build apk
This commit is contained in:
@@ -65,6 +65,36 @@ abstract class BaseRepository {
|
||||
}
|
||||
}
|
||||
|
||||
// with handling
|
||||
Future<Map<String, dynamic>> postGraphQlQueryX(
|
||||
String query, Map<String, dynamic> inpVariables) async {
|
||||
try {
|
||||
final options =
|
||||
QueryOptions(document: gql(query), variables: inpVariables);
|
||||
final QueryResult result = await graphql.query(options);
|
||||
|
||||
if (result.hasException) {
|
||||
if (result.exception != null) {
|
||||
if (result.exception!.graphqlErrors.isNotEmpty
|
||||
is BaseRepositoryException) {
|
||||
final error = result.exception!.graphqlErrors[0];
|
||||
BaseRepositoryException exception =
|
||||
result.exception!.linkException as BaseRepositoryException;
|
||||
var errorMessage = exception.message;
|
||||
print(errorMessage);
|
||||
throw BaseRepositoryException(
|
||||
message: errorMessage,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result.data!;
|
||||
} catch (e) {
|
||||
throw BaseRepositoryException(message: e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// NATIVE POST PAKE DIO
|
||||
Future<Map<String, dynamic>> post({
|
||||
required Map<String, dynamic> param,
|
||||
|
||||
@@ -152,15 +152,16 @@ class PresensiRepository extends BaseRepository {
|
||||
|
||||
// Map<String, dynamic> inpVariables = paramInpVariables;
|
||||
|
||||
// Map<String, dynamic> inpVariables = {
|
||||
// Map<String, dynamic> X = {
|
||||
// "M_StaffID": M_StaffID,
|
||||
// "M_CompanyID": M_CompanyID,
|
||||
// "token": token,
|
||||
// "token": token+"1",
|
||||
// };
|
||||
|
||||
print(paramInpVariables);
|
||||
|
||||
final resp = await postGraphQlQuery(query, paramInpVariables);
|
||||
// final resp = await postGraphQlQueryX(query, X);
|
||||
|
||||
// print(inpVariables);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user