Create a Firebase project for the app, according to Add Firebase to your Flutter app .

. Enable the sign-in method, I use Google in my project.

Create Realtime Database

Before coding, something should be prepared

- App ID & API Key: Can be found in google-services.json (for android) and GoogleService-Info.plist(for iOS), or at the Firebase project setting.

- Database URL : Find it in the Database page

Bake to Flutter, install plugins

Codes

Sign in

After sign in we'll get a FirebaseUser, the UID from it is the key I use to save & load local player's score.

Create a Player class

Load local player's score

Submit score

Change player info, this will call the user setting dialog.

Show leaderboard

After testing, we should set Rules for the Firebase database

That’s all, my final app can be downloaded on App Store and Google Play

Any suggestions or questions are welcome.

Best,

Mike