Minor change.

This commit is contained in:
stonegate 2020-10-14 14:41:14 +08:00
parent 2a54c5cb7b
commit 52b4e17200
2 changed files with 45 additions and 34 deletions

View File

@ -73,6 +73,7 @@ class _PlaylistPageState extends State<PlaylistPage> {
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
backgroundColor: context.accentColor.withAlpha(70), backgroundColor: context.accentColor.withAlpha(70),
leading: CustomBackButton(),
), ),
body: SafeArea( body: SafeArea(
child: Selector<AudioPlayerNotifier, child: Selector<AudioPlayerNotifier,
@ -138,8 +139,7 @@ class _PlaylistPageState extends State<PlaylistPage> {
text: 'Today ', text: 'Today ',
style: GoogleFonts.cairo( style: GoogleFonts.cairo(
textStyle: TextStyle( textStyle: TextStyle(
color: Theme.of(context) color: context.accentColor,
.accentColor,
fontSize: 20, fontSize: 20,
), ),
), ),
@ -215,8 +215,7 @@ class _PlaylistPageState extends State<PlaylistPage> {
color: context.brightness == Brightness.dark color: context.brightness == Brightness.dark
? Colors.grey[800] ? Colors.grey[800]
: Colors.grey[200], : Colors.grey[200],
borderRadius: borderRadius: BorderRadius.circular(10.0),
BorderRadius.all(Radius.circular(10.0)),
) )
: BoxDecoration(color: Colors.transparent), : BoxDecoration(color: Colors.transparent),
child: data.item2 child: data.item2
@ -530,7 +529,7 @@ class __HistoryListState extends State<_HistoryList> {
return playHistory; return playHistory;
} }
_loadMoreData() async { Future<void> _loadMoreData() async {
if (mounted) { if (mounted) {
setState(() { setState(() {
_loadMore = true; _loadMore = true;
@ -603,8 +602,11 @@ class __HistoryListState extends State<_HistoryList> {
child: ListTile( child: ListTile(
contentPadding: EdgeInsets.fromLTRB( contentPadding: EdgeInsets.fromLTRB(
24, 8, 20, 8), 24, 8, 20, 8),
onTap: () => onTap: () => audio.episodeLoad(
audio.episodeLoad(episode), episode,
startPosition: seekValue < 0.9
? (seconds * 1000).toInt()
: 0),
leading: CircleAvatar( leading: CircleAvatar(
backgroundColor: backgroundColor:
c?.withOpacity(0.5), c?.withOpacity(0.5),
@ -619,8 +621,8 @@ class __HistoryListState extends State<_HistoryList> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
subtitle: Container( subtitle: SizedBox(
height: 35, height: 40,
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
@ -629,14 +631,14 @@ class __HistoryListState extends State<_HistoryList> {
children: <Widget>[ children: <Widget>[
if (seekValue < 0.9) if (seekValue < 0.9)
Padding( Padding(
padding: const EdgeInsets padding:
.symmetric( EdgeInsets.symmetric(
vertical: 5.0), vertical: 5.0),
child: Material( child: Material(
color: color:
Colors.transparent, Colors.transparent,
child: InkWell( child: InkWell(
onTap: () async { onTap: () {
audio.episodeLoad( audio.episodeLoad(
episode, episode,
startPosition: startPosition:
@ -644,6 +646,9 @@ class __HistoryListState extends State<_HistoryList> {
1000) 1000)
.toInt()); .toInt());
}, },
borderRadius:
BorderRadius
.circular(20),
child: Stack( child: Stack(
children: [ children: [
ShaderMask( ShaderMask(
@ -682,8 +687,8 @@ class __HistoryListState extends State<_HistoryList> {
decoration: decoration:
BoxDecoration( BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all( BorderRadius.circular(
Radius.circular(20.0)), 20.0),
color: context color: context
.accentColor, .accentColor,
), ),
@ -782,9 +787,7 @@ class __HistoryListState extends State<_HistoryList> {
child: SizedBox( child: SizedBox(
height: 25, height: 25,
width: 25, width: 25,
child: CircularProgressIndicator( child: CircularProgressIndicator()),
strokeWidth: 2,
)),
); );
}); });
} }

View File

@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'dart:math' as math;
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:connectivity/connectivity.dart'; import 'package:connectivity/connectivity.dart';
@ -578,6 +579,12 @@ class _PodcastDetailState extends State<PodcastDetail> {
color: Colors.transparent, color: Colors.transparent,
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(100), borderRadius: BorderRadius.circular(100),
child: TweenAnimationBuilder(
duration: Duration(milliseconds: 500),
curve: Curves.easeInOutQuart,
tween: Tween<double>(begin: 0.0, end: 1.0),
builder: (context, angle, child) => Transform.rotate(
angle: math.pi * 2 * angle,
child: SizedBox( child: SizedBox(
width: 30, width: 30,
child: IconButton( child: IconButton(
@ -594,6 +601,8 @@ class _PodcastDetailState extends State<PodcastDetail> {
setState(() => _reverse = !_reverse); setState(() => _reverse = !_reverse);
}, },
), ),
),
),
)), )),
FutureBuilder<bool>( FutureBuilder<bool>(
future: _getHideListened(), future: _getHideListened(),
@ -858,8 +867,7 @@ class _PodcastDetailState extends State<PodcastDetail> {
); );
} }
return SliverToBoxAdapter( return SliverToBoxAdapter(
child: Center(), child: Center());
);
}), }),
SliverList( SliverList(
delegate: SliverChildBuilderDelegate( delegate: SliverChildBuilderDelegate(