Firestore how to set serverTimestamp behaviour in Flutter? - flutter

I am trying to make my app save local changes (e.g. saving notes) to firestore db while it is offline. When I use DateTime.now() for timeCreated, everything (most of job) works, but obviously, it is not correct time. I found solution with using FieldValue.serverTimestamp() to have correct time, but once I try to use it while app is offline, I can't get a value of previous timeCreated fields. Furthermore, I found out about DocumentSnapshot.ServerTimestampBehavior in firebase docs, and now I don't have clue how to use it or is it even available in flutter mobile apps. Link for Android: Android docs.
EDIT
I already gave up from using serverTimestamp, but I gave it another shot and successfully solved it. The problem was that I used hasPendingWriteson whole query, instead on single document which is added (updated) offline. In this article everything is described link. Still, I didn't find solution for my question.

Related

Maneuver issues in Turn By Turn Navigation with HERE maps in Flutter

Thanks in advance.
We have to use HERE map's Turn by turn navigation feature in one of our Flutter application, we have added billing in the developer account and have created the necessary keys.
When we try HERE map examples they have provided, we get everything except maneuver instructions that shows the user when to turn right/left/go straight for some distance etc.
I'm new to this and I have no idea how to get this, we never get events on the listener and it only shows updating there, am I missing something ?
this is how it looks right now, Updating...
I think we should be getting the progress here, but we are not getting it here...
_visualNavigator.routeProgressListener = Navigation.RouteProgressListener((routeProgress) { }
Please look into the provided example app. It shows here how to get the maneuver actions.
Your screenshot shows a different app, so make sure everything works with the example app, at first. The app offers to run a simulation mode. This should work. If you run the example app with real GPS updates, you may need to go outside and move to get location updates. This should also work.
If this still does not work, it could either mean that your device has an issue with getting GPS locations. Some iPads, for example, lack support. Or that you have disabled getting location updates. You can cross-check this when trying the positioning_app example from the same repository that shows how to get location updates.
A last point may be to clarify what events you get and what you miss: There are multiple event listeners providing real-time information during guidance - if you have only an issue with maneuvers, then most likely you can solve your issue by following strictly the code of the example app.
Note that previous HERE SDK versions, prior to HERE SDK 4.13.0, only provided empty maneuver instruction texts during guidance when they have been taken from the route instance. Make sure to take this information from the VisualNavigator instead.

How can we implement in app update in flutter app

I want to implement in-app-update or on-the-air update which means whenever the user opens the app, it checks and automatically downloads a new chunk of code and merges it, and asks the user to restart like most of the games (COD, PUBGm) do.
NOTE : I'm not talking about in_app_update
I tried to find out the basic workflow but could not.
I am assuming that what you need is what Firebase Remote config does, you can read about it and get more details from its Flutterfire docs

Firebase AsyncSnapshot, length of documents?

I need the length of Firebase documents for my app to make a ListView of them, but for some reason the data.docs cannot be found, even though the official Firebase website says it should (https://firebase.flutter.dev/docs/firestore-odm/references/). I tried everything, using documents keyword instead, using snapshot.requireData, but nothing is working. What am I doing wrong here?
enter image description here
use this way

Setting a value in Frappe application isn't reflected in ERPNext GUI

I have added a 'number_of_members' value to the Customer DocType via customization.
In my application I have tried several ways to update the value. However the value never updates in the webpage. I feel like I'm missing some sort of save or update or commit step.
For example I have tried:
frappe.client.set_value('Customer', '00042', 'number_of_members', 8887)
frappe.set_value('Customer', '00042', 'number_of_members', 8887)
frappe.db.set_value('Customer', '00042', 'number_of_members', 8887)
and also
customer = frappe.get_doc('Customer', '00042')
customer.number_of_members = 8887
customer.save()
In each case I can do something like frappe.get_value, or frappe.get_doc and it shows the value is set to 8887. However it never updates in the web side. This is what makes me think I'm updating some sort of cache or database transaction and I need some way to save it, but have not had any luck.
I am mostly testing this via bench console if that has any bearing on it, but I've tried a couple of the methods in my application code as well.
Relevant documentation:
Frappe Developer API - Document
Frappe Developer API - Database
Turns out the answer is to call frappe.db.commit() after making changes. If someone can point this out in the documentation so I can better understand how I'm missing stuff, I would appreciate it.
I also noticed if you try to Save something in the UI before you send frappe.db.commit() the UI will hang.

Whether or not your action is for families is required before publishing a Google Assistant action?

I was on the process of publishing my first google assitant action and after filling all the required details I am receiveing two errors.
1.Whether or not your action is for families is required
I have already checked and accepted the terms and conditions for families question. The data is saved also. Still I do not know why the error keeps popping up.
2.For en: Your sample invocations are structured incorrectly.
I have tested my invocations in the emulator and it seems to be working. And this error appears to be random. Sometimes, it does not happen even if I just save the same details again.
Any help appreciated as I am a complete new-bie to this.
I think this was a problem from the console itself. I updated today again and it seems to be saved.