1

ListTile is the only thing what can be in body here. idk why. I cant create anythin, even Text, in body now. Here is my code, it seems that I don't know correct structure of a project. That's how app should look like: https://vk.com/im?peers=420186915_-51497091_c21_-104755778_401520442_186961199_c1_188402691_596510656_312494247_493063710_171187154_161887710_c4_160881882_c2_-157369801&sel=221808173&z=photo478522815_457252372%2Fmail269045

I've made ListVies with Cards but cant add search area aabove

      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: ListView.builder(
              physics: BouncingScrollPhysics(),
              itemCount: events.length,
              itemBuilder: (_, index) => Card(
                    elevation: 10,
                    shadowColor: Colors.white,
                    margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
                    shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
                    child: ListTile(
                      title: Text(
                        events[index].name,
                        style: TextStyle(
                          fontSize: 13,
                        ),
                      ),
                      subtitle: Text(
                        "${events[index].spot} ${events[index].price}",
                        style: TextStyle(
                          fontSize: 20.0,
                        ),
                      ),
                      //isThreeLine: true,
                      leading: SvgPicture.asset("assets/images/car_icon.svg"),
                      onTap: () => print("${events[index].name} - tap"),
                    ),
    
                  )
          ),
        );
      }

Twis Ted
  • 11
  • 2

2 Answers2

0
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: ListView.builder(
        itemCount: 5,
           itemBuilder: (_,i){
             return Column(
             children: [
               Text("Ici Text or TextField $i"),
               ListTile(title: Text("Ici ListTile $i",)
               
             )],
             );
           },
      
      )
    );

}enter image description here

  • it should look like this: https://vk.com/im?peers=420186915_-51497091_c21_-104755778_401520442_186961199_c1_188402691_596510656_312494247_493063710_171187154_161887710_c4_160881882_c2_-157369801&sel=221808173&z=photo478522815_457252372%2Fmail269045 – Twis Ted May 24 '21 at 17:21
-1

You can wrap your listview with a column, something like this:

Container{
  Column{
    ......