I have a string that contains an information that was passed from previous classes. But i need to use that variable in the state class.
Class of stateful widget that contains the information (String text):
class CreateLevelScreen extends StatefulWidget {
String text;
CreateLevelScreen({Key key, @required this.text}) : super(key: key);
@override
State<StatefulWidget> createState() => _CreateLevelState();
}
State class of stateful widget to retrieve that information text too.
class _CreateLevelState extends State<CreateLevelScreen> {
//need to pass text in here to use it too.
}