child method

Widget child(
  1. dynamic value
)

Implementation

Widget child(value) {
  if (value.runtimeType == IconData) {
    return IconButton(
      onPressed: _onPressed,
      icon: Icon(value),
    );
  }
  return TextButton(
    onPressed: _onPressed,
    child: Text(value.toString()),
  );
}