Type of Widget
UI Widgets based on behaviour and functionality can be categorized into two types: Base Widget and Widget.Base Widget
Base Widgets form the building blocks of your app’s user interface (UI). They focus solely on presenting visual elements based on input data, without handling any business logic. These Widgets provide the foundational appearance and behavior for your UI.Widget
Widgets build upon Base Widgets by incorporating business logic via BLoC pattern. They not only render UI elements but also manage data loading through use cases and repositories, execute specific actions, and respond to events. This combination of visual presentation and functional capabilities makes Widgets essential for creating dynamic and interactive UIs.V6 Note: V6 does not have Composite Widgets likeCometChatMessagesorCometChatConversationsWithMessages. Instead, you compose the UI yourself using individual Widgets (CometChatMessageList,CometChatMessageComposer,CometChatMessageHeader). This gives you full control over layout and behavior.
Architecture
Each Widget in V6 follows clean architecture internally:| Layer | Purpose | Example |
|---|---|---|
bloc/ | State management (events, states, BLoC) | ConversationsBloc, ConversationsEvent, ConversationsState |
data/ | Data sources and repository implementations | ConversationsRemoteDatasource, ConversationsRepositoryImpl |
domain/ | Use cases and repository interfaces | GetConversationsUseCase, ConversationsRepository |
di/ | Dependency injection | ConversationsServiceLocator |
widgets/ | Decomposed sub-widgets | ConversationsList, ConversationsEmptyView |