I'm trying to call a variable from a state class to another class is that even possible with flutter?
This the var I'm trying to reach:
class PostRec extends StatefulWidget {
PostRec({
Key? key,
}) : super(key: key);
@override
State<PostRec> createState() => _PostRecState();
}
class _PostRecState extends State<PostRec> {
File? image;
and this is what i tried to do
class previewImg extends StatelessWidget {
previewImg({Key? key}) : super(key: key);
File img = _PostRecState.image;
it says that the class is undefined. I also tried to call it using PostRec class and i still get an error.