OR between values inside a filter group, AND between each filter group

I’m trying to create some filtering functionality inside my Flutter app. Within the flutter-algolia-helper package, I don’t have the ability to directly write query strings. Instead I’ll have to use the FilterGroupID.and and FilterGroupID.or classes - but I’m not sure exactly how I will do that. The query string will have to look something like this:

(interest:Sports OR interest:Technology OR interest:Health) AND (ageGroup:"Gen Z" OR ageGroup:"Millenial") AND (appSignUpComplete: true)

Where I have OR inside each filter group of the same field between each value, and AND outside each filter group

As far as I understand, the flutter client builds the query string for you under the hood. This is what I have so far, but I’m not sure this is even correct:

FilterState filterState = FilterState()
        ..add(FilterGroupID.or("Interests"), [
          Filter.facet("interest", "Sports"),
          Filter.facet("interest", "Technology"),
          Filter.facet("interest", "Health"),
        // is AND inserted between each FilterGroupID?  
        ..add(FilterGroupID.or('ageGroup'), [
            Filter.facet("ageGroup", "Gen Z"),
            Filter.facet("ageGroup","Millenials" ) 
        // is AND inserted between each FilterGroupID?  
       ..add(FilterGroupID.and('appSignUpComplete'), [
           Filter.facet("appSignUpComplete", true)

Does FilterGroupID.or only apply the OR inside it’s own group of filters? What about in between each filter group?

How could something like this work using the Flutter client?

After some testing and playing around with the library, I’ve found that yes, the library does seem to add an AND clause in between each filter group. The above code snippet is correct for my use case

In Flutter with the Algolia Helper package, FilterGroupID.or applies the OR logic within its group, and FilterGroupID.and applies AND between different groups. Your current setup is correct; the AND logic is implicit between different FilterGroupID groups when you add them to the FilterState.