You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
616 B

import 'package:get/get.dart';
import '../../../data/providers/agent_provider.dart';
class ChatItem {
final String id;
ChatItem({
required this.id,
});
}
class ExploreController extends GetxController {
static ExploreController get to => Get.find();
final _chatList = <ChatItem>[].obs;
List<ChatItem> get chatList => _chatList;
@override
void onInit() {
super.onInit();
_loadInitialChats();
}
void _loadInitialChats() {
final agents = AgentProvider.getAllAgents();
_chatList.assignAll(
agents.map((agent) => ChatItem(id: agent.id)).toList(),
);
}
}