我是Flutter的新手,我正在为某些概念而苦苦挣扎。
我无法在这样的容器内使用GridView()小部件:
class _ProductsGridState extends State<ProductsGrid> {
@override
Widget build(BuildContext context) {
return Container(
child: GridView.count(
crossAxisCount: 2,
),
);
}
}
调试控制台给我这个错误:
package:flutter / src / painting / basic_types.dart':失败的断言:第225行pos 10:'textDirection!= null':不正确
谢谢! :)
答案 0 :(得分:2)
MaterialApp是应用程序的根级别小部件,它在后台做了很多工作,为您提供了一个基本页面,您可以在其中添加多个小部件,这些小部件可以在屏幕上显示抖动显示。 ,则您的应用无法正常运行。