getAssetImageWithColor static method

Image getAssetImageWithColor(
  1. String assetFilePath,
  2. Color? color, {
  3. String? package,
})

将 icon 根据传入颜色变后返回

Implementation

static Image getAssetImageWithColor(String assetFilePath, Color? color,
    {String? package}) {
  if (!assetFilePath.startsWith('assets')) {
    assetFilePath = 'assets/$assetFilePath';
  }
  return Image.asset(
    assetFilePath,
    color: color,
    package: package ?? BaseStrings.flutterPackageName,
    scale: 3.0,
  );
}