Go to file
David Peters 0d2cae951c
Update example reference
2020-08-27 12:07:03 +02:00
example Update example 2020-08-27 12:05:47 +02:00
lib Changed the way elevation is displayed 2020-08-27 11:41:09 +02:00
CHANGELOG.md Bump version to 0.4.0 2020-08-27 11:43:26 +02:00
LICENSE Update LICENSE 2020-07-29 22:36:44 +02:00
README.md Update example reference 2020-08-27 12:07:03 +02:00
pubspec.yaml Bump version to 0.4.0 2020-08-27 11:43:26 +02:00

README.md

Pub

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.

Demo

demo

Usage

Miniplayer(
  minHeight: 70,
  maxHeight: 370,
  builder: (height, percentage) {
    return Center(
      child: Text('$height, $percentage'),
    );
  },
),

Usage without BottomNavigationBar

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

See example