title: displaying json array in expansion tile - flutter
body: <p>I am trying to display my json array data in expansion tile. i was able to display the data in expansion tile but when i press the expansion tile, it shows nothing. nothing is displayed when expansion tile is pressed.</p>
  
  <p>JSON: </p>
  
  <pre><code>{
  
      “name”: “kris”,
      “age”: 13,
      “class”: “13A”,
  
  }
  </code></pre>
  
  <p>Expansion_tile.dart:</p>
  
  <pre><code>import 'dart:async';
  import 'dart:convert';
  
  import 'package:flutter/material.dart';
  import 'package:http/http.dart' as http;
  
  var userData = [];
  
  class ActiveUser extends StatefulWidget {
    @override
    ActiveUserState createState() =&gt; new ActiveUserState();
  }
  
  class ActiveLevelState extends State&lt;ActiveUser&gt; {
    final String url = "http://35.186.145.243:8080/user?user_id=user3";
  
    List data;
  
    @override
    void initState() {
      super.initState();
      this.getJsonData();
    }
  
    Future&lt;String&gt; getJsonData() async {
      var response = await http.get(
        Uri.encodeFull(url),
        headers: {"Accept": "application/json"},
      );
  
      var extractdata = json.decode(response.body);
      data = extractdata['user'];
      userData = data;
  
      setState(
        () {
          var extractdata = json.decode(response.body);
          data = extractdata['user'];
        },
      );
      return "Success";
    }
  
    @override
    Widget build(BuildContext context) {
      return ListView.builder(
        itemBuilder: (BuildContext context, int index) =&gt; Card(
              child: SingleChildScrollView(
                child: StuffInTiles(userData[index]['name']),
              ),
            ),
        itemCount: userData.length,
      );
    }
  }
  
  class StuffInTiles extends StatelessWidget {
    final String elementList;
    StuffInTiles(this.elementList);
  
    @override
    Widget build(BuildContext context) {
      return _buildTiles();
    }
  
    Widget _buildTiles() {
      if (userData.length == 0)
        return ListTile(
          title: Text("Test"),
        );
      return ExpansionTile(
        title: Text(elementList),
        children: map(_buildTiles).toList(),
      );
    }
  }
  </code></pre>
  
  <p>I know that i am supposed to write something under children in expansion tile so it displays the content when pressed but i am unsure on how to display the children as it gives me error when i tried.</p>