79700629

Date: 2025-07-14 08:58:29
Score: 0.5
Natty:
Report link

Solved

I have followed this topic https://medium.com/@dnkibere/passing-a-function-as-an-argument-flutter-e011ad2afd86 and it works now:

 body: Column(
        children: [
          RecipeTypeButtons(
            filterResult: (String mealTypeFilter) {
              _updateFilterText(mealTypeFilter);
            },
          ),
        ],
      ),


And in the external class:

class RecipeTypeButtons extends StatelessWidget {
  final Function(String val) filterResult;

  const RecipeTypeButtons({super.key, required this.filterResult});
Reasons:
  • Blacklisted phrase (0.5): medium.com
  • Probably link only (1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • High reputation (-1):
Posted by: hous