From 7bf1a54ae7f76e6a5af4bdab04f715edd3315001 Mon Sep 17 00:00:00 2001 From: Ishwor Panta <31570025+ishworpanta10@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:11:42 +0545 Subject: [PATCH 1/8] Refactor VideoPlayerController initialization to adhere to video_player ^2.8.2 guidelines Updated VideoPlayerController initialization to use VideoPlayerController.networkUrl(Uri.parse('video_url')), complying with video_player ^2.8.2 guidelines. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); From a6ac6e4d3f4086a869c2fd718a57b5c0a7b7ffd7 Mon Sep 17 00:00:00 2001 From: George R Date: Wed, 14 Feb 2024 13:16:05 +0400 Subject: [PATCH 2/8] Ignore top safe area insets for material controls --- lib/src/material/material_controls.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/material/material_controls.dart b/lib/src/material/material_controls.dart index 92be36fbe..f7cf808f2 100644 --- a/lib/src/material/material_controls.dart +++ b/lib/src/material/material_controls.dart @@ -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( From d1f92c1844ec007137d65553f69aae9caf5f1050 Mon Sep 17 00:00:00 2001 From: Yash Chandra Verma Date: Sun, 24 Mar 2024 14:42:24 +0530 Subject: [PATCH 3/8] Update pubspec.yaml --- pubspec.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index cbd1057f6..3a5775a28 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,11 @@ dependencies: sdk: flutter provider: ^6.0.5 video_player: ^2.7.0 - wakelock_plus: ^1.1.0 + wakelock_plus: + git: + url: https://github.com/ycv005/wakelock_plus + ref: main + path: wakelock_plus dev_dependencies: flutter_test: From 7e4e9ba55c53d2886497d8890c5f6e1ff8676099 Mon Sep 17 00:00:00 2001 From: Yash Chandra Verma Date: Sat, 30 Mar 2024 11:19:39 +0530 Subject: [PATCH 4/8] Update pubspec.yaml --- pubspec.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 3a5775a28..fa4c9983a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,13 +11,9 @@ dependencies: cupertino_icons: ^1.0.5 flutter: sdk: flutter - provider: ^6.0.5 - video_player: ^2.7.0 - wakelock_plus: - git: - url: https://github.com/ycv005/wakelock_plus - ref: main - path: wakelock_plus + provider: ^6.1.2 + video_player: ^2.8.3 + wakelock_plus: wakelock_plus: ^1.2.1 dev_dependencies: flutter_test: From a3d7052a006e5bf9346b11bd14630acdd68bd8cf Mon Sep 17 00:00:00 2001 From: Yash Chandra Verma Date: Sun, 31 Mar 2024 10:57:55 +0530 Subject: [PATCH 5/8] Update pubspec.yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index fa4c9983a..2ccc3e5b0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: sdk: flutter provider: ^6.1.2 video_player: ^2.8.3 - wakelock_plus: wakelock_plus: ^1.2.1 + wakelock_plus: ^1.2.1 dev_dependencies: flutter_test: From fe1d43e4c170702b31f35f698f413c15260a6c4f Mon Sep 17 00:00:00 2001 From: Diego Tori Date: Mon, 1 Apr 2024 18:12:08 -0400 Subject: [PATCH 6/8] Next version will require at least Flutter 3.19 and Dart 3.3 or higher. --- example/lib/app/app.dart | 8 +++----- example/pubspec.yaml | 7 ++++--- lib/src/animated_play_pause.dart | 4 ++-- lib/src/center_play_button.dart | 4 ++-- lib/src/chewie_player.dart | 10 +++++----- lib/src/cupertino/cupertino_controls.dart | 8 +++----- lib/src/cupertino/cupertino_progress_bar.dart | 5 ++--- .../cupertino/widgets/cupertino_options_dialog.dart | 4 ++-- lib/src/helpers/adaptive_controls.dart | 4 ++-- lib/src/material/material_controls.dart | 4 ++-- lib/src/material/material_desktop_controls.dart | 4 ++-- lib/src/material/material_progress_bar.dart | 5 ++--- lib/src/material/widgets/options_dialog.dart | 4 ++-- lib/src/material/widgets/playback_speed_dialog.dart | 5 ++--- lib/src/player_with_controls.dart | 2 +- lib/src/progress_bar.dart | 9 ++++----- pubspec.yaml | 8 ++++---- 17 files changed, 44 insertions(+), 51 deletions(-) diff --git a/example/lib/app/app.dart b/example/lib/app/app.dart index e0c08b0b2..768b4e86d 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; @@ -333,8 +332,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 e41b77167..2591a9d53 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: @@ -13,10 +13,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 f35d4b521..a153b9110 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; @@ -647,10 +647,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..329bb6cb0 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 f7cf808f2..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; 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..2cbe8ccc9 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 553ae18d8..65d51a69b 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..71c857cc7 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 2ccc3e5b0..a72d28d21 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ name: chewie description: A video player for Flutter with Cupertino and Material play controls version: 1.7.5 -homepage: http://github.com/fluttercommunity/chewie +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 @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.2 + flutter_lints: ^3.0.2 flutter: uses-material-design: true From d29044d33495d49988e2476bd2102042e82c2ccb Mon Sep 17 00:00:00 2001 From: Diego Tori Date: Mon, 1 Apr 2024 18:12:36 -0400 Subject: [PATCH 7/8] Fixed Dart formatting. --- lib/src/cupertino/cupertino_progress_bar.dart | 2 +- lib/src/material/material_progress_bar.dart | 2 +- lib/src/progress_bar.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/cupertino/cupertino_progress_bar.dart b/lib/src/cupertino/cupertino_progress_bar.dart index 329bb6cb0..04ca99f59 100644 --- a/lib/src/cupertino/cupertino_progress_bar.dart +++ b/lib/src/cupertino/cupertino_progress_bar.dart @@ -12,7 +12,7 @@ class CupertinoVideoProgressBar extends StatelessWidget { this.onDragStart, this.onDragUpdate, super.key, - }) : colors = colors ?? ChewieProgressColors(); + }) : colors = colors ?? ChewieProgressColors(); final VideoPlayerController controller; final ChewieProgressColors colors; diff --git a/lib/src/material/material_progress_bar.dart b/lib/src/material/material_progress_bar.dart index 2cbe8ccc9..63b091c7d 100644 --- a/lib/src/material/material_progress_bar.dart +++ b/lib/src/material/material_progress_bar.dart @@ -12,7 +12,7 @@ class MaterialVideoProgressBar extends StatelessWidget { this.onDragStart, this.onDragUpdate, super.key, - }) : colors = colors ?? ChewieProgressColors(); + }) : colors = colors ?? ChewieProgressColors(); final double height; final VideoPlayerController controller; diff --git a/lib/src/progress_bar.dart b/lib/src/progress_bar.dart index 71c857cc7..2494abf36 100644 --- a/lib/src/progress_bar.dart +++ b/lib/src/progress_bar.dart @@ -13,7 +13,7 @@ class VideoProgressBar extends StatefulWidget { required this.barHeight, required this.handleHeight, required this.drawShadow, - }) : colors = colors ?? ChewieProgressColors(); + }) : colors = colors ?? ChewieProgressColors(); final VideoPlayerController controller; final ChewieProgressColors colors; From 93dc6d8eeb99e8b4abb8398484c6f4b2751bbea1 Mon Sep 17 00:00:00 2001 From: Diego Tori Date: Mon, 1 Apr 2024 18:46:13 -0400 Subject: [PATCH 8/8] chewie, version 1.8.0. Addresses #814, #815, #821, and #824. --- CHANGELOG.md | 8 ++++++++ pubspec.yaml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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/pubspec.yaml b/pubspec.yaml index a72d28d21..136bf22d9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: chewie description: A video player for Flutter with Cupertino and Material play controls -version: 1.7.5 +version: 1.8.0 homepage: https://github.com/fluttercommunity/chewie environment: