I tried to rebuild the code of this video (https://www.youtube.com/watch?v=d5PpeNb-dOY)
, which is about how to copy a String
value to another StatefulWidget
, but now I get the BodyConstructionState(value)
red underlined and it says "Too many positional arguments: 0 expected, but 1 found." Value
comes from another widget. I don“t know why because I did it in the same way like the guy in the video did it. Can anybody tell me what my mistake is? Thanks in advance!
class BodyConstruction extends StatefulWidget {
String value;
BodyConstruction({Key key, @required this.value}) : super(key : key);
@override
_BodyConstructionState createState() => _BodyConstructionState(value);
}
class _BodyConstructionState extends State<BodyConstruction> {
String value;
_BodyConstructionState({this.value});