i used google_generative_ai package and did it like this:
This site really helped me
final content = [ Content.text(prompt), Content.data("audio/aac", await File(_recordedFilePath!).readAsBytes()), ];