LCOV - code coverage report

Current view
top level - src - squadron_singleton.dart
Test
lcov.info
Date
2025-03-26
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
238 static final identical = impl.isSameInstance;
24
2530 static final _platformConverter = impl.getPlatformConverter();
2630 static Converter _converter = _platformConverter;
27
28 /// Gets the current converter.
2920 static Converter get converter => _converter;
30
31 /// Sets the current converter. If [value] is `null`, the default converter
32 /// will be restored. If the converter was updated, handlers registered with
33 /// [onConverterChanged] will be notified of the change.
341 static set converter(Converter? value) {
351 value ??= _platformConverter;
362 if (_converter != value) {
37 _converter = value;
383 for (var handler in _converterChangeHandlers.values) {
39 try {
401 handler();
41 } catch (_) {
42 // ignore
43 }
44 }
45 }
46 }
47
483 static final _converterChangeHandlers = <Object, void Function()>{};
49
50 /// Registers a callback that will be called whenever `converter` is changed.
51 /// Returns an object that can be used to unregister the callback by passing
52 /// it to [unregisterConverterChanged].
531 static Object onConverterChanged(void Function() handler) {
541 final key = Object();
552 _converterChangeHandlers[key] = handler;
56 return key;
57 }
58
59 /// Unregisters a callback that was registered with [onConverterChanged].
601 static void unregisterConverterChanged(Object key) {
612 _converterChangeHandlers.remove(key);
62 }
63}
Choose Features