Flutter SDK Content
Content is a separate section of the config, unrelated to App Features: groups, and inside them items carrying a key, tags, a file link and preview links. The SDK does not download or cache content files itself — it only hands back the links from the config. Downloading and rendering the actual files is your app's responsibility.
ContentItem
ContentItem({
required String key,
List<String> tags = const [],
List<String> previews = const [],
String? link,
});
link is always set on iOS — items with no link are filtered out there. Android may report
an item with no link at all, so check for null on Android before using it.
Fetching a list of items
Future<List<ContentItem>> contentList(
String groupKey,
String contentKey, {
List<String> tags = const [],
});
Returns the items under contentKey inside groupKey, keeping only those carrying all
the given tags. An empty tag list filters nothing.
final items = await MagifyClient.instance.contentList(
'store',
'seasonal_banners',
tags: ['winter'],
);
for (final item in items) {
if (item.link != null) {
// download/display item.link, cache it yourself if needed
}
}
Fetching the earliest or latest item
Two reserved tags — earliest and latest — let the server mark a priority item within a
key:
Future<ContentItem?> earliestContent(String groupKey, String contentKey);
Future<ContentItem?> latestContent(String groupKey, String contentKey);
earliestContent returns the item tagged earliest. When the key holds exactly one item,
that single item is returned whatever its tags; otherwise it returns null.
latestContent does the same for the latest tag.
final banner = await MagifyClient.instance.latestContent('store', 'seasonal_banners');
Next step
Continue to App Features for remote-controlled flags.