imessage fix (#6)

* first draft : static views wip

* refactor to ChatMessage and ChatMessageHeader

* add pedantic

* fix lints

* remove hardcoded message

* appBar title : iMessage

* format date

* cupertino style and model view

* fix display of message based on isReceived or sent

* SendMessageInput

* refactor to MessagesPage

* MissingPluginException

* use builtins instead of custom stream builders

* handle isReceived

* delete channel header

* fix layout issues in ChannelPreview

* fix formatDate

* sticky message input

* usage of builtin MessageListCore

* remove unused imports and a todo

* rename channelsStates to channels

* replace file imports /w package:imessage/filename

* remove size required ChannelNameText

* lint and format

* sendMessage

* transition animation

* stream_chat_flutter_core instead

* format Date differently if same week

* add padding to bubble

* remove iMessage text from header

* reverse message order

* if same day don't display date

* padding chat bubble right

* remove unused extension

* constraint message width

* group messages By dates

* unused import

* fix bug input + layout+ preview onTap

* change updatedAt to createdAt

* add filter on channel

* handle refresh

* handle pagination with core LazyLoadScrollView

* preview simple medias

* upload bug

* fix attachment

* visual changes to message input

* remove size

* clean up

* wait 5 sec before displaying image(hack)

* fix a couple of things

* fix padding in channel preview

* fix upload + debugShowCheckedModeBanner false

* fix overflow and refactor to Divider

* fix android build

* add imessage clone hero image

* update README

Co-authored-by: Sacha Arbonel <[email protected]>
This commit is contained in:
Salvatore Giordano
2021-02-26 18:06:54 +01:00
committed by GitHub
co-authored by Sacha Arbonel
parent 6feccd57dd
commit f861eb4584
21 changed files with 344 additions and 279 deletions
+22 -21
View File
@@ -43,6 +43,7 @@ class IMessage extends StatelessWidget {
initializeDateFormatting('en_US', null);
return CupertinoApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: CupertinoThemeData(brightness: Brightness.light),
home: StreamChatCore(client: client, child: ChatLoader()),
);
@@ -50,31 +51,26 @@ class IMessage extends StatelessWidget {
}
class ChatLoader extends StatelessWidget {
const ChatLoader({
ChatLoader({
Key key,
}) : super(key: key);
final channelListController = ChannelListController();
@override
Widget build(BuildContext context) {
final user = StreamChatCore.of(context).user;
var channelListController = ChannelListController();
return CupertinoPageScaffold(
child: ChannelsBloc(
child: ChannelListCore(
channelListController: channelListController,
filter: {
r'$and': [
{
'members': {
r'$in': [user.id],
}
},
{
'type': {
r'$eq': 'messaging',
}
}
]
'members': {
r'$in': [user.id],
},
'type': {
r'$eq': 'messaging',
},
},
sort: [SortOption('last_message_at')],
pagination: PaginationParams(
@@ -108,13 +104,18 @@ class ChatLoader extends StatelessWidget {
onEndOfPage: () async {
channelListController.paginateData();
},
child: CustomScrollView(slivers: [
CupertinoSliverRefreshControl(onRefresh: () async {
channelListController.loadData();
}),
ChannelPageAppBar(),
ChannelListView(channels: channels)
]),
child: CustomScrollView(
slivers: [
CupertinoSliverRefreshControl(onRefresh: () async {
channelListController.loadData();
}),
ChannelPageAppBar(),
SliverPadding(
sliver: ChannelListView(channels: channels),
padding: const EdgeInsets.only(top: 16),
)
],
),
))));
}
}