#Install Access on Flutter
The easiest way to add Poool Access to your Flutter app ✨
#Requirements
- Dart SDK >= 2.17.0 (not tested on older versions)
- Flutter SDK >= 3.0.0 (not tested on older versions)
- Provider plugin
#Installation
#Usage
#Documentation
#AccessProvider()
It uses the flutter
provider plugin in order to use a global context to store access factories and events, with some listeners. It has to be created through a ChangeNotifierProvider.#Props
appId{String} Your Poool App IDdebug{Boolean} Enable / Disable logs
#AccessWrapper()
It is used to wrap your content (both previews and complete premium articles) with Poool widgets.
#Props
appId{String} Your Poool App ID (it has to be the same used forAccessProvider)children{List<Widgets>} A list of flutter widgets
#Snippet()
Use it to display your preview or free content, which will be displayed above Poool Access's Paywall.
#Props
child{Widget} Free content or article's preview
#RestrictedContent()
Use it to display your article's premium content, when the paywall is finally released.
#Props
child{Widget} Premium content
#Paywall()
Used to load and display Poool's Paywall from native side (ios/android)
#Props
pageType{String} (optional, default:'premium') Current page type (supported types:page,premium,free)config{Map<String, Object>} (optional) Paywall config (see the configuration documentation).styles{Map<String, Object>} (optional) Paywall styles (see the styles documentation).texts{Map<String, String>} (optional) Paywall texts (see the texts documentation).variables{Map<String, Object>} (optional) Paywall variables (see the variables documentation).events{Map<String, Function>} (optional) Event listeners (see the events documentation).disableViewLoader{Boolean} (optional, default:false) Disables the default view loader (circle progress indicator)customViewLoader{Widget} (optional) Choose your own custom view loader to replace the default one if view loader is still enabledreleaseOnError{Boolean} (optional, default:false) Choose between releasing the entire article when Poool is enable to fetch your paywall & config, or keep fully blocking the entire content inRestrictedContentwidget.
#AccessBottomSheet()
This widget can be used anywhere and doesnt need to be wrapped in a
AccessWrapper widget. Instead of being displayed in the article, it will bring the Paywall in a native bottom sheet, locking access to your entire app. It mostly has the same props as Paywall. Since AccessWrapper isn't needed here, don't forget to bring your appId.#Props
appId{String} Your Poool App IDpageType{String} (optional, default:'premium') Current page type (supported types:page,premium,free)config{Map<String, Object>} (optional) Paywall config (see the configuration documentation).styles{Map<String, Object>} (optional) Paywall styles (see the styles documentation).texts{Map<String, String>} (optional) Paywall texts (see the texts documentation).variables{Map<String, Object>} (optional) Paywall variables (see the variables documentation).events{Map<String, Function>} (optional) Event listeners (see the events documentation).releaseOnError{Boolean} (optional, default:false) Choose between releasing the entire article when Poool is enable to fetch your paywall & config, or keep fully blocking the entire content inRestrictedContentwidget.
#Contributing
Please check the CONTRIBUTING.md doc for contribution guidelines.
#Development
Install dependencies:
(Optional-iOS Only) Install pods:
To run example, go to Android Studio or XCode and launch with your prefered device or emulator. From project root directory run:
Then select from this list the device you want and:
or
where
your_device is the name or id found in the list you get in the step before#License
This software is licensed under MIT.