Merge pull request #280 from ente-io/change-status-bar-color-on-details-screen

Status bar color on details screen on light theme
This commit is contained in:
Neeraj Gupta 2022-06-08 10:03:40 +05:30 committed by GitHub
commit f59aebfb2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 53 deletions

View file

@ -100,34 +100,31 @@ class _DetailPageState extends State<DetailPage> {
" files .");
_appBarKey = GlobalKey<FadingAppBarState>();
_bottomBarKey = GlobalKey<FadingBottomBarState>();
return SafeArea(
bottom: false,
child: Scaffold(
appBar: FadingAppBar(
_files[_selectedIndex],
_onFileDeleted,
Configuration.instance.getUserID(),
100,
widget.config.mode == DetailPageMode.full,
key: _appBarKey,
),
extendBodyBehindAppBar: true,
body: Center(
child: Stack(
children: [
_buildPageView(),
FadingBottomBar(
_files[_selectedIndex],
_onEditFileRequested,
widget.config.mode == DetailPageMode.minimalistic,
key: _bottomBarKey,
),
],
),
),
// backgroundColor: Theme.of(context).colorScheme.onPrimary,
return Scaffold(
appBar: FadingAppBar(
_files[_selectedIndex],
_onFileDeleted,
Configuration.instance.getUserID(),
100,
widget.config.mode == DetailPageMode.full,
key: _appBarKey,
),
extendBodyBehindAppBar: true,
body: Center(
child: Stack(
children: [
_buildPageView(),
FadingBottomBar(
_files[_selectedIndex],
_onEditFileRequested,
widget.config.mode == DetailPageMode.minimalistic,
key: _bottomBarKey,
),
],
),
),
// backgroundColor: Theme.of(context).colorScheme.onPrimary,
);
}

View file

@ -68,7 +68,10 @@ class FadingAppBarState extends State<FadingAppBar> {
stops: const [0, 0.2, 1],
),
),
child: _buildAppBar(),
child: Padding(
padding: const EdgeInsets.only(top: 10),
child: _buildAppBar(),
),
),
opacity: _shouldHide ? 0 : 1,
duration: Duration(milliseconds: 150),
@ -237,11 +240,15 @@ class FadingAppBarState extends State<FadingAppBar> {
return hasError ? oldValue : isLiked;
},
likeBuilder: (isLiked) {
return Icon(
Icons.favorite_border,
color:
isLiked ? Colors.pinkAccent : Colors.white, //same for both themes
size: 24,
return Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Icon(
Icons.favorite_border,
color: isLiked
? Colors.pinkAccent
: Colors.white, //same for both themes
size: 24,
),
);
},
);

View file

@ -151,30 +151,32 @@ class FadingBottomBarState extends State<FadingBottomBar> {
),
);
}
return AnimatedOpacity(
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.black.withOpacity(0.6),
Colors.black.withOpacity(0.72),
],
stops: const [0, 0.8, 1],
return SafeArea(
child: AnimatedOpacity(
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.black.withOpacity(0.6),
Colors.black.withOpacity(0.72),
],
stops: const [0, 0.8, 1],
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: children,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: children,
),
),
opacity: _shouldHide ? 0 : 1,
duration: Duration(milliseconds: 150),
),
opacity: _shouldHide ? 0 : 1,
duration: Duration(milliseconds: 150),
);
}