I have a ListView.builder() that I don't want its items to re-render, I tried this solution Solution but nothing happened, It kept re-rendering so, I don't know what is the problem.
Code
StreamBuilder<Object>(
stream: Firestore.instance
.collection('Khatma Collection')
.document('Khatma 1')
.collection('Videos')
.snapshots(),
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
return ListView.builder(
shrinkWrap: true,
itemCount: snapshot.data.documents.length,
itemBuilder: (context, i) {
var rng = new Random();
int ii = rng.nextInt(4);
if (ii == iii) {
} else {
iii = ii;
var link = snapshot.data.documents[ii].data['Link'];
var uploader = snapshot.data.documents[ii].data['Uploader'];
final videoPlayerController =
VideoPlayerController.network(link);
chewieController = ChewieController(
allowMuting: true,
autoInitialize: true,
deviceOrientationsAfterFullScreen: orientation,
allowFullScreen: true,
aspectRatio: 16 / 9,
videoPlayerController: videoPlayerController,
);
return SingleChildScrollView(
child: Column(
children: [
Chewie(
controller: chewieController,
),
),
],
),
);
}
},
);