Dan Hostettler
ยท1. Context matters. 2. Details matter. 3. Consistency matters. 4. Energy matters.

(+++solved+++) Custom Action can't be saved >" Failed to process parameters" - Yet again!

Custom Code
Resolved

+++ UPDATE > SOLVED: If interested, read the input from Steven Liu below. +++

Dear all, I am becoming increasingly frustrated with the FF custom code environment.

I'm sure it's me, but after reviewing the code, the set Return Value, and the parameters, I still can't pinpoint what's wrong.

If anybody has a hint, please! Thank you!

This is the code with just the arguments + the return value that can not be saved. At all.

// Automatic FlutterFlow imports
import '/backend/backend.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/flutter_flow/custom_functions.dart';
import 'package:flutter/material.dart';

// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!

import 'package:cloud_firestore/cloud_firestore.dart';

Future<bool> checkAndDeductCredits({
  required DocumentReference userRef,
  required String featureType,
  required bool isValidInput,
}) async {
  return true; // Simple placeholder
}
What have you tried so far?

Everything. Also, I am on a paid plan, which means I have access to VS Studio. So, I saved a very barebones boilerplate code to create the file, without arguments, but with the Return Value set to a boolean. The idea was to pull the code in VS Studio, populate it, and push it back. This sometimes works and circumvents FF's underlying issues we get all of the time, btw.
Unfortunately, this time, the code couldn't even be pushed up.

And this is the bare bone code I could save, arguments in code and in custom action panel both missing:

// Automatic FlutterFlow imports
import '/backend/backend.dart';
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!

import '/flutter_flow/custom_functions.dart';

import 'package:cloud_firestore/cloud_firestore.dart'; // Keep this import as it will be needed later

Future<bool> checkAndDeductCredits() async {
  // This is the absolute barebones placeholder with a Future<bool> return.
  // It has no parameters defined in the function signature here.
  // The goal is solely to get FlutterFlow to save the custom action itself.
  return true;
}
Did you check FlutterFlow's Documentation for this topic?
Yes
2
2 replies