diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aa87863..8ea216f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.1.1 + +- [DSVideoMessageBubble] Added title to this bubble. +- [DSUrlPreview] Added visual feedback when tapped. + ## 0.1.0 - [DSExpandedImage] Fixed image layout when expanded. diff --git a/lib/src/models/interactive_message/ds_interactive_message_document.model.dart b/lib/src/models/interactive_message/ds_interactive_message_document.model.dart index 04f47902..8ba65343 100644 --- a/lib/src/models/interactive_message/ds_interactive_message_document.model.dart +++ b/lib/src/models/interactive_message/ds_interactive_message_document.model.dart @@ -8,9 +8,9 @@ class DSInteractiveMessageDocument extends DSInteractiveMessageMedia { this.filename, }); - DSInteractiveMessageDocument.fromJson(Map json) + DSInteractiveMessageDocument.fromJson(super.json) : filename = json['filename'], - super.fromJson(json); + super.fromJson(); @override Map toJson() => { diff --git a/lib/src/models/interactive_message/ds_interactive_message_image.model.dart b/lib/src/models/interactive_message/ds_interactive_message_image.model.dart index d54d9415..53f89ce7 100644 --- a/lib/src/models/interactive_message/ds_interactive_message_image.model.dart +++ b/lib/src/models/interactive_message/ds_interactive_message_image.model.dart @@ -1,6 +1,6 @@ import 'ds_interactive_message_media.model.dart'; class DSInteractiveMessageImage extends DSInteractiveMessageMedia { - DSInteractiveMessageImage.fromJson(Map json) - : super.fromJson(json); + DSInteractiveMessageImage.fromJson(super.json) + : super.fromJson(); } diff --git a/lib/src/models/interactive_message/ds_interactive_message_video.model.dart b/lib/src/models/interactive_message/ds_interactive_message_video.model.dart index a1f10ab0..a197a32b 100644 --- a/lib/src/models/interactive_message/ds_interactive_message_video.model.dart +++ b/lib/src/models/interactive_message/ds_interactive_message_video.model.dart @@ -1,6 +1,6 @@ import 'ds_interactive_message_media.model.dart'; class DSInteractiveMessageVideo extends DSInteractiveMessageMedia { - DSInteractiveMessageVideo.fromJson(Map json) - : super.fromJson(json); + DSInteractiveMessageVideo.fromJson(super.json) + : super.fromJson(); } diff --git a/lib/src/themes/icons/ds_icons.dart b/lib/src/themes/icons/ds_icons.dart index 0c9aa259..3d4c800e 100644 --- a/lib/src/themes/icons/ds_icons.dart +++ b/lib/src/themes/icons/ds_icons.dart @@ -1,22 +1,22 @@ -/// Flutter icons DSIcons -/// Copyright (C) 2022 by original authors @ fluttericon.com, fontello.com -/// This font was generated by FlutterIcon.com, which is derived from Fontello. -/// -/// To use this font, place it in your fonts/ directory and include the -/// following in your pubspec.yaml -/// -/// flutter: -/// fonts: -/// - family: DSIcons -/// fonts: -/// - asset: fonts/DSIcons.ttf -/// -/// -/// * Material Design Icons, Copyright (C) Google, Inc -/// Author: Google -/// License: Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0) -/// Homepage: https://design.google.com/icons/ -/// +// Flutter icons DSIcons +// Copyright (C) 2022 by original authors @ fluttericon.com, fontello.com +// This font was generated by FlutterIcon.com, which is derived from Fontello. +// +// To use this font, place it in your fonts/ directory and include the +// following in your pubspec.yaml +// +// flutter: +// fonts: +// - family: DSIcons +// fonts: +// - asset: fonts/DSIcons.ttf +// +// +// * Material Design Icons, Copyright (C) Google, Inc +// Author: Google +// License: Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0) +// Homepage: https://design.google.com/icons/ + import 'package:flutter/widgets.dart'; import 'ds_icon_data.dart'; diff --git a/lib/src/widgets/animations/ds_fading_circle_loading.widget.dart b/lib/src/widgets/animations/ds_fading_circle_loading.widget.dart index 2f3534ad..6572972f 100644 --- a/lib/src/widgets/animations/ds_fading_circle_loading.widget.dart +++ b/lib/src/widgets/animations/ds_fading_circle_loading.widget.dart @@ -8,10 +8,10 @@ class DSFadingCircleLoading extends StatelessWidget { /// A Design System's animated spinner fading circle primarily used by loading scenarios. const DSFadingCircleLoading({ - Key? key, + super.key, required this.color, this.size = 30.0, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/animations/ds_ring_loading.widget.dart b/lib/src/widgets/animations/ds_ring_loading.widget.dart index 54b7399e..e281a212 100644 --- a/lib/src/widgets/animations/ds_ring_loading.widget.dart +++ b/lib/src/widgets/animations/ds_ring_loading.widget.dart @@ -9,11 +9,11 @@ class DSRingLoading extends StatelessWidget { /// Creates a Design System's animated spinner ring. const DSRingLoading({ - Key? key, + super.key, required this.color, this.size = 24.0, this.lineWidth = 2.0, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/animations/ds_spinner_loading.widget.dart b/lib/src/widgets/animations/ds_spinner_loading.widget.dart index a96fc78d..97323f6c 100644 --- a/lib/src/widgets/animations/ds_spinner_loading.widget.dart +++ b/lib/src/widgets/animations/ds_spinner_loading.widget.dart @@ -6,13 +6,13 @@ import '../../themes/colors/ds_colors.theme.dart'; class DSSpinnerLoading extends StatefulWidget { const DSSpinnerLoading({ - Key? key, + super.key, this.color = DSColors.primary, this.lineWidth = 5.0, this.size = 30.0, this.duration = const Duration(milliseconds: 500), this.controller, - }) : super(key: key); + }); final Color color; final double size; diff --git a/lib/src/widgets/buttons/ds_menu_item.widget.dart b/lib/src/widgets/buttons/ds_menu_item.widget.dart index 7308eed6..f38f0498 100644 --- a/lib/src/widgets/buttons/ds_menu_item.widget.dart +++ b/lib/src/widgets/buttons/ds_menu_item.widget.dart @@ -4,15 +4,14 @@ import '../../../blip_ds.dart'; class DSMenuItem extends StatelessWidget { DSMenuItem({ - Key? key, + super.key, required this.text, required this.align, this.showDivider = false, this.onPressed, this.fontWeight = DSFontWeights.bold, DSMessageBubbleStyle? style, - }) : style = style ?? DSMessageBubbleStyle(), - super(key: key) { + }) : style = style ?? DSMessageBubbleStyle() { isDefaultBubbleColors = this.style.isDefaultBubbleBackground(align); isLightBubbleBackground = this.style.isLightBubbleBackground(align); } diff --git a/lib/src/widgets/chat/ds_carrousel.widget.dart b/lib/src/widgets/chat/ds_carrousel.widget.dart index 388563d1..4380625f 100644 --- a/lib/src/widgets/chat/ds_carrousel.widget.dart +++ b/lib/src/widgets/chat/ds_carrousel.widget.dart @@ -36,7 +36,7 @@ class DSCarrousel extends StatelessWidget { final DSMessageBubbleStyle style; DSCarrousel({ - Key? key, + super.key, required this.align, required this.content, required this.borderRadius, @@ -44,8 +44,7 @@ class DSCarrousel extends StatelessWidget { this.onOpenLink, this.avatarConfig = const DSMessageBubbleAvatarConfig(), DSMessageBubbleStyle? style, - }) : style = style ?? DSMessageBubbleStyle(), - super(key: key); + }) : style = style ?? DSMessageBubbleStyle(); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/chat/ds_delivery_report_icon.widget.dart b/lib/src/widgets/chat/ds_delivery_report_icon.widget.dart index d112b954..b6862617 100644 --- a/lib/src/widgets/chat/ds_delivery_report_icon.widget.dart +++ b/lib/src/widgets/chat/ds_delivery_report_icon.widget.dart @@ -13,9 +13,9 @@ class DSDeliveryReportIcon extends StatelessWidget { /// Creates a new Design System's [DSDeliveryReportIcon] const DSDeliveryReportIcon({ - Key? key, + super.key, required this.deliveryStatus, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/chat/ds_document_select.widget.dart b/lib/src/widgets/chat/ds_document_select.widget.dart index 1b26c917..db68a3fc 100644 --- a/lib/src/widgets/chat/ds_document_select.widget.dart +++ b/lib/src/widgets/chat/ds_document_select.widget.dart @@ -24,14 +24,13 @@ class DSDocumentSelect extends StatelessWidget { /// Creates a new Design System's [DSDocumentSelect] DSDocumentSelect({ - Key? key, + super.key, required this.align, required this.options, this.onSelected, this.onOpenLink, DSMessageBubbleStyle? style, - }) : style = style ?? DSMessageBubbleStyle(), - super(key: key); + }) : style = style ?? DSMessageBubbleStyle(); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/chat/ds_message_bubble.widget.dart b/lib/src/widgets/chat/ds_message_bubble.widget.dart index afa3bb07..4131b93c 100644 --- a/lib/src/widgets/chat/ds_message_bubble.widget.dart +++ b/lib/src/widgets/chat/ds_message_bubble.widget.dart @@ -22,7 +22,7 @@ class DSMessageBubble extends StatelessWidget { final bool hasSpacer; const DSMessageBubble({ - Key? key, + super.key, required this.align, required this.child, this.replyContent, @@ -36,7 +36,7 @@ class DSMessageBubble extends StatelessWidget { this.defaultMinSize = DSUtils.bubbleMinSize, required this.style, this.hasSpacer = true, - }) : super(key: key); + }); @override Widget build(BuildContext context) => Column( diff --git a/lib/src/widgets/chat/ds_message_bubble_detail.widget.dart b/lib/src/widgets/chat/ds_message_bubble_detail.widget.dart index 16c235f4..060b836d 100644 --- a/lib/src/widgets/chat/ds_message_bubble_detail.widget.dart +++ b/lib/src/widgets/chat/ds_message_bubble_detail.widget.dart @@ -18,15 +18,14 @@ class DSMessageBubbleDetail extends StatelessWidget { /// Creates a new Design System's [DSMessageBubbleDetail] const DSMessageBubbleDetail({ - Key? key, + super.key, required this.align, required this.deliveryStatus, required this.style, this.showMessageStatus = true, this.date, this.detailWidget, - }) : assert((date != null || detailWidget != null)), - super(key: key); + }) : assert((date != null || detailWidget != null)); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/chat/ds_quick_reply.widget.dart b/lib/src/widgets/chat/ds_quick_reply.widget.dart index 72318cd1..29a970a9 100644 --- a/lib/src/widgets/chat/ds_quick_reply.widget.dart +++ b/lib/src/widgets/chat/ds_quick_reply.widget.dart @@ -14,11 +14,11 @@ class DSQuickReply extends StatelessWidget { final void Function(String, Map)? onSelected; const DSQuickReply({ - Key? key, + super.key, required this.align, required this.content, this.onSelected, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/chat/ds_text_message_bubble.widget.dart b/lib/src/widgets/chat/ds_text_message_bubble.widget.dart index fc81bc89..841bf930 100644 --- a/lib/src/widgets/chat/ds_text_message_bubble.widget.dart +++ b/lib/src/widgets/chat/ds_text_message_bubble.widget.dart @@ -23,7 +23,7 @@ class DSTextMessageBubble extends StatefulWidget { final DSMessageBubbleStyle style; DSTextMessageBubble({ - Key? key, + super.key, required this.text, required this.align, this.replyContent, @@ -33,8 +33,7 @@ class DSTextMessageBubble extends StatefulWidget { this.showSelect = false, this.onSelected, DSMessageBubbleStyle? style, - }) : style = style ?? DSMessageBubbleStyle(), - super(key: key); + }) : style = style ?? DSMessageBubbleStyle(); @override State createState() => _DSTextMessageBubbleState(); diff --git a/lib/src/widgets/chat/ds_unsupported_content_message_bubble.widget.dart b/lib/src/widgets/chat/ds_unsupported_content_message_bubble.widget.dart index bb7732b9..9af52391 100644 --- a/lib/src/widgets/chat/ds_unsupported_content_message_bubble.widget.dart +++ b/lib/src/widgets/chat/ds_unsupported_content_message_bubble.widget.dart @@ -19,7 +19,7 @@ class DSUnsupportedContentMessageBubble extends StatelessWidget { final DSMessageBubbleStyle style; DSUnsupportedContentMessageBubble({ - Key? key, + super.key, required this.align, this.leftWidget, this.text, @@ -27,8 +27,7 @@ class DSUnsupportedContentMessageBubble extends StatelessWidget { this.overflow = TextOverflow.ellipsis, this.borderRadius = const [DSBorderRadius.all], DSMessageBubbleStyle? style, - }) : style = style ?? DSMessageBubbleStyle(), - super(key: key); + }) : style = style ?? DSMessageBubbleStyle(); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/chat/ds_url_preview.widget.dart b/lib/src/widgets/chat/ds_url_preview.widget.dart index fb2ccc08..4e2ea696 100644 --- a/lib/src/widgets/chat/ds_url_preview.widget.dart +++ b/lib/src/widgets/chat/ds_url_preview.widget.dart @@ -92,23 +92,26 @@ class _DSUrlPreviewState extends State } Widget _buildPreview() { - return GestureDetector( - onTap: () => launchUrl( - Uri.parse(_controller.urlPreview.value!.url), - mode: LaunchMode.inAppWebView, - ).ignore(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (_controller.urlPreview.value?.image != null) - _buildImage( - path: _controller.urlPreview.value!.image!, + return Material( + color: Colors.transparent, + child: InkWell( + onTap: () => launchUrl( + Uri.parse(_controller.urlPreview.value!.url), + mode: LaunchMode.inAppWebView, + ).ignore(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (_controller.urlPreview.value?.image != null) + _buildImage( + path: _controller.urlPreview.value!.image!, + ), + _buildBody( + title: _controller.urlPreview.value?.title, + description: _controller.urlPreview.value?.description, ), - _buildBody( - title: _controller.urlPreview.value?.title, - description: _controller.urlPreview.value?.description, - ), - ], + ], + ), ), ); } diff --git a/lib/src/widgets/chat/ds_weblink_message_bubble.widget.dart b/lib/src/widgets/chat/ds_weblink_message_bubble.widget.dart index c67f3e34..5d4592b1 100644 --- a/lib/src/widgets/chat/ds_weblink_message_bubble.widget.dart +++ b/lib/src/widgets/chat/ds_weblink_message_bubble.widget.dart @@ -34,7 +34,7 @@ class DSWeblinkMessageBubble extends StatelessWidget { final DSReplyContent? replyContent; DSWeblinkMessageBubble({ - Key? key, + super.key, required this.title, required this.text, required this.align, @@ -42,8 +42,7 @@ class DSWeblinkMessageBubble extends StatelessWidget { this.replyContent, this.borderRadius = const [DSBorderRadius.all], DSMessageBubbleStyle? style, - }) : style = style ?? DSMessageBubbleStyle(), - super(key: key); + }) : style = style ?? DSMessageBubbleStyle(); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/chat/typing/ds_typing_dot.widget.dart b/lib/src/widgets/chat/typing/ds_typing_dot.widget.dart index 8c6467c3..bc92f1ca 100644 --- a/lib/src/widgets/chat/typing/ds_typing_dot.widget.dart +++ b/lib/src/widgets/chat/typing/ds_typing_dot.widget.dart @@ -8,10 +8,10 @@ class DSTypingDot extends StatelessWidget { /// /// Set the dot size and color using the parameters [size] and [color] const DSTypingDot({ - Key? key, + super.key, required this.color, required this.size, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/chat/typing/ds_typing_dot_animation.widget.dart b/lib/src/widgets/chat/typing/ds_typing_dot_animation.widget.dart index d62c53c5..3cda108a 100644 --- a/lib/src/widgets/chat/typing/ds_typing_dot_animation.widget.dart +++ b/lib/src/widgets/chat/typing/ds_typing_dot_animation.widget.dart @@ -18,14 +18,14 @@ class DSTypingDotAnimation extends StatefulWidget { /// To change the animation speed use [animationTime] /// To set the dot ascent level use [tweenEndAnimation] const DSTypingDotAnimation({ - Key? key, + super.key, this.numberDots = 3, this.size = 7, this.padding = 2, this.animationTime = DSUtils.defaultAnimationDuration, required this.color, this.tweenEndAnimation = -3, - }) : super(key: key); + }); @override State createState() => _DSTypingDotAnimationState(); diff --git a/lib/src/widgets/chat/typing/ds_typing_message_bubble.widget.dart b/lib/src/widgets/chat/typing/ds_typing_message_bubble.widget.dart index f6fe78d0..cac0df1f 100644 --- a/lib/src/widgets/chat/typing/ds_typing_message_bubble.widget.dart +++ b/lib/src/widgets/chat/typing/ds_typing_message_bubble.widget.dart @@ -14,11 +14,10 @@ class DSTypingAnimationMessageBubble extends StatelessWidget { /// /// Use [align] left or right to position typing on screen DSTypingAnimationMessageBubble({ - Key? key, + super.key, required this.align, DSMessageBubbleStyle? style, - }) : style = style ?? DSMessageBubbleStyle(), - super(key: key); + }) : style = style ?? DSMessageBubbleStyle(); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/chat/video/ds_video_message_bubble.widget.dart b/lib/src/widgets/chat/video/ds_video_message_bubble.widget.dart index d8bed8c7..33fba6c1 100644 --- a/lib/src/widgets/chat/video/ds_video_message_bubble.widget.dart +++ b/lib/src/widgets/chat/video/ds_video_message_bubble.widget.dart @@ -14,6 +14,7 @@ import '../../../themes/icons/ds_icons.dart'; import '../../../utils/ds_utils.util.dart'; import '../../animations/ds_uploading.widget.dart'; import '../../buttons/ds_button.widget.dart'; +import '../../texts/ds_caption_text.widget.dart'; import '../../utils/ds_circular_progress.widget.dart'; import '../ds_message_bubble.widget.dart'; import '../ds_show_more_text.widget.dart'; @@ -57,6 +58,9 @@ class DSVideoMessageBubble extends StatefulWidget { // reply id message final DSReplyContent? replyContent; + /// Title of the video which will be displayed inside the message bubble. + final String? title; + /// Card for the purpose of triggering a video to play. /// /// This widget is intended to display a video card from a url passed in the [url] parameter. @@ -76,6 +80,7 @@ class DSVideoMessageBubble extends StatefulWidget { DSMessageBubbleStyle? style, this.isUploading = false, this.replyContent, + this.title, }) : style = style ?? DSMessageBubbleStyle(); @override @@ -110,6 +115,9 @@ class _DSVideoMessageBubbleState extends State Widget build(BuildContext context) { super.build(context); + final hasText = widget.text?.isNotEmpty ?? false; + final hasTitle = widget.title?.isNotEmpty ?? false; + final foregroundColor = widget.style.isLightBubbleBackground(widget.align) ? DSColors.neutralDarkCity : DSColors.neutralLightSnow; @@ -226,19 +234,31 @@ class _DSVideoMessageBubbleState extends State ) : _buidErrorIcon(), ), - if (widget.text?.isNotEmpty ?? false) + if (hasTitle || hasText) SizedBox( - width: DSUtils.bubbleMinSize, child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 8.0, - horizontal: 16.0, - ), - child: DSShowMoreText( - text: widget.text!, - align: widget.align, - style: widget.style, - maxWidth: constraints.maxWidth, + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (hasTitle) + DSCaptionText( + widget.title!, + color: foregroundColor, + isSelectable: true, + ), + if (hasTitle && hasText) + const SizedBox( + height: 6.0, + ), + if (hasText) + DSShowMoreText( + text: widget.text!, + align: widget.align, + style: widget.style, + maxWidth: constraints.maxWidth, + ) + ], ), ), ), diff --git a/lib/src/widgets/chat/video/ds_video_player.widget.dart b/lib/src/widgets/chat/video/ds_video_player.widget.dart index 264855a0..6799b0ca 100644 --- a/lib/src/widgets/chat/video/ds_video_player.widget.dart +++ b/lib/src/widgets/chat/video/ds_video_player.widget.dart @@ -26,7 +26,7 @@ class DSVideoPlayer extends StatelessWidget { /// In this video player, the slash text is passed by the [appBarText] parameter so that it is contractually shown in the slash. /// The [url] parameter contains the reference to be executed DSVideoPlayer({ - Key? key, + super.key, required this.appBarText, required String url, this.appBarPhotoUri, @@ -35,8 +35,7 @@ class DSVideoPlayer extends StatelessWidget { DSVideoPlayerController( url: url, ), - ), - super(key: key); + ); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/fields/ds_text_field.widget.dart b/lib/src/widgets/fields/ds_text_field.widget.dart index c7d924f3..88ec17f2 100644 --- a/lib/src/widgets/fields/ds_text_field.widget.dart +++ b/lib/src/widgets/fields/ds_text_field.widget.dart @@ -59,7 +59,7 @@ class _DSTextFieldState extends State { Widget build(BuildContext context) => Obx( () => Focus( focusNode: widget.focusNode, - onFocusChange: hasFocus, + onFocusChange: hasFocus.call, child: Column( children: [ DSInputContainer( diff --git a/lib/src/widgets/radio/ds_radio.widget.dart b/lib/src/widgets/radio/ds_radio.widget.dart index 6e6c0f63..0b615bf3 100644 --- a/lib/src/widgets/radio/ds_radio.widget.dart +++ b/lib/src/widgets/radio/ds_radio.widget.dart @@ -4,15 +4,13 @@ import '../../themes/colors/ds_colors.theme.dart'; class DSRadio extends Radio { const DSRadio({ - Key? key, + super.key, required super.value, required super.groupValue, required super.onChanged, super.materialTapTargetSize, this.isEnabled = true, - }) : super( - key: key, - ); + }); final bool isEnabled; diff --git a/lib/src/widgets/radio/ds_radio_tile.widget.dart b/lib/src/widgets/radio/ds_radio_tile.widget.dart index 154f95c9..57c6a9f5 100644 --- a/lib/src/widgets/radio/ds_radio_tile.widget.dart +++ b/lib/src/widgets/radio/ds_radio_tile.widget.dart @@ -13,7 +13,7 @@ class DSRadioTile extends StatelessWidget { /// ///To disable the radio button, use the [isEnabled] property const DSRadioTile({ - Key? key, + super.key, required this.value, required this.onChanged, required this.title, @@ -21,7 +21,7 @@ class DSRadioTile extends StatelessWidget { this.subTitle, this.isEnabled = true, this.contentPadding = const EdgeInsets.symmetric(vertical: 16.0), - }) : super(key: key); + }); /// Clickable radio group title allowing you to select an option. final Widget title; diff --git a/lib/src/widgets/switch/ds_switch.widget.dart b/lib/src/widgets/switch/ds_switch.widget.dart index 78afddd8..c662d04b 100644 --- a/lib/src/widgets/switch/ds_switch.widget.dart +++ b/lib/src/widgets/switch/ds_switch.widget.dart @@ -7,13 +7,11 @@ class DSSwitch extends DSSwitchBase { /// Creates a customizable switch for use alone or in conjunction with ListTile /// const DSSwitch({ - Key? key, + super.key, required super.onChanged, required super.value, super.isEnabled = true, - }) : super( - key: key, - ); + }); /// Animation duration for [DSSwitch] when activate or deactivate. final Duration _animationDuration = const Duration(milliseconds: 400); diff --git a/lib/src/widgets/switch/ds_switch_base.widget.dart b/lib/src/widgets/switch/ds_switch_base.widget.dart index 22dbdef5..beaf1371 100644 --- a/lib/src/widgets/switch/ds_switch_base.widget.dart +++ b/lib/src/widgets/switch/ds_switch_base.widget.dart @@ -2,13 +2,11 @@ import 'package:flutter/material.dart'; abstract class DSSwitchBase extends StatelessWidget { const DSSwitchBase({ - Key? key, + super.key, required this.onChanged, required this.value, this.isEnabled = true, - }) : super( - key: key, - ); + }); /// Callback performed when changing status [value] final ValueChanged onChanged; diff --git a/lib/src/widgets/switch/ds_switch_tile.widget.dart b/lib/src/widgets/switch/ds_switch_tile.widget.dart index 0d8ce093..f6a73248 100644 --- a/lib/src/widgets/switch/ds_switch_tile.widget.dart +++ b/lib/src/widgets/switch/ds_switch_tile.widget.dart @@ -9,14 +9,14 @@ class DSSwitchTile extends DSSwitchBase { /// It is mandatory to inform three parameters: [value], enabling or disabling the switch, [onChanged], /// the event that will be executed when changing the value, and [title], which is the title of the tile. const DSSwitchTile({ - Key? key, + super.key, required super.value, required super.onChanged, super.isEnabled = true, required this.title, this.leading, this.contentPadding, - }) : super(key: key); + }); /// Switchtile title to be shown referring to the switch final Widget? title; diff --git a/lib/src/widgets/tags/ds_input_chip.widget.dart b/lib/src/widgets/tags/ds_input_chip.widget.dart index 9fd96be3..271b142d 100644 --- a/lib/src/widgets/tags/ds_input_chip.widget.dart +++ b/lib/src/widgets/tags/ds_input_chip.widget.dart @@ -18,14 +18,14 @@ class DSInputChip extends StatefulWidget { final ScrollController? scrollController; const DSInputChip({ - Key? key, + super.key, required this.values, required this.controller, this.hintText, this.onTextChanged, this.onDeleted, this.scrollController, - }) : super(key: key); + }); @override State createState() => _DSInputChipState(); diff --git a/lib/src/widgets/tags/tag_editor/tag_editor.dart b/lib/src/widgets/tags/tag_editor/tag_editor.dart index ad87215d..2b48a5b4 100644 --- a/lib/src/widgets/tags/tag_editor/tag_editor.dart +++ b/lib/src/widgets/tags/tag_editor/tag_editor.dart @@ -28,7 +28,7 @@ class TagEditor extends StatefulWidget { required this.onTagChanged, required this.suggestionBuilder, required this.findSuggestions, - Key? key, + super.key, this.focusNode, this.hasAddButton = true, this.delimiters = const [], @@ -69,7 +69,7 @@ class TagEditor extends StatefulWidget { this.suggestionPadding, this.suggestionMargin, this.scrollController, - }) : super(key: key); + }); /// The controller of scroll in tag box area final ScrollController? scrollController; diff --git a/lib/src/widgets/tags/tag_editor/tag_layout.dart b/lib/src/widgets/tags/tag_editor/tag_layout.dart index e2403817..29fa73ea 100644 --- a/lib/src/widgets/tags/tag_editor/tag_layout.dart +++ b/lib/src/widgets/tags/tag_editor/tag_layout.dart @@ -6,10 +6,10 @@ import './tag_render_layout_box.dart'; /// overrided [createRenderObject] to use custom [RenderCustomMultiChildLayoutBox] class TagLayout extends CustomMultiChildLayout { const TagLayout({ - Key? key, - required TagEditorLayoutDelegate delegate, - List children = const [], - }) : super(key: key, children: children, delegate: delegate); + super.key, + required TagEditorLayoutDelegate super.delegate, + super.children, + }); @override TagRenderLayoutBox createRenderObject(BuildContext context) { diff --git a/lib/src/widgets/tags/tag_editor/tag_render_layout_box.dart b/lib/src/widgets/tags/tag_editor/tag_render_layout_box.dart index abb9e419..a8979445 100644 --- a/lib/src/widgets/tags/tag_editor/tag_render_layout_box.dart +++ b/lib/src/widgets/tags/tag_editor/tag_render_layout_box.dart @@ -5,9 +5,9 @@ import './tag_editor_layout_delegate.dart'; /// https://gist.github.com/slightfoot/0ddf14dd0f77e5be4c6b8904d3a2df67 class TagRenderLayoutBox extends RenderCustomMultiChildLayoutBox { TagRenderLayoutBox({ - List? children, - required TagEditorLayoutDelegate delegate, - }) : super(children: children, delegate: delegate); + super.children, + required TagEditorLayoutDelegate super.delegate, + }); @override void performLayout() { diff --git a/lib/src/widgets/utils/ds_cached_network_image_view.widget.dart b/lib/src/widgets/utils/ds_cached_network_image_view.widget.dart index d1daca1a..efd3c880 100644 --- a/lib/src/widgets/utils/ds_cached_network_image_view.widget.dart +++ b/lib/src/widgets/utils/ds_cached_network_image_view.widget.dart @@ -29,7 +29,7 @@ class DSCachedNetworkImageView extends StatelessWidget { )? errorWidget; DSCachedNetworkImageView({ - Key? key, + super.key, required this.url, required this.align, this.width, @@ -40,8 +40,7 @@ class DSCachedNetworkImageView extends StatelessWidget { this.onError, this.shouldAuthenticate = false, DSMessageBubbleStyle? style, - }) : style = style ?? DSMessageBubbleStyle(), - super(key: key); + }) : style = style ?? DSMessageBubbleStyle(); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/utils/ds_card.widget.dart b/lib/src/widgets/utils/ds_card.widget.dart index 203265d8..1faa9e49 100644 --- a/lib/src/widgets/utils/ds_card.widget.dart +++ b/lib/src/widgets/utils/ds_card.widget.dart @@ -313,6 +313,7 @@ class DSCard extends StatelessWidget { ? avatarConfig.receivedAvatar : avatarConfig.sentAvatar, text: media.text, + title: media.title, replyContent: replyContent, borderRadius: borderRadius, style: style, diff --git a/lib/src/widgets/utils/ds_header.widget.dart b/lib/src/widgets/utils/ds_header.widget.dart index 678c94cf..af567585 100644 --- a/lib/src/widgets/utils/ds_header.widget.dart +++ b/lib/src/widgets/utils/ds_header.widget.dart @@ -33,7 +33,7 @@ class DSHeader extends StatelessWidget implements PreferredSizeWidget { late final bool isBackgroundLight; DSHeader({ - Key? key, + super.key, required this.title, this.subtitle, this.customerName, @@ -52,8 +52,7 @@ class DSHeader extends StatelessWidget implements PreferredSizeWidget { this.visible = true, final SystemUiOverlayStyle? systemUiOverlayStyle, }) : systemUiOverlayStyle = - systemUiOverlayStyle ?? DSSystemOverlayStyle.dark, - super(key: key) { + systemUiOverlayStyle ?? DSSystemOverlayStyle.dark { isBackgroundLight = backgroundColor.computeLuminance() > 0.5; } diff --git a/pubspec.yaml b/pubspec.yaml index e66f610f..9e355a7f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: blip_ds description: Blip Design System for Flutter. -version: 0.1.0 +version: 0.1.1 homepage: https://github.com/takenet/blip-ds-flutter#readme repository: https://github.com/takenet/blip-ds-flutter diff --git a/sample/pubspec.lock b/sample/pubspec.lock index 7784a0fb..62412119 100644 --- a/sample/pubspec.lock +++ b/sample/pubspec.lock @@ -31,7 +31,7 @@ packages: path: ".." relative: true source: path - version: "0.0.98" + version: "0.1.1" boolean_selector: dependency: transitive description: