Flutter ';一揽子计划;颤振/src/widgets/framework.dart';:断言失败:';child==\u child&\x27;:事实并非如此 class Home扩展了无状态小部件{ @凌驾 小部件构建(构建上下文){ 返回新的MediaQuery( 数据:新建MediaQueryData.fromWindow(ui.window), 儿童:新安全区( 儿童:新材料( 子项:新自定义滚动视图( 条子:[ 新型滑片导板( 代表:MyCustomAppBar(扩展高度:200), 对,, ), 新名单( 代表:SliverChildBuilderDelegate( (u,索引)=>ListTile( 标题:正文( “索引:$Index”, textDirection:textDirection.ltr, ), ), ), ), ], ), ), ), ); } }
我正在创建一个自定义滚动视图,但我有错误,我无法理解它是从哪里生成的 我正在使用SliverPersistentHeaderDelegate类创建自定义appBarFlutter ';一揽子计划;颤振/src/widgets/framework.dart';:断言失败:';child==\u child&\x27;:事实并非如此 class Home扩展了无状态小部件{ @凌驾 小部件构建(构建上下文){ 返回新的MediaQuery( 数据:新建MediaQueryData.fromWindow(ui.window), 儿童:新安全区( 儿童:新材料( 子项:新自定义滚动视图( 条子:[ 新型滑片导板( 代表:MyCustomAppBar(扩展高度:200), 对,, ), 新名单( 代表:SliverChildBuilderDelegate( (u,索引)=>ListTile( 标题:正文( “索引:$Index”, textDirection:textDirection.ltr, ), ), ), ), ], ), ), ), ); } },flutter,flutter-layout,flutter-sliver,Flutter,Flutter Layout,Flutter Sliver,我正在创建一个自定义滚动视图,但我有错误,我无法理解它是从哪里生成的 我正在使用SliverPersistentHeaderDelegate类创建自定义appBar class Home extends StatelessWidget{ @override Widget build(BuildContext context){ return new MediaQuery( data: new MediaQueryData.fromWindow(ui.window),
class Home extends StatelessWidget{
@override
Widget build(BuildContext context){
return new MediaQuery(
data: new MediaQueryData.fromWindow(ui.window),
child: new SafeArea(
child: new Material(
child: new CustomScrollView(
slivers: <Widget>[
new SliverPersistentHeader(
delegate: MyCustomAppBar(expandedHeight: 200),
pinned: true,
),
new SliverList(
delegate: SliverChildBuilderDelegate(
(_,index) => ListTile(
title: Text(
"Index: $index",
textDirection: TextDirection.ltr,
),
),
),
),
],
),
),
),
);
}
}