From 91eff967fb753dbcc34275f2d2f4b3f82786d13f Mon Sep 17 00:00:00 2001 From: Stonegate Date: Fri, 1 Jan 2021 23:43:10 +0800 Subject: [PATCH] Minor change. --- lib/type/playlist.dart | 3 +++ lib/widgets/audiopanel.dart | 34 ++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/lib/type/playlist.dart b/lib/type/playlist.dart index e846f2a..92fdcc6 100644 --- a/lib/type/playlist.dart +++ b/lib/type/playlist.dart @@ -36,9 +36,12 @@ class Playlist extends Equatable { bool get isEmpty => episodeList.isEmpty; + int get length => episodes.length; + Playlist(this.name, {String id, List episodeList, List episodes}) : id = id ?? Uuid().v4(), + assert(name != ''), episodeList = episodeList ?? [], episodes = episodes ?? []; diff --git a/lib/widgets/audiopanel.dart b/lib/widgets/audiopanel.dart index b08eb97..3226ff7 100644 --- a/lib/widgets/audiopanel.dart +++ b/lib/widgets/audiopanel.dart @@ -53,7 +53,7 @@ class AudioPanelState extends State with TickerProviderStateMixin { _controller.forward(); _slideDirection = SlideDirection.up; super.initState(); - _expandHeight = widget.maxHeight + 300; + _expandHeight = widget.maxHeight + 316; } @override @@ -67,7 +67,7 @@ class AudioPanelState extends State with TickerProviderStateMixin { void didUpdateWidget(AudioPanel oldWidget) { if (oldWidget.maxHeight != widget.maxHeight) { setState(() { - _expandHeight = widget.maxHeight + 300; + _expandHeight = widget.maxHeight + 316; }); } super.didUpdateWidget(oldWidget); @@ -92,10 +92,8 @@ class AudioPanelState extends State with TickerProviderStateMixin { child: GestureDetector( onTap: backToMini, child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.9 * - math.min(_animation.value / widget.maxHeight, 1)), + color: context.scaffoldBackgroundColor.withOpacity( + 0.9 * math.min(_animation.value / widget.maxHeight, 1)), ), ), ) @@ -111,7 +109,7 @@ class AudioPanelState extends State with TickerProviderStateMixin { height: _getHeight(), child: _animation.value < widget.minHeight + 30 ? Container( - color: Theme.of(context).primaryColor, + color: context.primaryColor, child: Opacity( opacity: _animation.value > widget.minHeight ? (widget.minHeight + 30 - _animation.value) / 40 @@ -122,10 +120,9 @@ class AudioPanelState extends State with TickerProviderStateMixin { : Container( decoration: BoxDecoration( color: context.primaryColor, - // borderRadius: BorderRadius.only( - // topLeft: Radius.circular(20.0), - // topRight: Radius.circular(20.0)), - + borderRadius: BorderRadius.only( + topLeft: Radius.circular(16.0), + topRight: Radius.circular(16.0)), boxShadow: [ BoxShadow( offset: Offset(0, -1), @@ -134,6 +131,13 @@ class AudioPanelState extends State with TickerProviderStateMixin { ? Colors.grey[400].withOpacity(0.5) : Colors.grey[800], ), + BoxShadow( + offset: Offset(-1, 0), + blurRadius: 1, + color: context.brightness == Brightness.light + ? Colors.grey[400].withOpacity(0.5) + : Colors.grey[800], + ), ], ), child: SingleChildScrollView( @@ -146,7 +150,13 @@ class AudioPanelState extends State with TickerProviderStateMixin { child: SizedBox( height: math.max(widget.maxHeight, math.min(_animation.value, _expandHeight)), - child: widget.expandedPanel, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox(height: 16), + Expanded(child: widget.expandedPanel), + ], + ), ), ), ),