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