Firebase Auth for Flutter Desktop
The platform implementation of FlutterFire for Linux and Windows.
NOTE: This package overrides the existing implementation of macOS in FlutterFire for development purposes.
First, please make sure you initialize Firebase for Dart by following the guide to install
On the root of your project, run the following command:
dart pub add firebase_auth_desktop
Phone Authentication on Desktop
On Desktop, phone authentication is similar to Web.
signInWithPhoneNumbermethod, this will trigger a reCAPTCHA webview in a seprate window for verification, once completed the user will receive SMS Code.
FirebaseAuth auth = FirebaseAuth.instance; // Wait for the user to complete the reCAPTCHA & for an SMS code to be sent. ConfirmationResult confirmationResult = await auth.signInWithPhoneNumber('+44 7123 123 456');
- Prompt the user to provide the SMS Code, then confirm it.
However, there's currently one limitation, the SMS message that the user receives contain your App Name, on web that's usually your auth domain, but since Firebase doesn't fully support Phone auth on desktop platforms yet, the current implementation will show your app name in the message as 127.0.0.1 which stands for the localhost IP address.
UserCredential userCredential = await confirmationResult.confirm('123456');
Issue and Feedback
Please file any issues, bugs, or feature requests in our issue tracker.