| 1 | | | import 'dart:io'; |
| 2 | | | import 'dart:isolate'; |
| 3 | | | |
| 4 | | | import 'package:meta/meta.dart'; |
| 5 | | | |
| 6 | | | import '../../converters/cast_converter.dart'; |
| 7 | | | import '../../squadron_platform_type.dart'; |
| 8 | | | import '../../utils.dart'; |
| 9 | | | |
| 10 | | | /// threadIDs may not be unique on VM... |
| 11 | | 5 | final threadId = Isolate.current.hashCode.hex; |
| 12 | | | |
| 13 | | | const platformConverter = CastConverter.instance; |
| 14 | | | |
| 15 | | | const platformType = SquadronPlatformType.vm; |
| 16 | | | |
| 17 | | 3 | final osType = switch (Platform.operatingSystem) { |
| 18 | | 1 | 'windows' => SquadronOSType.windows, |
| 19 | | 0 | 'linux' => SquadronOSType.linux, |
| 20 | | 0 | 'fuchsia' => SquadronOSType.fuchsia, |
| 21 | | 0 | 'macos' => SquadronOSType.macos, |
| 22 | | 0 | 'android' => SquadronOSType.android, |
| 23 | | 0 | 'ios' => SquadronOSType.ios, |
| 24 | | | _ => SquadronOSType.unknown |
| 25 | | | }; |
| 26 | | | |
| 27 | | 0 | Uri mapUrl(String url) => Uri.parse(url); |
| 28 | | | |
| 29 | | 1 | @internal |
| 30 | | | bool isSameInstance(Object a, Object b) => identical(a, b); |