Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotificationBarから複数ピルシートの案内を削除 #576

Merged
merged 9 commits into from
Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 0 additions & 84 deletions lib/domain/modal/announcement_multiple_pillsheet.dart

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:pilll/analytics.dart';
import 'package:pilll/components/atoms/color.dart';
import 'package:pilll/domain/modal/announcement_multiple_pillsheet.dart';
import 'package:pilll/domain/premium_introduction/premium_introduction_sheet.dart';
import 'package:pilll/domain/premium_introduction/util/discount_deadline.dart';
import 'package:pilll/domain/premium_trial/premium_trial_complete_modal.dart';
import 'package:pilll/domain/premium_trial/premium_trial_modal.dart';
import 'package:pilll/domain/record/components/notification_bar/components/announce_supported_multiple_pill_sheet.dart';
import 'package:pilll/domain/record/components/notification_bar/components/discount_price_deadline.dart';
import 'package:pilll/domain/record/components/notification_bar/components/ended_pill_sheet.dart';
import 'package:pilll/domain/record/components/notification_bar/components/premium_trial_begin.dart';
Expand All @@ -21,8 +19,6 @@ import 'package:pilll/domain/record/record_page_state.codegen.dart';
import 'package:pilll/signin/signin_sheet.dart';
import 'package:pilll/signin/signin_sheet_state.codegen.dart';
import 'package:pilll/util/datetime/day.dart';
import 'package:pilll/util/shared_preference/keys.dart';
import 'package:shared_preferences/shared_preferences.dart';

class NotificationBar extends HookConsumerWidget {
final RecordPageState parameter;
Expand Down Expand Up @@ -166,24 +162,6 @@ class NotificationBar extends HookConsumerWidget {
}
}

if (!state.isAlreadyShowAnnouncementSupportedMultilplePillSheet) {
return AnnouncementSupportedMultiplePillSheet(
onTap: () async {
final sharedPreferences = await SharedPreferences.getInstance();
if (sharedPreferences.getBool(BoolKey
.isAlreadyShowAnnouncementSupportedMultilplePillSheet) ??
false) {
return;
}

store.setTrueIsAlreadyShowAnnouncementSupportedMultilplePillSheet();
showAnnouncementMultiplePillSheet(context);
},
onClose: () {
store.setTrueIsAlreadyShowAnnouncementSupportedMultilplePillSheet();
},
);
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class NotificationBarState with _$NotificationBarState {
required int totalCountOfActionForTakenPill,
required bool isPremium,
required bool isTrial,
required bool isAlreadyShowAnnouncementSupportedMultilplePillSheet,
required bool hasDiscountEntitlement,
required DateTime? beginTrialDate,
required DateTime? trialDeadlineDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class _$NotificationBarStateTearOff {
required int totalCountOfActionForTakenPill,
required bool isPremium,
required bool isTrial,
required bool isAlreadyShowAnnouncementSupportedMultilplePillSheet,
required bool hasDiscountEntitlement,
required DateTime? beginTrialDate,
required DateTime? trialDeadlineDate,
Expand All @@ -37,8 +36,6 @@ class _$NotificationBarStateTearOff {
totalCountOfActionForTakenPill: totalCountOfActionForTakenPill,
isPremium: isPremium,
isTrial: isTrial,
isAlreadyShowAnnouncementSupportedMultilplePillSheet:
isAlreadyShowAnnouncementSupportedMultilplePillSheet,
hasDiscountEntitlement: hasDiscountEntitlement,
beginTrialDate: beginTrialDate,
trialDeadlineDate: trialDeadlineDate,
Expand All @@ -64,8 +61,6 @@ mixin _$NotificationBarState {
int get totalCountOfActionForTakenPill => throw _privateConstructorUsedError;
bool get isPremium => throw _privateConstructorUsedError;
bool get isTrial => throw _privateConstructorUsedError;
bool get isAlreadyShowAnnouncementSupportedMultilplePillSheet =>
throw _privateConstructorUsedError;
bool get hasDiscountEntitlement => throw _privateConstructorUsedError;
DateTime? get beginTrialDate => throw _privateConstructorUsedError;
DateTime? get trialDeadlineDate => throw _privateConstructorUsedError;
Expand Down Expand Up @@ -94,7 +89,6 @@ abstract class $NotificationBarStateCopyWith<$Res> {
int totalCountOfActionForTakenPill,
bool isPremium,
bool isTrial,
bool isAlreadyShowAnnouncementSupportedMultilplePillSheet,
bool hasDiscountEntitlement,
DateTime? beginTrialDate,
DateTime? trialDeadlineDate,
Expand Down Expand Up @@ -122,7 +116,6 @@ class _$NotificationBarStateCopyWithImpl<$Res>
Object? totalCountOfActionForTakenPill = freezed,
Object? isPremium = freezed,
Object? isTrial = freezed,
Object? isAlreadyShowAnnouncementSupportedMultilplePillSheet = freezed,
Object? hasDiscountEntitlement = freezed,
Object? beginTrialDate = freezed,
Object? trialDeadlineDate = freezed,
Expand All @@ -149,11 +142,6 @@ class _$NotificationBarStateCopyWithImpl<$Res>
? _value.isTrial
: isTrial // ignore: cast_nullable_to_non_nullable
as bool,
isAlreadyShowAnnouncementSupportedMultilplePillSheet:
isAlreadyShowAnnouncementSupportedMultilplePillSheet == freezed
? _value.isAlreadyShowAnnouncementSupportedMultilplePillSheet
: isAlreadyShowAnnouncementSupportedMultilplePillSheet // ignore: cast_nullable_to_non_nullable
as bool,
hasDiscountEntitlement: hasDiscountEntitlement == freezed
? _value.hasDiscountEntitlement
: hasDiscountEntitlement // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -217,7 +205,6 @@ abstract class _$NotificationBarStateCopyWith<$Res>
int totalCountOfActionForTakenPill,
bool isPremium,
bool isTrial,
bool isAlreadyShowAnnouncementSupportedMultilplePillSheet,
bool hasDiscountEntitlement,
DateTime? beginTrialDate,
DateTime? trialDeadlineDate,
Expand Down Expand Up @@ -248,7 +235,6 @@ class __$NotificationBarStateCopyWithImpl<$Res>
Object? totalCountOfActionForTakenPill = freezed,
Object? isPremium = freezed,
Object? isTrial = freezed,
Object? isAlreadyShowAnnouncementSupportedMultilplePillSheet = freezed,
Object? hasDiscountEntitlement = freezed,
Object? beginTrialDate = freezed,
Object? trialDeadlineDate = freezed,
Expand All @@ -275,11 +261,6 @@ class __$NotificationBarStateCopyWithImpl<$Res>
? _value.isTrial
: isTrial // ignore: cast_nullable_to_non_nullable
as bool,
isAlreadyShowAnnouncementSupportedMultilplePillSheet:
isAlreadyShowAnnouncementSupportedMultilplePillSheet == freezed
? _value.isAlreadyShowAnnouncementSupportedMultilplePillSheet
: isAlreadyShowAnnouncementSupportedMultilplePillSheet // ignore: cast_nullable_to_non_nullable
as bool,
hasDiscountEntitlement: hasDiscountEntitlement == freezed
? _value.hasDiscountEntitlement
: hasDiscountEntitlement // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -328,7 +309,6 @@ class _$_NotificationBarState extends _NotificationBarState {
required this.totalCountOfActionForTakenPill,
required this.isPremium,
required this.isTrial,
required this.isAlreadyShowAnnouncementSupportedMultilplePillSheet,
required this.hasDiscountEntitlement,
required this.beginTrialDate,
required this.trialDeadlineDate,
Expand All @@ -348,8 +328,6 @@ class _$_NotificationBarState extends _NotificationBarState {
@override
final bool isTrial;
@override
final bool isAlreadyShowAnnouncementSupportedMultilplePillSheet;
@override
final bool hasDiscountEntitlement;
@override
final DateTime? beginTrialDate;
Expand All @@ -368,7 +346,7 @@ class _$_NotificationBarState extends _NotificationBarState {

@override
String toString() {
return 'NotificationBarState(latestPillSheetGroup: $latestPillSheetGroup, totalCountOfActionForTakenPill: $totalCountOfActionForTakenPill, isPremium: $isPremium, isTrial: $isTrial, isAlreadyShowAnnouncementSupportedMultilplePillSheet: $isAlreadyShowAnnouncementSupportedMultilplePillSheet, hasDiscountEntitlement: $hasDiscountEntitlement, beginTrialDate: $beginTrialDate, trialDeadlineDate: $trialDeadlineDate, discountEntitlementDeadlineDate: $discountEntitlementDeadlineDate, recommendedSignupNotificationIsAlreadyShow: $recommendedSignupNotificationIsAlreadyShow, premiumTrialGuideNotificationIsClosed: $premiumTrialGuideNotificationIsClosed, premiumTrialBeginAnouncementIsClosed: $premiumTrialBeginAnouncementIsClosed, isLinkedLoginProvider: $isLinkedLoginProvider)';
return 'NotificationBarState(latestPillSheetGroup: $latestPillSheetGroup, totalCountOfActionForTakenPill: $totalCountOfActionForTakenPill, isPremium: $isPremium, isTrial: $isTrial, hasDiscountEntitlement: $hasDiscountEntitlement, beginTrialDate: $beginTrialDate, trialDeadlineDate: $trialDeadlineDate, discountEntitlementDeadlineDate: $discountEntitlementDeadlineDate, recommendedSignupNotificationIsAlreadyShow: $recommendedSignupNotificationIsAlreadyShow, premiumTrialGuideNotificationIsClosed: $premiumTrialGuideNotificationIsClosed, premiumTrialBeginAnouncementIsClosed: $premiumTrialBeginAnouncementIsClosed, isLinkedLoginProvider: $isLinkedLoginProvider)';
}

@override
Expand All @@ -383,9 +361,6 @@ class _$_NotificationBarState extends _NotificationBarState {
totalCountOfActionForTakenPill) &&
const DeepCollectionEquality().equals(other.isPremium, isPremium) &&
const DeepCollectionEquality().equals(other.isTrial, isTrial) &&
const DeepCollectionEquality().equals(
other.isAlreadyShowAnnouncementSupportedMultilplePillSheet,
isAlreadyShowAnnouncementSupportedMultilplePillSheet) &&
const DeepCollectionEquality()
.equals(other.hasDiscountEntitlement, hasDiscountEntitlement) &&
const DeepCollectionEquality()
Expand Down Expand Up @@ -415,8 +390,6 @@ class _$_NotificationBarState extends _NotificationBarState {
const DeepCollectionEquality().hash(totalCountOfActionForTakenPill),
const DeepCollectionEquality().hash(isPremium),
const DeepCollectionEquality().hash(isTrial),
const DeepCollectionEquality()
.hash(isAlreadyShowAnnouncementSupportedMultilplePillSheet),
const DeepCollectionEquality().hash(hasDiscountEntitlement),
const DeepCollectionEquality().hash(beginTrialDate),
const DeepCollectionEquality().hash(trialDeadlineDate),
Expand All @@ -441,7 +414,6 @@ abstract class _NotificationBarState extends NotificationBarState {
required int totalCountOfActionForTakenPill,
required bool isPremium,
required bool isTrial,
required bool isAlreadyShowAnnouncementSupportedMultilplePillSheet,
required bool hasDiscountEntitlement,
required DateTime? beginTrialDate,
required DateTime? trialDeadlineDate,
Expand All @@ -461,8 +433,6 @@ abstract class _NotificationBarState extends NotificationBarState {
@override
bool get isTrial;
@override
bool get isAlreadyShowAnnouncementSupportedMultilplePillSheet;
@override
bool get hasDiscountEntitlement;
@override
DateTime? get beginTrialDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class NotificationBarStateStore extends StateNotifier<NotificationBarState> {
isPremium: parameter.isPremium,
isTrial: parameter.isTrial,
hasDiscountEntitlement: parameter.hasDiscountEntitlement,
isAlreadyShowAnnouncementSupportedMultilplePillSheet:
parameter.isAlreadyShowAnnouncementSupportedMultilplePillSheet,
trialDeadlineDate: parameter.trialDeadlineDate,
beginTrialDate: parameter.beginTrialDate,
discountEntitlementDeadlineDate:
Expand Down Expand Up @@ -63,13 +61,4 @@ class NotificationBarStateStore extends StateNotifier<NotificationBarState> {
BoolKey.premiumTrialBeginAnouncementIsClosed, true);
state = state.copyWith(premiumTrialBeginAnouncementIsClosed: true);
}

Future<void>
setTrueIsAlreadyShowAnnouncementSupportedMultilplePillSheet() async {
final sharedPreferences = await SharedPreferences.getInstance();
sharedPreferences.setBool(
BoolKey.isAlreadyShowAnnouncementSupportedMultilplePillSheet, true);
state = state.copyWith(
isAlreadyShowAnnouncementSupportedMultilplePillSheet: true);
}
}
1 change: 0 additions & 1 deletion lib/domain/record/record_page_state.codegen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class RecordPageState with _$RecordPageState {
@Default(false) bool isPremium,
@Default(false) bool isTrial,
@Default(false) bool hasDiscountEntitlement,
@Default(false) bool isAlreadyShowAnnouncementSupportedMultilplePillSheet,
@Default(false) bool isAlreadyShowTiral,
@Default(false) bool isAlreadyShowPremiumSurvey,
@Default(false) bool shouldShowMigrateInfo,
Expand Down
Loading