🚀 Lune SDK Flutter Plugin

A powerful Flutter plugin that seamlessly integrates the Lune SDK into your Flutter applications! ✨ This plugin brings the full power of Lune's financial data visualization to both Android and iOS platforms with native performance.

✨ Features

  • 🔄 Native integration with Lune SDK for both Android and iOS
  • 📊 Rich financial data visualization components
  • 📝 Comprehensive event logging and analytics
  • ⚠️ Robust error handling and notifications
  • 🔑 Secure token refresh mechanism
  • 🎨 Customizable view types for your needs

🚀 Getting Started

📦 Installation

Add the following to your pubspec.yaml:

dependencies:
  lune: ^0.0.1

💡 Usage

  1. Initialize the SDK with your credentials:

final lunePlugin = Lune(
  baseUrl: 'YOUR_BASE_URL',
  accessToken: 'YOUR_ACCESS_TOKEN',
);

await lunePlugin.initialize();
  1. Set up callbacks for events and error handling:

// Token refresh - ⚠️ This is important
await lunePlugin.setRefreshTokenCallback(() async {
  // Implement your token refresh logic here
  return 'new_access_token';
});

// Event logging
await lunePlugin.setLoggingCallback((event) {
  print('Event: $event');
});

// Error logging
await lunePlugin.setErrorLoggerCallback((error) {
  print('Error: $error');
});

// Error notifications
await lunePlugin.setErrorNotifierCallback((error) {
  print('Error notification: $error');
});

// Success notifications
await lunePlugin.setSuccessNotifierCallback((success) {
  print('Success: $success');
});
  1. Display Lune SDK views:
// Get a view with default settings
final view = lunePlugin.getView(viewType);

// Get a view with custom settings
final view = lunePlugin.getView(
  viewType,
  solo: true, // Whether to render the view independently
);

📱 Platform Support

  • 🤖 Android: Requires Android API level 21 or higher
  • 🍎 iOS: Requires iOS 13.0 or higher

🎨 Customization

To customize the native implementation:

Opening the Projects

Android:

  1. Open Android Studio
  2. Open your project's android directory in Android Studio. You can do this from the context menu by right-clicking the android directory.
  3. Modify the project as necessary, following the Lune Android SDK Documentation

iOS:

  1. Open Terminal and navigate to your project's root directory
  2. Run cd ios && open Runner.xcworkspace. This opens the project in Xcode.
  3. Modify the project as necessary, following the Lune iOS SDK Documentation

Customization Options

Follow the customization instructions in the official documentation of the native SDKs linked above.

You will be able to customize:

  • 🎨 theming and styling using a json configuration file
  • 🈯 localization for the project
  • 🖼️ image assets used in the project

Note: 🖋️ The SDK automatically uses the font set up for the host app.

🛠️ Development

Built with Flutter's powerful plugin development framework! For more information on developing Flutter plugins, check out the Flutter documentation.

📄 License

This project is licensed under the terms of the LICENSE file in the root of this repository.


Made with ❤️ by the Lune team