Skip to content

Commit 65391c4

Browse files
authored
Merge pull request #676 from jweidner-mbible/master
Allow Chewie controls to be positioned to allow for a larger safe area.
2 parents 9261f8b + 0fbc0a7 commit 65391c4

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

lib/src/chewie_player.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ class ChewieController extends ChangeNotifier {
283283
this.routePageBuilder,
284284
this.progressIndicatorDelay,
285285
this.hideControlsTimer = defaultHideControlsTimer,
286+
this.controlsSafeAreaMinimum = EdgeInsets.zero,
286287
}) : assert(
287288
playbackSpeeds.every((speed) => speed > 0),
288289
'The playbackSpeeds values must all be greater than 0',
@@ -322,6 +323,7 @@ class ChewieController extends ChangeNotifier {
322323
bool? allowPlaybackSpeedChanging,
323324
bool? useRootNavigator,
324325
Duration? hideControlsTimer,
326+
EdgeInsets? controlsSafeAreaMinimum,
325327
List<double>? playbackSpeeds,
326328
List<SystemUiOverlay>? systemOverlaysOnEnterFullScreen,
327329
List<DeviceOrientation>? deviceOrientationsOnEnterFullScreen,
@@ -525,6 +527,10 @@ class ChewieController extends ChangeNotifier {
525527
/// Defines a delay in milliseconds between entering buffering state and displaying the loading spinner. Set null (default) to disable it.
526528
final Duration? progressIndicatorDelay;
527529

530+
/// Adds additional padding to the controls' [SafeArea] as desired.
531+
/// Defaults to [EdgeInsets.zero].
532+
final EdgeInsets controlsSafeAreaMinimum;
533+
528534
static ChewieController of(BuildContext context) {
529535
final chewieControllerProvider =
530536
context.dependOnInheritedWidgetOfExactType<ChewieControllerProvider>()!;

lib/src/cupertino/cupertino_controls.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ class _CupertinoControlsState extends State<CupertinoControls>
246246
) {
247247
return SafeArea(
248248
bottom: chewieController.isFullScreen,
249+
minimum: chewieController.controlsSafeAreaMinimum,
249250
child: AnimatedOpacity(
250251
opacity: notifier.hideStuff ? 0.0 : 1.0,
251252
duration: const Duration(milliseconds: 300),

lib/src/material/material_controls.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ class _MaterialControlsState extends State<MaterialControls>
262262
),
263263
child: SafeArea(
264264
bottom: chewieController.isFullScreen,
265+
minimum: chewieController.controlsSafeAreaMinimum,
265266
child: Column(
266267
mainAxisSize: MainAxisSize.min,
267268
mainAxisAlignment: MainAxisAlignment.center,

0 commit comments

Comments
 (0)