@@ -186,118 +186,120 @@ class _HomeState extends State<Home> with WidgetsBindingObserver {
186186 WaveBubble (
187187 playerController: playerController1,
188188 isPlaying: playerController1.playerState == PlayerState .playing,
189- onTap: () => _playOrPlausePlayer (playerController1),
189+ onTap: () => _playOrPausePlayer (playerController1),
190190 ),
191191 ],
192192 if (playerController2.playerState != PlayerState .stopped) ...[
193193 WaveBubble (
194194 playerController: playerController2,
195195 isPlaying: playerController2.playerState == PlayerState .playing,
196- onTap: () => _playOrPlausePlayer (playerController2),
196+ onTap: () => _playOrPausePlayer (playerController2),
197197 isSender: true ,
198198 ),
199199 ],
200200 if (playerController3.playerState != PlayerState .stopped) ...[
201201 WaveBubble (
202202 playerController: playerController3,
203203 isPlaying: playerController3.playerState == PlayerState .playing,
204- onTap: () => _playOrPlausePlayer (playerController3),
204+ onTap: () => _playOrPausePlayer (playerController3),
205205 ),
206206 ],
207207 if (playerController4.playerState != PlayerState .stopped) ...[
208208 WaveBubble (
209209 playerController: playerController4,
210210 isPlaying: playerController4.playerState == PlayerState .playing,
211- onTap: () => _playOrPlausePlayer (playerController4),
211+ onTap: () => _playOrPausePlayer (playerController4),
212212 isSender: true ,
213213 ),
214214 ],
215215 if (playerController5.playerState != PlayerState .stopped) ...[
216216 WaveBubble (
217217 playerController: playerController5,
218218 isPlaying: playerController5.playerState == PlayerState .playing,
219- onTap: () => _playOrPlausePlayer (playerController5),
219+ onTap: () => _playOrPausePlayer (playerController5),
220220 isSender: true ,
221221 ),
222222 ],
223223 if (playerController6.playerState != PlayerState .stopped) ...[
224224 WaveBubble (
225225 playerController: playerController6,
226226 isPlaying: playerController6.playerState == PlayerState .playing,
227- onTap: () => _playOrPlausePlayer (playerController6),
227+ onTap: () => _playOrPausePlayer (playerController6),
228228 isSender: true ,
229229 ),
230230 ],
231231 const Spacer (),
232- Row (
233- children: [
234- AnimatedSwitcher (
235- duration: const Duration (milliseconds: 200 ),
236- child: isRecording
237- ? AudioWaveforms (
238- enableGesture: true ,
239- size: Size (MediaQuery .of (context).size.width / 2 , 50 ),
240- recorderController: recorderController,
241- waveStyle: const WaveStyle (
242- waveColor: Colors .white,
243- extendWaveform: true ,
244- showMiddleLine: false ,
245- ),
246- decoration: BoxDecoration (
247- borderRadius: BorderRadius .circular (12.0 ),
248- color: const Color (0xFF1E1B26 ),
249- ),
250- padding: const EdgeInsets .only (left: 18 ),
251- margin: const EdgeInsets .symmetric (horizontal: 15 ),
252- )
253- : Container (
254- width: MediaQuery .of (context).size.width / 1.7 ,
255- height: 50 ,
256- decoration: BoxDecoration (
257- color: const Color (0xFF1E1B26 ),
258- borderRadius: BorderRadius .circular (12.0 ),
259- ),
260- padding: const EdgeInsets .only (left: 18 ),
261- margin: const EdgeInsets .symmetric (horizontal: 15 ),
262- child: TextField (
263- readOnly: true ,
264- decoration: InputDecoration (
265- hintText: "Type Something..." ,
266- hintStyle: const TextStyle (color: Colors .white54),
267- contentPadding: const EdgeInsets .only (top: 16 ),
268- border: InputBorder .none,
269- suffixIcon: IconButton (
270- onPressed: _pickFile,
271- icon: Icon (Icons .adaptive.share),
272- color: Colors .white54,
232+ SafeArea (
233+ child: Row (
234+ children: [
235+ AnimatedSwitcher (
236+ duration: const Duration (milliseconds: 200 ),
237+ child: isRecording
238+ ? AudioWaveforms (
239+ enableGesture: true ,
240+ size: Size (MediaQuery .of (context).size.width / 2 , 50 ),
241+ recorderController: recorderController,
242+ waveStyle: const WaveStyle (
243+ waveColor: Colors .white,
244+ extendWaveform: true ,
245+ showMiddleLine: false ,
246+ ),
247+ decoration: BoxDecoration (
248+ borderRadius: BorderRadius .circular (12.0 ),
249+ color: const Color (0xFF1E1B26 ),
250+ ),
251+ padding: const EdgeInsets .only (left: 18 ),
252+ margin: const EdgeInsets .symmetric (horizontal: 15 ),
253+ )
254+ : Container (
255+ width: MediaQuery .of (context).size.width / 1.7 ,
256+ height: 50 ,
257+ decoration: BoxDecoration (
258+ color: const Color (0xFF1E1B26 ),
259+ borderRadius: BorderRadius .circular (12.0 ),
260+ ),
261+ padding: const EdgeInsets .only (left: 18 ),
262+ margin: const EdgeInsets .symmetric (horizontal: 15 ),
263+ child: TextField (
264+ readOnly: true ,
265+ decoration: InputDecoration (
266+ hintText: "Type Something..." ,
267+ hintStyle: const TextStyle (color: Colors .white54),
268+ contentPadding: const EdgeInsets .only (top: 16 ),
269+ border: InputBorder .none,
270+ suffixIcon: IconButton (
271+ onPressed: _pickFile,
272+ icon: Icon (Icons .adaptive.share),
273+ color: Colors .white54,
274+ ),
273275 ),
274276 ),
275277 ),
276- ),
277- ),
278- IconButton (
279- onPressed: _refreshWave,
280- icon: Icon (
281- isRecording ? Icons .refresh : Icons .send,
278+ ),
279+ IconButton (
280+ onPressed: _refreshWave,
281+ icon: Icon (
282+ isRecording ? Icons .refresh : Icons .send,
283+ color: Colors .white,
284+ ),
285+ ),
286+ const SizedBox (width: 16 ),
287+ IconButton (
288+ onPressed: _startOrStopRecording,
289+ icon: Icon (isRecording ? Icons .stop : Icons .mic),
282290 color: Colors .white,
291+ iconSize: 28 ,
283292 ),
284- ),
285- const SizedBox (width: 16 ),
286- IconButton (
287- onPressed: _startOrStopRecording,
288- icon: Icon (isRecording ? Icons .stop : Icons .mic),
289- color: Colors .white,
290- iconSize: 28 ,
291- ),
292- ],
293+ ],
294+ ),
293295 ),
294296 ],
295297 ),
296298 ),
297299 );
298300 }
299301
300- void _playOrPlausePlayer (PlayerController controller) async {
302+ void _playOrPausePlayer (PlayerController controller) async {
301303 controller.playerState == PlayerState .playing
302304 ? await controller.pausePlayer ()
303305 : await controller.startPlayer (finishMode: FinishMode .loop);
0 commit comments