In other words, we need to add the following item to the dependency list in $(FLUTTER_PROJECT_ROOT)/android/adle file: classpath ':google-services:4.2.0' // change 4.2.0 to the latest version On the Android side, we need to add the google-services Gradle plugin to our project-level Gradle configuration. The last two are, hopefully, self-explanatory.įinally, we need to configure platform-specific project settings that will enable our authentication flow to complete successfully. The first two aren’t related to Firebase but are going to be frequently used in the project. In the dependencies section of the file, paste the following snippet: flutter_bloc: This is done by specifying the Dart packages (libraries) we’ll be using in our project’s pubspec.yaml file. Next, we need to actually set up the Firebase libraries we’re going to use in the project and hook them up with the configuration files. The google-services.json file should be placed in the $(FLUTTER_PROJECT_ROOT)/android/app folder and ist should be placed in the $(FLUTTER_PROJECT_ROOT)/ios/Runner directory. First of all, we need to put the files we downloaded in our project. Now you can close the dashboard as the rest of the set up takes place in our codebase. To do this, choose the Authentication item from the menu and then select the Sign-In method tab. Before closing the dashboard, make sure to enable Firebase and Google authentication providers as we’ll use them for user identification. The platform will produce two configuration files that you need to download: google-services.json for Android and ist for iOS. First of all, make sure you create a new project in the Firebase Dashboard and add Android and iOS applications in the newly generated workspace. Setting up Firebase is the only thing that we have to do independently for each platform. Finally, the article assumes you already have your development environment set up, including the required Android Studio plugins and Flutter SDK. This has been undertaken for article brevity as one of its objectives is for the reader to complete the project in one sitting. PrerequisitesĮven though effort has been made to allow readers to follow and accomplish this project even if it’s their first attempt at mobile development, a lot of core mobile development concepts that aren’t Flutter-specific are mentioned and used without detailed explanation. Full source code reference for the project can be found in this GitHub repo. Note: This article focuses only on certain bits of the implementation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |