Summary
firebase_ai works on Windows desktop, but nothing says so. The pub.dev page lists Android, iOS, macOS and web, and the Firebase AI Logic Flutter docs don't mention Windows. We assumed it was unsupported and kept it disabled on Windows in our app until we tested it.
What we tested
Windows 10 22H2, debug builds:
- A minimal Flutter app with
firebase_ai 3.15.0 and again with 4.0.0: Firebase.initializeApp(options: DefaultFirebaseOptions.windows), then FirebaseAI.agentPlatform(location: 'us-central1').generativeModel(model: 'gemini-2.5-flash-lite'). generateContent and generateContentStream both returned complete responses. No signed-in user, no App Check.
- Our production app on 3.15.0, as an integration test with a signed-in Firebase Auth user:
generateContent and generateContentStream at us-east5 both returned complete responses.
We also called the REST endpoint directly with the Windows app's API key and no identity headers; global, us-central1, us-east5 and europe-west4 all answered.
Why it works
The package's only native code is the getPlatformHeaders method channel, which supplies the API-key identity headers (X-Android-Package / X-Android-Cert, x-ios-bundle-identifier). On Windows no plugin is registered, so getPlatformSecurityHeaders() in platform_header_helper.dart catches the missing channel and sends no identity headers, the same path web takes. Everything else is plain Dart HTTP.
pub.dev derives its platform tags from flutter.plugin.platforms in the pubspec. There is no windows entry, so the package shows as unsupported there.
Suggestion
- Document Windows as supported, with the two caveats that come from having no native plugin: the API key can't be restricted to a Windows app identity (it behaves like the web key), and there is no Windows App Check provider, so enforcing App Check for AI Logic would block Windows clients.
- Optionally declare Windows in the pubspec (a
dartPluginClass, or whatever you prefer) so pub.dev lists the platform.
Happy to test a change on Windows.
Summary
firebase_aiworks on Windows desktop, but nothing says so. The pub.dev page lists Android, iOS, macOS and web, and the Firebase AI Logic Flutter docs don't mention Windows. We assumed it was unsupported and kept it disabled on Windows in our app until we tested it.What we tested
Windows 10 22H2, debug builds:
firebase_ai3.15.0 and again with 4.0.0:Firebase.initializeApp(options: DefaultFirebaseOptions.windows), thenFirebaseAI.agentPlatform(location: 'us-central1').generativeModel(model: 'gemini-2.5-flash-lite').generateContentandgenerateContentStreamboth returned complete responses. No signed-in user, no App Check.generateContentandgenerateContentStreamatus-east5both returned complete responses.We also called the REST endpoint directly with the Windows app's API key and no identity headers;
global,us-central1,us-east5andeurope-west4all answered.Why it works
The package's only native code is the
getPlatformHeadersmethod channel, which supplies the API-key identity headers (X-Android-Package/X-Android-Cert,x-ios-bundle-identifier). On Windows no plugin is registered, sogetPlatformSecurityHeaders()inplatform_header_helper.dartcatches the missing channel and sends no identity headers, the same path web takes. Everything else is plain Dart HTTP.pub.dev derives its platform tags from
flutter.plugin.platformsin the pubspec. There is nowindowsentry, so the package shows as unsupported there.Suggestion
dartPluginClass, or whatever you prefer) so pub.dev lists the platform.Happy to test a change on Windows.