diff --git a/CHANGELOG.md b/CHANGELOG.md index 009955c..1cabaf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.2.0] + +* Added backgroundColor property + ## [0.1.2] * Bug fixes. diff --git a/lib/miniplayer.dart b/lib/miniplayer.dart index 9ab985f..9450508 100644 --- a/lib/miniplayer.dart +++ b/lib/miniplayer.dart @@ -12,6 +12,7 @@ class Miniplayer extends StatefulWidget { final MiniplayerBuilder builder; final Curve curve; final double elevation; + final Color backgroundColor; const Miniplayer({ Key key, @@ -20,6 +21,7 @@ class Miniplayer extends StatefulWidget { @required this.builder, this.curve = Curves.easeInQuart, this.elevation = 0, + this.backgroundColor = const Color(0x70000000), }) : super(key: key); @override @@ -83,8 +85,10 @@ class _MiniplayerState extends State with TickerProviderStateMixin { if (_percentage > 0) GestureDetector( onTap: () => animateToHeight(widget.minHeight), - child: Container( - color: Colors.black.withOpacity(_percentage * 0.5)), + child: Opacity( + opacity: _percentage, + child: Container(color: widget.backgroundColor), + ), ), Align( alignment: Alignment.bottomCenter, diff --git a/pubspec.yaml b/pubspec.yaml index 06027cf..9997b44 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: miniplayer -description: Miniplayer for Flutter -version: 0.1.2 +description: 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. +version: 0.2.0 homepage: https://www.peterscode.dev repository: https://github.com/peterscodee/miniplayer