MediaPlayback constructor
MediaPlayback(
- Iterable<
Uri> resources, { - required WidgetBuilder onLoadFailed,
- WidgetBuilder? onLoading,
- MediaPlaybackPreference preference = const MediaPlaybackPreference(),
- Key? key,
Construct MediaPlayback with predefined preferences.
It should not be built during widget test due to behavourial of Dart's built in client. Therefore, UnsupportedError will be thrown if attempted to build it.
Implementation
MediaPlayback(Iterable<Uri> resources,
{required this.onLoadFailed,
this.onLoading,
this.preference = const MediaPlaybackPreference(),
super.key})
: resources = List.unmodifiable(resources) {
if (isTesting) {
throw UnsupportedError(
"No real network interaction allowed during test, and it should never be built.");
}
}