clearTestRecordButton method

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

clearTestRecordButton builds a button to flush the test record, clear the test name, clear the test record id.

Implementation

Widget clearTestRecordButton(BuildContext context, StateSetter setState) {
  return (IconButton(
    padding: const EdgeInsets.all(0.0),
    icon: const Icon(
      Icons.clean_hands,
      color: Colors.blue,
    ),
    tooltip: "Clear test record",
    onPressed: () {
      confirmedAction(
        context: context,
        title: "Clear test record confirmation",
        message: "Confirm clearing test record",
        onOk: () async {
          testNameFieldController.text = "";
          widget.flutsterTestRecord.clear();
          setState(() {});
        },
      );
    },
  ));
}