I am trying to create a bmp icon for my google map markers. I need to add dynamically different background pictures to fit the circle in the loop. Not really sure how to approach this since im new to flutter, is there actually any way I can preview the mapbitdescriptor while trying to do this? Basically I need a circle in that loop that takes an image as a background.
Future<BitmapDescriptor> customBitMap(String imageUrl) async {
final myImage = await Image(image: AssetImage('assets/images/icon.png'));
final pictureRecorder = ui.PictureRecorder();
final canvas = Canvas(pictureRecorder);
final recordedPicture = pictureRecorder.endRecording();
final img = await recordedPicture.toImage(20, 20);
final data = await img.toByteData(format: ui.ImageByteFormat.png);
return BitmapDescriptor.fromBytes(data!.buffer.asUint8List());
}