我正在开发一个巨大的应用程序,当我在模拟器或真实设备上运行它时,它可以完美地在android上运行,今天它可以正常运行而没有任何错误,我尝试在iOS设备和模拟器上运行它,并且不断收到奇怪的错误,而无法跟踪到错误的位置。
以调试模式在iPhoneXʀ上启动lib / main.dart ... 错误完成:NoSuchMethodError:在null上调用了getter'length'。 接收者:null 尝试致电:长度
Picture of the error [click here]
main.dart文件:
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: home_main(),
routes: {
// When navigating to the "/" route, build the FirstScreen widget.
// When navigating to the "/second" route, build the SecondScreen widget.
'/home_screen': (context) => home_screen(),
'/register': (context) => register(),
'/tyres':(context)=> tyres(),
'/walk_through':(context)=> WalkthroughScreen(),
'/use_my_location':(context)=> UseMyLocation(),
'/home_main': (context) => home_main(),
'/main_screen':(context)=> main_screen(),
'/washing':(context) => maintenance(),
'/profile':(context) => profile(),
'/notifications':(context) => notifications(),
'/cars':(context) => cars(),
'/orders':(context) => orders(),
'/aboutus':(context) => about_us(),
'/testing':(context) => CustomRadio()
},
);
}
}