Status.dart 644 B

123456789101112131415161718192021
  1. import 'package:dio/dio.dart';
  2. class Status {
  3. static const String OK = "OK";
  4. static const String RES_REPEATED = "RES_REPEATED";
  5. static const String RES_NOT_MATCH = "RES_NOT_MATCH";
  6. static const String INVALID_AUTHORIZE = "INVALID_AUTHORIZE";
  7. static const String RES_NOT_FOUND = "RES_NOT_FOUND";
  8. static const String CREATE_FAIL = "CREATE_FAIL";
  9. static const String CONNECT_FAIL = "CONNECT_FAIL";
  10. static const String RES_NOT_ALLOW = "RES_NOT_ALLOW";
  11. static String? of(Response? response) {
  12. if (response == null) {
  13. return CONNECT_FAIL;
  14. }
  15. else {
  16. return response.headers.value("responseCode");
  17. }
  18. }
  19. }