Line data Source code
1 : // Licensed under the Apache License, Version 2.0
2 : // Copyright 2025, Michael Bushe, All rights reserved.
3 :
4 : // This is a stub implementation for non-web platforms
5 : // It doesn't import dart:js_interop
6 : import 'resource.dart';
7 : import 'resource_detector.dart';
8 :
9 : /// Stub implementation of the WebResourceDetector for non-web platforms.
10 : ///
11 : /// This implementation is a placeholder that throws an error if used,
12 : /// ensuring that the web-specific detector is only used in web environments.
13 : ///
14 : /// This is part of Dart's conditional import/export pattern for
15 : /// platform-specific code.
16 : class WebResourceDetector implements ResourceDetector {
17 0 : @override
18 : Future<Resource> detect() async {
19 0 : throw UnsupportedError(
20 : 'WebResourceDetector is only available on web platforms');
21 : }
22 : }
|