baseUrl property

String get baseUrl

Request base url, it can be multiple forms:

  • Contains sub paths, e.g. https://pub.dev/api/.
  • Relative path on Web, e.g. api/.

Implementation

String get baseUrl => _baseUrl;
set baseUrl (String value)

Implementation

set baseUrl(String value) {
  if (value.isNotEmpty && !kIsWeb && Uri.parse(value).host.isEmpty) {
    throw ArgumentError.value(
      value,
      'baseUrl',
      'Must be a valid URL on platforms other than Web.',
    );
  }
  _baseUrl = value;
}