|
@@ -6,8 +6,11 @@ import 'package:photos/core/configuration.dart';
|
|
|
import 'package:photos/core/event_bus.dart';
|
|
|
import 'package:photos/events/opened_settings_event.dart';
|
|
|
import 'package:photos/services/feature_flag_service.dart';
|
|
|
+import "package:photos/services/storage_bonus_service.dart";
|
|
|
import 'package:photos/theme/colors.dart';
|
|
|
import 'package:photos/theme/ente_theme.dart';
|
|
|
+import "package:photos/ui/components/notification_warning_widget.dart";
|
|
|
+import "package:photos/ui/growth/referral_screen.dart";
|
|
|
import 'package:photos/ui/settings/about_section_widget.dart';
|
|
|
import 'package:photos/ui/settings/account_section_widget.dart';
|
|
|
import 'package:photos/ui/settings/app_version_widget.dart';
|
|
@@ -21,9 +24,11 @@ import 'package:photos/ui/settings/social_section_widget.dart';
|
|
|
import 'package:photos/ui/settings/storage_card_widget.dart';
|
|
|
import 'package:photos/ui/settings/support_section_widget.dart';
|
|
|
import 'package:photos/ui/settings/theme_switch_widget.dart';
|
|
|
+import "package:photos/utils/navigation_util.dart";
|
|
|
|
|
|
class SettingsPage extends StatelessWidget {
|
|
|
final ValueNotifier<String?> emailNotifier;
|
|
|
+
|
|
|
const SettingsPage({Key? key, required this.emailNotifier}) : super(key: key);
|
|
|
|
|
|
@override
|
|
@@ -71,6 +76,22 @@ class SettingsPage extends StatelessWidget {
|
|
|
if (hasLoggedIn) {
|
|
|
contents.addAll([
|
|
|
const StorageCardWidget(),
|
|
|
+ StorageBonusService.instance.shouldShowStorageBonus()
|
|
|
+ ? Padding(
|
|
|
+ padding: const EdgeInsets.only(top: 4.0),
|
|
|
+ child: NotificationWidget(
|
|
|
+ startIcon: Icons.auto_awesome,
|
|
|
+ actionIcon: Icons.arrow_forward_outlined,
|
|
|
+ text: "Double your storage",
|
|
|
+ subText: "Refer friends and 2x your plan",
|
|
|
+ type: NotificationType.banner,
|
|
|
+ onTap: () async {
|
|
|
+ StorageBonusService.instance.markStorageBonusAsDone();
|
|
|
+ routeToPage(context, const ReferralScreen());
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ : const SizedBox.shrink(),
|
|
|
const SizedBox(height: 12),
|
|
|
const BackupSectionWidget(),
|
|
|
sectionSpacing,
|