Skip to content

Commit

Permalink
Merge commit '93dc6d8eeb99e8b4abb8398484c6f4b2751bbea1' into custom-lg
Browse files Browse the repository at this point in the history
* commit '93dc6d8eeb99e8b4abb8398484c6f4b2751bbea1':
  chewie, version 1.8.0. Addresses fluttercommunity#814, fluttercommunity#815, fluttercommunity#821, and fluttercommunity#824.
  Fixed Dart formatting.
  Next version will require at least Flutter 3.19 and Dart 3.3 or higher.
  Update pubspec.yaml
  Update pubspec.yaml
  Update pubspec.yaml
  Ignore top safe area insets for material controls
  Refactor VideoPlayerController initialization to adhere to video_player ^2.8.2 guidelines
  • Loading branch information
lg8294 committed Aug 27, 2024
2 parents f907a45 + 93dc6d8 commit a6071e0
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 57 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
8 changes: 3 additions & 5 deletions example/lib/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -336,8 +335,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
}

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;
Expand Down
7 changes: 4 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/src/animated_play_pause.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/center_play_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions lib/src/chewie_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
8 changes: 3 additions & 5 deletions lib/src/cupertino/cupertino_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -822,12 +822,10 @@ class _CupertinoControlsState extends State<CupertinoControls>

class _PlaybackSpeedDialog extends StatelessWidget {
const _PlaybackSpeedDialog({
Key? key,
required List<double> speeds,
required double selected,
}) : _speeds = speeds,
_selected = selected,
super(key: key);
_selected = selected;

final List<double> _speeds;
final double _selected;
Expand Down
5 changes: 2 additions & 3 deletions lib/src/cupertino/cupertino_progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/cupertino/widgets/cupertino_options_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<OptionItem> options;
final String? cancelButtonText;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/helpers/adaptive_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions lib/src/material/material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -261,6 +261,7 @@ class _MaterialControlsState extends State<MaterialControls>
bottom: !chewieController.isFullScreen ? 10.0 : 0,
),
child: SafeArea(
top: false,
bottom: chewieController.isFullScreen,
minimum: chewieController.controlsSafeAreaMinimum,
child: Column(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/material/material_desktop_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 2 additions & 3 deletions lib/src/material/material_progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/material/widgets/options_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<OptionItem> options;
final String? cancelButtonText;
Expand Down
5 changes: 2 additions & 3 deletions lib/src/material/widgets/playback_speed_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import 'package:flutter/material.dart';

class PlaybackSpeedDialog extends StatelessWidget {
const PlaybackSpeedDialog({
Key? key,
super.key,
required List<double> speeds,
required double selected,
}) : _speeds = speeds,
_selected = selected,
super(key: key);
_selected = selected;

final List<double> _speeds;
final double _selected;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/player_with_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
9 changes: 4 additions & 5 deletions lib/src/progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -126,14 +125,14 @@ class _VideoProgressBarState extends State<VideoProgressBar> {

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;
Expand Down
16 changes: 8 additions & 8 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a6071e0

Please sign in to comment.