pabulo_sdk 1.0.10
pabulo_sdk: ^1.0.10 copied to clipboard
Pábulo: The future of Loyalty, Merchants & Wallet Platforms, Today
Pabulo Platform Dart Library #
Pábulo: The future of Loyalty, Merchants & Wallet Platforms, Today.
Provides APIs for seamlessly connect to the Pabulo Platform and build rich Flutter UIs in no time.
Motivation #
✅ To provide ability to quickly build front-ends in the shortest possible time.
✅ Simplifying complex JSON data models into standard Request & Response objects.
✅ Providing efficiency to reduce network traffic by validating data before doing a server
round trip.
Get Started #
Future<void> main() async {
await AppConfig.initialize();
/// Initialize th Globals for the base framework.
/// This is a singleton so enable it in the main
/// for early initialization.
PabuloGlobals(
AppConfig().appConfig.baseUrl,
AppConfig().appConfig.defaults.getRequestTimeOut(),
AppConfig().appConfig.defaults.language,
);
// You code after this.
}
Initialize the PabuloGlobals() with the three parameters:
baseUrl: this is the path to the backend where the core platform is running , i.e.https://api.domain.comorhttps://api.domain.com:8080requestTimeOut: Optional The time as [Durations] to wait for backend to respond. If ignored the default is 30 seconds.language: Optional This is the language 'en-US' or 'fr-FR' to be used for communicating to the backand. If ignored the default is 'en-US'.
🫡 That is all !!! You are now wired up to start using the SDK.
Usage #
Once you have wired the SDK in the main() you have to wire the necessary repositories for the
business flow that you are working on.
e.g.; you are building a Login Screen for users to login.
class LoginBloc extends Bloc<LoginEvent, LoginState> {
// Wire the SDK Repository for Administration Functions.
final RepoAdmin _repoAdmin = RepoAdmin();
// On Login Pressed call the api
Future<void> onLoginPressed() async {
try {
RspLogin? rspLogin = await _repoAdmin.letMeIn(
ReqLogin(consumerEmail: email, consumerPassword: password),);
} catch (error) {
// ... handle errors
}
// ... reset of your code.
}
}
Always get the latest Swagger Documentation to understand the End-Points & APIs
© Adhvent Consulting Ltd.