Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[video_player] add assertion for rotation to be a multiple of 90
Signed-off-by: ふぁ <[email protected]>
  • Loading branch information
fa0311 committed Mar 20, 2025
commit 5ac956552ae34c546a1c619ae40534174eaba543
7 changes: 3 additions & 4 deletions packages/video_player/video_player/lib/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,9 @@ class _VideoPlayerState extends State<VideoPlayer> {
}

class _VideoPlayerWithRotation extends StatelessWidget {
const _VideoPlayerWithRotation({required this.rotation, required this.child});
const _VideoPlayerWithRotation({required this.rotation, required this.child})
: assert(rotation % 90 == 0, 'Rotation must be a multiple of 90');

final int rotation;
final Widget child;

Expand All @@ -890,9 +892,6 @@ class _VideoPlayerWithRotation extends StatelessWidget {
if (rotation == 0) {
return child;
}
if (rotation % 90 != 0) {
throw ArgumentError('Rotation must be a multiple of 90');
}
return RotatedBox(
quarterTurns: rotation ~/ 90,
child: child,
Expand Down