Fixes, elevation property

This commit is contained in:
peterscodee 2020-07-30 17:01:37 +02:00
parent f18eb5033a
commit 9e6dd01e02
2 changed files with 53 additions and 42 deletions

View File

@ -11,14 +11,16 @@ class Miniplayer extends StatefulWidget {
final double maxHeight;
final MiniplayerBuilder builder;
final Curve curve;
final double elevation;
const Miniplayer(
{Key key,
const Miniplayer({
Key key,
@required this.minHeight,
@required this.maxHeight,
@required this.builder,
this.curve = Curves.easeInQuart})
: super(key: key);
this.curve = Curves.easeInQuart,
this.elevation = 0,
}) : super(key: key);
@override
_MiniplayerState createState() => _MiniplayerState();
@ -84,10 +86,18 @@ class _MiniplayerState extends State<Miniplayer> with TickerProviderStateMixin {
child: Container(
color: Colors.black.withOpacity(_percentage * 0.5)),
),
SizedBox(
Align(
alignment: Alignment.bottomCenter,
child: SizedBox(
height: snapshot.data,
child: GestureDetector(
child: Material(
elevation: widget.elevation,
child: Container(
constraints: BoxConstraints.expand(),
child: widget.builder(snapshot.data, _percentage),
),
),
onTap: () {
bool up = _height != widget.maxHeight;
animateToHeight(up ? widget.maxHeight : widget.minHeight);
@ -121,6 +131,7 @@ class _MiniplayerState extends State<Miniplayer> with TickerProviderStateMixin {
},
),
),
),
],
);
} else

View File

@ -1,12 +1,12 @@
name: miniplayer
description: Miniplayer for Flutter
version: 0.0.1
author: David Peters
homepage: peterscode.dev
version: 0.1.0
homepage: https://www.peterscode.dev
repository: https://github.com/peterscodee/miniplayer
environment:
sdk: ">=2.7.0 <3.0.0"
flutter: ">=1.17.0 <2.0.0"
sdk: ">=2.3.0 <3.0.0"
flutter: ">=1.0.0 <2.0.0"
dependencies:
flutter: