Skip to content

Commit

Permalink
Dart format & v 7.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Illia Romanenko committed Apr 28, 2022
1 parent 55e2753 commit b61a238
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
37 changes: 19 additions & 18 deletions flutter_vlc_player/lib/src/flutter_vlc_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ class VlcPlayer extends StatefulWidget {
final Widget? placeholder;
final bool virtualDisplay;

const VlcPlayer({
Key? key,
const VlcPlayer(
{Key? key,

/// The [VlcPlayerController] responsible for the video being rendered in
/// this widget.
required this.controller,
/// The [VlcPlayerController] responsible for the video being rendered in
/// this widget.
required this.controller,

/// The aspect ratio used to display the video.
/// This MUST be provided, however it could simply be (parentWidth / parentHeight) - where parentWidth and
/// parentHeight are the width and height of the parent perhaps as defined by a LayoutBuilder.
required this.aspectRatio,
/// The aspect ratio used to display the video.
/// This MUST be provided, however it could simply be (parentWidth / parentHeight) - where parentWidth and
/// parentHeight are the width and height of the parent perhaps as defined by a LayoutBuilder.
required this.aspectRatio,

/// Before the platform view has initialized, this placeholder will be rendered instead of the video player.
/// This can simply be a [CircularProgressIndicator] (see the example.)
this.placeholder,
/// Before the platform view has initialized, this placeholder will be rendered instead of the video player.
/// This can simply be a [CircularProgressIndicator] (see the example.)
this.placeholder,

/// Specify whether Virtual displays or Hybrid composition is used on Android.
/// iOS only uses Hybrid composition.
this.virtualDisplay = true
}) : super(key: key);
/// Specify whether Virtual displays or Hybrid composition is used on Android.
/// iOS only uses Hybrid composition.
this.virtualDisplay = true})
: super(key: key);

@override
_VlcPlayerState createState() => _VlcPlayerState();
Expand Down Expand Up @@ -94,8 +94,9 @@ class _VlcPlayerState extends State<VlcPlayer>
),
Offstage(
offstage: !_isInitialized,
child: vlcPlayerPlatform
.buildView(widget.controller.onPlatformViewCreated, virtualDisplay: widget.virtualDisplay),
child: vlcPlayerPlatform.buildView(
widget.controller.onPlatformViewCreated,
virtualDisplay: widget.virtualDisplay),
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class MethodChannelVlcPlayer extends VlcPlayerPlatform {
/// The `virtualDisplay` specifies whether Virtual displays or Hybrid composition is used on Android.
/// iOS only uses Hybrid composition.
@override
Widget buildView(PlatformViewCreatedCallback onPlatformViewCreated, {bool virtualDisplay = true}) {
Widget buildView(PlatformViewCreatedCallback onPlatformViewCreated,
{bool virtualDisplay = true}) {
const viewType = 'flutter_video_plugin/getVideoView';
if (Platform.isAndroid) {
if (virtualDisplay) {
Expand All @@ -75,9 +76,9 @@ class MethodChannelVlcPlayer extends VlcPlayerPlatform {
return PlatformViewLink(
viewType: viewType,
surfaceFactory: (
BuildContext context,
PlatformViewController controller,
) {
BuildContext context,
PlatformViewController controller,
) {
return AndroidViewSurface(
controller: controller as AndroidViewController,
gestureRecognizers: const {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ abstract class VlcPlayerPlatform extends PlatformInterface {
}

/// Returns a widget displaying the video.
Widget buildView(PlatformViewCreatedCallback onPlatformViewCreated, {bool virtualDisplay = true}) {
Widget buildView(PlatformViewCreatedCallback onPlatformViewCreated,
{bool virtualDisplay = true}) {
throw _unimplemented('buildView');
}

Expand Down

0 comments on commit b61a238

Please sign in to comment.