SingleChildScrollView(
child: Column(
children: [
Container(
padding: EdgeInsets.all(24),
child: Form(
key: _formSearcOrdershKey,
autovalidateMode: AutovalidateMode.onUserInteraction,
child: TextFormField(
decoration: InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Enter Data',
),
onChanged: (value) => getData(value),
),
),
),
RefreshIndicator(
onRefresh: () => controller.callApi(0),
child: ListView.separated(
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: controller.workOrders.length,
separatorBuilder: (context, position) {
return Divider();
},
itemBuilder: (context, position) {
return ListTile(
isThreeLine: true,
title: Text(
'title',
maxLines: 1,
overflow: TextOverflow.ellipsis,
softWrap: false,
),
onTap: () => {print('tap')},
subtitle: Text(
'text',
maxLines: 1,
overflow: TextOverflow.ellipsis,
softWrap: false,
),
);
},
),
),
],
),
),
I'm stumped why it doesn't work. AlwaysScrollableScrollPhysics is active but it still doesn't work. What am I missing?
CodePudding user response:
try remove SingleChildScrollView.
then change your RefreshIndicator to this.
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Container(
padding: EdgeInsets.all(24),
child: Form(
// key: _formSearcOrdershKey,
autovalidateMode: AutovalidateMode.onUserInteraction,
child: TextFormField(
decoration: const InputDecoration(
border: UnderlineInputBorder(),
labelText: 'Enter Data',
),
onChanged: (value) {},
),
),
),
Expanded(
child: RefreshIndicator(
onRefresh: () => callApi(),
child: ListView.separated(
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: 10,
separatorBuilder: (context, position) {
return Divider();
},
itemBuilder: (context, position) {
return ListTile(
isThreeLine: true,
title: Text(
'title',
maxLines: 1,
overflow: TextOverflow.ellipsis,
softWrap: false,
),
onTap: () => {print('tap')},
subtitle: Text(
'text',
maxLines: 1,
overflow: TextOverflow.ellipsis,
softWrap: false,
),
);
},
),
),
),
],
),
);
}
