From 52b4e172004ba903a841e53543c0406e51f2380c Mon Sep 17 00:00:00 2001 From: stonegate Date: Wed, 14 Oct 2020 14:41:14 +0800 Subject: [PATCH] Minor change. --- lib/home/playlist.dart | 39 +++++++++++++++++-------------- lib/podcasts/podcast_detail.dart | 40 +++++++++++++++++++------------- 2 files changed, 45 insertions(+), 34 deletions(-) diff --git a/lib/home/playlist.dart b/lib/home/playlist.dart index b4ba730..32379a9 100644 --- a/lib/home/playlist.dart +++ b/lib/home/playlist.dart @@ -73,6 +73,7 @@ class _PlaylistPageState extends State { appBar: AppBar( elevation: 0, backgroundColor: context.accentColor.withAlpha(70), + leading: CustomBackButton(), ), body: SafeArea( child: Selector { text: 'Today ', style: GoogleFonts.cairo( textStyle: TextStyle( - color: Theme.of(context) - .accentColor, + color: context.accentColor, fontSize: 20, ), ), @@ -215,8 +215,7 @@ class _PlaylistPageState extends State { color: context.brightness == Brightness.dark ? Colors.grey[800] : Colors.grey[200], - borderRadius: - BorderRadius.all(Radius.circular(10.0)), + borderRadius: BorderRadius.circular(10.0), ) : BoxDecoration(color: Colors.transparent), child: data.item2 @@ -530,7 +529,7 @@ class __HistoryListState extends State<_HistoryList> { return playHistory; } - _loadMoreData() async { + Future _loadMoreData() async { if (mounted) { setState(() { _loadMore = true; @@ -603,8 +602,11 @@ class __HistoryListState extends State<_HistoryList> { child: ListTile( contentPadding: EdgeInsets.fromLTRB( 24, 8, 20, 8), - onTap: () => - audio.episodeLoad(episode), + onTap: () => audio.episodeLoad( + episode, + startPosition: seekValue < 0.9 + ? (seconds * 1000).toInt() + : 0), leading: CircleAvatar( backgroundColor: c?.withOpacity(0.5), @@ -619,8 +621,8 @@ class __HistoryListState extends State<_HistoryList> { overflow: TextOverflow.ellipsis, ), ), - subtitle: Container( - height: 35, + subtitle: SizedBox( + height: 40, child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -629,14 +631,14 @@ class __HistoryListState extends State<_HistoryList> { children: [ if (seekValue < 0.9) Padding( - padding: const EdgeInsets - .symmetric( - vertical: 5.0), + padding: + EdgeInsets.symmetric( + vertical: 5.0), child: Material( color: Colors.transparent, child: InkWell( - onTap: () async { + onTap: () { audio.episodeLoad( episode, startPosition: @@ -644,6 +646,9 @@ class __HistoryListState extends State<_HistoryList> { 1000) .toInt()); }, + borderRadius: + BorderRadius + .circular(20), child: Stack( children: [ ShaderMask( @@ -682,8 +687,8 @@ class __HistoryListState extends State<_HistoryList> { decoration: BoxDecoration( borderRadius: - BorderRadius.all( - Radius.circular(20.0)), + BorderRadius.circular( + 20.0), color: context .accentColor, ), @@ -782,9 +787,7 @@ class __HistoryListState extends State<_HistoryList> { child: SizedBox( height: 25, width: 25, - child: CircularProgressIndicator( - strokeWidth: 2, - )), + child: CircularProgressIndicator()), ); }); } diff --git a/lib/podcasts/podcast_detail.dart b/lib/podcasts/podcast_detail.dart index bd7829d..436dd4d 100644 --- a/lib/podcasts/podcast_detail.dart +++ b/lib/podcasts/podcast_detail.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:io'; +import 'dart:math' as math; import 'package:cached_network_image/cached_network_image.dart'; import 'package:connectivity/connectivity.dart'; @@ -578,21 +579,29 @@ class _PodcastDetailState extends State { color: Colors.transparent, clipBehavior: Clip.hardEdge, borderRadius: BorderRadius.circular(100), - child: SizedBox( - width: 30, - child: IconButton( - padding: EdgeInsets.zero, - tooltip: s.homeSubMenuSortBy, - icon: Icon( - _reverse - ? LineIcons.hourglass_start_solid - : LineIcons.hourglass_end_solid, - color: _reverse ? context.accentColor : null, + child: TweenAnimationBuilder( + duration: Duration(milliseconds: 500), + curve: Curves.easeInOutQuart, + tween: Tween(begin: 0.0, end: 1.0), + builder: (context, angle, child) => Transform.rotate( + angle: math.pi * 2 * angle, + child: SizedBox( + width: 30, + child: IconButton( + padding: EdgeInsets.zero, + tooltip: s.homeSubMenuSortBy, + icon: Icon( + _reverse + ? LineIcons.hourglass_start_solid + : LineIcons.hourglass_end_solid, + color: _reverse ? context.accentColor : null, + ), + iconSize: 18, + onPressed: () { + setState(() => _reverse = !_reverse); + }, + ), ), - iconSize: 18, - onPressed: () { - setState(() => _reverse = !_reverse); - }, ), )), FutureBuilder( @@ -858,8 +867,7 @@ class _PodcastDetailState extends State { ); } return SliverToBoxAdapter( - child: Center(), - ); + child: Center()); }), SliverList( delegate: SliverChildBuilderDelegate(