I declare a class variable for a StatefulWidget - in the code below it's someString.
Is it possible to use this variable in the build(…)-method without declaring it as static?
class MyClass extends StatefulWidget {
String someString;
MyClass() {
this.someString = "foo";
}
@override
_MyClassState createState() => _MyClassState();
}
class _MyClassState extends State<MyClass> {
_MyClassState();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("someString - how to access it here?!"),
// title: Text(someString), is not possible, obviously
),
);
}
}
Thanks in advance for help!

Text(widget.someString);