ivk1800 / tdlib-dart

MIT License
19 stars 12 forks source link

Tracking the result of td.GetChats() and td.LoadChats() #15

Closed Yaroslav-Zagumennikov closed 2 weeks ago

Yaroslav-Zagumennikov commented 6 months ago

I had a problem when I was trying to track the result of a query _client?.send(const td.GetChats(limit: 10))

image

I used the following code to track the result, but the value of the variable is still empty I changed the code of the example file

image image

if (_chats.isNotEmpty)
              Expanded(
                child: ListView.builder(
                  itemCount: _chats.length,
                  itemBuilder: (context, index) {
                    final chat = _chats[index];
                    return ListTile(
                      title: Text(chat.title ?? ''),
                      subtitle: Text(chat.type.toString()),
                    );
                  },
                ),
              ),
ivk1800 commented 3 months ago

Please check working example: https://github.com/ivk1800/telegram-flutter/blob/a1093fc75043c9c2b4e53fb986971b2014fc7f3a/core_tdlib_impl/lib/src/data_source/chat_data_source.dart#L72