Messaging
Implemented Chat Screens, Profile Pages, Search Pages WIP: User profile, new chat button Intended: Groups, Calls, Voice Messages Properly deleting chats, offline storage of messages
This commit is contained in:
+56
-39
@@ -15,17 +15,38 @@ class HomePage extends StatefulWidget {
|
||||
|
||||
class _HomePageState extends State<HomePage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
//TickerProviderStateMixin
|
||||
// //
|
||||
//TickerProviderStateMixin
|
||||
// //
|
||||
late double _deviceHeight;
|
||||
late double _deviceWidth;
|
||||
late final TabController _tabController;
|
||||
|
||||
final List<Tab> _iconTabs = [
|
||||
Tab(
|
||||
icon: Icon(
|
||||
Icons.people_outline,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
Tab(
|
||||
icon: Icon(
|
||||
Icons.chat_bubble_outline,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
Tab(
|
||||
icon: Icon(
|
||||
Icons.person_outline,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(
|
||||
length: 3,
|
||||
length: _iconTabs.length,
|
||||
vsync: this,
|
||||
initialIndex: 1,
|
||||
);
|
||||
@@ -44,49 +65,45 @@ class _HomePageState extends State<HomePage>
|
||||
_deviceWidth = MediaQuery.of(context).size.width;
|
||||
|
||||
return Scaffold(
|
||||
// backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
appBar: AppBar(
|
||||
// backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
title: Text("the messenger"),
|
||||
titleTextStyle: TextStyle(fontSize: 16),
|
||||
bottom: TabBar(
|
||||
unselectedLabelColor: Colors.grey,
|
||||
indicatorColor: Colors.blue,
|
||||
labelColor: Colors.blue,
|
||||
controller: _tabController,
|
||||
tabs: [
|
||||
Tab(
|
||||
icon: Icon(
|
||||
Icons.people_outline,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
Tab(
|
||||
icon: Icon(
|
||||
Icons.chat_bubble_outline,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
Tab(
|
||||
icon: Icon(
|
||||
Icons.person_outline,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
],
|
||||
// backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
// backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
title: Text("the messenger"),
|
||||
titleTextStyle: TextStyle(fontSize: 16),
|
||||
bottom: TabBar(
|
||||
unselectedLabelColor: Colors.grey,
|
||||
indicatorColor: Colors.blue,
|
||||
labelColor: Colors.blue,
|
||||
controller: _tabController,
|
||||
tabs: _iconTabs,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: _tabBarPages(),
|
||||
);
|
||||
body: _tabBarPages(),
|
||||
floatingActionButton: _tabController.index == 1
|
||||
? Container()
|
||||
: FloatingActionButton(
|
||||
child: Icon(Icons.add),
|
||||
onPressed: () {},
|
||||
));
|
||||
}
|
||||
|
||||
Widget _tabBarPages() {
|
||||
return TabBarView(
|
||||
controller: _tabController,
|
||||
children: [
|
||||
SearchPage( deviceHeight: _deviceHeight , deviceWidth: _deviceWidth,),
|
||||
RecentConverstationsPage(_deviceHeight, _deviceWidth),
|
||||
ProfilePage(_deviceHeight, _deviceWidth),
|
||||
SearchPage(
|
||||
deviceHeight: _deviceHeight,
|
||||
deviceWidth: _deviceWidth,
|
||||
),
|
||||
RecentConverstationsPage(
|
||||
_deviceHeight,
|
||||
_deviceWidth,
|
||||
),
|
||||
ProfilePage(
|
||||
_deviceHeight,
|
||||
_deviceWidth,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user