LCOV - code coverage report

Current view
top level - src - squadron_singleton.dart
Test
lcov.info
Date
2025-11-17
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines171989.5%
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 type.
1436 static final platformType = impl.getPlatformType();
15
16 /// Parse [url] and returns the corresponding [Uri].
17 ///
18 /// On Web platforms, a leading '~' character will be replaced with the
19 /// current page's root URL. E.g. '~/workers' from '/path/to/index.html'
20 /// will return '/path/to/workers'.
210 static Uri uri(String url) => impl.mapUrl(url);
22
23 static bool disableBrowserCache = false;
24
258 static final identical = impl.isSameInstance;
2630 static final _platformConverter = impl.getPlatformConverter();
2730 static Converter _converter = _platformConverter;
28
29 /// Gets the current converter.
3020 static Converter get converter => _converter;
31
32 /// Sets the current converter. If [value] is `null`, the default converter
33 /// will be restored. If the converter was updated, handlers registered with
34 /// [onConverterChanged] will be notified of the change.
351 static set converter(Converter? value) {
361 value ??= _platformConverter;
372 if (_converter != value) {
38 _converter = value;
393 for (var handler in _converterChangeHandlers.values) {
40 try {
411 handler();
42 } catch (_) {
43 // ignore
44 }
45 }
46 }
47 }
48
493 static final _converterChangeHandlers = <Object, void Function()>{};
50
51 /// Registers a callback that will be called whenever `converter` is changed.
52 /// Returns an object that can be used to unregister the callback by passing
53 /// it to [unregisterConverterChanged].
541 static Object onConverterChanged(void Function() handler) {
551 final key = Object();
562 _converterChangeHandlers[key] = handler;
57 return key;
58 }
59
60 /// Unregisters a callback that was registered with [onConverterChanged].
611 static void unregisterConverterChanged(Object key) {
622 _converterChangeHandlers.remove(key);
63 }
64}
Choose Features