classInstantiate method

String classInstantiate(
  1. AssetType asset
)

Implementation

String classInstantiate(AssetType asset) {
  final buffer = StringBuffer(className);
  buffer.write('(');
  buffer.write('\'${asset.posixStylePath}\'');
  if (asset.flavors.isNotEmpty) {
    buffer.write(', flavors: {');
    final flavors = asset.flavors.map((e) => '\'$e\'').join(', ');
    buffer.write(flavors);
    buffer.write('}');
    buffer.write(','); // Better formatting.
  }
  buffer.write(')');
  return buffer.toString();
}