Skip to content

armgit / ente

Public Imported from GitHub
0

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

Show new black friday banner only for android

ashilkn781271c43c54
diff --git a/lib/ui/components/notification_widget.dart b/lib/ui/components/notification_widget.dart
index 69207ee3dd..cf684f0f4c 100644
--- a/lib/ui/components/notification_widget.dart
+++ b/lib/ui/components/notification_widget.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import "package:flutter_animate/flutter_animate.dart";
import "package:photos/ente_theme_data.dart";
import 'package:photos/theme/colors.dart';
import "package:photos/theme/ente_theme.dart";
@@ -20,6 +21,7 @@ class NotificationWidget extends StatelessWidget {
final String? subText;
final GestureTapCallback onTap;
final NotificationType type;
+ final bool isBlackFriday;
const NotificationWidget({
Key? key,
@@ -27,6 +29,7 @@ class NotificationWidget extends StatelessWidget {
required this.actionIcon,
required this.text,
required this.onTap,
+ this.isBlackFriday = false,
this.subText,
this.type = NotificationType.warning,
}) : super(key: key);
@@ -90,11 +93,34 @@ class NotificationWidget extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Icon(
- startIcon,
- size: 36,
- color: strokeColorScheme.strokeBase,
- ),
+ isBlackFriday
+ ? Icon(
+ startIcon,
+ size: 36,
+ color: strokeColorScheme.strokeBase,
+ )
+ .animate(
+ onPlay: (controller) =>
+ controller.repeat(reverse: true),
+ delay: 2000.ms,
+ )
+ .shake(
+ duration: 500.ms,
+ hz: 6,
+ delay: 1600.ms,
+ )
+ .scale(
+ duration: 500.ms,
+ begin: const Offset(0.9, 0.9),
+ end: const Offset(1.1, 1.1),
+ delay: 1600.ms,
+ // curve: Curves.easeInOut,
+ )
+ : Icon(
+ startIcon,
+ size: 36,
+ color: strokeColorScheme.strokeBase,
+ ),
const SizedBox(width: 12),
Expanded(
child: Column(
diff --git a/lib/ui/payment/stripe_subscription_page.dart b/lib/ui/payment/stripe_subscription_page.dart
index 506e597dab..54a551b7d7 100644
--- a/lib/ui/payment/stripe_subscription_page.dart
+++ b/lib/ui/payment/stripe_subscription_page.dart
@@ -211,10 +211,12 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
widgets.add(_showSubscriptionToggle());
if (_hasActiveSubscription) {
- widgets.add(ValidityWidget(
- currentSubscription: _currentSubscription,
- bonusData: _userDetails.bonusData,
- ));
+ widgets.add(
+ ValidityWidget(
+ currentSubscription: _currentSubscription,
+ bonusData: _userDetails.bonusData,
+ ),
+ );
}
if (_currentSubscription!.productID == freeProductID) {
diff --git a/lib/ui/settings_page.dart b/lib/ui/settings_page.dart
index ce631822a2..bf8f522599 100644
--- a/lib/ui/settings_page.dart
+++ b/lib/ui/settings_page.dart
@@ -28,6 +28,7 @@ import 'package:photos/ui/settings/support_section_widget.dart';
import 'package:photos/ui/settings/theme_switch_widget.dart';
import "package:photos/ui/sharing/verify_identity_dialog.dart";
import "package:photos/utils/navigation_util.dart";
+import "package:url_launcher/url_launcher_string.dart";
class SettingsPage extends StatelessWidget {
final ValueNotifier<String?> emailNotifier;
@@ -90,17 +91,33 @@ class SettingsPage extends StatelessWidget {
? RepaintBoundary(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
- child: NotificationWidget(
- startIcon: Icons.auto_awesome,
- actionIcon: Icons.arrow_forward_outlined,
- text: S.of(context).doubleYourStorage,
- subText: S.of(context).referFriendsAnd2xYourPlan,
- type: NotificationType.goldenBanner,
- onTap: () async {
- StorageBonusService.instance.markStorageBonusAsDone();
- routeToPage(context, const ReferralScreen());
- },
- ),
+ child: !Platform.isIOS
+ ? NotificationWidget(
+ isBlackFriday: true,
+ startIcon: Icons.celebration,
+ actionIcon: Icons.arrow_forward_outlined,
+ text: "Black Friday Sale",
+ subText: "Upto 50% off!",
+ type: NotificationType.goldenBanner,
+ onTap: () async {
+ launchUrlString(
+ "https://ente.io/blackfriday/",
+ mode: LaunchMode.platformDefault,
+ );
+ },
+ )
+ : NotificationWidget(
+ startIcon: Icons.auto_awesome,
+ actionIcon: Icons.arrow_forward_outlined,
+ text: S.of(context).doubleYourStorage,
+ subText: S.of(context).referFriendsAnd2xYourPlan,
+ type: NotificationType.goldenBanner,
+ onTap: () async {
+ StorageBonusService.instance
+ .markStorageBonusAsDone();
+ routeToPage(context, const ReferralScreen());
+ },
+ ),
).animate(onPlay: (controller) => controller.repeat()).shimmer(
duration: 1000.ms,
delay: 3200.ms,