This file contains hidden or 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
| import 'package:equatable/equatable.dart'; | |
| abstract class NotificationEvent extends Equatable { | |
| const NotificationEvent(); | |
| @override | |
| List<Object> get props => []; | |
| } | |
| class InitNotificationEvent extends NotificationEvent { |
This file contains hidden or 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
| class ExampleState extends Equatable { | |
| const ExampleState({ | |
| this.user = const User(), | |
| this.isLoading = false, | |
| }); | |
| @override | |
| List<Object?> get props => [ | |
| user, | |
| isLoading, |
This file contains hidden or 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
| class AppWidget extends StatelessWidget { | |
| const AppWidget({super.key}); | |
| @override | |
| Widget build(BuildContext context) { | |
| return const MaterialApp( | |
| debugShowCheckedModeBanner: false, | |
| title: 'Responsive Flutter UI App', | |
| home: ResponsiveLayout( | |
| mobileLayout: MobileChatsPage(), |
This file contains hidden or 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
| class ResponsiveLayout extends StatelessWidget { | |
| const ResponsiveLayout({ | |
| super.key, | |
| required this.mobileLayout, | |
| required this.desktopLayout, | |
| }); | |
| final Widget mobileLayout; | |
| final Widget desktopLayout; |
This file contains hidden or 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
| MaterialApp.router( | |
| debugShowCheckedModeBanner: false, | |
| routerConfig: appRouter.router, | |
| localizationsDelegates: const [...], | |
| supportedLocales: const [...], | |
| builder: (context, child) { | |
| final client = getIt<StreamChatClient>(); | |
| child = StreamChat( | |
| client: client, |
This file contains hidden or 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
| builder: (context, child) { | |
| final client = getIt<StreamChatClient>(); | |
| child = StreamChat( | |
| client: client, | |
| child: child, | |
| ); | |
| child = botToastBuilder(context, child); | |
| return child; |
This file contains hidden or 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
| bool searchInsideExistingChannels({ | |
| required List<Channel> listOfChannels, | |
| required String searchedText, | |
| required int index, | |
| required int lengthOfTheChannelMembers, | |
| required User oneToOneChatMember, | |
| }) { | |
| int result; | |
| final editedSearchedText = searchedText.toLowerCase().trim(); |
This file contains hidden or 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
| void selectUserToSendCapturedPhoto({ | |
| required User user, | |
| required int userIndex, | |
| }) { | |
| final listOfSelectedUserIDs = {...state.listOfSelectedUserIDs}; | |
| if (listOfSelectedUserIDs.isEmpty) { | |
| listOfSelectedUserIDs.add(user.id); | |
| } |
This file contains hidden or 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
| void selectUserWhenCreatingAGroup({ | |
| required User user, | |
| required bool isCreateNewChatPageForCreatingGroup, | |
| }) { | |
| final listOfSelectedUserIDs = {...state.listOfSelectedUserIDs}; | |
| final listOfSelectedUsers = {...state.listOfSelectedUsers}; | |
| if (!isCreateNewChatPageForCreatingGroup) { | |
| if (listOfSelectedUserIDs.isEmpty) { | |
| listOfSelectedUserIDs.add(user.id); |
This file contains hidden or 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
| Future<void> createNewChannel({ | |
| required bool isCreateNewChatPageForCreatingGroup, | |
| }) async { | |
| if (state.isInProgress) { | |
| return; | |
| } | |
| String channelImageUrl = ""; | |
| String channelName = state.channelName; | |
| final listOfMemberIDs = {...state.listOfSelectedUserIDs}; |
NewerOlder