[ad_1]
I have two classes from the first class, I am trying to pass value to the second class. I have defined the required constructor and argument in both of the classes. But the problem is that whenever I try to retrieve the value of first class in the second class, the value is always null.
**First Class**
suffixIcon: IconButton(
icon: Icon(Icons.send),
onPressed: () {
setState(() => _getVin.text);
LandingPage(VinNumber:_getVin.text);
}
)
**second class**
class LandingPage extends StatefulWidget {
String? VinNumber; //This value is null
LandingPage({Key? key, this.VinNumber}) : super(key: key);
@override
_LandingPageState createState() => _LandingPageState(VinNumber);
}
class _LandingPageState extends State<LandingPage> {
String? VinNumber;
_LandingPageState(this.VinNumber);
[ad_2]