PlayerAssetsScope class

用于在 Widget 树中传递资源路径

自定义皮肤

  1. 创建资源目录:

    your_app/assets/player_icons/
    ├── ic_back.png
    ├── ic_settings.png
    └── ...
    
  2. 注册资源(pubspec.yaml):

    flutter:
      assets:
        - assets/player_icons/
    
  3. 传入路径:

    AliPlayerWidget(controller, assetsPath: 'assets/player_icons')
    
Inheritance

Constructors

PlayerAssetsScope({Key? key, required String assetsPath, required Widget child})
const

Properties

assetsPath String
资源路径
final
child Widget
The widget below this widget in the tree.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
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

Methods

createElement() InheritedElement
Inflates this configuration to a concrete instance.
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, 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
updateShouldNotify(covariant PlayerAssetsScope oldWidget) bool
Whether the framework should notify widgets that inherit from this widget.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

iconPath(BuildContext context, String iconName) String
获取完整图标路径
of(BuildContext context) String
从 context 获取资源路径,未找到则返回默认路径

Constants

defaultAssetsPath → const String
默认资源路径(包内)