Navaron Bracke

depend on package:web

... ... @@ -6,8 +6,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 0.0.1
environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
sdk: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
... ...
// // This is here because dart doesn't seem to support this properly
// // https://stackoverflow.com/questions/61161135/adding-support-for-navigator-mediadevices-getusermedia-to-dart
@JS('navigator.mediaDevices')
library media_devices;
import 'package:js/js.dart';
@JS('getUserMedia')
external Future<dynamic> getUserMedia(UserMediaOptions constraints);
@JS()
@anonymous
class UserMediaOptions {
external VideoOptions get video;
external factory UserMediaOptions({VideoOptions? video});
}
@JS()
@anonymous
class VideoOptions {
external String get facingMode;
// external DeviceIdOptions get deviceId;
external Map get width;
external Map get height;
external factory VideoOptions({
String? facingMode,
DeviceIdOptions? deviceId,
Map? width,
Map? height,
});
}
@JS()
@anonymous
class DeviceIdOptions {
external String get exact;
external factory DeviceIdOptions({String? exact});
}
... ... @@ -16,16 +16,17 @@ screenshots:
path: example/screenshots/overlay.png
environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
sdk: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
dependencies:
flutter:
sdk: flutter
flutter_web_plugins:
sdk: flutter
js: ">=0.6.3 <0.8.0"
js: ^0.6.3
plugin_platform_interface: ^2.0.2
web: ^0.3.0
dev_dependencies:
flutter_test:
... ...