LCOV - code coverage report

Current view
top level - src/annotations - squadron_service.dart
Test
lcov.info
Date
2025-11-17
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines77100.0%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import '../pool/worker_pool.dart';
2import '../worker/worker.dart';
3import 'target_platform.dart';
4
5const localService = SquadronService.local();
6const vmService = SquadronService.vm();
7const sharedService = SharedServiceParam._();
8
9@Deprecated('Use sharedService instead.')
10const localWorker = SharedServiceParam._();
11
12class SharedServiceParam {
1312 const SharedServiceParam._();
14}
15
16/// Annotation for service classes to be wrapped as workers.
17class SquadronService {
1812 const SquadronService({
19 this.pool = true,
20 this.targetPlatform = TargetPlatform.all,
21 String? baseUrl,
22 this.version,
23 }) : baseUrl = baseUrl ?? '',
24 local = false;
25
261 const SquadronService.web({bool pool = true, String? baseUrl, int? version})
271 : this(
28 pool: pool,
29 targetPlatform: TargetPlatform.web,
30 baseUrl: baseUrl,
31 version: version,
32 );
33
3412 const SquadronService.vm({bool pool = true})
3512 : this(pool: pool, targetPlatform: TargetPlatform.vm);
36
3712 const SquadronService.local()
38 : pool = false,
39 local = true,
40 targetPlatform = TargetPlatform.none,
41 baseUrl = '',
42 version = null;
43
44 /// Controls code generation of a [WorkerPool] exposing the target service
45 /// class. `true` by default.
46 final bool pool;
47
48 /// Controls code generation of [Worker] and [WorkerPool]. When `true`, no
49 /// [Worker] and no [WorkerPool] will be generated but instances of the service
50 /// class can be shared with other workers.
51 final bool local;
52
53 /// Controls code generation of a entry points for various platforms.
54 final int targetPlatform;
55
56 /// For Web-based workers, indicates the [baseUrl] where the Web Worker will
57 /// be exposed in production.
58 final String baseUrl;
59
60 /// For Web-based workers, indicates the Worker's [version]. When provided, this
61 /// number will be included in the worker's URL as a query parameter.
62 final int? version;
63}
Choose Features