LCOV - code coverage report

Current view
top level - src/annotations - squadron_service.dart
Test
lcov.info
Date
2026-11-07
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
9class SharedServiceParam {
101 const SharedServiceParam._();
11}
12
13/// Annotation for service classes to be wrapped as workers.
14class SquadronService {
151 const SquadronService({
16 this.pool = true,
17 this.targetPlatform = TargetPlatform.all,
18 String? baseUrl,
19 this.version,
20 }) : baseUrl = baseUrl ?? '',
21 local = false;
22
231 const SquadronService.web({bool pool = true, String? baseUrl, int? version})
241 : this(
25 pool: pool,
26 targetPlatform: TargetPlatform.web,
27 baseUrl: baseUrl,
28 version: version,
29 );
30
311 const SquadronService.vm({bool pool = true})
321 : this(pool: pool, targetPlatform: TargetPlatform.vm);
33
341 const SquadronService.local()
35 : pool = false,
36 local = true,
37 targetPlatform = TargetPlatform.none,
38 baseUrl = '',
39 version = null;
40
41 /// Controls code generation of a [WorkerPool] exposing the target service
42 /// class. `true` by default.
43 final bool pool;
44
45 /// Controls code generation of [Worker] and [WorkerPool]. When `true`, no
46 /// [Worker] and no [WorkerPool] will be generated but instances of the service
47 /// class can be shared with other workers.
48 final bool local;
49
50 /// Controls code generation of a entry points for various platforms.
51 final int targetPlatform;
52
53 /// For Web-based workers, indicates the [baseUrl] where the Web Worker will
54 /// be exposed in production.
55 final String baseUrl;
56
57 /// For Web-based workers, indicates the Worker's [version]. When provided, this
58 /// number will be included in the worker's URL as a query parameter.
59 final int? version;
60}
Choose Features