1

I'm building windows application by flutter, after adding Firebase packages and connect the app to firebase, I had this problem:

Unhandled Exception: MissingPluginException(No implementation found for method DocumentReference#set on channel plugins.flutter.io/firebase_firestore)

I've tried so many solutions, and searched on the web, but unfortunately all solutions are suit Android not Windows!!!

The idea that I work on, is to upload images to firebase storage, and save data in firestore collections. All firebase services didn't work with me, Authintication, FireStore, and Storage either.

update: This is my function code:

  Future addCategory() async {
    await _userCollectionRef.add({
      'id': '4328',
      'name': cateNameController.text,
      'image': image?.path,
    });

    cateNameController.clear();
    image = null;
    update();
  }
}

And this is my PubSpec.yaml packages code:

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.2
  get: ^4.6.5
  smooth_page_indicator: ^1.0.0+2
  carousel_slider: ^4.1.1
  shared_preferences: ^2.0.15
  flutter_svg: ^1.1.0
  firebase_core: ^1.19.1
  firebase_storage: ^10.3.6
  firebase_auth: ^3.6.4
  firebase_auth_desktop: ^1.0.2
  firebase_core_desktop: ^1.0.2
  google_sign_in: ^5.3.3
  cloud_firestore: ^3.4.5
  firebase_messaging: ^12.0.3
  image_picker: ^0.8.5+3
  image_picker_windows: ^0.1.0+2
  file_picker: ^5.0.1

The Initialize in main() :

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );
  await initialServices();
  runApp(const MyApp());
}
  • Can you include your code and pubspec.yaml in the question? – Dulaj Nadawa Aug 30 '22 at 09:22
  • @DulajNadawa I've edit the post, and put codes – Muhammad Qazmouz Aug 30 '22 at 09:34
  • Firebase packages are not supported on windows. Option 1. You can try this package https://pub.dev/packages/firedart. Option 2. build your app for web and release it on windows using electron. Electron can display a website as a windows app. Since all firebase packages are supported on web, they are also supported on an electron window's app. – Peter Obiechina Aug 30 '22 at 10:25

1 Answers1

2

Official firebase plugins are not supported on windows yet, try this https://www.youtube.com/watch?v=Tw7L2NkhwPc But this plugin does not have firebase_storage support.

Dulaj Nadawa
  • 507
  • 3
  • 10
  • Sir, I saw this video many times, now firebase has more kind of applications you can add to the project like: Android, IOS, Web, Unity, and Flutter, (Flutter: which means windows and mac etc...) I'm sure there is ways to do it, but I don't know why I face this problem!!! – Muhammad Qazmouz Aug 30 '22 at 09:52
  • If you go to https://pub.dev/packages/cloud_firestore package you can see it is only supported for Android, iOS, Web and MacOS. Adding flutter in firebase project does not mean it supports windows. – Dulaj Nadawa Aug 30 '22 at 10:00
  • windows is supported too. see this blog, https://invertase.io/blog/announcing-flutterfire-desktop-auth-stable – Burak Senel Dec 27 '22 at 13:30