ClientRouter constructor

ClientRouter({
  1. String? baseUrl,
  2. String prefix = '',
  3. Map<String, String> headers = const {},
  4. Map<String, dynamic> query = const {},
  5. Duration timeout = const Duration(seconds: 30),
  6. bool debug = false,
  7. bool throwIfError = false,
  8. ErrorHandler? onError,
  9. RequestDoneCallback? onDone,
  10. StatusCodeConfig statusCodeConfig = const StatusCodeConfig(),
})

Creates a client router using the current browser origin by default.

Implementation

ClientRouter({
  String? baseUrl,
  this.prefix = '',
  Map<String, String> headers = const {},
  Map<String, dynamic> query = const {},
  Duration timeout = const Duration(seconds: 30),
  bool debug = false,
  bool throwIfError = false,
  ErrorHandler? onError,
  RequestDoneCallback? onDone,
  StatusCodeConfig statusCodeConfig = const StatusCodeConfig(),
}) : client = FlintClient(
       baseUrl: baseUrl ?? _browserOrigin(),
       headers: headers,
       defaultQueryParameters: query,
       timeout: timeout,
       debug: debug,
       throwIfError: throwIfError,
       onError: onError,
       onDone: onDone,
       statusCodeConfig: statusCodeConfig,
     );