错误是什么?我该如何解决?
what is the error ? and how can i solve it?
我正在学习颤振。我已经制作了一个应用程序名称聊天 x(标题)。代码如下
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Chat X'),
),
body: Card(child: Column(children: <Widget>[
Text('hey! this one is new');
],),),
),
);
}
}
每当我想调试此代码时,我都会收到此错误
Expected to find ']'.
你不应该有;在文本小部件之后。像这样:
Text('hey! this one is new')
从 Text('hey! this one is new');
中删除 ;
或者如果您想在 Column
中放置更多小部件,则可以放置 ,
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Chat X'),
),
body: Card(child: Column(children: <Widget>[
Text('hey! this one is new'),
Text('hey! this one is second new'),
],),),
),
);
}
}
我正在学习颤振。我已经制作了一个应用程序名称聊天 x(标题)。代码如下
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Chat X'),
),
body: Card(child: Column(children: <Widget>[
Text('hey! this one is new');
],),),
),
);
}
}
每当我想调试此代码时,我都会收到此错误
Expected to find ']'.
你不应该有;在文本小部件之后。像这样:
Text('hey! this one is new')
从 Text('hey! this one is new');
中删除 ;
或者如果您想在 Column
,
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Chat X'),
),
body: Card(child: Column(children: <Widget>[
Text('hey! this one is new'),
Text('hey! this one is second new'),
],),),
),
);
}
}