Go to file
peterscodee ddf09936fa Version 0.2.0: Add backgroundColor property 2020-07-31 10:02:40 +02:00
lib Version 0.2.0: Add backgroundColor property 2020-07-31 10:02:40 +02:00
CHANGELOG.md Version 0.2.0: Add backgroundColor property 2020-07-31 10:02:40 +02:00
LICENSE Update LICENSE 2020-07-29 22:36:44 +02:00
README.md Update README.md 2020-07-31 08:45:33 +02:00
pubspec.yaml Version 0.2.0: Add backgroundColor property 2020-07-31 10:02:40 +02:00

README.md

Pub

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.

Usage

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

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!