Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Make drawer shade and mailbox title fade to be in sync with drawer an…
Browse files Browse the repository at this point in the history
…imation (#310)
  • Loading branch information
Renzo-Olivares authored Sep 17, 2020
1 parent 284c894 commit 24f0438
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
37 changes: 21 additions & 16 deletions lib/studies/reply/adaptive_nav.dart
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,8 @@ class _MobileNavState extends State<_MobileNav> with TickerProviderStateMixin {
maintainAnimation: true,
maintainState: true,
visible: _bottomDrawerVisible,
child: AnimatedOpacity(
opacity: _bottomDrawerVisible ? 1.0 : 0.0,
curve: standardEasing,
duration: _kAnimationDuration,
child: FadeTransition(
opacity: _drawerCurve,
child: Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
Expand Down Expand Up @@ -729,6 +727,10 @@ class _AnimatedBottomAppBar extends StatelessWidget {

@override
Widget build(BuildContext context) {
var fadeOut = Tween<double>(begin: 1, end: -1).animate(
drawerController.drive(CurveTween(curve: standardEasing)),
);

return Selector<EmailStore, bool>(
selector: (context, emailStore) => emailStore.onMailView,
builder: (context, onMailView, child) {
Expand Down Expand Up @@ -768,18 +770,21 @@ class _AnimatedBottomAppBar extends StatelessWidget {
const SizedBox(width: 8),
const _ReplyLogo(),
const SizedBox(width: 10),
AnimatedOpacity(
opacity:
bottomDrawerVisible || onMailView ? 0.0 : 1.0,
duration: _kAnimationDuration,
curve: standardEasing,
child: Text(
navigationDestinations[selectedIndex].name,
style: Theme.of(context)
.textTheme
.bodyText1
.copyWith(color: ReplyColors.white50),
),
_FadeThroughTransitionSwitcher(
fillColor: Colors.transparent,
child: onMailView
? const SizedBox(width: 48)
: FadeTransition(
opacity: fadeOut,
child: Text(
navigationDestinations[selectedIndex]
.name,
style: Theme.of(context)
.textTheme
.bodyText1
.copyWith(color: ReplyColors.white50),
),
),
),
],
),
Expand Down
6 changes: 3 additions & 3 deletions lib/studies/reply/app.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:animations/animations.dart';
import 'package:flutter/material.dart';
import 'package:gallery/data/gallery_options.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/data/gallery_options.dart';
import 'package:gallery/layout/letter_spacing.dart';
import 'package:gallery/studies/reply/adaptive_nav.dart';
import 'package:gallery/studies/reply/colors.dart';
Expand Down Expand Up @@ -83,7 +83,7 @@ ThemeData _buildReplyLightTheme(BuildContext context) {
bottomAppBarColor: ReplyColors.blue700,
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: ReplyColors.blue700,
modalBackgroundColor: Colors.white.withOpacity(0.4),
modalBackgroundColor: Colors.white.withOpacity(0.7),
),
navigationRailTheme: NavigationRailThemeData(
backgroundColor: ReplyColors.blue700,
Expand Down Expand Up @@ -131,7 +131,7 @@ ThemeData _buildReplyDarkTheme(BuildContext context) {
bottomAppBarColor: ReplyColors.darkBottomAppBarBackground,
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: ReplyColors.darkDrawerBackground,
modalBackgroundColor: Colors.black.withOpacity(0.8),
modalBackgroundColor: Colors.black.withOpacity(0.7),
),
navigationRailTheme: NavigationRailThemeData(
backgroundColor: ReplyColors.darkBottomAppBarBackground,
Expand Down

0 comments on commit 24f0438

Please sign in to comment.