Files
supabase/examples/realtime/flutter-multiplayer-shooting-game
Stojan DimitrovskiandChris Chinchilla 93ba2a312c docs: indicate publishable key instead of anon in many examples (#37411)
* docs: indicate publishable key instead of anon in many examples

* replace your-anon-key to string indicating publishable or anon

* fix your_...

* apply suggestion from @ChrisChinchilla

Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>

* Update keys in code examples

* Prettier fix

* Update apps/docs/content/guides/functions/schedule-functions.mdx

---------

Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
2025-08-18 13:47:48 +02:00
..
2023-02-14 16:56:09 +09:00
2023-02-14 16:56:09 +09:00

Flutter Real-time Multiplayer Shooting Game

A real-time shooting game built with Flutter, Flame and Supabase.

You can find a step by step guide on how to build this app on How to build a real-time multiplayer game with Flutter Flame article.

Getting Started

1. Create new project

Sign up to Supabase - app.supabase.io and create a new project. Wait for your database to start.

2. Get the URL and Key

Go to the Project Settings (the cog icon), open the API tab, and find your API URL and anon key, you'll need these in the next step.

The anon key is your client-side API key. It allows "anonymous access" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token.

Supabase Anon Key

3. Pull this example git repository

git clone <<this repository url>>

4. Paste the Supabase URL and Anon Key

Copy and paste the Supabase URL and Anon key in lib/main.dart file

void main() async {
  await Supabase.initialize(
    url: 'supabaseUrl',
    anonKey: 'supabasePublishableKey',
    realtimeClientOptions: const RealtimeClientOptions(eventsPerSecond: 40),
  );
  runApp(const MyApp());
}

5. Run the Flutter App

Now run

flutter run

This app can run on any environment that runs Flutter.