Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to increment counter in realtime database. #58

Closed
ziarehmank opened this issue Dec 10, 2024 · 1 comment
Closed

How to increment counter in realtime database. #58

ziarehmank opened this issue Dec 10, 2024 · 1 comment

Comments

@ziarehmank
Copy link

I am trying out this package to make our app compatible with windows.
I need to increment an integer counter in the realtime database, but i am unable to make it work in this package.

Here is what i tried.

ref.child('current_order_no').child(shop!.uuid).set({
      '.sv': {
        'increment': 1,
      },
    })

In this package ServerValue.increment(1) is not available, so i cannot do that.

I get the error. type '_Map<String, int>' is not a subtype of type 'String?'

Thanks

@rbellens
Copy link
Collaborator

The increment server value is indeed not supported, but I can probably add it quite easily. I'll see if I can find some time to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants