if (subStatuses.isEmpty) {
// No second tab bar needed if subStatuses is empty
return RefreshIndicator(
child: ListView.builder(
physics: const BouncingScrollPhysics(),
shrinkWrap: true,
itemCount: applicants.length,
itemBuilder: (context, index) {
final applicant = applicants[index];
return listViewItem_new(
context,
applicant,
true,
statuses,
profilemodel.id != null
? profilemodel.id!.toInt()
: 467,
index,
);
},
),
);
}
Here I’m trying to use RefreshIndicator but getting error that ""’RefreshIndicator’ isn’t a function.
Try correcting the name to match an existing function, or define a method or function named ‘RefreshIndicator’.""
According to me there is no other issue but I don’t know why this is happening…
2
Answers
Try adding the on Refresh Method
Seems like the problem is that you imported
package:flutter/material.dart
andpackage:pull_to_refresh/pull_to_refresh.dart
, which both export aRefreshIndicator
class. If you’re going to useRefreshIndicator
from the Flutter framework, you need to hideRefreshIndicator
from thepull_to_refresh
import like this:Or if you’re not using that package, just remove the import.