parent
6e22b4d2fc
commit
f62b922ae7
46
README.md
46
README.md
|
@ -2,7 +2,7 @@
|
|||
|
||||
A lightweight flutter package providing a miniplayer widget which resizes according to drag gestures and returns a builder function with the current height and percentage progress.
|
||||
|
||||
## Usuage
|
||||
## Usage
|
||||
|
||||
```dart
|
||||
Miniplayer(
|
||||
|
@ -15,3 +15,47 @@ Miniplayer(
|
|||
},
|
||||
),
|
||||
```
|
||||
#### Default usage
|
||||
|
||||
```
|
||||
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
|
||||
|
||||
```
|
||||
Example coming soon!
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue