diff --git a/CHANGELOG.md b/CHANGELOG.md index 33d1d1885..813d9f418 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.8.0 +* 🛠️ [#814](https://github.com/fluttercommunity/chewie/pull/814): Refactor VideoPlayerController initialization to adhere to video_player ^2.8.2 guidelines. Thanks [ishworpanta10](https://github.com/ishworpanta10). +* 🛠️ [#815](https://github.com/fluttercommunity/chewie/pull/815): Fix the Safe area conflict for material controls in Android. Thanks [MadGeorge](https://github.com/MadGeorge). +* 🛠️ [#821](https://github.com/fluttercommunity/chewie/pull/821): Upgrade chewie's dependency package. Thanks [ycv005](https://github.com/ycv005). +* 🛠️ [#824](https://github.com/fluttercommunity/chewie/pull/824): Flutter 3.19 enforcement. Thanks [diegotori](https://github.com/diegotori). +* **BREAKING CHANGE**: Library now requires at least Flutter and Dart versions `3.19.0` and `3.3` respectively. + + ## 1.7.5 * 🛠️ [#810](https://github.com/fluttercommunity/chewie/pull/810): Fixed : Web full screen issue (#790 #688). Thanks [ToddZeil](https://github.com/ToddZeil). * 🛠️ [#802](https://github.com/fluttercommunity/chewie/pull/802): Update chewie_player.dart. Thanks [B0yma](https://github.com/B0yma). diff --git a/README.md b/README.md index 2f3f365d5..7819647b8 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ dependencies: ```dart import 'package:chewie/chewie.dart'; -final videoPlayerController = VideoPlayerController.network( - 'https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4'); +final videoPlayerController = VideoPlayerController.networkUrl(Uri.parse( + 'https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4')); await videoPlayerController.initialize(); diff --git a/example/lib/app/app.dart b/example/lib/app/app.dart index 479079832..f337442ec 100644 --- a/example/lib/app/app.dart +++ b/example/lib/app/app.dart @@ -3,14 +3,13 @@ import 'dart:io'; import 'package:chewie/chewie.dart'; import 'package:chewie_example/app/theme.dart'; import 'package:flutter/material.dart'; -// ignore: depend_on_referenced_packages import 'package:video_player/video_player.dart'; class ChewieDemo extends StatefulWidget { const ChewieDemo({ - Key? key, + super.key, this.title = 'Chewie Demo', - }) : super(key: key); + }); final String title; @@ -336,8 +335,7 @@ class _ChewieDemoState extends State { } class DelaySlider extends StatefulWidget { - const DelaySlider({Key? key, required this.delay, required this.onSave}) - : super(key: key); + const DelaySlider({super.key, required this.delay, required this.onSave}); final int? delay; final void Function(int?) onSave; diff --git a/example/pubspec.yaml b/example/pubspec.yaml index b55303e75..0647d555c 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.0 publish_to: none environment: - sdk: '>=2.18.0 <4.0.0' - flutter: ">=3.10.0" + sdk: '>=3.3.0 <4.0.0' + flutter: ">=3.19.0" dependencies: chewie: @@ -14,10 +14,11 @@ dependencies: flutter: sdk: flutter + video_player: any dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.1 + flutter_lints: ^3.0.2 # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec diff --git a/lib/src/animated_play_pause.dart b/lib/src/animated_play_pause.dart index bef2dc3cf..e41111b7a 100644 --- a/lib/src/animated_play_pause.dart +++ b/lib/src/animated_play_pause.dart @@ -3,11 +3,11 @@ import 'package:flutter/material.dart'; /// A widget that animates implicitly between a play and a pause icon. class AnimatedPlayPause extends StatefulWidget { const AnimatedPlayPause({ - Key? key, + super.key, required this.playing, this.size, this.color, - }) : super(key: key); + }); final double? size; final bool playing; diff --git a/lib/src/center_play_button.dart b/lib/src/center_play_button.dart index 0f23d4f77..2b1656497 100644 --- a/lib/src/center_play_button.dart +++ b/lib/src/center_play_button.dart @@ -3,14 +3,14 @@ import 'package:flutter/material.dart'; class CenterPlayButton extends StatelessWidget { const CenterPlayButton({ - Key? key, + super.key, required this.backgroundColor, this.iconColor, required this.show, required this.isPlaying, required this.isFinished, this.onPressed, - }) : super(key: key); + }); final Color backgroundColor; final Color? iconColor; diff --git a/lib/src/chewie_player.dart b/lib/src/chewie_player.dart index a63f5104e..dfa6f0041 100644 --- a/lib/src/chewie_player.dart +++ b/lib/src/chewie_player.dart @@ -26,9 +26,9 @@ typedef ChewieRoutePageBuilder = Widget Function( /// make it easy to use! class Chewie extends StatefulWidget { const Chewie({ - Key? key, + super.key, required this.controller, - }) : super(key: key); + }); /// The [ChewieController] final ChewieController controller; @@ -662,10 +662,10 @@ class ChewieController extends ChangeNotifier { class ChewieControllerProvider extends InheritedWidget { const ChewieControllerProvider({ - Key? key, + super.key, required this.controller, - required Widget child, - }) : super(key: key, child: child); + required super.child, + }); final ChewieController controller; diff --git a/lib/src/cupertino/cupertino_controls.dart b/lib/src/cupertino/cupertino_controls.dart index 6fd319e43..df1475274 100644 --- a/lib/src/cupertino/cupertino_controls.dart +++ b/lib/src/cupertino/cupertino_controls.dart @@ -22,8 +22,8 @@ class CupertinoControls extends StatefulWidget { required this.backgroundColor, required this.iconColor, this.showPlayButton = true, - Key? key, - }) : super(key: key); + super.key, + }); final Color backgroundColor; final Color iconColor; @@ -822,12 +822,10 @@ class _CupertinoControlsState extends State class _PlaybackSpeedDialog extends StatelessWidget { const _PlaybackSpeedDialog({ - Key? key, required List speeds, required double selected, }) : _speeds = speeds, - _selected = selected, - super(key: key); + _selected = selected; final List _speeds; final double _selected; diff --git a/lib/src/cupertino/cupertino_progress_bar.dart b/lib/src/cupertino/cupertino_progress_bar.dart index 8e14962bc..04ca99f59 100644 --- a/lib/src/cupertino/cupertino_progress_bar.dart +++ b/lib/src/cupertino/cupertino_progress_bar.dart @@ -11,9 +11,8 @@ class CupertinoVideoProgressBar extends StatelessWidget { this.onDragEnd, this.onDragStart, this.onDragUpdate, - Key? key, - }) : colors = colors ?? ChewieProgressColors(), - super(key: key); + super.key, + }) : colors = colors ?? ChewieProgressColors(); final VideoPlayerController controller; final ChewieProgressColors colors; diff --git a/lib/src/cupertino/widgets/cupertino_options_dialog.dart b/lib/src/cupertino/widgets/cupertino_options_dialog.dart index 0dbf27801..1fa07aa52 100644 --- a/lib/src/cupertino/widgets/cupertino_options_dialog.dart +++ b/lib/src/cupertino/widgets/cupertino_options_dialog.dart @@ -3,10 +3,10 @@ import 'package:flutter/cupertino.dart'; class CupertinoOptionsDialog extends StatefulWidget { const CupertinoOptionsDialog({ - Key? key, + super.key, required this.options, this.cancelButtonText, - }) : super(key: key); + }); final List options; final String? cancelButtonText; diff --git a/lib/src/helpers/adaptive_controls.dart b/lib/src/helpers/adaptive_controls.dart index be59a7f66..e8dbdef4f 100644 --- a/lib/src/helpers/adaptive_controls.dart +++ b/lib/src/helpers/adaptive_controls.dart @@ -3,8 +3,8 @@ import 'package:flutter/material.dart'; class AdaptiveControls extends StatelessWidget { const AdaptiveControls({ - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/lib/src/material/material_controls.dart b/lib/src/material/material_controls.dart index 92be36fbe..70711173b 100644 --- a/lib/src/material/material_controls.dart +++ b/lib/src/material/material_controls.dart @@ -17,8 +17,8 @@ import 'package:video_player/video_player.dart'; class MaterialControls extends StatefulWidget { const MaterialControls({ this.showPlayButton = true, - Key? key, - }) : super(key: key); + super.key, + }); final bool showPlayButton; @@ -261,6 +261,7 @@ class _MaterialControlsState extends State bottom: !chewieController.isFullScreen ? 10.0 : 0, ), child: SafeArea( + top: false, bottom: chewieController.isFullScreen, minimum: chewieController.controlsSafeAreaMinimum, child: Column( diff --git a/lib/src/material/material_desktop_controls.dart b/lib/src/material/material_desktop_controls.dart index 2e1a92d9c..41ab86906 100644 --- a/lib/src/material/material_desktop_controls.dart +++ b/lib/src/material/material_desktop_controls.dart @@ -18,8 +18,8 @@ import 'package:video_player/video_player.dart'; class MaterialDesktopControls extends StatefulWidget { const MaterialDesktopControls({ this.showPlayButton = true, - Key? key, - }) : super(key: key); + super.key, + }); final bool showPlayButton; diff --git a/lib/src/material/material_progress_bar.dart b/lib/src/material/material_progress_bar.dart index ebfee55b5..63b091c7d 100644 --- a/lib/src/material/material_progress_bar.dart +++ b/lib/src/material/material_progress_bar.dart @@ -11,9 +11,8 @@ class MaterialVideoProgressBar extends StatelessWidget { this.onDragEnd, this.onDragStart, this.onDragUpdate, - Key? key, - }) : colors = colors ?? ChewieProgressColors(), - super(key: key); + super.key, + }) : colors = colors ?? ChewieProgressColors(); final double height; final VideoPlayerController controller; diff --git a/lib/src/material/widgets/options_dialog.dart b/lib/src/material/widgets/options_dialog.dart index bca7a9a2d..41a206319 100644 --- a/lib/src/material/widgets/options_dialog.dart +++ b/lib/src/material/widgets/options_dialog.dart @@ -3,10 +3,10 @@ import 'package:flutter/material.dart'; class OptionsDialog extends StatefulWidget { const OptionsDialog({ - Key? key, + super.key, required this.options, this.cancelButtonText, - }) : super(key: key); + }); final List options; final String? cancelButtonText; diff --git a/lib/src/material/widgets/playback_speed_dialog.dart b/lib/src/material/widgets/playback_speed_dialog.dart index 84ff79f73..0525a8f3b 100644 --- a/lib/src/material/widgets/playback_speed_dialog.dart +++ b/lib/src/material/widgets/playback_speed_dialog.dart @@ -2,12 +2,11 @@ import 'package:flutter/material.dart'; class PlaybackSpeedDialog extends StatelessWidget { const PlaybackSpeedDialog({ - Key? key, + super.key, required List speeds, required double selected, }) : _speeds = speeds, - _selected = selected, - super(key: key); + _selected = selected; final List _speeds; final double _selected; diff --git a/lib/src/player_with_controls.dart b/lib/src/player_with_controls.dart index a6294bcc0..98de90f68 100644 --- a/lib/src/player_with_controls.dart +++ b/lib/src/player_with_controls.dart @@ -6,7 +6,7 @@ import 'package:provider/provider.dart'; import 'package:video_player/video_player.dart'; class PlayerWithControls extends StatelessWidget { - const PlayerWithControls({Key? key}) : super(key: key); + const PlayerWithControls({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/src/progress_bar.dart b/lib/src/progress_bar.dart index 80cd23375..2494abf36 100644 --- a/lib/src/progress_bar.dart +++ b/lib/src/progress_bar.dart @@ -9,12 +9,11 @@ class VideoProgressBar extends StatefulWidget { this.onDragEnd, this.onDragStart, this.onDragUpdate, - Key? key, + super.key, required this.barHeight, required this.handleHeight, required this.drawShadow, - }) : colors = colors ?? ChewieProgressColors(), - super(key: key); + }) : colors = colors ?? ChewieProgressColors(); final VideoPlayerController controller; final ChewieProgressColors colors; @@ -126,14 +125,14 @@ class _VideoProgressBarState extends State { class StaticProgressBar extends StatelessWidget { const StaticProgressBar({ - Key? key, + super.key, required this.value, required this.colors, required this.barHeight, required this.handleHeight, required this.drawShadow, this.latestDraggableOffset, - }) : super(key: key); + }); final Offset? latestDraggableOffset; final VideoPlayerValue value; diff --git a/pubspec.yaml b/pubspec.yaml index cbd1057f6..136bf22d9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,24 +1,24 @@ name: chewie description: A video player for Flutter with Cupertino and Material play controls -version: 1.7.5 -homepage: http://github.com/fluttercommunity/chewie +version: 1.8.0 +homepage: https://github.com/fluttercommunity/chewie environment: - sdk: '>=2.18.0 <4.0.0' - flutter: ">=3.3.0" + sdk: '>=3.3.0 <4.0.0' + flutter: ">=3.19.0" dependencies: cupertino_icons: ^1.0.5 flutter: sdk: flutter - provider: ^6.0.5 - video_player: ^2.7.0 - wakelock_plus: ^1.1.0 + provider: ^6.1.2 + video_player: ^2.8.3 + wakelock_plus: ^1.2.1 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.2 + flutter_lints: ^3.0.2 flutter: uses-material-design: true