how can this code be null safty?
this is the code
class FoodTitleWidget extends StatelessWidget {
String productName;
String productPrice;
String productHost;
FoodTitleWidget({
Key key,
@required this.productName,
@required this.productPrice,
@required this.productHost,
}) : super(key: key);
>Solution :
Just remove @ annotation it’s deprecated, and pass the key directly to the parent class constructor.
FoodTitleWidget({
super.key,
required this.productName,
required this.productPrice,
required this.productHost,
});