build method Null safety

  1. @override
dynamic build(
  1. dynamic context
)

Implementation

@override
Widget build(BuildContext context) => ElevatedButton(
      style: ButtonStyle(
        backgroundColor: MaterialStateProperty.all(
            important ? Colors.black : Colors.white),
        shape: MaterialStateProperty.all(
          const RoundedRectangleBorder(
            borderRadius: ROUNDED_BORDER_RADIUS,
          ),
        ),
        minimumSize: MaterialStateProperty.all(
          Size(
            width,
            height,
          ),
        ),
      ),
      child: Text(
        text,
        style: TextStyle(color: important ? Colors.white : Colors.black),
      ),
      onPressed: () => onPressed(),
    );