pub package License

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 asset
  • AdaptiveCard.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.