googlearchive / firebase-dart

Dart wrapper for Firebase
https://pub.dev/packages/firebase
404 stars 144 forks source link

firestore listener not working as expected #336

Closed suvarna84 closed 3 years ago

suvarna84 commented 4 years ago

My web application requires me to use firestore listener for a document 'jkl. Instead of printing the updated value once, it is repeatedly printing the value even though there is no update in the document 'jkl.

 void switchListener() async {
      _listener = Firestore.instance
       .collection('abc')
      .document('def')
      .collection('ghi')
     .document('jkl')
     .snapshots()
 .listen((data) => listenerUpdate(data));
 }

 void listenerUpdate(data) {
   String number = data['URL'];
  setState(() {
  _totalDocs = number;
     });
   }

[✓] Flutter (Channel unknown, 1.20.1, on Mac OS X 10.15.1 19B88, locale en-IN)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [✗] Xcode - develop for iOS and macOS ✗ Xcode installation is incomplete; a full installation is necessary for iOS development. Download at: https://developer.apple.com/xcode/download/ Or install Xcode via the App Store. Once installed, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunch ✗ CocoaPods not installed. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install: sudo gem install cocoapods [✓] Chrome - develop for the web [✓] Android Studio (version 3.4) [!] VS Code (version 1.37.1) ✗ Flutter extension not installed; install from https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (2 available)

! Doctor found issues in 2 categories.

kevmoo commented 3 years ago

What version of this package are you using? Which version of the firebase JS libraries are you using? What is the event data?

no-response[bot] commented 3 years ago

Without additional information we're not able to resolve this issue, so it will be closed at this time. You're still free to add more info and respond to any questions above, though. We'll reopen the case if you do. Thanks for your contribution!