SubsBlocNew class

Inheritance

Constructors

SubsBlocNew({required BuildContext context, required String checkSubscriptionApi, RequestType checkSubscriptonApiRequestType = RequestType.get, required String saveSubscriptionApiUrl, required List<String> subscriptionProductIds, required SubscriptionPlans subscriptionPlans, required bool planActiveCheckFromApi, required bool activePlanSaveInApi, required bool isSandbox, required String sharedSecret, required bool isCancelAllow, required String cancelSubscriptionApiUrl})

Properties

activePlanSaveInApi bool
getter/setter pair
cancelSubscriptionApiUrl String
final
checkSubscriptionApi String
final
checkSubscriptonApiRequestType RequestType
final
context BuildContext
final
hashCode int
The hash code for this object.
no setterinherited
inAppPurchase InAppPurchase
final
isCancelAllow bool
getter/setter pair
isClosed bool
Whether the bloc is closed.
no setterinherited
isSandbox bool
getter/setter pair
notFoundIds List<String>
getter/setter pair
planActiveCheckFromApi bool
getter/setter pair
purchaseDetail PurchaseDetails
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
saveSubscriptionApiUrl String
final
scaffoldKey GlobalKey<ScaffoldState>
getter/setter pair
service SubscriptionService
final
sharedSecret String
getter/setter pair
state SubscriptionState
The current state.
no setterinherited
stream Stream<SubscriptionState>
The current stream of states.
no setterinherited
subscription StreamSubscription<List<PurchaseDetails>>?
getter/setter pair
subscriptionPlans SubscriptionPlans
Product IDs with durations (testing + production)
final
subscriptionProductIds List<String>
final

Methods

add(SubscriptionEvent event) → void
Notifies the Bloc of a new event which triggers all corresponding EventHandler instances.
inherited
addError(Object error, [StackTrace? stackTrace]) → void
Reports an error which triggers onError with an optional StackTrace.
inherited
buyProductEvent(BuyProductEvent event, Emitter<SubscriptionState> emit) Future<void>
calculatePlanDuration({required String productId}) Duration?
cancelSubscription(CancelSubscriptionEvent event, Emitter<SubscriptionState> emit) Future<void>
checkActiveSubscription() Future<Map<String, dynamic>>
close() Future<void>
Closes the event and state Streams. This method should be called when a Bloc is no longer needed. Once close is called, events that are added will not be processed. In addition, if close is called while events are still being processed, the Bloc will finish processing the pending events.
override
dispose() Future<void>
downgradeOrUpgradeEvent(DowngradeOrUpgradeEvent event, Emitter<SubscriptionState> emit) Future<void>
emit(SubscriptionState state) → void
emit is only for internal use and should never be called directly outside of tests. The Emitter instance provided to each EventHandler should be used instead.
inherited
getIosPastPurchases() Future<List<PurchaseDetails>>
getOldPurchaseEvent(GetOldPurchaseEvent event, Emitter<SubscriptionState> emit) Future<void>
getValueBeforeBracket(String input) String
initEvent(SubscriptionInitEvent event, Emitter<SubscriptionState> emit) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on<E extends Event>(EventHandler<E, SubscriptionState> handler, {EventTransformer<E>? transformer}) → void
Register event handler for an event of type E. There should only ever be one event handler per event type E.
inherited
onChange(Change<SubscriptionState> change) → void
Called whenever a change occurs with the given change. A change occurs when a new state is emitted. onChange is called before the state of the cubit is updated. onChange is a great spot to add logging/analytics for a specific cubit.
inherited
onDone(SubscriptionEvent event, [Object? error, StackTrace? stackTrace]) → void
Called whenever an event handler for a specific Bloc has completed. This may include an error and stackTrace if an uncaught exception occurred within the event handler.
inherited
onError(Object error, StackTrace stackTrace) → void
Called whenever an error occurs and notifies BlocObserver.onError.
inherited
onEvent(SubscriptionEvent event) → void
Called whenever an event is added to the Bloc. A great spot to add logging/analytics at the individual Bloc level.
inherited
onTransition(Transition<SubscriptionEvent, SubscriptionState> transition) → void
Called whenever a transition occurs with the given transition. A transition occurs when a new event is added and a new state is emitted from a corresponding EventHandler.
inherited
removeAfterMonthlyOrYearly(String input) String
saveSubscriptionEvent(SaveSubscriptionEvent event, Emitter<SubscriptionState> emit) Future<void>
toString() String
A string representation of this object.
inherited
verifyPurchaseEvent(VerifyPurchaseEvent event, Emitter<SubscriptionState> emit) Future<void>
verifyReceipt(String receiptData, {bool isSandbox = true}) Future<Map<String, dynamic>>

Operators

operator ==(Object other) bool
The equality operator.
inherited