E/flutter (24839): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter (24839): Unable to load asset: packages/myAppName/assets/images/ReceiptRaw_1.jpg
Future<bool> makeReceiptImage() async {
// load the receipt jpeg
String mImagePath = await rootBundle.loadString('packages/myAppName/assets/images/ReceiptRaw_1.jpg');
print("mImagePath: $mImagePath");
Image _receiptImage = await decodeImage(new File(mImagePath).readAsBytesSync());
drawString(_receiptImage, arial_48, 440, 30, “Customer Name”, color: 0xFF000000);
// Write it to disk as a different jpeg
var new_jpeg = await encodeJpg(_receiptImage);
String newImagePath = await rootBundle.loadString('packages/myAppName/assets/images/ReceiptRaw_2.jpg');
await new File(‘$newImagePath’).writeAsBytesSync(new_jpeg);
}The Dart Console App is working with similar code
import 'dart:io';
import 'dart:convert';
import 'dart:async';
import 'package:image/image.dart';
void main() async {
// load the receipt jpeg
String mImagePath = 'images/ReceiptRaw_1.jpg';
Image _receiptImage = decodeImage(new File(mImagePath).readAsBytesSync());
drawString(_receiptImage, arial_48, 440, 30, “Customer Name”, color: 0xFF000000);
// Write it to disk as a different jpeg
var new_jpeg = encodeJpg(_receiptImage);
new File('images/ReceiptRaw_1.jpg').writeAsBytesSync(new_jpeg);
}