takeScreenShotButton method

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

takeScreenShotButton builds a button to take a screenshot of the child widget.

Implementation

Widget takeScreenShotButton(BuildContext context, StateSetter setState,
    void Function(VoidCallback fn) updateParent) {
  return (IconButton(
    padding: const EdgeInsets.all(0.0),
    icon: Icon(
      Icons.camera,
      color:
          (!widget.flutsterTestRecord.recording) ? Colors.grey : Colors.blue,
    ),
    tooltip: "Take screenshot (also double-tap floating button)",
    onPressed: !widget.flutsterTestRecord.recording
        ? () {
            snack("Start recording to take screenshot", context);
          }
        : () async {
            await takeScreenShot(updateParent);
            setState(() {});
          },
  ));
}