我在其中一个屏幕中有以下代码。我需要在ListView小部件上方添加一行文本。我试过在装有ListView的容器的上方和下方添加一个Column小部件,但似乎无法正确处理。
谁能告诉我我该怎么做?
干杯,
保罗
@override
Widget build(BuildContext context) {
return WillPopScope(
child: Scaffold(
appBar: rmoAppBar(subText: 'My Jobs'),
drawer: RmoMenu(),
body: isLoading
? Center(child: CircularProgressIndicator())
: Container(
child: ListView.builder(
itemCount: jobs.sjRows.length,
itemBuilder: (BuildContext context, int index) {
return jobCard(jobs.sjRows, index);
},
),
),
),
onWillPop: () => logoutAlert(context: context),
);
}
@override
Widget build(BuildContext context) {
return WillPopScope(
child: Scaffold(
appBar: rmoAppBar(subText: 'My Jobs'),
drawer: RmoMenu(),
body: isLoading
? Center(child: CircularProgressIndicator())
: Column(
children: [
Text('Your text goes here'),
Expanded(
child: ListView.builder(
itemCount: jobs.sjRows.length,
itemBuilder: (BuildContext context, int index) {
return jobCard(jobs.sjRows, index);
},
),
)
],
),
),
onWillPop: () => logoutAlert(context: context),
);
}