运行应用程序时显示问题验证码:https://codeshare.io/eV6dyl在类登录前添加摘要
q43xntqr1#
试试这个:
class Login extends StatefulWidget { const Login({super.key}); @override State<Login> createState() => _LoginState(); } class _LoginState extends State<Login> { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Login"), ), body: Container(child: Text("Login")), ); } } // Page Main.dart void main(){ runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context){ return const MaterialApp( debugShowCheckedModeBanner: false, home: Login(), routes: { }, ); } }
你犯了个错误
_LoginState creatState() => _LoginState();
它应该是:
@override State<Login> createState() => _LoginState();
1条答案
按热度按时间q43xntqr1#
试试这个:
你犯了个错误
它应该是: