LCOV - code coverage report

Current view
top level - src - squadron_singleton.dart
Test
lcov.info
Date
2026-11-07
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines151788.2%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import '_impl/xplat/_platform.dart'
2 if (dart.library.io) '_impl/native/_platform.dart'
3 if (dart.library.html) '_impl/web/_platform.dart'
4 if (dart.library.js) '_impl/web/_platform.dart'
5 if (dart.library.js_interop) '_impl/web/_platform.dart' as impl;
6import 'converters/converter.dart';
7
82String get threadId => impl.threadId;
9
10class Squadron {
110 Squadron._();
12
13 /// Gets the current platform information.
14 static const platformType = impl.platformType;
153 static final osType = impl.osType;
16
17 /// Parse [url] and returns the corresponding [Uri].
18 ///
19 /// On Web platforms, a leading '~' character will be replaced with the
20 /// current page's root URL. E.g. '~/workers' from '/path/to/index.html'
21 /// will return '/path/to/workers'.
220 static Uri uri(String url) => impl.mapUrl(url);
23
24 static bool disableBrowserCache = false;
25
262 static final identical = impl.isSameInstance;
27 static const _platformConverter = impl.platformConverter;
282 static Converter _converter = _platformConverter;
29
30 /// Gets the current converter.
312 static Converter get converter => _converter;
32
33 /// Sets the current converter. If [value] is `null`, the default converter
34 /// will be restored. If the converter was updated, handlers registered with
35 /// [onConverterChanged] will be notified of the change.
361 static set converter(Converter? value) {
37 value ??= _platformConverter;
382 if (_converter != value) {
39 _converter = value;
403 for (var handler in _converterChangeHandlers.values) {
41 try {
421 handler();
43 } catch (_) {
44 // ignore
45 }
46 }
47 }
48 }
49
503 static final _converterChangeHandlers = <Object, void Function()>{};
51
52 /// Registers a callback that will be called whenever `converter` is changed.
53 /// Returns an object that can be used to unregister the callback by passing
54 /// it to [unregisterConverterChanged].
551 static Object onConverterChanged(void Function() handler) {
561 final key = Object();
572 _converterChangeHandlers[key] = handler;
58 return key;
59 }
60
61 /// Unregisters a callback that was registered with [onConverterChanged].
621 static void unregisterConverterChanged(Object key) {
632 _converterChangeHandlers.remove(key);
64 }
65}
Choose Features