Make drawer shade and mailbox title fade to be in sync with drawer animation (#310)
diff --git a/lib/studies/reply/adaptive_nav.dart b/lib/studies/reply/adaptive_nav.dart
index b03fcd2..c0d8a4d 100644
--- a/lib/studies/reply/adaptive_nav.dart
+++ b/lib/studies/reply/adaptive_nav.dart
@@ -642,10 +642,8 @@
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,
@@ -729,6 +727,10 @@
@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) {
@@ -768,18 +770,21 @@
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),
+ ),
+ ),
),
],
),
diff --git a/lib/studies/reply/app.dart b/lib/studies/reply/app.dart
index 158e40e..745b96a 100644
--- a/lib/studies/reply/app.dart
+++ b/lib/studies/reply/app.dart
@@ -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';
@@ -83,7 +83,7 @@
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,
@@ -131,7 +131,7 @@
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,