Closed Night-Amber3301 closed 11 months ago
I'm sorry that's not what I meant by creating a new widget for the IconButton
. There are multiple syntax errors. Feel free to pick easier issues if you need to ramp up with Flutter syntax
Yeah sure, actually I'm new to open-source and learned a lot from your project, thanks for your time and consideration. Will continue my journey with more beginner-friendly issues.
No worries, your code is pretty close to a working solution. It's just that you need to encapsulate this widget into a new stateful widget which will hold the state variable isPlaying
.
IconButton(
icon: isPlaying ? Icon(Icons.pause) : Icon(Icons.play_arrow),
onPressed: () {
if (isPlaying) {
_pause();
}
else
{
_speak(notesBloc.state.title! + ". " + notesBloc.state.controller!.document.toPlainText());
}
setState(() {
isPlaying = !isPlaying;
});
},
)
I will refactor your code. I have changed the target branch. You can check this issue for a simpler one
Thank you sir.
solves: #60
Updated the file by adding pause button functionality and created read_notes.dart in widgets directory