skip to Main Content
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


  1. Try adding the on Refresh Method

    return RefreshIndicator(
      onRefresh: () {
        //write the call to method you want to run on refreshing
      },
      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,
          );
        },
      ),
    );
    
    Login or Signup to reply.
  2. Seems like the problem is that you imported package:flutter/material.dart and package:pull_to_refresh/pull_to_refresh.dart, which both export a RefreshIndicator class. If you’re going to use RefreshIndicator from the Flutter framework, you need to hide RefreshIndicator from the pull_to_refresh import like this:

    import 'package:pull_to_refresh/pull_to_refresh.dart' hide RefreshIndicator;
    

    Or if you’re not using that package, just remove the import.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search