diff --git a/CHANGELOG.md b/CHANGELOG.md index f2be73b..62cba3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 1.1.0 + +* Fix namespace issue and add a new media action preset by [kmartins](https://github.com/kmartins): [PR #21](https://github.com/PuntitOwO/simple_pip_mode_flutter/pull/21) +* Add deprecation warning to `PipWidget.builder` and `PipWidget.pipBuilder` parameters. They will be removed in v2.0.0. +* Refactor native code method dispatcher to separate methods for each method call. +* Update README.md to include new features and deprecation warning. + ## 1.0.0 * Android 14 support by [song011794](https://github.com/song011794): [PR #12](https://github.com/PuntitOwO/simple_pip_mode_flutter/pull/12) diff --git a/README.md b/README.md index e21d3f7..44a6e2b 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ This way, when user presses home (or uses home gesture), the app enters PIP mode There's two ways of enabling callbacks: * [Activity wrapper](#activity-wrapper) (Recommended!) -* [Callback helper](#callback-helper) +* [Callback helper](#callback-helper) (The old, manual way) ### Activity wrapper @@ -189,16 +189,18 @@ SimplePip _pip = SimplePip( To use the widget, you need to [enable callbacks](#enabling-callbacks) first. Import `pip_widget.dart` file. -Add a `PipWidget` widget to your tree and give it a `builder` or a `child`, and a `pipBuilder` or a `pipChild`. +Add a `PipWidget` widget to your tree and give it a `child` and a `pipChild`. + +> [!Note] +> `builder` and `pipBuilder` are deprecated. Use a `Builder` as the `child` or `pipChild` instead. + ```dart import 'package:simple_pip_mode/pip_widget.dart'; class MyWidget extends StatelessWidget { Widget build(BuildContext context) { return PipWidget( - builder: (context) => Text('This is built when PIP mode is not active'), - child: Text('This widget is not used because builder is not null'), - //pipBuilder: (context) => Text('This is built when PIP mode is active'), - pipChild: Text('This widget is used because pipBuilder is null'), + child: Text('This is built when PIP mode is not active'), + pipChild: Text('This is built when PIP mode is active'), ); } } @@ -224,10 +226,8 @@ class MyWidget extends StatelessWidget { switch (action) { case PipAction.play: // example: videoPlayerController.play(); - break; case PipAction.pause: // example: videoPlayerController.pause(); - break; case PipAction.next: // example: videoPlayerController.next(); case PipAction.previous: @@ -236,7 +236,6 @@ class MyWidget extends StatelessWidget { // example: videoPlayerController.seek(-10); case PipAction.forward: // example: videoPlayerController.seek(10); - setState(() => actionResponse = "Forward") default: break; } @@ -268,5 +267,6 @@ Huge thanks to: * [Erick Daros](https://github.com/erickdaros) for PIP Actions feature. * [song011794](https://github.com/song011794) for updating the plugin to Android 14. * [af-ffr](https://github.com/af-ffr) for updating the plugin to add auto enter parameter. +* [kmartins](https://github.com/kmartins) for updating the plugin to add more actions. Issues and pull requests are appreciated! diff --git a/pubspec.yaml b/pubspec.yaml index cec7473..cf0f05a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: simple_pip_mode description: A complete Picture-In-Picutre mode plugin (Android support only) -version: 1.0.0 +version: 1.1.0 repository: https://github.com/PuntitOwO/simple_pip_mode_flutter environment: