Skip to content

Flutter 3.29 minimum version #923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ jobs:
# refer to https://docs.flutter.dev/development/tools/sdk/releases.
# Note: The version below should be manually updated to the latest second most recent version
# after a new stable version comes out.
- "3.27.4"
- "3.29.3"
- "3.x"
fail-fast: false
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
Expand All @@ -59,3 +60,5 @@ jobs:

- name: 📁 Upload coverage to Codecov
uses: codecov/codecov-action@v5
# TODO: Remove the below once we have adequate tests for this library.
continue-on-error: true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ build/

.project
.classpath
.settings
.settings

coverage/*
1 change: 0 additions & 1 deletion example/lib/app/app.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:chewie/chewie.dart';
import 'package:chewie_example/app/theme.dart';
import 'package:flutter/material.dart';
Expand Down
13 changes: 7 additions & 6 deletions lib/src/center_play_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ class CenterPlayButton extends StatelessWidget {
child: IconButton(
iconSize: 32,
padding: const EdgeInsets.all(12.0),
icon: isFinished
? Icon(Icons.replay, color: iconColor)
: AnimatedPlayPause(
color: iconColor,
playing: isPlaying,
),
icon:
isFinished
? Icon(Icons.replay, color: iconColor)
: AnimatedPlayPause(
color: iconColor,
playing: isPlaying,
),
onPressed: onPressed,
),
),
Expand Down
42 changes: 21 additions & 21 deletions lib/src/chewie_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,20 @@ import 'package:provider/provider.dart';
import 'package:video_player/video_player.dart';
import 'package:wakelock_plus/wakelock_plus.dart';

typedef ChewieRoutePageBuilder = Widget Function(
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
ChewieControllerProvider controllerProvider,
);
typedef ChewieRoutePageBuilder =
Widget Function(
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
ChewieControllerProvider controllerProvider,
);

/// A Video Player with Material and Cupertino skins.
///
/// `video_player` is pretty low level. Chewie wraps it in a friendly skin to
/// make it easy to use!
class Chewie extends StatefulWidget {
const Chewie({
super.key,
required this.controller,
});
const Chewie({super.key, required this.controller});

/// The [ChewieController]
final ChewieController controller;
Expand Down Expand Up @@ -223,15 +221,13 @@ class ChewieState extends State<Chewie> {
DeviceOrientation.landscapeRight,
]);
}

/// Video h > w means we force portrait
else if (isPortraitVideo) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
}

/// Otherwise if h == w (square video)
else {
SystemChrome.setPreferredOrientations(DeviceOrientation.values);
Expand Down Expand Up @@ -310,9 +306,9 @@ class ChewieController extends ChangeNotifier {
this.controlsSafeAreaMinimum = EdgeInsets.zero,
this.pauseOnBackgroundTap = false,
}) : assert(
playbackSpeeds.every((speed) => speed > 0),
'The playbackSpeeds values must all be greater than 0',
) {
playbackSpeeds.every((speed) => speed > 0),
'The playbackSpeeds values must all be greater than 0',
) {
_initialize();
}

Expand Down Expand Up @@ -365,7 +361,8 @@ class ChewieController extends ChangeNotifier {
Animation<double>,
Animation<double>,
ChewieControllerProvider,
)? routePageBuilder,
)?
routePageBuilder,
bool? pauseOnBackgroundTap,
}) {
return ChewieController(
Expand Down Expand Up @@ -409,14 +406,16 @@ class ChewieController extends ChangeNotifier {
allowPlaybackSpeedChanging ?? this.allowPlaybackSpeedChanging,
useRootNavigator: useRootNavigator ?? this.useRootNavigator,
playbackSpeeds: playbackSpeeds ?? this.playbackSpeeds,
systemOverlaysOnEnterFullScreen: systemOverlaysOnEnterFullScreen ??
systemOverlaysOnEnterFullScreen:
systemOverlaysOnEnterFullScreen ??
this.systemOverlaysOnEnterFullScreen,
deviceOrientationsOnEnterFullScreen:
deviceOrientationsOnEnterFullScreen ??
this.deviceOrientationsOnEnterFullScreen,
this.deviceOrientationsOnEnterFullScreen,
systemOverlaysAfterFullScreen:
systemOverlaysAfterFullScreen ?? this.systemOverlaysAfterFullScreen,
deviceOrientationsAfterFullScreen: deviceOrientationsAfterFullScreen ??
deviceOrientationsAfterFullScreen:
deviceOrientationsAfterFullScreen ??
this.deviceOrientationsAfterFullScreen,
routePageBuilder: routePageBuilder ?? this.routePageBuilder,
hideControlsTimer: hideControlsTimer ?? this.hideControlsTimer,
Expand Down Expand Up @@ -449,7 +448,8 @@ class ChewieController extends ChangeNotifier {
final Future<void> Function(
BuildContext context,
List<OptionItem> chewieOptions,
)? optionsBuilder;
)?
optionsBuilder;

/// Add your own additional options on top of chewie options
final List<OptionItem> Function(BuildContext context)? additionalOptions;
Expand Down Expand Up @@ -506,7 +506,7 @@ class ChewieController extends ChangeNotifier {
/// When the video playback runs into an error, you can build a custom
/// error message.
final Widget Function(BuildContext context, String errorMessage)?
errorBuilder;
errorBuilder;

/// When the video is buffering, you can build a custom widget.
final WidgetBuilder? bufferingBuilder;
Expand Down
8 changes: 4 additions & 4 deletions lib/src/chewie_progress_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ class ChewieProgressColors {
Color bufferedColor = const Color.fromRGBO(30, 30, 200, 0.2),
Color handleColor = const Color.fromRGBO(200, 200, 200, 1.0),
Color backgroundColor = const Color.fromRGBO(200, 200, 200, 0.5),
}) : playedPaint = Paint()..color = playedColor,
bufferedPaint = Paint()..color = bufferedColor,
handlePaint = Paint()..color = handleColor,
backgroundPaint = Paint()..color = backgroundColor;
}) : playedPaint = Paint()..color = playedColor,
bufferedPaint = Paint()..color = bufferedColor,
handlePaint = Paint()..color = handleColor,
backgroundPaint = Paint()..color = backgroundColor;

final Paint playedPaint;
final Paint bufferedPaint;
Expand Down
Loading