Commit 1de82c6c5e00258927808f6be120c9aaabcd04d3
1 parent
fc048c78
feat:绘本跟读录音播放组件用回gif(lottie有点问题,需要改成纯json方式播放)
Showing
1 changed file
with
26 additions
and
9 deletions
lib/pages/reading/reading_page.dart
| ... | ... | @@ -203,15 +203,32 @@ class _ReadingPage extends StatelessWidget { |
| 203 | 203 | SizedBox( |
| 204 | 204 | width: 10.w, |
| 205 | 205 | ), |
| 206 | - RecorderPlaybackWidget( | |
| 207 | - isClickable: !bloc.isRecording && bloc.currentPageData()?.recordUrl != null, | |
| 208 | - isPlaying: bloc.isRecordAudioPlaying, | |
| 209 | - width: 42.w, | |
| 210 | - height: 42.w, | |
| 211 | - onTap: () { | |
| 212 | - bloc.add(PlayRecordAudioEvent()); | |
| 213 | - }, | |
| 214 | - ) | |
| 206 | + GestureDetector( | |
| 207 | + onTap: () { | |
| 208 | + if (bloc.isRecording) { | |
| 209 | + return; | |
| 210 | + } | |
| 211 | + bloc.add(PlayRecordAudioEvent()); | |
| 212 | + }, | |
| 213 | + child: Visibility( | |
| 214 | + visible: bloc.currentPageData()?.recordUrl != null, | |
| 215 | + child: Image.asset( | |
| 216 | + bloc.isRecordAudioPlaying | |
| 217 | + ? 'record_pause'.assetWebp | |
| 218 | + : 'record_play'.assetWebp, | |
| 219 | + height: 33.h, | |
| 220 | + width: 33.w, | |
| 221 | + ), | |
| 222 | + )), | |
| 223 | + // RecorderPlaybackWidget( | |
| 224 | + // isClickable: !bloc.isRecording && bloc.currentPageData()?.recordUrl != null, | |
| 225 | + // isPlaying: bloc.isRecordAudioPlaying, | |
| 226 | + // width: 42.w, | |
| 227 | + // height: 42.w, | |
| 228 | + // onTap: () { | |
| 229 | + // bloc.add(PlayRecordAudioEvent()); | |
| 230 | + // }, | |
| 231 | + // ) | |
| 215 | 232 | ], |
| 216 | 233 | ), |
| 217 | 234 | ), | ... | ... |