ConditionalTrigger class

Constructors

ConditionalTrigger(String name, {int minDays = 3, int minCalls = 3, List<String> noRequestVersions = const [], List<String> remindedVersions = const [], bool keepRemind = false, bool debugLog = false})
Create the conditions that help you to control the conditions before doing something.
const

Properties

debugLog bool
Print the debug log if this value is true.
final
hashCode int
The hash code for this object.
no setterinherited
keepRemind bool
If true, it'll keep asking for the ConditionalTrigger on each new version (and satisfied with all the above ConditionalTrigger). If false, it only requests for the first time the ConditionalTrigger are satisfied.
final
lastState ConditionalState?
You can use lastState to get the ConditionalState if you already ran check() somewhere else.
no setter
minCalls int
Min calls of this method (increase counter when this method is executed) If you add this line in your main(), it's same as app opening count.
final
minDays int
Min days since this method is called.
final
name String
Name of this contidion. This is also known as prefix of the SharedPreferences.
final
noRequestVersions List<String>
If the current version is satisfied with this than not showing the request this value use plugin satisfied_version to compare.
final
remindedVersions List<String>
List of version that allow the app to remind the in-app review.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateKey String
no setter

Methods

check() Future<ConditionalState>
This method will check whether the conditions are satisfied, the conditions will be repeated to check everytime this method is called. Main different is this method will insrease the calls counter.
checkOnce() Future<ConditionalState>
This function will check whether the conditions are satisfied, the conditions will be check only one time even multiple checkOnce is called. Main different is this method will NOT insrease the calls counter.
copyWith({String? name, String? version, int? minDays, int? minCalls, List<String>? noRequestVersions, List<String>? remindedVersions, bool? keepRemind, bool? debugLog}) ConditionalTrigger
Create a copy of Condition.
dispose() → void
Optional Free the memory if there is no longer used.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setMockInitialValues([ConditionalMock? mock]) → void
Set mock values.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

clearAllMocks() → void
Clear all mocks.
clearAllStates() → void
Clear all states.