BrunoTools class

图片加载工具类

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

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

Static Methods

colorFromHexString(String? s) Color
从16进制数字字符串,生成Color,例如EDF0F3
getAssetImage(String assetFilePath, {BoxFit? fit, bool gaplessPlayback = false}) Image
assetFilePath assets 资源文件路径 fit 图片剪裁模式 gaplessPlayback 当图像提供程序更改时,是继续显示旧映像(true),还是暂时显示空白(false)。
getAssetImageProvider(String assetFilePath) ImageProvider<Object>
获取本地 AssetImage assetFilePath assets资源文件路径
getAssetImageWithBandColor(String assetFilePath, {String configId = GLOBAL_CONFIG_ID}) Image
将 icon 根据主题色变色后返回 assetFilePath assets 资源文件路径 configId 主题配置id
getAssetImageWithColor(String assetFilePath, Color? color) Image
将 icon 根据传入颜色变后返回 assetFilePath assets 资源文件路径 color 图片着色
getAssetScaleImage(String assetFilePath) Image
assetFilePath assets 资源文件路径,使用默认 scale
getAssetSizeImage(String assetFilePath, double w, double h, {Color? color}) Image
assetFilePath assets 资源文件路径 w 图片宽度 h 图片高度, color 图片着色
isEmpty(Object? obj) bool
判空
textSize(String text, TextStyle style) Size
根据 TextStyle 计算 text 宽度。