@@ -46,23 +46,12 @@ class _AudioPageState extends State<AudioPage> {
4646 chat = widget.model.startChat ();
4747 }
4848
49- void _scrollDown () {
50- WidgetsBinding .instance.addPostFrameCallback (
51- (_) => _scrollController.animateTo (
52- _scrollController.position.maxScrollExtent,
53- duration: const Duration (
54- milliseconds: 750 ,
55- ),
56- curve: Curves .easeOutCirc,
57- ),
58- );
59- }
60-
6149 Future <void > recordAudio () async {
6250 if (await record.hasPermission ()) {
6351 final dir = Directory (
6452 '${(await getApplicationDocumentsDirectory ()).path }/libs/recordings' );
6553
54+ // ignore: avoid_slow_async_io
6655 if (! await dir.exists ()) {
6756 await dir.create (recursive: true );
6857 }
@@ -108,7 +97,7 @@ class _AudioPageState extends State<AudioPage> {
10897 try {
10998
11099 String textPrompt = 'What is in the audio recording?' ;
111- final prompt = TextPart (" What is in the audio recording?" );
100+ final prompt = TextPart (' What is in the audio recording?' );
112101 setState (() {
113102 _messages.add (MessageData (text: textPrompt, fromUser: true ));
114103 });
@@ -182,7 +171,7 @@ class _AudioPageState extends State<AudioPage> {
182171 const SizedBox .square (
183172 dimension: 15 ,
184173 ),
185- const Text ('Tap the mic to record, tap again to submit' )
174+ const Text ('Tap the mic to record, tap again to submit' ),
186175 ],
187176 ),
188177 ),
0 commit comments