lint changes image
This commit is contained in:
@@ -192,7 +192,8 @@ class AttachmentActionsModal extends StatelessWidget {
|
|||||||
VoidCallback? onTap, {
|
VoidCallback? onTap, {
|
||||||
Color? color,
|
Color? color,
|
||||||
Key? key,
|
Key? key,
|
||||||
}) => Material(
|
}) =>
|
||||||
|
Material(
|
||||||
key: key,
|
key: key,
|
||||||
color: StreamChatTheme.of(context).colorTheme.white,
|
color: StreamChatTheme.of(context).colorTheme.white,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
|||||||
|
|
||||||
/// Back button implementation
|
/// Back button implementation
|
||||||
class StreamBackButton extends StatelessWidget {
|
class StreamBackButton extends StatelessWidget {
|
||||||
|
|
||||||
/// Constructor for creating back button
|
/// Constructor for creating back button
|
||||||
const StreamBackButton({
|
const StreamBackButton({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
|||||||
@@ -243,7 +243,8 @@ class ChannelListHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
Widget _buildDisconnectedTitleState(
|
Widget _buildDisconnectedTitleState(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
StreamChatClient client,
|
StreamChatClient client,
|
||||||
) => Row(
|
) =>
|
||||||
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import 'package:stream_chat_flutter/src/utils.dart';
|
|||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||||
|
|
||||||
|
|
||||||
/// Callback called when tapping on a channel
|
/// Callback called when tapping on a channel
|
||||||
typedef ChannelTapCallback = void Function(Channel, Widget?);
|
typedef ChannelTapCallback = void Function(Channel, Widget?);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import 'package:flutter/rendering.dart';
|
|||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||||
|
|
||||||
|
|
||||||
/// It shows the current [Channel] name using a [Text] widget.
|
/// It shows the current [Channel] name using a [Text] widget.
|
||||||
///
|
///
|
||||||
/// The widget uses a [StreamBuilder] to render the channel information
|
/// The widget uses a [StreamBuilder] to render the channel information
|
||||||
@@ -60,8 +59,7 @@ class ChannelName extends StatelessWidget {
|
|||||||
|
|
||||||
final exceedingMembers =
|
final exceedingMembers =
|
||||||
otherMembers.length - currentMembers.length;
|
otherMembers.length - currentMembers.length;
|
||||||
title =
|
title = '${currentMembers.map((e) => e.user?.name).join(', ')} '
|
||||||
'${currentMembers.map((e) => e.user?.name).join(', ')} '
|
|
||||||
'${exceedingMembers > 0 ? '+ $exceedingMembers' : ''}';
|
'${exceedingMembers > 0 ? '+ $exceedingMembers' : ''}';
|
||||||
} else {
|
} else {
|
||||||
title = 'No title';
|
title = 'No title';
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
|||||||
/// [StreamChatTheme].
|
/// [StreamChatTheme].
|
||||||
/// Modify it to change the widget appearance.
|
/// Modify it to change the widget appearance.
|
||||||
class ChannelPreview extends StatelessWidget {
|
class ChannelPreview extends StatelessWidget {
|
||||||
|
|
||||||
/// Constructor for creating [ChannelPreview]
|
/// Constructor for creating [ChannelPreview]
|
||||||
const ChannelPreview({
|
const ChannelPreview({
|
||||||
required this.channel,
|
required this.channel,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
|||||||
|
|
||||||
/// It shows a date divider depending on the date difference
|
/// It shows a date divider depending on the date difference
|
||||||
class DateDivider extends StatelessWidget {
|
class DateDivider extends StatelessWidget {
|
||||||
|
|
||||||
/// Constructor for creating a [DateDivider]
|
/// Constructor for creating a [DateDivider]
|
||||||
const DateDivider({
|
const DateDivider({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
|||||||
|
|
||||||
/// Widget to display deleted message
|
/// Widget to display deleted message
|
||||||
class DeletedMessage extends StatelessWidget {
|
class DeletedMessage extends StatelessWidget {
|
||||||
|
|
||||||
/// Constructor to create [DeletedMessage]
|
/// Constructor to create [DeletedMessage]
|
||||||
const DeletedMessage({
|
const DeletedMessage({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import 'package:video_player/video_player.dart';
|
|||||||
|
|
||||||
/// Return action for coming back from pages
|
/// Return action for coming back from pages
|
||||||
enum ReturnActionType {
|
enum ReturnActionType {
|
||||||
|
|
||||||
/// No return action
|
/// No return action
|
||||||
none,
|
none,
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,22 @@ import 'package:stream_chat_flutter/src/video_thumbnail_image.dart';
|
|||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||||
|
|
||||||
|
/// Footer widget for media display
|
||||||
class ImageFooter extends StatefulWidget implements PreferredSizeWidget {
|
class ImageFooter extends StatefulWidget implements PreferredSizeWidget {
|
||||||
|
/// Creates a channel header
|
||||||
|
const ImageFooter({
|
||||||
|
Key? key,
|
||||||
|
required this.message,
|
||||||
|
this.onBackPressed,
|
||||||
|
this.onTitleTap,
|
||||||
|
this.onImageTap,
|
||||||
|
this.currentPage = 0,
|
||||||
|
this.totalPages = 0,
|
||||||
|
this.mediaAttachments = const [],
|
||||||
|
this.mediaSelectedCallBack,
|
||||||
|
}) : preferredSize = const Size.fromHeight(kToolbarHeight),
|
||||||
|
super(key: key);
|
||||||
|
|
||||||
/// Callback to call when pressing the back button.
|
/// Callback to call when pressing the back button.
|
||||||
/// By default it calls [Navigator.pop]
|
/// By default it calls [Navigator.pop]
|
||||||
final VoidCallback? onBackPressed;
|
final VoidCallback? onBackPressed;
|
||||||
@@ -23,28 +38,21 @@ class ImageFooter extends StatefulWidget implements PreferredSizeWidget {
|
|||||||
/// Callback to call when the image is tapped.
|
/// Callback to call when the image is tapped.
|
||||||
final VoidCallback? onImageTap;
|
final VoidCallback? onImageTap;
|
||||||
|
|
||||||
|
/// Stores the current index of media shown
|
||||||
final int currentPage;
|
final int currentPage;
|
||||||
|
|
||||||
|
/// Total number of pages of media
|
||||||
final int totalPages;
|
final int totalPages;
|
||||||
|
|
||||||
|
/// All attachments to show
|
||||||
final List<Attachment> mediaAttachments;
|
final List<Attachment> mediaAttachments;
|
||||||
|
|
||||||
|
/// Message which attachments are attached to
|
||||||
final Message message;
|
final Message message;
|
||||||
|
|
||||||
|
/// Callback when media is selected
|
||||||
final ValueChanged<int>? mediaSelectedCallBack;
|
final ValueChanged<int>? mediaSelectedCallBack;
|
||||||
|
|
||||||
/// Creates a channel header
|
|
||||||
ImageFooter({
|
|
||||||
Key? key,
|
|
||||||
required this.message,
|
|
||||||
this.onBackPressed,
|
|
||||||
this.onTitleTap,
|
|
||||||
this.onImageTap,
|
|
||||||
this.currentPage = 0,
|
|
||||||
this.totalPages = 0,
|
|
||||||
this.mediaAttachments = const [],
|
|
||||||
this.mediaSelectedCallBack,
|
|
||||||
}) : preferredSize = Size.fromHeight(kToolbarHeight),
|
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_ImageFooterState createState() => _ImageFooterState();
|
_ImageFooterState createState() => _ImageFooterState();
|
||||||
|
|
||||||
@@ -119,7 +127,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: widget.onTitleTap,
|
onTap: widget.onTitleTap,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -169,8 +177,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
expand: false,
|
expand: false,
|
||||||
initialChildSize: initialChildSize / size.height,
|
initialChildSize: initialChildSize / size.height,
|
||||||
minChildSize: initialChildSize / size.height,
|
minChildSize: initialChildSize / size.height,
|
||||||
builder: (context, scrollController) {
|
builder: (context, scrollController) => SingleChildScrollView(
|
||||||
return SingleChildScrollView(
|
|
||||||
controller: scrollController,
|
controller: scrollController,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -205,7 +212,9 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
itemCount: widget.mediaAttachments.length,
|
itemCount: widget.mediaAttachments.length,
|
||||||
padding: const EdgeInsets.all(1),
|
padding: const EdgeInsets.all(1),
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
// ignore: lines_longer_than_80_chars
|
||||||
|
gridDelegate:
|
||||||
|
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: crossAxisCount,
|
crossAxisCount: crossAxisCount,
|
||||||
mainAxisSpacing: 2,
|
mainAxisSpacing: 2,
|
||||||
crossAxisSpacing: 2,
|
crossAxisSpacing: 2,
|
||||||
@@ -244,7 +253,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
media,
|
media,
|
||||||
if (widget.message.user != null)
|
if (widget.message.user != null)
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
child: Container(
|
child: Container(
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -264,7 +273,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
child: UserAvatar(
|
child: UserAvatar(
|
||||||
user: widget.message.user!,
|
user: widget.message.user!,
|
||||||
constraints:
|
constraints:
|
||||||
BoxConstraints.tight(Size(24, 24)),
|
BoxConstraints.tight(const Size(24, 24)),
|
||||||
showOnlineStatus: false,
|
showOnlineStatus: false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -276,8 +285,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -304,29 +312,3 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Used for clipping textfield prefix icon
|
|
||||||
class IconClipper extends CustomClipper<Path> {
|
|
||||||
@override
|
|
||||||
Path getClip(Size size) {
|
|
||||||
final leftX = size.width / 5;
|
|
||||||
final rightX = 4 * size.width / 5;
|
|
||||||
final topY = size.height / 5;
|
|
||||||
final bottomY = 4 * size.height / 5;
|
|
||||||
|
|
||||||
final path = Path();
|
|
||||||
path.moveTo(leftX, topY);
|
|
||||||
path.lineTo(leftX, bottomY);
|
|
||||||
path.lineTo(rightX, bottomY);
|
|
||||||
path.lineTo(rightX, topY);
|
|
||||||
path.lineTo(leftX, topY);
|
|
||||||
path.lineTo(0, 0);
|
|
||||||
path.close();
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool shouldReclip(CustomClipper oldClipper) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import 'package:stream_chat_flutter/src/full_screen_media.dart';
|
|||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||||
|
|
||||||
|
/// Widget for constructing a group of images in message
|
||||||
class ImageGroup extends StatelessWidget {
|
class ImageGroup extends StatelessWidget {
|
||||||
|
/// Constructor for creating [ImageGroup] widget
|
||||||
const ImageGroup({
|
const ImageGroup({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.images,
|
required this.images,
|
||||||
@@ -13,15 +15,23 @@ class ImageGroup extends StatelessWidget {
|
|||||||
this.onShowMessage,
|
this.onShowMessage,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
|
/// List of attachments to show
|
||||||
final List<Attachment> images;
|
final List<Attachment> images;
|
||||||
|
|
||||||
|
/// Message which images are attached to
|
||||||
final Message message;
|
final Message message;
|
||||||
|
|
||||||
|
/// [MessageTheme] to apply to message
|
||||||
final MessageTheme messageTheme;
|
final MessageTheme messageTheme;
|
||||||
|
|
||||||
|
/// Size of iamges
|
||||||
final Size size;
|
final Size size;
|
||||||
|
|
||||||
|
/// Callback for when show message is tapped
|
||||||
final ShowMessageCallback? onShowMessage;
|
final ShowMessageCallback? onShowMessage;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) => ConstrainedBox(
|
||||||
return ConstrainedBox(
|
|
||||||
constraints: BoxConstraints.loose(size),
|
constraints: BoxConstraints.loose(size),
|
||||||
child: Flex(
|
child: Flex(
|
||||||
direction: Axis.vertical,
|
direction: Axis.vertical,
|
||||||
@@ -77,7 +87,7 @@ class ImageGroup extends StatelessWidget {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'+ ${images.length - 4}',
|
'+ ${images.length - 4}',
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 26,
|
fontSize: 26,
|
||||||
),
|
),
|
||||||
@@ -97,7 +107,6 @@ class ImageGroup extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
void _onTap(
|
void _onTap(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
@@ -122,8 +131,7 @@ class ImageGroup extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildImage(BuildContext context, int index) {
|
Widget _buildImage(BuildContext context, int index) => ImageAttachment(
|
||||||
return ImageAttachment(
|
|
||||||
attachment: images[index],
|
attachment: images[index],
|
||||||
size: size,
|
size: size,
|
||||||
message: message,
|
message: message,
|
||||||
@@ -131,4 +139,3 @@ class ImageGroup extends StatelessWidget {
|
|||||||
onAttachmentTap: () => _onTap(context, index),
|
onAttachmentTap: () => _onTap(context, index),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,11 +1,26 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stream_chat_flutter/src/attachment_actions_modal.dart';
|
||||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||||
import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
|
import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
|
||||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||||
|
|
||||||
import 'attachment_actions_modal.dart';
|
/// Header/AppBar widget for media display screen
|
||||||
|
|
||||||
class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
|
class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||||
|
/// Creates a channel header
|
||||||
|
const ImageHeader({
|
||||||
|
Key? key,
|
||||||
|
required this.message,
|
||||||
|
this.currentIndex = 0,
|
||||||
|
this.showBackButton = true,
|
||||||
|
this.onBackPressed,
|
||||||
|
this.onShowMessage,
|
||||||
|
this.onTitleTap,
|
||||||
|
this.onImageTap,
|
||||||
|
this.userName = '',
|
||||||
|
this.sentAt = '',
|
||||||
|
}) : preferredSize = const Size.fromHeight(kToolbarHeight),
|
||||||
|
super(key: key);
|
||||||
|
|
||||||
/// True if this header shows the leading back button
|
/// True if this header shows the leading back button
|
||||||
final bool showBackButton;
|
final bool showBackButton;
|
||||||
|
|
||||||
@@ -22,31 +37,20 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
/// Callback to call when the image is tapped.
|
/// Callback to call when the image is tapped.
|
||||||
final VoidCallback? onImageTap;
|
final VoidCallback? onImageTap;
|
||||||
|
|
||||||
|
/// Message which attachments are attached to
|
||||||
final Message message;
|
final Message message;
|
||||||
|
|
||||||
|
/// Username of sender
|
||||||
final String userName;
|
final String userName;
|
||||||
|
|
||||||
|
/// Text which connotes the time the message was sent
|
||||||
final String sentAt;
|
final String sentAt;
|
||||||
|
|
||||||
|
/// Stores the current index of media shown
|
||||||
final int currentIndex;
|
final int currentIndex;
|
||||||
|
|
||||||
/// Creates a channel header
|
|
||||||
ImageHeader({
|
|
||||||
Key? key,
|
|
||||||
required this.message,
|
|
||||||
this.currentIndex = 0,
|
|
||||||
this.showBackButton = true,
|
|
||||||
this.onBackPressed,
|
|
||||||
this.onShowMessage,
|
|
||||||
this.onTitleTap,
|
|
||||||
this.onImageTap,
|
|
||||||
this.userName = '',
|
|
||||||
this.sentAt = '',
|
|
||||||
}) : preferredSize = Size.fromHeight(kToolbarHeight),
|
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) => AppBar(
|
||||||
return AppBar(
|
|
||||||
brightness: Theme.of(context).brightness,
|
brightness: Theme.of(context).brightness,
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
leading: showBackButton
|
leading: showBackButton
|
||||||
@@ -57,7 +61,7 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
),
|
),
|
||||||
onPressed: onBackPressed,
|
onPressed: onBackPressed,
|
||||||
)
|
)
|
||||||
: SizedBox(),
|
: const SizedBox(),
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
StreamChatTheme.of(context).channelTheme.channelHeaderTheme.color,
|
StreamChatTheme.of(context).channelTheme.channelHeaderTheme.color,
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
@@ -75,7 +79,7 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
title: message.type != 'ephemeral'
|
title: message.type != 'ephemeral'
|
||||||
? InkWell(
|
? InkWell(
|
||||||
onTap: onTitleTap,
|
onTap: onTitleTap,
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
height: preferredSize.height,
|
height: preferredSize.height,
|
||||||
width: preferredSize.width,
|
width: preferredSize.width,
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -84,7 +88,8 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
userName,
|
userName,
|
||||||
style: StreamChatTheme.of(context).textTheme.headlineBold,
|
style:
|
||||||
|
StreamChatTheme.of(context).textTheme.headlineBold,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
sentAt,
|
sentAt,
|
||||||
@@ -96,9 +101,8 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: SizedBox(),
|
: const SizedBox(),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Size preferredSize;
|
final Size preferredSize;
|
||||||
@@ -109,16 +113,14 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
final result = await showDialog(
|
final result = await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
barrierColor: StreamChatTheme.of(context).colorTheme.overlay,
|
barrierColor: StreamChatTheme.of(context).colorTheme.overlay,
|
||||||
builder: (context) {
|
builder: (context) => StreamChannel(
|
||||||
return StreamChannel(
|
|
||||||
channel: channel,
|
channel: channel,
|
||||||
child: AttachmentActionsModal(
|
child: AttachmentActionsModal(
|
||||||
message: message,
|
message: message,
|
||||||
currentIndex: currentIndex,
|
currentIndex: currentIndex,
|
||||||
onShowMessage: onShowMessage,
|
onShowMessage: onShowMessage,
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|||||||
@@ -812,7 +812,8 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
final renderBox = context.findRenderObject() as RenderBox;
|
final renderBox = context.findRenderObject() as RenderBox;
|
||||||
final size = renderBox.size;
|
final size = renderBox.size;
|
||||||
|
|
||||||
return OverlayEntry(builder: (context) => Positioned(
|
return OverlayEntry(
|
||||||
|
builder: (context) => Positioned(
|
||||||
bottom: size.height + MediaQuery.of(context).viewInsets.bottom,
|
bottom: size.height + MediaQuery.of(context).viewInsets.bottom,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
@@ -832,9 +833,12 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
color: StreamChatTheme.of(context).colorTheme.white,
|
color: StreamChatTheme.of(context).colorTheme.white,
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
child: Container(
|
child: Container(
|
||||||
constraints: BoxConstraints.loose(Size.fromHeight(400)),
|
constraints:
|
||||||
|
BoxConstraints.loose(Size.fromHeight(400)),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: StreamChatTheme.of(context).colorTheme.white,
|
color: StreamChatTheme.of(context)
|
||||||
|
.colorTheme
|
||||||
|
.white,
|
||||||
borderRadius: BorderRadius.circular(8)),
|
borderRadius: BorderRadius.circular(8)),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
@@ -891,17 +895,20 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
TextSpan(
|
TextSpan(
|
||||||
text: c.name.capitalize(),
|
text: c.name.capitalize(),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.bold),
|
fontWeight:
|
||||||
|
FontWeight.bold),
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: ' /${c.name} ${c.args}',
|
text:
|
||||||
|
' /${c.name} ${c.args}',
|
||||||
style:
|
style:
|
||||||
StreamChatTheme.of(context)
|
StreamChatTheme.of(
|
||||||
|
context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.body
|
.body
|
||||||
.copyWith(
|
.copyWith(
|
||||||
color: StreamChatTheme
|
color: StreamChatTheme.of(
|
||||||
.of(context)
|
context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
.grey,
|
.grey,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user