Home > OS >  How to put a Listview under the existing one Listview. Flutter/Dart
How to put a Listview under the existing one Listview. Flutter/Dart

Time:10-27

hello there i want to add another one listview on the same screen, how can i do that?

hello there i want to add another one listview on the same screen, how can i do that?

enter image description here

here is my code:

return Scaffold(
        appBar: AppBar(title: Text('detailsPage'),
        ),
        body: ListView(
          children: [
            Card(
                child: ListTile(
                  title:new Center(child:new Text(utf8.decode(appController.userName.runes.toList())   " "   utf8.decode(appController.userSurname.runes.toList()))),
                  subtitle:new Center(child:new Text('UserID: ' appController.userid.toString())),
                )
            ),
            Card(
              child: ListTile(
                title:new Center(child:new  Text(months[index])),
                subtitle:new Center(child:new Text("This month you have done " appController.Totaleachlength[index].toString() ' charges')),
              ),
            ),
            Card(
                child: ListTile(
                  title:new Center(child:new  Text(appController.Totaleachlist[index].toStringAsFixed(3) "€")),
                  subtitle:new Center(child:new Text("Total amount")),

                )
            ),
            ElevatedButton(child: Text('Download Bill pdf'),
                onPressed: ()  => ''),
            ListTile(
              title: new Center(child: new Text('Details of your charges'),),
            ),
          ],
          shrinkWrap: true,
        ),
      );

CodePudding user response:

if you want to divide your screen, you can use Column

return Scaffold(
  appBar: AppBar(title: Text('detailsPage'),),
  body : Column(
  children: [
   Expanded(flex: 2 // you can customize as you need
     child: ListView()
   ),
   Expanded(flex: 3 // you can customize as you need
     child: ListView()
   ),
])

CodePudding user response:

Column:(
    children: [
        ListView1(),
        ListView2(),
    ]
),

If each list didnt scroll, wrap your each one with Exapmle

  • Related