Introducing A New Social Auth Library For Flutter
I’ve been helping out with the rework of FlutterFire 💙, in particular Firebase Auth and how to integrate social providers such as Facebook and Google. There are several amazing plugins 🔌 built by the community that makes this very easy:
However, you may have faced some issues using the GitHub and Twitter plugins as they‘re no longer maintained and kept up-to-date.
This motivated 💡 me to create flutter_auth, a unified approach to signing in with multiple providers. Currently, it only supports two social providers but is built to be easily expanded for any third-party authenticator that implements OAuth 1 or OAuth 2.
Let me show you the code 🔎
As you can see from the example above, there’s a standard way to create credentials, start the sign-in flow, and to handle errors. I think it’s a cleaner approach using a try {} catch {} and checking the status of the result, and it’s in line with how Firebase handles errors too.
Please check out the docs as well as the example app on GitHub.
I really hope this makes integrating social auth for GitHub and Twitter easier. Please check out the repo, and if you have any feedback, we’d love to hear it❤️