part of web;

class BuildSearchAll extends StatefulWidget {
  final void Function()? onTap;
  const BuildSearchAll({
    Key? key,
    this.onTap
  }) : super(key: key);

  @override
  State<BuildSearchAll> createState() => _BuildSearchAllState();
}

class _BuildSearchAllState extends State<BuildSearchAll> {
  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemBuilder: (BuildContext context, int index){
        return GestureDetector(
          onTap: (){
            if(widget.onTap !=null){
              widget.onTap!();
            }
          },
          child: Container(
            color: Colors.red,
            height: 110,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text('章节名称$index'),
                Text('章节内容$index'),
              ],
            ),
          ),
        );
      },
      itemCount: 3,
    );
  }
}
