Feed Placement
Feed (SmartFeed) is a ready-made, self-paginating content recommendations widget. Drop FeedPlacement into a scrolling list and it handles the rest.
The plugin's example app, shipped with the teads_flutter package, includes a working screen for this format. Use it as a reference while you set up this placement.
Example
FeedPlacement(
config: FeedPlacementConfig(
widgetId: 'MB_1', // Provided by your Teads account manager
installationKey: 'YOUR_INSTALLATION_KEY',
articleUrl: 'https://example.com/article/123',
),
onOrganicClick: (Uri organicUrl) {
// Open your own article — see Organic clicks below.
},
onUnsupported: (TeadsAdError error) => debugPrint('Feed: ${error.reason}'),
)
Pagination is automatic
As the user scrolls to within 600 logical pixels of the end, the placement requests the next chunk and grows to fit it, until the feed is exhausted. There is nothing to call and no "load more" control to build.
By default the feed grows to its full content height. maxHeight caps it so the feed scrolls internally instead; leaving it null matches native behavior.
FeedPlacement(config: feedConfig, maxHeight: 1200)
The feed adds no space below its content, as on native. To reserve some, set contentBottomPadding:
FeedPlacement(config: feedConfig, contentBottomPadding: 16)
To follow the feed's height or its clicks, listen for heightUpdated, clicked and clickedOrganic on onEvent. See Placement Events.
Size before the ad loads
The feed takes no space until the page reports its content, and the loading spinner is gone. FeedPlacement.initialHeight is deprecated and no longer the slot's height. A layout that relied on the old 300 px placeholder shifts when the ad arrives.
- iOS: the feed stays at 0 until the ad fills and its height is known, and stays at 0 if the page reports no fill first. A no-fill after that keeps the height.
- Android: the feed takes each height the page reports, before the fill too, as native Android does, so it can take space before the ad is confirmed. A no-fill before the fill collapses it to 0, and a no-fill after the fill keeps the height.
A feed that fails to start also collapses to 0 instead of showing an error message to your users.
Counting a page view again (iOS)
To count a new page view on a feed the user came back to, pass a FeedPlacementController and call reportPageViewOnTheSameWidget():
final feedController = FeedPlacementController();
FeedPlacement(config: feedConfig, controller: feedController);
// When the user returns to the same article:
await feedController.reportPageViewOnTheSameWidget();
This does nothing on Android, whose native SDK has no equivalent. On iOS it does nothing until the feed has started loading.
Multiple feeds on one page
widgetIndex is a coordination key, not a positionOnly a placement with widgetIndex: 0 fetches its ad directly. Any other value waits for a widgetIndex: 0 placement on the same page to publish shared bridge parameters before it fetches at all.
If no widgetIndex: 0 placement is guaranteed to load on the same page, the ad never loads, and no error is reported. This mirrors the native SDKs exactly. Use widgetIndex: 0 unless you have another Feed guaranteed to load first with widgetIndex: 0.
ListView(
children: [
FeedPlacement(
config: FeedPlacementConfig(
widgetId: 'MB_1',
installationKey: 'YOUR_INSTALLATION_KEY',
articleUrl: articleUrl,
widgetIndex: 0, // fetches directly
),
),
const Text('More content…'),
FeedPlacement(
config: FeedPlacementConfig(
widgetId: 'MB_2',
installationKey: 'YOUR_INSTALLATION_KEY',
articleUrl: articleUrl,
widgetIndex: 1, // waits for index 0
),
),
],
)
Organic clicks
Organic recommendations point at your content, not an advertiser's, so the SDK hands you the URL instead of opening a browser over your app. Wire onOrganicClick up to keep the reader inside your own UI; leave it null and the article opens in an in-app browser view. The click is registered either way.
FeedPlacement(
config: feedConfig,
onOrganicClick: (Uri organicUrl) {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => ArticleScreen(url: organicUrl.toString())),
);
},
)
Fullscreen video
The feed can ask to go fullscreen for a video card. It can only grow its own slot — it cannot paint over your app bar or the system bars — so your app must fold its chrome away when asked.
import 'package:flutter/services.dart'; // for SystemChrome
class _ArticleScreenState extends State<ArticleScreen> {
bool _fullScreen = false;
void dispose() {
// Leaving mid-fullscreen would otherwise strand the app in immersive mode.
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
super.dispose();
}
Widget build(BuildContext context) {
return Scaffold(
// Black behind the card: on Android the hidden navigation bar leaves a
// strip the card does not cover.
backgroundColor: _fullScreen ? Colors.black : null,
// Zero height rather than null: removing the AppBar changes the
// Scaffold's layout and risks re-parenting the body.
appBar: PreferredSize(
preferredSize: Size.fromHeight(_fullScreen ? 0 : kToolbarHeight),
child: _fullScreen
? const SizedBox.shrink()
: AppBar(title: const Text('Article')),
),
body: ListView(
physics: _fullScreen ? const NeverScrollableScrollPhysics() : null,
children: [
// Collapse siblings, do NOT remove them from the tree.
Visibility(
visible: !_fullScreen,
maintainState: true,
child: const Text('Article content…'),
),
FeedPlacement(
config: feedConfig,
onFullScreenChange: (bool fullScreen) {
if (!mounted) return;
setState(() => _fullScreen = fullScreen);
SystemChrome.setEnabledSystemUIMode(
fullScreen ? SystemUiMode.immersive : SystemUiMode.edgeToEdge,
);
},
),
],
),
);
}
}
Collapse surrounding content with Visibility(maintainState: true) or a zero height — never by removing it from the tree. Removing a sibling re-parents the WebView and it stops painting entirely.
Scrolling into and out of fullscreen
On entering fullscreen the placement scrolls its card to the top of the viewport itself, through every enclosing scrollable, and keeps correcting for up to 10 frames while your layout settles. Do not scroll your list from onFullScreenChange. The placement's alignment overrides it, and a jump to maxScrollExtent lands short in a lazy list such as ListView.builder. A header you leave visible above the card is scrolled away, so fold it in the callback instead.
On exit the placement restores the scroll position of the nearest enclosing scrollable only. An outer one, such as a NestedScrollView's, keeps the offset the entry gave it.
Pinned SliverAppBar
A pinned SliverAppBar needs three toggles while fullscreen. A primary app bar keeps the status bar's height even at a zero toolbar height, and the card cannot scroll past that band. Setting primary: false all the time puts your content under the status bar instead.
SliverAppBar(
pinned: true,
primary: !_fullScreen,
toolbarHeight: _fullScreen ? 0 : kToolbarHeight,
title: _fullScreen ? null : const Text('Article'),
)
Keep the bar in the tree. Removing it re-parents the WebView, which stops painting.
Dark mode
Rebuild with a new config; the placement pushes the change into the already-loaded page. There is no controller call for this.
final isDark = MediaQuery.platformBrightnessOf(context) == Brightness.dark;
FeedPlacement(config: feedConfig.copyWith(darkMode: isDark));
Best Practices
onUnsupportedonUnsupported is the only route for parity gaps, meaning bridge features the plugin does not implement. Page events and error messages that both native SDKs drop are logged at debug level instead. Wire it up in any build you intend to debug.
No widget may cover the placement — not even a transparent overlay. It breaks viewability measurement.
Configuration
Every FeedPlacementConfig field and FeedPlacement property is in Settings.
Ad Lifecycle Listener
Feed's onEvent uses the same typed TeadsAdEvent vocabulary as the other placements, and adds onUnsupported, onOrganicClick and onFullScreenChange. See Placement Events Listener.
Checklist
- ✅ Ensure Brand Safety is enabled: pass the real
articleUrl - ✅ Ensure you comply with privacy legal requirements (GDPR/CCPA/GPP)
- ✅ Comply with app-ads.txt
- ✅
widgetIndex: 0unless you deliberately coordinate multiple feeds - ✅ Test with the IDs in Test PIDs and Configurations