I am passing an String
from another StatefulWidget
to the below CardItem StatefulWidget
and then from here the String
is passed to the _CardItemState
as shown in the code below.
But how this String
passed should be accessed from _CardItemState(String itemTitle);
class CardItem extends StatefulWidget {
String itemTitle;
CardItem({@required this.itemTitle});
@override
_CardItemState createState() => _CardItemState(itemTitle);
}
class _CardItemState extends State<CardItem> {
_CardItemState(String itemTitle);
void initState(){
print("INiatialize");
print("itemTitle is " + );
}
}