[![Pub](https://img.shields.io/pub/v/miniplayer?color=2196F3)](https://pub.dev/packages/miniplayer) A lightweight flutter package to simplify the creation of a miniplayer by providing a builder function with the current height and percentage progress. The widget responds to tap and drag gestures and is highly customizable. **What is a miniplayer?** Miniplayers are commonly used in media applications like Spotify and Youtube. A miniplayer can be expanded and minified and remains on the screen when minified until dismissed by the user. See the demo below for an example. ## Demo ![demo](./example/demo_gif/demo.gif "demo") ## Usage ```dart Miniplayer( minHeight: 70, maxHeight: 370, builder: (height, percentage) { return Center( child: Text('$height, $percentage'), ); }, ), ``` ## Options
Parameter | Implementation | Explanation |
---|---|---|
onDismiss |
Miniplayer(
onDismiss: () {
//Handle onDismissed here
},
),
|
If onDismiss is set, the miniplayer can be dismissed |
valueNotifier |
final ValueNotifier<double> playerExpandProgress =
ValueNotifier(playerMinHeight);
Miniplayer(
valueNotifier: playerExpandProgress,
),
|
Allows you to use a global ValueNotifier with the current progress. This can be used to hide the BottomNavigationBar. |