I have a Flutter project that previously used the flutter_adaptive_cards package to render Microsoft Adaptive Cards. The old code looked something like this:
final AdaptiveCard adaptiveCard = AdaptiveCard.memory(
content: json.decode(
attachment.content!
.replaceAll(RegExp(r'"height"\s*:\s*"auto"'), '''"height" : null''')
.replaceAll(RegExp(r'"width"\s*:\s*"auto"'), '''"width" : null''')
),
hostConfigPath: 'lib/host_config',
showDebugJson: false,
);
However, flutter_adaptive_cards is now outdated and is no longer maintained. I’ve tried replacing it with adaptive_card_renderer (or other newer packages), but I’m facing issues:
Some classes and methods (AdaptiveCard, .memory(), hostConfigPath) no longer exist in the new package.
I can’t find clear documentation or migration guides for converting existing code.
My app needs to dynamically render Adaptive Cards from JSON strings (coming from Microsoft Graph API messages).
Question: What is the best currently maintained Flutter package for rendering Adaptive Cards, and how can I rewrite the above flutter_adaptive_cards code to work with it? Ideally, I’d like: