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

Fix MetaData.fromJson in order.dart for non String value #32

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CarloDotLog
Copy link

Hello,
I've experienced an error with MetaData.fromJson in order.dart file.
In order creation, I received a response like this:

meta_data: [{id: 18, key: community-events-location, value: {ip: xx.xx.xx.xx}}, {id: 23, key: wc_last_active, value: 1603756800},{..}]

where there is an object instead of a string for the "value" tag: value: {ip: xx.xx.xx.xx}.

The named constructor must change from:

MetaData.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    key = json['key'];
    value = json['value'];
  }

to:

MetaData.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    key = json['key'];
    value = json['value'].toString();
  }

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

Successfully merging this pull request may close these issues.

1 participant