chore(repo): add lints, update freezed, json_serializable
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -11,10 +11,10 @@ typedef AttachmentTitle = StreamAttachmentTitle;
|
||||
class StreamAttachmentTitle extends StatelessWidget {
|
||||
/// Supply attachment and theme for constructing title
|
||||
const StreamAttachmentTitle({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.attachment,
|
||||
required this.messageTheme,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
/// Theme to apply to text
|
||||
final StreamMessageThemeData messageTheme;
|
||||
|
||||
+10
-21
@@ -19,14 +19,14 @@ typedef AttachmentUploadStateBuilder = StreamAttachmentUploadStateBuilder;
|
||||
class StreamAttachmentUploadStateBuilder extends StatelessWidget {
|
||||
/// Constructor for creating an [StreamAttachmentUploadStateBuilder] widget
|
||||
const StreamAttachmentUploadStateBuilder({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.message,
|
||||
required this.attachment,
|
||||
this.failedBuilder,
|
||||
this.successBuilder,
|
||||
this.inProgressBuilder,
|
||||
this.preparingBuilder,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
/// Message which attachment is added to
|
||||
final Message message;
|
||||
@@ -85,30 +85,24 @@ class StreamAttachmentUploadStateBuilder extends StatelessWidget {
|
||||
|
||||
class _IconButton extends StatelessWidget {
|
||||
const _IconButton({
|
||||
Key? key,
|
||||
this.icon,
|
||||
this.iconSize = 24.0,
|
||||
this.onPressed,
|
||||
this.fillColor,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
final Widget? icon;
|
||||
final double iconSize;
|
||||
final VoidCallback? onPressed;
|
||||
final Color? fillColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => SizedBox(
|
||||
height: iconSize,
|
||||
width: iconSize,
|
||||
height: 24,
|
||||
width: 24,
|
||||
child: RawMaterialButton(
|
||||
elevation: 0,
|
||||
highlightElevation: 0,
|
||||
focusElevation: 0,
|
||||
hoverElevation: 0,
|
||||
onPressed: onPressed,
|
||||
fillColor:
|
||||
fillColor ?? StreamChatTheme.of(context).colorTheme.overlayDark,
|
||||
fillColor: StreamChatTheme.of(context).colorTheme.overlayDark,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
@@ -118,10 +112,7 @@ class _IconButton extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _PreparingState extends StatelessWidget {
|
||||
const _PreparingState({
|
||||
Key? key,
|
||||
required this.attachmentId,
|
||||
}) : super(key: key);
|
||||
const _PreparingState({required this.attachmentId});
|
||||
|
||||
final String attachmentId;
|
||||
|
||||
@@ -155,11 +146,10 @@ class _PreparingState extends StatelessWidget {
|
||||
|
||||
class _InProgressState extends StatelessWidget {
|
||||
const _InProgressState({
|
||||
Key? key,
|
||||
required this.sent,
|
||||
required this.total,
|
||||
required this.attachmentId,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
final int sent;
|
||||
final int total;
|
||||
@@ -195,11 +185,10 @@ class _InProgressState extends StatelessWidget {
|
||||
|
||||
class _FailedState extends StatelessWidget {
|
||||
const _FailedState({
|
||||
Key? key,
|
||||
this.error,
|
||||
required this.messageId,
|
||||
required this.attachmentId,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
final String? error;
|
||||
final String messageId;
|
||||
@@ -222,7 +211,7 @@ class _FailedState extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: theme.colorTheme.overlayDark.withOpacity(0.6),
|
||||
|
||||
@@ -38,13 +38,12 @@ typedef AttachmentWidget = StreamAttachmentWidget;
|
||||
abstract class StreamAttachmentWidget extends StatelessWidget {
|
||||
/// Constructor for creating attachment widget
|
||||
const StreamAttachmentWidget({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.message,
|
||||
required this.attachment,
|
||||
this.size,
|
||||
AttachmentSource? source,
|
||||
}) : _source = source,
|
||||
super(key: key);
|
||||
}) : _source = source;
|
||||
|
||||
/// Size of attachments
|
||||
final Size? size;
|
||||
@@ -68,9 +67,9 @@ abstract class StreamAttachmentWidget extends StatelessWidget {
|
||||
class AttachmentError extends StatelessWidget {
|
||||
/// Constructor for creating AttachmentError
|
||||
const AttachmentError({
|
||||
Key? key,
|
||||
super.key,
|
||||
this.size,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
/// Size of error
|
||||
final Size? size;
|
||||
|
||||
@@ -20,19 +20,14 @@ typedef FileAttachment = StreamFileAttachment;
|
||||
class StreamFileAttachment extends StreamAttachmentWidget {
|
||||
/// Constructor for creating a widget when attachment is of type 'file'
|
||||
const StreamFileAttachment({
|
||||
Key? key,
|
||||
required Message message,
|
||||
required Attachment attachment,
|
||||
Size? size,
|
||||
super.key,
|
||||
required super.message,
|
||||
required super.attachment,
|
||||
super.size,
|
||||
this.title,
|
||||
this.trailing,
|
||||
this.onAttachmentTap,
|
||||
}) : super(
|
||||
key: key,
|
||||
message: message,
|
||||
attachment: attachment,
|
||||
size: size,
|
||||
);
|
||||
});
|
||||
|
||||
/// Title for attachment
|
||||
final Widget? title;
|
||||
|
||||
@@ -15,19 +15,14 @@ typedef GiphyAttachment = StreamGiphyAttachment;
|
||||
class StreamGiphyAttachment extends StreamAttachmentWidget {
|
||||
/// Constructor for creating a [StreamGiphyAttachment] widget
|
||||
const StreamGiphyAttachment({
|
||||
Key? key,
|
||||
required Message message,
|
||||
required Attachment attachment,
|
||||
Size? size,
|
||||
super.key,
|
||||
required super.message,
|
||||
required super.attachment,
|
||||
super.size,
|
||||
this.onShowMessage,
|
||||
this.onReturnAction,
|
||||
this.onAttachmentTap,
|
||||
}) : super(
|
||||
key: key,
|
||||
message: message,
|
||||
attachment: attachment,
|
||||
size: size,
|
||||
);
|
||||
});
|
||||
|
||||
/// Callback when show message is tapped
|
||||
final ShowMessageCallback? onShowMessage;
|
||||
|
||||
@@ -15,21 +15,16 @@ typedef ImageAttachment = StreamImageAttachment;
|
||||
class StreamImageAttachment extends StreamAttachmentWidget {
|
||||
/// Constructor for creating a [StreamImageAttachment] widget
|
||||
const StreamImageAttachment({
|
||||
Key? key,
|
||||
required Message message,
|
||||
required Attachment attachment,
|
||||
super.key,
|
||||
required super.message,
|
||||
required super.attachment,
|
||||
required this.messageTheme,
|
||||
Size? size,
|
||||
super.size,
|
||||
this.showTitle = false,
|
||||
this.onShowMessage,
|
||||
this.onReturnAction,
|
||||
this.onAttachmentTap,
|
||||
}) : super(
|
||||
key: key,
|
||||
message: message,
|
||||
attachment: attachment,
|
||||
size: size,
|
||||
);
|
||||
});
|
||||
|
||||
/// [StreamMessageThemeData] for showing image title
|
||||
final StreamMessageThemeData messageTheme;
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef UrlAttachment = StreamUrlAttachment;
|
||||
class StreamUrlAttachment extends StatelessWidget {
|
||||
/// Constructor for creating a [StreamUrlAttachment]
|
||||
const StreamUrlAttachment({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.urlAttachment,
|
||||
required this.hostDisplayName,
|
||||
required this.messageTheme,
|
||||
@@ -21,7 +21,7 @@ class StreamUrlAttachment extends StatelessWidget {
|
||||
vertical: 8,
|
||||
),
|
||||
this.onLinkTap,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
/// Attachment to be displayed
|
||||
final Attachment urlAttachment;
|
||||
@@ -70,7 +70,7 @@ class StreamUrlAttachment extends StatelessWidget {
|
||||
Positioned(
|
||||
left: 0,
|
||||
bottom: -1,
|
||||
child: Container(
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.only(
|
||||
topRight: Radius.circular(16),
|
||||
|
||||
@@ -14,20 +14,15 @@ typedef VideoAttachment = StreamVideoAttachment;
|
||||
class StreamVideoAttachment extends StreamAttachmentWidget {
|
||||
/// Constructor for creating a [StreamVideoAttachment] widget
|
||||
const StreamVideoAttachment({
|
||||
Key? key,
|
||||
required Message message,
|
||||
required Attachment attachment,
|
||||
super.key,
|
||||
required super.message,
|
||||
required super.attachment,
|
||||
required this.messageTheme,
|
||||
Size? size,
|
||||
super.size,
|
||||
this.onShowMessage,
|
||||
this.onReturnAction,
|
||||
this.onAttachmentTap,
|
||||
}) : super(
|
||||
key: key,
|
||||
message: message,
|
||||
attachment: attachment,
|
||||
size: size,
|
||||
);
|
||||
});
|
||||
|
||||
/// [StreamMessageThemeData] for showing title
|
||||
final StreamMessageThemeData messageTheme;
|
||||
|
||||
Reference in New Issue
Block a user