读取包内资产的最小接口。
path 用 HyperlensAssets 里的常量(形如 packages/hyperlens/assets/web/…)。
只声明「怎么读」不关心「怎么打包」:包内不 import flutter / dart:io,
要现成实现见 package:hyperlens/root_bundle.dart(Flutter)与将来的
package:hyperlens/io.dart(VM)。
为什么是接口而不是直接用 rootBundle:测试要替身(返回假模板),使用方也可能
从别处取资产(预置缓存、内嵌字节)。把读取方式钉死,等于把这两种场景堵死。
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
loadString(
String path) → Future< String> - 读一份文本资产。
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited