U view stranici gdje prikazujemo listu

PHOTO EMBED

Wed May 18 2022 09:32:26 GMT+0000 (UTC)

Saved by @Vesko_devv #dart

ontroller.obx(
        (data) => ListView.builder(
            padding: EdgeInsets.all(8),
            itemCount: data.length,
            itemBuilder: (BuildContext context, int index) {
              return Card(
                child: Column(
                  children: <Widget>[
                    ListTile(
                      leading: CircleAvatar(
                        radius: 30,
                        backgroundImage:
                            NetworkImage(data[index]['picture']['large']),
                      ),
                      title: Text(
                        data[index]['name']['title'] +
                            " " +
                            data[index]['name']['first'] +
                            " " +
                            data[index]['name']['last'],
                      ),
                      subtitle: Text(
                        data[index]['email'],
                        style: TextStyle(fontSize: 12),
                      ),
                      trailing: Text(
                        "Age : " + data[index]['dob']['age'].toString(),
                      ),
                    ),
                  ],
                ),
              );
            }),
        onError: (error) => Center(
          child: Text(error),
        ),
      ),
    );
content_copyCOPY