Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

discovery tab banner

laurenspriem41a4930efd9d
diff --git a/mobile/apps/photos/lib/ui/wrapped/wrapped_discovery_section.dart b/mobile/apps/photos/lib/ui/wrapped/wrapped_discovery_section.dart
index 42e2ef06f5..32a8ca45c0 100644
--- a/mobile/apps/photos/lib/ui/wrapped/wrapped_discovery_section.dart
+++ b/mobile/apps/photos/lib/ui/wrapped/wrapped_discovery_section.dart
@@ -19,14 +19,38 @@ class WrappedDiscoverySection extends StatelessWidget {
? "Resume Ente Rewind 2025"
: "Open Ente Rewind 2025";
+ const double bleed = 12;
+ const double bannerHeight = 164;
+
return Padding(
- padding: const EdgeInsets.fromLTRB(12, 16, 12, 32),
- child: SizedBox(
- width: double.infinity,
- child: WrappedRewindBannerButton(
- height: 164,
- semanticsLabel: semanticsLabel,
- ),
+ padding: const EdgeInsets.only(top: 16, bottom: 16),
+ child: LayoutBuilder(
+ builder: (BuildContext context, BoxConstraints constraints) {
+ final double baseWidth =
+ constraints.hasBoundedWidth && constraints.maxWidth.isFinite
+ ? constraints.maxWidth
+ : MediaQuery.sizeOf(context).width;
+ final double targetWidth = baseWidth + bleed * 2;
+
+ return SizedBox(
+ height: bannerHeight,
+ child: OverflowBox(
+ alignment: Alignment.center,
+ minWidth: targetWidth,
+ maxWidth: targetWidth,
+ minHeight: bannerHeight,
+ maxHeight: bannerHeight,
+ child: SizedBox(
+ width: targetWidth,
+ height: bannerHeight,
+ child: WrappedRewindBannerButton(
+ height: bannerHeight,
+ semanticsLabel: semanticsLabel,
+ ),
+ ),
+ ),
+ );
+ },
),
);
}