baseUrl property
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;
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;
}