Skip to content

Commit

Permalink
chore: update README and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
PuntitOwO committed Jan 23, 2025
1 parent 8cf8db4 commit 64073e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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'),
);
}
}
Expand All @@ -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:
Expand All @@ -236,7 +236,6 @@ class MyWidget extends StatelessWidget {
// example: videoPlayerController.seek(-10);
case PipAction.forward:
// example: videoPlayerController.seek(10);
setState(() => actionResponse = "Forward")
default:
break;
}
Expand Down Expand Up @@ -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!
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 64073e1

Please sign in to comment.