2020-07-30 16:01:58 +02:00
[![Pub ](https://img.shields.io/pub/v/miniplayer?color=2196F3 )](https://pub.dev/packages/miniplayer)
2020-07-30 15:58:35 +02:00
2020-08-27 11:47:06 +02:00
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.
2020-07-29 22:13:39 +02:00
2020-08-03 15:03:54 +02:00
## Demo
2020-08-26 14:47:39 +02:00
![demo ](./example/demo_gif/demo.gif "demo" )
2020-08-03 15:03:54 +02:00
2020-07-30 21:38:41 +02:00
## Usage
2020-07-29 22:13:39 +02:00
2020-07-30 17:02:14 +02:00
```dart
Miniplayer(
minHeight: 70,
maxHeight: 370,
builder: (height, percentage) {
return Center(
child: Text('$height, $percentage'),
);
},
),
```
2020-08-27 11:47:06 +02:00
#### Usage without BottomNavigationBar
2020-07-30 21:38:41 +02:00
2020-07-31 08:45:33 +02:00
```dart
2020-07-30 21:38:41 +02:00
import 'package:flutter/material.dart';
import 'package:miniplayer/miniplayer.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Miniplayer Demo',
theme: ThemeData(
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(),
builder: (context, child) { // < --- Important part
return Stack(
children: [
child,
Miniplayer(
minHeight: 70,
maxHeight: 370,
builder: (height, percentage) {
if(percentage > 0.2)
//return Text('!mini');
else
//return Text('mini');
},
),
],
);
},
);
}
}
```
#### Usage with BottomNavigationBar
2020-08-27 11:47:06 +02:00
[See example ](example/miniplayer_with_bottomnav/lib/main.dart )