stopRecordingButton method

Widget stopRecordingButton(
  1. BuildContext context,
  2. StateSetter setState,
  3. void updateParent(
    1. VoidCallback fn
    )
)

stopRecordingButton builds a button to stop the recording.

Implementation

Widget stopRecordingButton(BuildContext context, StateSetter setState,
    void Function(VoidCallback fn) updateParent) {
  return (IconButton(
    padding: const EdgeInsets.all(0.0),
    // icon:const Icon(Icons.fiber_manual_record),
    icon: const Icon(
      Icons.circle,
    ),
    color: Colors.red,
    onPressed: () {
      if (!widget.flutsterTestRecord.recording) {
        return;
      }
      updateParent(() {
        widget.flutsterTestRecord.recording = false;
      });
      setState(() {});
      snack(const Text("Recording stopped"), context);
    },
    tooltip: "Stop recording",
  ));
}