If you don't mind using two list. Try it using centerKey
with CustomScrollView
. The first list for new item and the second list for you initial item. When you adding new item to the start, just add item to the first list and the viewport will not jump.
@override
Widget build(BuildContext context) {
const Key centerKey = ValueKey('second-sliver-list');
return Scaffold(
body: CustomScrollView(
center: centerKey,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) {
final item = newList[index];
return ListTile(
title: Text('${item.id} ${item.name}'),
);
},
childCount: newList.length,
),
),
SliverList(
key: centerKey,
delegate: SliverChildBuilderDelegate(
(context, index) {
final item = myList[index];
return ListTile(
title: Text('${item.id} ${item.name}'),
);
},
childCount: myList.length,
),
),
],
),
);
}