'When using FlutterfireUI, I would like to use a callback that is executed only when a user registers

I am building an app using Flutterfire_UI's SignInScreen and other features.

I would like to generate a user document for each user in the users collection of firestore upon user registration.

I would like to use a callback that is executed only when a user registers, but I don't know how to do it.

I can set up a callback for every sign-in by setting up an AuthStateChangeAction callback, but that means I have to check each time whether it is the first time or not, so if there is a smarter way, please let me know.

Translated with www.DeepL.com/Translator (free version)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source