* 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) Co-authored-by: Salvatore Giordano <[email protected]>
26 lines
789 B
Dart
26 lines
789 B
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart' show Channel;
|
|
|
|
import 'package:imessage/utils.dart';
|
|
|
|
class ChannelImage extends StatelessWidget {
|
|
const ChannelImage({Key key, @required this.channel, @required this.size})
|
|
: super(key: key);
|
|
|
|
final Channel channel;
|
|
final double size;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final avatarUrl = channel.extraData.containsKey('image') &&
|
|
(channel.extraData['image'] as String).isNotEmpty
|
|
? channel.extraData['image'] as String
|
|
: 'https://4.bp.blogspot.com/-Jx21kNqFSTU/UXemtqPhZCI/AAAAAAAAh74/BMGSzpU6F48/s1600/funny-cat-pictures-047-001.jpg';
|
|
|
|
return CupertinoCircleAvatar(
|
|
size: size,
|
|
url: avatarUrl,
|
|
);
|
|
}
|
|
}
|