Config constructor

Config({
  1. String baseUrl = '',
  2. CreateHttpClient? createHttpClient,
  3. ValidateCertificate? badCertificateCallback,
  4. Duration connectTimeout = const Duration(seconds: 30),
  5. Duration receiveTimeout = const Duration(seconds: 30),
  6. String code = 'code',
  7. String data = 'data',
  8. String list = 'data/list',
  9. String message = 'message',
  10. String validCode = '0',
  11. String? errorTimeout = '网络请求超时',
  12. String? errorConnection = '网络连接出错,请检查网络连接',
  13. String? errorBadResponse = '服务器错误,请稍后重试',
  14. String? errorCancel = '请求被取消了',
  15. String? errorUnknown = '网络连接不稳定,请检查网络连接',
})

Implementation

Config(
    {this.baseUrl = '',
    this.createHttpClient,
    this.badCertificateCallback,
    this.connectTimeout = const Duration(seconds: 30),
    this.receiveTimeout = const Duration(seconds: 30),
    this.code = 'code',
    this.data = 'data',
    this.list = 'data/list',
    this.message = 'message',
    this.validCode = '0',
    this.errorTimeout = '网络请求超时',
    this.errorConnection = '网络连接出错,请检查网络连接',
    this.errorBadResponse = '服务器错误,请稍后重试',
    this.errorCancel = '请求被取消了',
    this.errorUnknown = '网络连接不稳定,请检查网络连接'});