【问题标题】:The passed value for argument is null参数的传递值为 null
【发布时间】:2022-06-11 02:52:58
【问题描述】:

我有来自第一类的两个类,我正在尝试将值传递给第二类。我已经在两个类中定义了所需的构造函数和参数。但问题是,每当我尝试在第二类中检索第一类的值时,该值始终为空。

**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);

【问题讨论】:

  • 您能否提供更多关于_getVin的信息

标签: android flutter dart constructor


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-10
  • 2012-11-18
  • 1970-01-01
  • 2011-12-23
  • 2011-08-31
相关资源
最近更新 更多