Getting Trouble with a custom action to clear an AppState Variable(list)

Custom Code

I think it has already been posted before but a solution wasn't provided, so I believe this discussion is still crucial. Is there a native way in FlutterFlow to clear items from a list that has been declared in the AppState of the application? Is there?

I have this list:

When I'm running my app on test mode, I have this widget that I mounted the list "lances" in:

it's a simple listview.


Alright, so, I have that icon button, next to the text "Resetar lances" over there at the top of this image. On this icon, I need to call an action to clear/remove all items from the list "lances". It's simple, isn't it? BUT! It's not happening.

I don't know why FlutterFlow hasn't created a native action to do this yet. It's so archaic to have to write a code in a tool considered LOW CODE.

Sometimes nothing happens. Sometimes the app gets crashed out, so, in the end, my problem still continues. Can anyone help us to solve this simple, although, for one reason, FlutterFlow team doesn't care about this, problem?

What have you tried so far?

I've already tryed this custom action:

// Automatic FlutterFlow imports
import '/backend/schema/structs/index.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!

void clearItemsFromListLances() {
  // Reseta a variável Lances do AppState
  FFAppState().lances = [];

  // Retorna o novo valor da variável 'Lances'
  return;
}
// Set your action name, define your arguments and return parameter,
// and then add the boilerplate code using the green button on the right!

And this:

// Automatic FlutterFlow imports
import '/backend/schema/structs/index.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!

clearItemsFromListLances() {
  // Reseta a variável Lances do AppState
  FFAppState().lances = [];

  // Retorna o novo valor da variável 'Lances'
  return FFAppState().lances;
}
// Set your action name, define your arguments and return parameter,
// and then add the boilerplate code using the green button on the right!

The Return Type is configured like this:

I've used AI to help me but nothing could be able to solve this issue. I'm almost appealing to some kind of god or demon to help me. 😅

Did you check FlutterFlow's Documentation for this topic?
No