fix(studio): use publishableKey in the Flutter connect snippet (#51792)

## Problem

The Flutter snippet in the dashboard Connect sheet calls
`Supabase.initialize` with `anonKey`. The current stable
`supabase_flutter` (2.18.3) deprecates `anonKey` in favor of
`publishableKey`, so the copied code shows a deprecation warning right
away.

## Solution

Pass the key as `publishableKey` and change the fallback placeholder to
`your-publishable-key`. The old placeholder told users to prefer the
publishable key over the anon key, which no longer makes sense once the
parameter itself is named `publishableKey`.

## Review instructions

1. Open a project in the dashboard and click Connect.
2. Choose Framework, then Flutter.
3. Check that `lib/main.dart` calls `Supabase.initialize(url: ...,
publishableKey: ...)`.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
This commit is contained in:
Lukas Klingsbo authored and GitHub committed 2026-10-15 14:23:59 +00:00
1 parent 97bd456842
commit dfd1f58838
1 file changed
+1 -1
@@ -14,7 +14,7 @@ import 'package:supabase_flutter/supabase_flutter.dart';
Future<void> main() async {
await Supabase.initialize(
url: '${projectKeys.apiUrl ?? 'your-project-url'}',
anonKey: '${projectKeys.publishableKey ?? '<prefer publishable key instead of anon key for mobile and desktop apps>'}',
publishableKey: '${projectKeys.publishableKey ?? 'your-publishable-key'}',
);
runApp(MyApp());
}