Yup. Another library package. This time its for Authentication. Again, for the fledgling Flutter community, I would like to offer code for anyone to take and make your own. As I’ve done in past articles, the library package will utilize a plugin found in the Pub website. This article will start with the example code found in the Pub website originally demonstrating the use of the plugin, but now to demonstrate the use of the library package. Followed by the traditional ‘walkthrough’ the library package in nice ‘easy to read’ screenshots.

Of course, there will be the GitHub links so you can copy and paste snippets of code if you like. However, it is hoped you instead download the code, modify it as software can always be improved upon, and then contribute it back to community. Sound good?

Let’s begin.

Article Hyperlinks: ( So you can come back if TL;DR)

Unlike my previous class libraries, this one works with not one but two plugins: firebase_auth and google_sign_in. The demo example used for this article is the example found under the google_sign_in plugin. However, the example here implements this class library instead, and can be copied from this gist if you like, Auth Class Library Demo Example.

There’s a supplementary version available to those still using Android 27 and earlier. It continues to use the now deprecated support library files:

Before you do anything

Before you do anything, you gotta set up Firebase. I’m not going to instruct you on how to do this step-by-step. It’s beyond the scope here; you can do that on your own.

I will, however, throw up some screen shots giving you hints on what you need to do and what you’ll likely see on your screen if you try to get ahead of yourself and run this class library.

No Gists About It!

Note, most of the screenshots will have a corresponding gist entry in their captions for easy copy and paste. I personally find gists hard on the eyes, and I don’t like using them in my articles. However, if you must look at those ugly things. You’ve got that option. My mantra of sorts:

‘love options, gotta have options, gotta be options, serenity now…’

As it is, I’m Android

Further, I’m Android, not iOS, and so this next section applies more so to Android developers. I apologize to you iOS folk. Please, for you, how about we have you skip this part and go to the rest of the article?

Now, as for the rest of you, maybe open up this website, Add Firebase to Your Android Project, as a supplement to help you set up Firebase as I’m going to describe this stuff in brief. Under the directory, android, add the following two dependencies to the build.gradle file.