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 ."); " files .");
_appBarKey = GlobalKey<FadingAppBarState>(); _appBarKey = GlobalKey<FadingAppBarState>();
_bottomBarKey = GlobalKey<FadingBottomBarState>(); _bottomBarKey = GlobalKey<FadingBottomBarState>();
return SafeArea( return Scaffold(
bottom: false, appBar: FadingAppBar(
child: Scaffold( _files[_selectedIndex],
appBar: FadingAppBar( _onFileDeleted,
_files[_selectedIndex], Configuration.instance.getUserID(),
_onFileDeleted, 100,
Configuration.instance.getUserID(), widget.config.mode == DetailPageMode.full,
100, key: _appBarKey,
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,
), ),
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], stops: const [0, 0.2, 1],
), ),
), ),
child: _buildAppBar(), child: Padding(
padding: const EdgeInsets.only(top: 10),
child: _buildAppBar(),
),
), ),
opacity: _shouldHide ? 0 : 1, opacity: _shouldHide ? 0 : 1,
duration: Duration(milliseconds: 150), duration: Duration(milliseconds: 150),
@ -237,11 +240,15 @@ class FadingAppBarState extends State<FadingAppBar> {
return hasError ? oldValue : isLiked; return hasError ? oldValue : isLiked;
}, },
likeBuilder: (isLiked) { likeBuilder: (isLiked) {
return Icon( return Padding(
Icons.favorite_border, padding: const EdgeInsets.only(top: 8.0),
color: child: Icon(
isLiked ? Colors.pinkAccent : Colors.white, //same for both themes Icons.favorite_border,
size: 24, 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( return SafeArea(
child: Align( child: AnimatedOpacity(
alignment: Alignment.bottomCenter, child: Align(
child: Container( alignment: Alignment.bottomCenter,
decoration: BoxDecoration( child: Container(
gradient: LinearGradient( decoration: BoxDecoration(
begin: Alignment.topCenter, gradient: LinearGradient(
end: Alignment.bottomCenter, begin: Alignment.topCenter,
colors: [ end: Alignment.bottomCenter,
Colors.transparent, colors: [
Colors.black.withOpacity(0.6), Colors.transparent,
Colors.black.withOpacity(0.72), Colors.black.withOpacity(0.6),
], Colors.black.withOpacity(0.72),
stops: const [0, 0.8, 1], ],
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),
); );
} }