Flutter Adaptive Cards Plus
A Flutter library for rendering Adaptive Cards, updated and maintained to support the latest Flutter SDK 3.35.2.
This version modernizes the codebase, improves stability, and ensures compatibility with the current Flutter ecosystem while preserving the simplicity and flexibility of adaptive card rendering.
โจ Features
- Compatible with Flutter 3.35.2+
- Render adaptive cards using Flutter widgets
- Supports text, media, inputs, and actions
- Load card definitions from network, assets, or memory
- Improved dark mode color adaptation
- Clean and minimal API for developers
๐ฆ Installation
Add the package to your pubspec.yaml:
dependencies:
flutter_adaptive_cards_plus: ^1.0.0
Then run:
flutter pub get
๐ Usage Example
AdaptiveCard.network(
placeholder: Text("Loading, please wait..."),
url: "https://example.com/sample.json",
hostConfigPath: "assets/host_config.json",
onSubmit: (data) {
// Handle form submission
},
onOpenUrl: (url) {
// Handle URL click
},
showDebugJson: true,
approximateDarkThemeColors: true,
);
Other constructors:
AdaptiveCard.assetโ Load card from a local assetAdaptiveCard.memoryโ Load from an in-memory JSON map
You can provide host config either as an asset path (hostConfigPath) or as a decoded map (hostConfigMap).
If you use hostConfigPath, point to a bundled asset path (for example assets/host_config.json) declared in your app pubspec.yaml โ do not pass lib/....
Use hostConfigMap when your host config JSON lives in code and is not bundled as a Flutter asset.
๐งช Running Tests
flutter test
๐ก About
This project continues the development of an earlier open-source Adaptive Cards library for Flutter, now updated to meet the requirements of the latest Flutter SDK and community standards.
Special thanks to the open-source community for the inspiration and foundation that made this project possible.
๐ค Maintainer
Rajitha Perera GitHub: @HRCJ7
๐ License
Licensed under the MIT License. Use freely in commercial or personal projects.