-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TW-613: Create bottom navigation bar for chat list when active select…
…ing mode
- Loading branch information
Showing
3 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import 'package:fluffychat/pages/chat_list/chat_list_bottom_navigator_style.dart'; | ||
import 'package:fluffychat/presentation/enum/chat_list/chat_list_enum.dart'; | ||
import 'package:fluffychat/utils/responsive/responsive_utils.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class ChatListBottomNavigator extends StatelessWidget { | ||
const ChatListBottomNavigator({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
height: ResponsiveUtils.heightBottomNavigation, | ||
padding: ChatListBottomNavigatorStyle.padding, | ||
color: Theme.of(context).colorScheme.surface, | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: _getNavigationDestinations.map( | ||
(item) { | ||
return SizedBox( | ||
width: ChatListBottomNavigatorStyle.width, | ||
child: Column( | ||
children: [ | ||
Icon( | ||
item.icon(context), | ||
size: ChatListBottomNavigatorStyle.iconSize, | ||
color: Theme.of(context).colorScheme.primary, | ||
), | ||
Text( | ||
item.title(context), | ||
style: Theme.of(context).textTheme.labelMedium?.copyWith( | ||
color: Theme.of(context).colorScheme.primary, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
).toList(), | ||
), | ||
); | ||
} | ||
|
||
List<ChatListBottomNavigatorBar> get _getNavigationDestinations { | ||
return [ | ||
ChatListBottomNavigatorBar.read, | ||
ChatListBottomNavigatorBar.mute, | ||
ChatListBottomNavigatorBar.pin, | ||
ChatListBottomNavigatorBar.more, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ChatListBottomNavigatorStyle { | ||
static const EdgeInsetsDirectional padding = EdgeInsetsDirectional.symmetric( | ||
horizontal: 8, | ||
vertical: 12, | ||
); | ||
|
||
static const double width = 86; | ||
static const double iconSize = 24; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/l10n.dart'; | ||
|
||
enum SelectMode { | ||
normal, | ||
select, | ||
} | ||
|
||
enum PopupMenuAction { | ||
settings, | ||
invite, | ||
newGroup, | ||
setStatus, | ||
archive, | ||
} | ||
|
||
enum ActiveFilter { | ||
allChats, | ||
groups, | ||
messages, | ||
spaces, | ||
} | ||
|
||
enum ChatListBottomNavigatorBar { | ||
read, | ||
mute, | ||
pin, | ||
more; | ||
|
||
String title(BuildContext context) { | ||
switch (this) { | ||
case ChatListBottomNavigatorBar.read: | ||
return L10n.of(context)!.contacts; | ||
case ChatListBottomNavigatorBar.mute: | ||
return L10n.of(context)!.mute; | ||
case ChatListBottomNavigatorBar.pin: | ||
return L10n.of(context)!.pin; | ||
case ChatListBottomNavigatorBar.more: | ||
return L10n.of(context)!.more; | ||
} | ||
} | ||
|
||
IconData icon(BuildContext context) { | ||
switch (this) { | ||
case ChatListBottomNavigatorBar.read: | ||
return Icons.mark_email_read; | ||
case ChatListBottomNavigatorBar.mute: | ||
return Icons.notifications_off; | ||
case ChatListBottomNavigatorBar.pin: | ||
return Icons.push_pin; | ||
case ChatListBottomNavigatorBar.more: | ||
return Icons.more_vert; | ||
} | ||
} | ||
} |