lib/multi_tab_chat_ui_guid.dart
file with the following code:
import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
import 'package:flutter/material.dart';
class MultiTabUIGuideExample extends StatefulWidget {
const MultiTabUIGuideExample({super.key});
@override
State<MultiTabUIGuideExample> createState() => _MultiTabUIGuideExampleState();
}
class _MultiTabUIGuideExampleState extends State<MultiTabUIGuideExample> {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
title: const Text('Multi Tab UI Guide'),
backgroundColor: Colors.white,
leading: null,
automaticallyImplyLeading: false,
bottom: const TabBar(
tabs: [
Tab(icon: Icon(Icons.chat), text: 'Conversation'),
Tab(icon: Icon(Icons.person), text: 'Users'),
Tab(icon: Icon(Icons.group), text: 'Groups'),
],
),
),
body: const TabBarView(
children: [
CometChatConversationsWithMessages(
conversationsConfiguration: ConversationsConfiguration(
hideAppbar: true
)
),
CometChatUsersWithMessages(
usersConfiguration: UsersConfiguration(
hideAppbar: true,
hideSearch: true
)
),
CometChatGroupsWithMessages(
groupsConfiguration: GroupsConfiguration(
hideAppbar: true,
hideSearch: true
)
),
],
),
),
);
}
}
Was this page helpful?