Change opacity when open detail sheet.

This commit is contained in:
stonegate 2020-07-30 17:29:48 +08:00
parent d7559943dc
commit 9b8ef2d770
1 changed files with 234 additions and 222 deletions

View File

@ -480,7 +480,7 @@ class _SearchListState extends State<SearchList> {
child: GestureDetector( child: GestureDetector(
onTap: () => setState(() => _selectedPodcast = null), onTap: () => setState(() => _selectedPodcast = null),
child: Container( child: Container(
color: context.scaffoldBackgroundColor.withOpacity(0.8), color: context.scaffoldBackgroundColor.withOpacity(0.9),
), ),
), ),
), ),
@ -774,7 +774,6 @@ class _SearchResultDetailState extends State<SearchResultDetail>
onVerticalDragStart: _start, onVerticalDragStart: _start,
onVerticalDragUpdate: _update, onVerticalDragUpdate: _update,
onVerticalDragEnd: (event) => _end(), onVerticalDragEnd: (event) => _end(),
child: SingleChildScrollView(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
@ -794,6 +793,10 @@ class _SearchResultDetailState extends State<SearchResultDetail>
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: math.min(_animation.value, 120),
child: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: SizedBox(
height: 120, height: 120,
child: Row( child: Row(
children: [ children: [
@ -827,13 +830,14 @@ class _SearchResultDetailState extends State<SearchResultDetail>
BorderRadius.circular(100.0), BorderRadius.circular(100.0),
side: BorderSide( side: BorderSide(
color: context.accentColor)), color: context.accentColor)),
splashColor: splashColor: context.accentColor
context.accentColor.withOpacity(0.5), .withOpacity(0.5),
child: Text(s.subscribe, child: Text(s.subscribe,
style: TextStyle( style: TextStyle(
color: context.accentColor)), color: context.accentColor)),
onPressed: () { onPressed: () {
subscribePodcast(widget.onlinePodcast); subscribePodcast(
widget.onlinePodcast);
setState(() { setState(() {
_isSubscribed = true; _isSubscribed = true;
}); });
@ -843,14 +847,15 @@ class _SearchResultDetailState extends State<SearchResultDetail>
); );
}) })
: OutlineButton( : OutlineButton(
color: color: context.accentColor
context.accentColor.withOpacity(0.5), .withOpacity(0.5),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius.circular(100.0), BorderRadius.circular(100.0),
side: BorderSide( side: BorderSide(
color: Colors.grey[500])), color: Colors.grey[500])),
highlightedBorderColor: Colors.grey[500], highlightedBorderColor:
Colors.grey[500],
disabledTextColor: Colors.grey[500], disabledTextColor: Colors.grey[500],
child: Text(s.subscribe), child: Text(s.subscribe),
disabledBorderColor: Colors.grey[500], disabledBorderColor: Colors.grey[500],
@ -888,7 +893,14 @@ class _SearchResultDetailState extends State<SearchResultDetail>
], ],
), ),
), ),
),
),
if (_animation.value > 120)
SizedBox( SizedBox(
height: math.min(_animation.value - 120, 50),
child: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: SizedBox(
height: 50, height: 50,
child: TabBar( child: TabBar(
indicatorColor: context.accentColor, indicatorColor: context.accentColor,
@ -907,7 +919,8 @@ class _SearchResultDetailState extends State<SearchResultDetail>
left: 5, right: 5, top: 2, bottom: 2), left: 5, right: 5, top: 2, bottom: 2),
decoration: BoxDecoration( decoration: BoxDecoration(
color: context.accentColor, color: context.accentColor,
borderRadius: BorderRadius.circular(100)), borderRadius:
BorderRadius.circular(100)),
child: Text( child: Text(
widget.onlinePodcast.count.toString(), widget.onlinePodcast.count.toString(),
style: TextStyle(color: Colors.white))) style: TextStyle(color: Colors.white)))
@ -915,6 +928,8 @@ class _SearchResultDetailState extends State<SearchResultDetail>
) )
]), ]),
), ),
),
),
Expanded( Expanded(
child: TabBarView(children: [ child: TabBarView(children: [
ListView( ListView(
@ -960,8 +975,8 @@ class _SearchResultDetailState extends State<SearchResultDetail>
child: OutlineButton( child: OutlineButton(
highlightedBorderColor: highlightedBorderColor:
context.accentColor, context.accentColor,
splashColor: context.accentColor splashColor:
.withOpacity(0.5), context.accentColor.withOpacity(0.5),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(100))), Radius.circular(100))),
@ -969,8 +984,7 @@ class _SearchResultDetailState extends State<SearchResultDetail>
? SizedBox( ? SizedBox(
height: 20, height: 20,
width: 20, width: 20,
child: child: CircularProgressIndicator(
CircularProgressIndicator(
strokeWidth: 2, strokeWidth: 2,
)) ))
: Text(context.s.loadMore), : Text(context.s.loadMore),
@ -980,8 +994,7 @@ class _SearchResultDetailState extends State<SearchResultDetail>
() { () {
_loading = true; _loading = true;
_searchFuture = _getEpisodes( _searchFuture = _getEpisodes(
id: widget id: widget.onlinePodcast.id,
.onlinePodcast.id,
nextEpisodeDate: nextEpisodeDate:
_nextEpisdoeDate); _nextEpisdoeDate);
}, },
@ -995,8 +1008,8 @@ class _SearchResultDetailState extends State<SearchResultDetail>
subtitle: Text( subtitle: Text(
'${content[index].length.toTime} | ' '${content[index].length.toTime} | '
'${content[index].pubDate.toDate(context)}', '${content[index].pubDate.toDate(context)}',
style: TextStyle( style:
color: context.accentColor)), TextStyle(color: context.accentColor)),
); );
}, },
); );
@ -1011,7 +1024,6 @@ class _SearchResultDetailState extends State<SearchResultDetail>
), ),
), ),
), ),
),
); );
} }
} }