R89Tag class
This widget places the advertisement by using the provided tag and route name according to predefined advertisement configurations for a screen and a tag.
Column(
children: [
...,
// will place an ad.
R89Tag(tag: 'banner_tag'),
...,
// will place an ad before or after it DescriptionContent.
R89Tag(tag: 'banner_tag',child: DescriptionContent(),)
],
)
This widget can be used in the scrollables as well, such as ListView, GridView and others. It will take an extra itemIndex parameter to make a desition whether place an ad for a given position or not.
ListView.builder(
itemCount: 100,
itemBuilder: (context, index) =>
Column(
children: [
...,
// will place an ad if it is available for a given position.
R89Tag(tag: 'banner_tag', itemIndex: index,),
...,
// will place an ad before or after it DescriptionContent.
// if it is available for a given position.
R89Tag(tag: 'banner_tag', itemIndex: index, child: DescriptionContent(),)
],
),)
In case the same screen has multiple scrollable widgets, provide a unique key to R89Tag, that uniquly identifies the scroll widget on the screen, R89Tag can run the logic of position based ad placement separate for each scrollable widget. In this sample a horizontal list is placed inside the vertical one.
CustomScrollView(
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
childCount: 100,
(context, index) => index != 3
// ValueKey('v_scroll') is a unique key for the vertical scroll
tag group
? R89Tag(key: const ValueKey('v_scroll'), tag: 'infinite_scroll',
itemIndex: index,child: VScrollListItem())
: KeepAliveWrapper(
child: SizedBox(
height: 400,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: 40,
// ValueKey('h_scroll') is a unique key for the horizontal
scroll tag group
itemBuilder: (context, index) => R89Tag(key: const
ValueKey('h_scroll'), tag: 'infinite_scroll',
itemIndex: index,child: VScrollListItem()),
),
),
))),
],
)
- Inheritance
Constructors
- R89Tag({required String tag, Widget? child, int? itemIndex, Key? key})
-
tag
the name of the tag, if therechild
optional child, if the child is provided the advertizement will be placed before or after the child according to wrapper position configuration, see theAdScreenConfig .addBanner
and AdScreenConfig.addOutStream methods.itemIndex
provide the item position index if the R89Tag is placed inside the scroll view so internally it will use theitemIndex
to make a desition whether to place an advertisement for a given position or not.key
provide a unique key to each R89Tag group if there are multiple list views on the same screen.const
Properties
- child → Widget?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemIndex → int?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tag → String
-
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited