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

Rows doesn't get reponse data #51

Open
arzukara opened this issue Sep 24, 2021 · 0 comments
Open

Rows doesn't get reponse data #51

arzukara opened this issue Sep 24, 2021 · 0 comments

Comments

@arzukara
Copy link

arzukara commented Sep 24, 2021

Hi,

I'm getting data from API like I wrote down.

 Future<String> getDataTableProvider(context) async {
    final response = await http.post(Uri.parse('https://**/DENEME.php'), body: {'tablename': 'TABLENAME'});

     rows = json.decode(response.body);
    print(rows);
    print("Data download successfully");
    return Future.value("Data download successfully");
  }

But Editable rows don't accept that row variable, turns rows as null. When I copy print of rows (print(rows);) and use it to define rows like;

rows = [
    {
      "name": 'James LongName Joe',
      "date": '23/09/2020',
      "month": 'June',
      "status": 'completed'
    },
    {
      "name": 'Daniel Paul',
      "month": 'March',
      "status": 'new',
      "date": '12/4/2020',
    },
    {
      "month": 'May',
      "name": 'Mark Zuckerberg',
      "date": '09/4/1993',
      "status": 'expert'
    },
    {
      "name": 'Jack',
      "status": 'legend',
      "date": '01/7/1820',
      "month": 'December',
    },
  ];

It works. I can get the same data with the same format when I use "json.decode(response.body)" but it doesn't work.
Why it could be?
(rows variable defined as List. And response has a right shape which package example requires.)

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

1 participant