π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
tap to close
laurenspriemefe80734fcf0
diff --git a/mobile/apps/photos/lib/ui/activity/ritual_badge_popup.dart b/mobile/apps/photos/lib/ui/activity/ritual_badge_popup.dartindex d83937282e..55ee15f359 100644--- a/mobile/apps/photos/lib/ui/activity/ritual_badge_popup.dart+++ b/mobile/apps/photos/lib/ui/activity/ritual_badge_popup.dart@@ -84,233 +84,244 @@ class _RitualBadgePopupSheetState extends State<_RitualBadgePopupSheet> {? "Untitled ritual": widget.badge.ritual.title;- return SafeArea(- child: Padding(- padding:- EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),- child: Align(- alignment: Alignment.bottomCenter,- child: Container(- constraints: const BoxConstraints(maxWidth: 480),- decoration: BoxDecoration(- color: colorScheme.backgroundElevated,- borderRadius: const BorderRadius.vertical(- top: Radius.circular(22),- ),- border: Border.all(- color: colorScheme.strokeFaint,- width: 1,- ),- boxShadow: [- BoxShadow(- color: Colors.black.withValues(alpha: 0.12),- blurRadius: 24,- offset: const Offset(0, -6),- ),- ],+ return Stack(+ fit: StackFit.expand,+ children: [+ GestureDetector(+ behavior: HitTestBehavior.opaque,+ onTap: () => Navigator.of(context).pop(),+ child: const SizedBox.expand(),+ ),+ SafeArea(+ child: Padding(+ padding: EdgeInsets.only(+ bottom: MediaQuery.of(context).viewInsets.bottom,),- child: Stack(- children: [- Positioned(- top: 6,- right: 6,- child: IconButton(- style: IconButton.styleFrom(- backgroundColor: colorScheme.fillFaint,- padding: const EdgeInsets.all(8),- shape: const CircleBorder(),- minimumSize: const Size(40, 40),- ),- onPressed: () => Navigator.of(context).pop(),- icon: Icon(- Icons.close_rounded,- color: colorScheme.textBase,- ),+ child: Align(+ alignment: Alignment.bottomCenter,+ child: Container(+ constraints: const BoxConstraints(maxWidth: 480),+ decoration: BoxDecoration(+ color: colorScheme.backgroundElevated,+ borderRadius: const BorderRadius.vertical(+ top: Radius.circular(22),),- ),- Positioned.fill(- child: IgnorePointer(- child: Align(- alignment: Alignment.center,- child: SizedOverflowBox(- size: ui.Size.zero,- alignment: Alignment.center,- // The SVG bounds include large transparent top/bottom; mask them- // out while keeping the fidgets centered behind the badge.- child: Transform.translate(- offset: const Offset(0, -80),- child: ShaderMask(- shaderCallback: (Rect bounds) =>- const LinearGradient(- begin: Alignment.topCenter,- end: Alignment.bottomCenter,- stops: [0, 0.16, 0.84, 1],- colors: [- Colors.transparent,- Colors.white,- Colors.white,- Colors.transparent,- ],- ).createShader(bounds),- blendMode: BlendMode.dstIn,- child: SvgPicture.asset(- brightness == Brightness.dark- ? "assets/rituals/badge_popup_fidgets_dark.svg"- : "assets/rituals/badge_popup_fidgets_light.svg",- fit: BoxFit.cover,- width: 220,- height: 220,- ),- ),- ),- ),- ),+ border: Border.all(+ color: colorScheme.strokeFaint,+ width: 1,),+ boxShadow: [+ BoxShadow(+ color: Colors.black.withValues(alpha: 0.12),+ blurRadius: 24,+ offset: const Offset(0, -6),+ ),+ ],),- Padding(- padding: const EdgeInsets.fromLTRB(20, 14, 20, 24),- child: Column(- mainAxisSize: MainAxisSize.min,- children: [- const SizedBox(height: 16),- ShaderMask(- shaderCallback: (Rect bounds) => LinearGradient(- begin: Alignment.topCenter,- end: Alignment.bottomCenter,- stops: const [0.2933, 1],- colors: headingGradientColors,- ).createShader(- Rect.fromLTWH(- 0,- 0,- bounds.width,- bounds.height,- ),+ child: Stack(+ children: [+ Positioned(+ top: 6,+ right: 6,+ child: IconButton(+ style: IconButton.styleFrom(+ backgroundColor: colorScheme.fillFaint,+ padding: const EdgeInsets.all(8),+ shape: const CircleBorder(),+ minimumSize: const Size(40, 40),),- blendMode: BlendMode.srcIn,- child: const Text(- "New achievement",- textAlign: TextAlign.center,- style: TextStyle(- fontFamily: "Nunito",- fontStyle: FontStyle.normal,- fontSize: 24,- fontWeight: FontWeight.w900,- letterSpacing: -0.72,- height: 1.15,- decoration: TextDecoration.none,- ),+ onPressed: () => Navigator.of(context).pop(),+ icon: Icon(+ Icons.close_rounded,+ color: colorScheme.textBase,),),- const SizedBox(height: 6),- SvgPicture.asset(- "assets/rituals/green_stroke.svg",- width: 74,- height: 8,- ),- const SizedBox(height: 14),- Stack(- alignment: Alignment.center,- clipBehavior: Clip.none,- children: [- SizedBox(- width: 220,- height: 240,- child: OverflowBox(- maxWidth: 900,- maxHeight: 900,- child: Transform.translate(- offset: const Offset(0, -100),+ ),+ Positioned.fill(+ child: IgnorePointer(+ child: Align(+ alignment: Alignment.center,+ child: SizedOverflowBox(+ size: ui.Size.zero,+ alignment: Alignment.center,+ // The SVG bounds include large transparent top/bottom; mask them+ // out while keeping the fidgets centered behind the badge.+ child: Transform.translate(+ offset: const Offset(0, -80),+ child: ShaderMask(+ shaderCallback: (Rect bounds) =>+ const LinearGradient(+ begin: Alignment.topCenter,+ end: Alignment.bottomCenter,+ stops: [0, 0.16, 0.84, 1],+ colors: [+ Colors.transparent,+ Colors.white,+ Colors.white,+ Colors.transparent,+ ],+ ).createShader(bounds),+ blendMode: BlendMode.dstIn,child: SvgPicture.asset(- "assets/rituals/background_rays.svg",- width: 900,- height: 900,- fit: BoxFit.contain,- colorFilter: ColorFilter.mode(- raysColor,- BlendMode.srcATop,- ),+ brightness == Brightness.dark+ ? "assets/rituals/badge_popup_fidgets_dark.svg"+ : "assets/rituals/badge_popup_fidgets_light.svg",+ fit: BoxFit.cover,+ width: 220,+ height: 220,),),),),- Image.asset(- badgeAsset,- width: 184,- height: 184,- fit: BoxFit.contain,- ),- ],- ),- _RitualChip(- icon: widget.badge.ritual.icon.isEmpty- ? "πΈ"- : widget.badge.ritual.icon,- title: title,- ),- const SizedBox(height: 32),- Text(- badgeMessage,- textAlign: TextAlign.center,- style: textTheme.body.copyWith(- fontSize: 18,- height: 1.4,),),- const SizedBox(height: 36),- if (widget.allowShare)- SizedBox(- width: double.infinity,- child: ElevatedButton(- key: _shareButtonKey,- style: ElevatedButton.styleFrom(- backgroundColor: Colors.black,- foregroundColor: Colors.white,- shape: RoundedRectangleBorder(- borderRadius: BorderRadius.circular(18),+ ),+ Padding(+ padding: const EdgeInsets.fromLTRB(20, 14, 20, 24),+ child: Column(+ mainAxisSize: MainAxisSize.min,+ children: [+ const SizedBox(height: 16),+ ShaderMask(+ shaderCallback: (Rect bounds) => LinearGradient(+ begin: Alignment.topCenter,+ end: Alignment.bottomCenter,+ stops: const [0.2933, 1],+ colors: headingGradientColors,+ ).createShader(+ Rect.fromLTWH(+ 0,+ 0,+ bounds.width,+ bounds.height,),- padding: const EdgeInsets.symmetric(- vertical: 16,- horizontal: 12,+ ),+ blendMode: BlendMode.srcIn,+ child: const Text(+ "New achievement",+ textAlign: TextAlign.center,+ style: TextStyle(+ fontFamily: "Nunito",+ fontStyle: FontStyle.normal,+ fontSize: 24,+ fontWeight: FontWeight.w900,+ letterSpacing: -0.72,+ height: 1.15,+ decoration: TextDecoration.none,),),- onPressed: _sharing- ? null- : () async {- setState(() {- _sharing = true;- });- try {- await shareRitualBadge(- context,- badge: widget.badge,- shareButtonKey: _shareButtonKey,- );- } finally {- if (mounted) {+ ),+ const SizedBox(height: 6),+ SvgPicture.asset(+ "assets/rituals/green_stroke.svg",+ width: 74,+ height: 8,+ ),+ const SizedBox(height: 14),+ Stack(+ alignment: Alignment.center,+ clipBehavior: Clip.none,+ children: [+ SizedBox(+ width: 220,+ height: 240,+ child: OverflowBox(+ maxWidth: 900,+ maxHeight: 900,+ child: Transform.translate(+ offset: const Offset(0, -100),+ child: SvgPicture.asset(+ "assets/rituals/background_rays.svg",+ width: 900,+ height: 900,+ fit: BoxFit.contain,+ colorFilter: ColorFilter.mode(+ raysColor,+ BlendMode.srcATop,+ ),+ ),+ ),+ ),+ ),+ Image.asset(+ badgeAsset,+ width: 184,+ height: 184,+ fit: BoxFit.contain,+ ),+ ],+ ),+ _RitualChip(+ icon: widget.badge.ritual.icon.isEmpty+ ? "πΈ"+ : widget.badge.ritual.icon,+ title: title,+ ),+ const SizedBox(height: 32),+ Text(+ badgeMessage,+ textAlign: TextAlign.center,+ style: textTheme.body.copyWith(+ fontSize: 18,+ height: 1.4,+ ),+ ),+ const SizedBox(height: 36),+ if (widget.allowShare)+ SizedBox(+ width: double.infinity,+ child: ElevatedButton(+ key: _shareButtonKey,+ style: ElevatedButton.styleFrom(+ backgroundColor: Colors.black,+ foregroundColor: Colors.white,+ shape: RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(18),+ ),+ padding: const EdgeInsets.symmetric(+ vertical: 16,+ horizontal: 12,+ ),+ ),+ onPressed: _sharing+ ? null+ : () async {setState(() {- _sharing = false;+ _sharing = true;});- }- }- },- child: Text(- _sharing ? "Preparing..." : "Share",- style: textTheme.bodyBold.copyWith(- color: Colors.white,- fontSize: 16,+ try {+ await shareRitualBadge(+ context,+ badge: widget.badge,+ shareButtonKey: _shareButtonKey,+ );+ } finally {+ if (mounted) {+ setState(() {+ _sharing = false;+ });+ }+ }+ },+ child: Text(+ _sharing ? "Preparing..." : "Share",+ style: textTheme.bodyBold.copyWith(+ color: Colors.white,+ fontSize: 16,+ ),+ ),),),- ),- ),- ],- ),+ ],+ ),+ ),+ ],),- ],+ ),),),),- ),+ ],);}}