Skip to content

kula-app/OnLaunch-Flutter-Client

Repository files navigation

OnLaunch Flutter Client

Swift Versions

Created and maintained by kula.app and all the amazing contributors.

OnLaunch is a service allowing app developers to notify app users about updates, warnings and maintenance Our open-source framework provides an easy-to-integrate client to communicate with the backend and display the user interface.

Features

  • Display customizable messages to your app users
  • Set your app into maintenance mode with blocking messages
  • Easy to integrate with existing Flutter apps

Installation 💻

❗ In order to start using Onlaunch you must have the Flutter SDK installed on your machine.

Add flutter_onlaunch to your pubspec.yaml:

dependencies:
  flutter_onlaunch:

Install it:

flutter packages get

Usage

Setup

Initialize the service in your main function:

void main() {
  WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
  OnLaunch().init(publicKey, baseURL);
  runApp(const MyApp());
}

Wrap your top widget with OnLaunchOverlay. The overlay has to come AFTER the MaterialAppWidget (or similar)

  return MaterialApp(home: OnLaunchOverlay(child: MainWidget()));

Test

To verify the setup, you can call the test method OnLaunch().preview({blocking}).

Options

The OnLaunch Flutter client provides a couple of configuration options:

Name Description Default
baseURL Base URL where the OnLaunch API is hosted at. Change this to point to your self-hosted instance of the OnLaunch server. https://onlaunch.kula.app/api/
publicKey Public key used to authenticate with the API
shouldCheckOnConfigure Flag indicating if the client should check for new messages immediately after it has been configured. true

Contributing Guide

Please see our Contributing Guide .

License

Distributed under the MIT License


Running Tests 🧪

For first time users, install the very_good_cli:

dart pub global activate very_good_cli

To run all unit tests:

very_good test --coverage

To view the generated coverage report you can use lcov.

# Generate Coverage Report
genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
open coverage/index.html

About

Flutter client for OnLaunch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages