Надеюсь, это сработает для вас:)
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("LIST VIEW:1",style: TextStyle(fontWeight: FontWeight.bold),),
SizedBox(height: 20,),
Expanded(
// flex: 1,
child:Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.black),
color: Colors.green,
),
height: 20,
child: ListView.builder(
itemCount: 20,
itemBuilder: (context, index){
return Card(
child: ListTile(
title: Text("Name"),
subtitle: Text("SubNME"),
),
);
}
),
)
),
SizedBox(height: 20,),
Text("LIST VIEW:2",style: TextStyle(fontWeight: FontWeight.bold)),
SizedBox(height: 20,),
Expanded(
child:Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.black),
color: Colors.red,
),
height: 20,
child: ListView.builder(
itemCount: 20,
itemBuilder: (context, index){
return Card(
child: ListTile(
title: Text("Title"),
subtitle: Text("Subtitle"),
),
);
}
),
)
)
],
),
),
),
);
}
}
![enter image description here](https://i.stack.imgur.com/4ugWK.png)