StoryHomeNativeView class
短故事聚合页 NativeView
通过 PlatformView 将原生短故事聚合页内嵌到 Flutter 中, 自动处理 Android 和 iOS 平台的差异,提供统一的接口。
使用前请确保:
- 已成功调用
PangrowthContent.initialize和PangrowthContent.start。 - GroMore(gromore_ads) SDK 完成初始化(如果需要广告)。
架构说明:
- Android: 使用 NovSdk.factory().createStoryHome() 创建 IDJXWidget
- iOS: 使用 MNSMainViewController 作为聚合页视图控制器
推荐使用场景:
- 内嵌式短故事聚合页(在Tab或Page中显示)
- 需要与其他Flutter Widget组合布局的场景
- 需要Flutter自动管理生命周期的场景
对比 API方式:
- API方式: 通过 create/show/destroy 手动管理生命周期
- StoryHomeNativeView: 通过 PlatformView 自动管理(推荐)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- StoryHomeNativeView
Constructors
-
StoryHomeNativeView({Key? key, bool? canPullRefresh, int? topOffset, int? recPageSize, Map<
String, dynamic> ? readerConfig, Map<String, dynamic> ? extra, Set<Factory< gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{}, StoryHomeListener? listener, String? viewId})OneSequenceGestureRecognizer> > -
const
Properties
- canPullRefresh → bool?
-
是否支持下拉刷新
final
-
extra
→ Map<
String, dynamic> ? -
传递给原生层的额外参数
final
-
gestureRecognizers
→ Set<
Factory< OneSequenceGestureRecognizer> > -
自定义手势识别器
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listener → StoryHomeListener?
-
短故事聚合页事件监听器
final
-
readerConfig
→ Map<
String, dynamic> ? -
阅读器的个性化配置
final
- recPageSize → int?
-
推荐榜请求分页大小
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- topOffset → int?
-
布局Y轴偏移量,单位dp
final
- viewId → String?
-
自定义视图标识(用于调试),默认自动生成
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StoryHomeNativeView> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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, int wrapWidth = 65}) → 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