Custom function block Flutterflow UI

Widgets & Design

Hi, i created a cloud function with FlutterFlow, well deployed and all

Here is my code :

const functions = require('firebase-functions');
const admin     = require('firebase-admin');


exports.isNicknameAvailable = functions.https.onCall(async (data, context) => {
  const nickname = (data?.nickname || '').trim();
  if (!nickname) {
    throw new functions.https.HttpsError('invalid-argument','Nickname vide');
  }
  const snap = await admin.firestore()
                 .collection('users')
                 .where('display_name','==',nickname)
                 .limit(1)
                 .get();
  return { available: snap.empty };   // OBJET, pas bool pur
});

EDIT : tested and OK

When i use it in my UI, it works and i even get a response :

{"result":{"available":true}}

However, my UI will be blocked. I tried without : it's OK. But with the function ? IT BLOCKS

So i think the problem comes from FlutterFlow.

Here is the UI : I hide it lol, but the most important is the button.

It's stuck when i click on "suivant" and it starts the Cloud function. Even with an alert dialog before, it works but it stops when it starts the function

Did anyone managed this without having to be a tinker ?

Should i stop noCode ?

What have you tried so far?
  • asking chatGPT lol

  • debug

  • google cloud logs

  • alert dialogs everywhere

  • correcting the function

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