Description
Sync failed when closing app
Every time I enter a bank information, I need to check if the name is correct, because I want this feature to work offline, so I can not have inconsistencies in the bank. So far as the code below is working the way I want. but in only one situation does the sync fail, which is when I press the app's back button until it closes. So when I turn on the internet the data is not synchronized.
Code :
Firestore.instance
.collection('Regiao')
.where('idRegiao', isEqualTo: idRegiao)
.snapshots()
.listen((data){
data.documents.forEach((doc) {
Firestore.instance
.collection('CadernoCampoDefensivo')
.document(idCadernoCampo)
.updateData({'regiao' : doc['nomeRegiao']})
.then((_){});
});
});
Log Error:
D/NetworkManagementSocketTagger(30646): tagSocket(60) with statsTag=0xffffffff, statsUid=-1
D/FlutterNativeView(30646): FlutterView.send called on a detached view, channel=plugins.flutter.io/cloud_firestore
D/FlutterNativeView(30646): FlutterView.send called on a detached view, channel=plugins.flutter.io/cloud_firestore
D/FlutterNativeView(30646): FlutterView.send called on a detached view, channel=plugins.flutter.io/cloud_firestore
D/FlutterNativeView(30646): FlutterView.send called on a detached view, channel=plugins.flutter.io/cloud_firestore
D/FlutterNativeView(30646): FlutterView.send called on a detached view, channel=plugins.flutter.io/cloud_firestore
W/FlutterJNI(30646): Tried to send a platform message response, but FlutterJNI was detached from native C++. Could not send. Response ID: 232