shareTestRecordButton method

Widget shareTestRecordButton(
  1. BuildContext context,
  2. StateSetter setState
)

shareTestRecordButton builds a button to share the test record.

Implementation

Widget shareTestRecordButton(BuildContext context, StateSetter setState) {
  return (IconButton(
    padding: const EdgeInsets.all(0.0),
    icon: Icon(
      Icons.share,
      color:
          widget.flutsterTestRecord.isCleared() ? Colors.grey : Colors.blue,
    ),
    tooltip: "Share this test record",
    onPressed: widget.flutsterTestRecord.isCleared()
        ? null
        : () {
            if (!widget.flutsterTestRecord.containsScreenShot()) {
              confirmedAction(
                context: context,
                title: "Share without screenshot confirmation",
                message: "Share test record without a screenshot?",
                onOk: () {
                  share();
                },
              );
            } else {
              share();
            }
          },
  ));
}