Custom Action doesn't save, I cant change It's name or content.

Custom Code

Im using a custom action, it doesn't let me save.

Suddendly it saves some code I introduced.

I try to change the custom action name but now it don't seem to work.

I can't even change the name.

I feel that somehow that code passed the analysis of flutterflow but now it cant be modified. Even its name.

This is the custom action code and it works as expected, but now it can't be changed.

// 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 'package:cloud_firestore/cloud_firestore.dart';

Future<List<DocumentReference>> newCustomAction(
    List<String>? documentPaths) async {
  // Convert a list of firebase documents path strings to a list of document references
  if (documentPaths == null) {
    return [];
  }
  List<DocumentReference> documentReferences = [];
  for (String path in documentPaths) {
    // Trim any whitespace
    String trimmedPath = path.trim();

    // Extract the documentID from the path
    // Assuming the format is '/collection/documentID', we get the last part
    String documentID = trimmedPath.split('/').last;

    // Create a DocumentReference using the documentID
    DocumentReference documentReference =
        FirebaseFirestore.instance.collection('sellers').doc(documentID);
    documentReferences.add(documentReference);
  }
  return documentReferences;
}

Action Settings:

This is the actual error from the console:

FlutterFlow Code Editor: [Error - 12:14:06 PM] Request textDocument/documentColor failed.

monaco-code-editor-dart.bundle.js:2 FlutterFlow Code Editor: Message: File is not being analyzed

Code: -32007

/tmp/ff_service_scratch/s-m-b-harbor-690ccq/lib/custom_code/actions/from_string_to_ref_sellers.dart

monaco-code-editor-dart.bundle.js:2 Error from language server: 1 Request textDocument/documentColor failed.

monaco-code-editor-dart.bundle.js:2 [main 2024-06-07T16:14:06.691Z] [monaco] provider FAILED

error @ monaco-code-editor-dart.bundle.js:2

monaco-code-editor-dart.bundle.js:2 [main 2024-06-07T16:14:06.692Z] Error: File is not being analyzed

What have you tried so far?

I've tryed a lot of code snnipets. I might be missing something. And I could be wrong but I just don't understand how i could save it before and now I cant. And Its working as expected.

Did you check FlutterFlow's Documentation for this topic?
Yes
1
1 reply