invertase / flutterfire_cli

A CLI to help with using FlutterFire in your Flutter applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

request: Support Windows with `flutterfire configure`

adil192 opened this issue · comments

Is there an existing feature request for this?

  • I have searched the existing issues.

Command

No response

Description

Support Windows with flutterfire configure.
The generated lib/firebase_options.dart should look like this:

class DefaultFirebaseOptions {
  static FirebaseOptions get currentPlatform {
    switch (defaultTargetPlatform) {
      case TargetPlatform.windows:
        return windows;
  }

  static const FirebaseOptions windows = FirebaseOptions(
    apiKey: '____________________________',
    appId: '_:_____________:windows:___________',
    messagingSenderId: '___________',
    projectId: '___________',
    authDomain: '________________.firebaseapp.com',
    storageBucket: '___________________.appspot.com',
    measurementId: 'G-____________',
  );

Reasoning

Following firebase/flutterfire#11516, we now have Windows support in firebase_core.
However, flutterfire configure doesn't have a Windows option yet.

Additional context and comments

Previous issue:

Console log:

ahanney@pop-os:~/Documents/GitHub/we_do$ flutterfire configure
i Found 5 Firebase projects.                                                                                                             
✔ Select a Firebase project to configure your Flutter application with · we-do-flutter (WeDo)                                            
? Which platforms should your configuration support (use arrow keys & space to select)? ›                                                
✔ android                                                                                                                                
✔ ios                                                                                                                                    
✔ macos                                                                                                                                  
✔ web                                                                                                                                    
(Ctrl C)
ahanney@pop-os:~/Documents/GitHub/we_do$ flutterfire --version
0.2.7

+1

Any update on this?

I was trying to use firestore with desktop app using flutter, and I couldn't find any working solution.

I tried this and it worked:
on the firebase_option.dart file I change the code to this:
Screenshot 2023-11-15 215558

and this for the main.dart file:
Screenshot 2023-11-15 215836

"I don't know if there will be any problem on this, I just wanted to use firebase with desktop. If there is anything new, I'll post it here"

I was trying to use firestore with desktop app using flutter, and I couldn't find any working solution.

The Windows support hasn't been released to pub.dev yet, so you'll need to use a local development version:

git clone https://github.com/invertase/flutterfire_cli
cd flutterfire_cli

# Activate CLI from path:
dart pub global activate --source="path" . --executable="flutterfire" --overwrite

# Confirm you now using a local development version:
flutterfire --help
# You should now see a banner printed at the top of the help output similar to:
# ------------------------------------------------------------------
# | You are running a local development version of FlutterFire CLI. |
# ------------------------------------------------------------------

Then you can run flutterfire configure in your Flutter app's folder.