djangoflow_remote_config 0.0.2 copy "djangoflow_remote_config: ^0.0.2" to clipboard
djangoflow_remote_config: ^0.0.2 copied to clipboard

Djangoflow Remote Config is a library that helps to handle remote config in your flutter application.

Djangoflow Remote Config Logo

🌐 Djangoflow Remote Config for Flutter 🌐

GitHub Repository Pub Package

A Flutter package for managing remote configurations in your Flutter applications, designed to work seamlessly with django-df-remote-config.


🌟 Features #

  • Dynamic Configuration: Load configurations dynamically from the server.
  • Fallback Support: Use fallback configurations when the server is unreachable.
  • Hydrated State: Save and restore state across app launches.
  • Part-based Loading: Load specific parts of the configuration as needed.

📦 Installation #

To add djangoflow_remote_config to your Flutter project, add the following line to your pubspec.yaml:

dependencies:
  djangoflow_remote_config: <latest_version>

Then, run:

flutter pub get

🚀 Quick Start #

🌅 App Startup #

Make sure to call AppLaunchRemoteConfigCubit during your app's startup. This will contain updates of different parts with their last changed DateTime objects.

final appLaunchCubit = AppLaunchRemoteConfigCubit(
  fallbackConfig: {
    // Your fallback configurations here
  },
  params: {
    "app": "com.example.app"
  },
);

appLaunchCubit.load();

🔄 Dynamic Configuration Loading #

Use RemoteConfigPartUpdater to load the necessary data based on the last updated time. If the data is not updated, it will use the fallback data or the last hydrated state.

RemoteConfigPartUpdater<AppLaunchRemoteConfigCubit>(
  create: (context) => AppLaunchRemoteConfigCubit(
    // Your configurations here
  ),
  child: YourWidget(),
)

🛠 Parameters #

  • fallbackConfig: The default configuration to use if the server is unreachable.
  • params: Additional parameters to send to the server.
  • useOnlyFallbackOnError: Whether to use only the fallback configuration on error.

📖 Example App #

Check out the example directory for a complete example app demonstrating the package's capabilities.

🤝 Contributing #

We welcome contributions! Feel free to open an issue or submit a pull request if you have any improvements or find any bugs.

📜 License #

This project is licensed under the MIT License. See the LICENSE file for details.