From 593302e7d4899424f456b0be4c61a3ae51fcca66 Mon Sep 17 00:00:00 2001 From: David <8vsxdxd@gmail.com> Date: Sat, 26 Sep 2020 15:13:06 +0200 Subject: [PATCH] Add documentation --- lib/miniplayer.dart | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/miniplayer.dart b/lib/miniplayer.dart index 43e0d1d..668a2d5 100644 --- a/lib/miniplayer.dart +++ b/lib/miniplayer.dart @@ -5,17 +5,37 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:miniplayer/src/utils.dart'; +///Type definition for the builder function typedef Widget MiniplayerBuilder(double height, double percentage); -enum SnapPosition { MAX, MIN, DISMISS } - +///Miniplayers are commonly used in media applications like Spotify and Youtube. +///A miniplayer can be expanded and minified and +///remains on the screen when minified until dismissed by the user. class Miniplayer extends StatefulWidget { - final double minHeight, maxHeight, elevation; + ///Required option to set the minimum and maximum height + final double minHeight, maxHeight; + + ///Option to enable and set elevation for the miniplayer + final double elevation; + + ///Central API-Element + ///Provides a builder with useful information final MiniplayerBuilder builder; + + ///Option to set the animation curve final Curve curve; + + ///Sets the background-color of the miniplayer final Color backgroundColor; + + ///Option to set the animation duration final Duration duration; + + ///Allows you to use a global ValueNotifier with the current progress. + ///This can be used to hide the BottomNavigationBar. final ValueNotifier valueNotifier; + + ///If onDismiss is set, the miniplayer can be dismissed final Function onDismiss; const Miniplayer({