patapata_core library

Classes

Analytics
An analytics class that notifies and monitors information related to events within the app, user tracking, and more, to external services or within the app itself.
AnalyticsContext
Context class for using analytics functionality, to be used in conjunction with AnalyticsContextProvider.
AnalyticsContextProvider
A widget that provides AnalyticsContext to it's child widgets via Provider.
AnalyticsEvent
Analytics event class
AnalyticsEventName
A class representing the names of analytics events as strings.
AnalyticsEventWidget
A widget that sends analytics events when the user taps the widget and releases their finger, in other words, using Listener.onPointerUp.
AnalyticsImpressionWidget
A widget that sends analytics when the widget is displayed, i.e., during impressions. When using this widget, if you are adding this to each item in a list of items, it is recommended to set the batchGenerator for sending multiple analytics events with batch processing.
AnalyticsNavigationType
A class representing the types of transitions as strings to be used as analytics data for page navigation.
AnalyticsRevenueEvent
Class for revenue-related analytics events.
AnalyticsRouteViewEvent
Class for RouteView analytics events.
AnalyticsSingletonEventWidget
A widget that sends an event only once when the child widget is built.
App<T extends Object>
The main class for a Patapata app. Typically passed to runApp. The main class for a Patapata-based application.
Config
A base class that manages the application's Config and provides the functionality to notify changes.
ConflictException
Thrown when ProviderModel.begin is called while a lock is already in place.
DeviceInfoLinuxPlatform
DeviceInfoPlugin
Plugin that manages information related to the platform's device.
DeviceInfoWebPlatform
DeviceInfoWindowsPlatform
I18n
Provides functionality required to switch the language of the application.
I18nPlugin
Plugin that provides localization. The l function becomes available.
InlinePlugin
A Plugin that can define all methods in the constructor.
L10n
Manages resources required for localization.
L10nDelegate
Factory to load resources for L10n. Called by the Localizations Widget.
L10nLoadAssetsException
Thrown if the loading of an asset in L10n fails.
LocalConfig
Abstract class for the LocalConfig.
LocalConfigFinder
This is an abstract class that utilizes conditional import functionality to handle LocalConfigFinder in both the app environment and web environment using a common source code. In the app environment, it functions as NativeLocalConfigFinder, while in the web environment, it functions as WebLocalConfigFinder.
Log
Provides an implementation for Logger.onRecord.
LogicState
The state to be executed in LogicStateMachine.
LogicStateAllTransitionsNotAllowed
Thrown when current is not allowed to transition to anything.
LogicStateComplete
The state in which LogicStateMachine successfully completed.
LogicStateError
The state in which LogicStateMachine terminated with an error.
LogicStateFactory<T extends LogicState>
Factory for LogicState.
LogicStateMachine
Provides the functionality of a Finite State Machine.
LogicStateNotCurrent
Thrown when current is not current in LogicStateMachine.
LogicStateTransition<R extends LogicState>
A class that specifies the types of other LogicStates that can transition from a given LogicState.
LogicStateTransitionNotAllowed
Thrown when current is not allowed to transition to next.
LogicStateTransitionNotFound
Thrown when LogicStateTransition is not found.
MockRemoteConfig
A RemoteConfig that can be used for testing. This class is not intended to be used in production. This RemoteConfig also implements WritableConfig and therefore can be used to set values for testing.
MockRemoteMessaging
This is a mock class for RemoteMessaging, used for testing purposes.
NativeLocalConfigPlugin
NativeThrowable
Class for exceptions that occurred natively.
NetworkInformation
A class representing the current network status of App.
NetworkPlugin
Plugin for retrieving the network status of App.
NotificationsInitializationException
Throw when exception if an error occurs in initializing NotificationsPlugin.
NotificationsPlugin
This is a plugin for performing local notifications.
PackageInfoPlugin
Plugin that manages information related to the application's metadata.
PatapataException
Defines exceptions that occur in applications using patapata.
Permissions
Requests permissions from the platform (Android, iOS).
Plugin
You can inherit from this class to create your own extensions for Patapata.
ProviderLockKey
Use an instance of this class to pass in to ProviderModel.lock and ProviderModel.begin.
ProviderModel<T>
ProviderModel is an abstract class that can be extended to create a model for state management and safe logic flow for your application. It uses the ChangeNotifier mixin to notify its listeners when changes occur, and therefore can be used with Provider via ChangeNotifierProvider, and anything that can work with ChangeNotifier or Listenable.
ProviderModelBatch
A batch of changes to a ProviderModel. Changes made to ProviderModelVariables will not be reflected until commit is called.
ProviderModelUseSubscription<T>
ProviderModelUseSubscription is a class that represents a subscription to a ProviderModel's ProviderModelVariables.
ProviderModelVariable<T>
A variable that can be used in batches and automatically detect changes as to notify listeners when it's value changes. The variable can be 'set' or 'unset' depending on whether it's value has been set or not. If it's value has not been set and it is accessed, an assertion will be thrown.
ProxyLocalConfig
Class for managing all LocalConfig used by the app. If multiple local configurations are added, the most recently added local configuration is used as the current LocalConfig.
ProxyRemoteConfig
Class for managing all RemoteConfig used by the app.
ProxyRemoteMessaging
Class for managing all RemoteMessaging used by the app.
RemoteConfig
Abstract class for the RemoteConfig.
RemoteMessage
A class for handling remote messages such as Patapata notifications.
RemoteMessageNotification
Class that represents remote messages that were displayed in the notification area of the device.
RemoteMessaging
An abstract class that provides the ability to monitor state changes of RemoteMessage. For each feature that provides remote messages, create a RemoteMessaging that inherits from this class.
ReportRecord
A log entry representation used to propagate information from Logger to individual handlers.
ResetStartupSequence
Thrown when StartupSequence.resetMachine is called while StartupSequence is already running.
SequentialWorkQueue
A utility class that will process work giving to it in order, without failure.
StartupNavigatorObserver
StartupSequence
Manages the series of processes from app launch to the display of the initial screen using LogicStateMachine. When executing StartupSequence.resetMachine, it starts execution from the first state provided in the StartupStateFactory list.
StartupState
LogicState executed in StartupSequence.
StartupStateFactory<T extends StartupState>
A factory for states used in the StartupSequence system.
TestMockStreamHandler
Test class for testing stream handlers. The app does not reference this class.
TestMockStreamHandlerEventSink
Class for events referenced in TestMockStreamHandler.onListen. The app does not reference this class.
User
User information of the application.
UserChangeData
User data while attempting to change the User.

Enums

AppStage
Defines what stage the App is currently in.
NetworkConnectivity
This enum describes various states of network connectivity for an app or system
PermissionNotificationResult
Result of Permissions.requestNotifications.
PermissionTrackingResult
Result of Permissions.requestTracking.

Mixins

AnalyticsEventFilterEnvironment
A mixin for an App.environment that can filter AnalyticsEvents.
ErrorEnvironment
Settings for PatapataException
I18nEnvironment
Language settings of the application. Used in I18nPlugin.
LogEnvironment
Settings for Log system
MemoryLocalConfig
A mixin that implements default functionality in LocalConfig. If you don't need to implement special features, you can use this mixin to create a LocalConfig
MethodChannelTestMixin
A mixin for adding a function to mock processing in a test environment to a class.
NotificationsEnvironment
This is a Mixin for adding variables related to notification settings to the Environment.
ReadableConfig
Provides an interface to read values from Config.
StartupNavigatorMixin
Implements page navigation during StartupSequence processing. If you are performing page navigation outside of the StandardAppPlugin system, implement a Plugin that uses this with a mixin.
WritableConfig
Provides an interface to write values to Config.

Constants

kIsTest → const bool
A value to check if this is running in a test environment. Defined by setting the dart define IS_TEST to true
kPataInHex → const int
A value that can be used as a 32 bit integer. It's value is just pata in ascii hexidecimal.

Properties

debugIsWeb bool
getter/setter pair
fakeNowSet bool
Whether is fake time is currently set or not via setFakeNow.
no setter
fakeNowStream Stream<DateTime?>
A stream to listen to when fake now changes.
no setter
mockL10nAssetBundle AssetBundle?
getter/setter pair
notificationAppLaunchDetailsMap Map<String, dynamic>?
getter/setter pair
now DateTime
Get the current DateTime. The value returned here can be overriden for debug or testing purposes with setFakeNow.
no setter
onPostFrameCallback VoidCallback?
Set this to execute a callback every time scheduleFunction is executed, after a frame has been scheduled, but before the post frame callback is set. Mostly used for testing purposes as a way to pump automatically.
getter/setter pair
testOnConnectivityChangedValue List<NetworkConnectivity>
getter/setter pair
testSetMockMethodCallHandler ↔ void Function(MethodChannel, Future<Object?>? (MethodCall)?)
Sets a mock method call handler for the given MethodChannel for testing purposes.
getter/setter pair
testSetMockStreamHandler ↔ void Function(EventChannel, TestMockStreamHandler?)
Sets a mock stream handler for the given EventChannel for testing purposes.
getter/setter pair

Functions

getApp<T extends Object>() App<T>
Returns the App for the current Zone. In almost all cases in your application, you can use this to grab your App instance without a BuildContext T is not required and will work undefined (as dynamic).
l(BuildContext context, String key, [Map<String, Object>? namedParameters]) String
Returns a localized string using the yaml file when L10n.lookup is called.
loadFakeNow() → void
Load the saved fake time from LocalConfig, previously set by setFakeNow.
platformCompute<Q, R>(ComputeCallback<Q, R> callback, Q message, {String? debugLabel}) FutureOr<R>
compute doesn't work in a test environment or on the web. This function runs compute on supported platforms but on unsupported platforms runs a simple microtask via scheduleMicrotask.
scheduleFunction(VoidCallback func) → void
Executes func asynchronously. If this application is active and rendering, it will use SchedulerBinding.addPostFrameCallback, ensuring that it will run with a call to SchedulerBinding.scheduleFrame. If the application is not active and rendering, ie, in the background, it will simply add a 1ms timer and execute func after that time.
setFakeNow(DateTime? fakeNow, {bool persist = true, bool elapse = false}) → void
Set a fake time that now will return. Set to null to return to real time again.
typeIs<T, S>() bool
Determines if T is a subclass of another S

Typedefs

LogicStateCompleter = void Function()
ProviderModelProcess = FutureOr<void> Function(ProviderModelBatch batch)
ReportRecordFilter = ReportRecord? Function(ReportRecord record)
StartupPageCompleter = void Function(Object? result)
TestMockStreamHandlerOnCancelCallback = void Function(Object? arguments)
Typedef for the inline onCancel callback.
TestMockStreamHandlerOnListenCallback = void Function(Object? arguments, TestMockStreamHandlerEventSink events)
Typedef for the inline onListen callback.
TransitionPredicate = bool Function(LogicState current, LogicState next)