diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 134cce95..7e1bcd30 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @benken @mikecoomber @thelukewalton \ No newline at end of file +* @ZebraDevs/front-end-devs \ No newline at end of file diff --git a/lib/src/components/badges/label.dart b/lib/src/components/badges/label.dart index 53f7f02d..b9e8f5b8 100644 --- a/lib/src/components/badges/label.dart +++ b/lib/src/components/badges/label.dart @@ -3,10 +3,6 @@ import 'package:flutter/material.dart'; import '../../../zeta_flutter.dart'; -///Zeta Badge. -@Deprecated('Use ZetaLabel instead. ' 'This widget has been renamed as of 0.11.0') -typedef ZetaBadge = ZetaLabel; - /// Text badges notify users of line items that need attention. /// {@category Components} /// diff --git a/lib/src/components/badges/priority_pill.dart b/lib/src/components/badges/priority_pill.dart index 1b92d041..6582a7c2 100644 --- a/lib/src/components/badges/priority_pill.dart +++ b/lib/src/components/badges/priority_pill.dart @@ -1,5 +1,3 @@ -// ignore_for_file: deprecated_member_use_from_same_package - import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -69,7 +67,6 @@ class ZetaPriorityPill extends ZetaStatelessWidget { super.rounded, super.key, this.index, - @Deprecated('Use label instead. ' 'This variable has been renamed as of 0.11.0') this.priority, this.label, this.isBadge = false, this.type = ZetaPriorityPillType.urgent, @@ -87,10 +84,6 @@ class ZetaPriorityPill extends ZetaStatelessWidget { /// * Low = 3 final String? index; - /// Text in main part of component. - @Deprecated('Use label instead. ' 'This variable has been renamed as of 0.11.0') - final String? priority; - /// Text in main part of component. final String? label; @@ -125,7 +118,7 @@ class ZetaPriorityPill extends ZetaStatelessWidget { final Color lozengeColor = customColor?.shade10 ?? type._lozengeColor(context); final size = this.size == ZetaPriorityPillSize.small ? Zeta.of(context).spacing.xl : Zeta.of(context).spacing.xl_3; - final label = (this.label ?? priority) ?? type.name.capitalize(); + final label = this.label ?? type.name.capitalize(); final rounded = context.rounded; return Semantics( @@ -195,7 +188,6 @@ class ZetaPriorityPill extends ZetaStatelessWidget { ..add(EnumProperty('size', size)) ..add(StringProperty('label', label)) ..add(ColorProperty('customColor', customColor)) - ..add(StringProperty('priority', priority)) ..add(StringProperty('semanticLabel', semanticLabel)); } } diff --git a/lib/src/components/banner/banner.dart b/lib/src/components/banner/banner.dart index 6f74dde4..4991e43f 100644 --- a/lib/src/components/banner/banner.dart +++ b/lib/src/components/banner/banner.dart @@ -1,4 +1,3 @@ -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import '../../../zeta_flutter.dart'; @@ -43,9 +42,6 @@ class ZetaBanner extends MaterialBanner { /// Whether the title should be centered. bool titleCenter = false, - /// Whether the title should be centered. - @Deprecated('Use titleCenter instead. ' 'This attribute has been renamed as of 0.18.0') bool? titleStart, - /// The trailing widget for the banner. Widget? trailing, @@ -58,25 +54,22 @@ class ZetaBanner extends MaterialBanner { String? semanticLabel, }) : super( dividerColor: Colors.transparent, + onVisible: () { + if (PlatformIs.android) { + final backgroundColor = _backgroundColorFromType(context, type); + + SystemChrome.setSystemUIOverlayStyle( + SystemUiOverlayStyle( + statusBarColor: backgroundColor, + systemNavigationBarIconBrightness: backgroundColor.isDark ? Brightness.light : Brightness.dark, + ), + ); + } + }, content: Builder( builder: (context) { - final backgroundColor = _backgroundColorFromType(context, type); final foregroundColor = Zeta.of(context).colors.mainInverse; - if (!kIsWeb && PlatformIs.android && context.mounted) { - // ignore: invalid_use_of_visible_for_testing_member - final statusBarColor = SystemChrome.latestStyle?.statusBarColor; - if (statusBarColor != backgroundColor) { - SystemChrome.setSystemUIOverlayStyle( - SystemUiOverlayStyle( - statusBarColor: backgroundColor, - systemNavigationBarIconBrightness: backgroundColor.isDark ? Brightness.light : Brightness.dark, - ), - ); - } - } - // ignore: no_leading_underscores_for_local_identifiers - final _titleCenter = titleStart ?? titleCenter; return ZetaRoundedScope( rounded: rounded ?? context.rounded, child: Semantics( @@ -87,7 +80,7 @@ class ZetaBanner extends MaterialBanner { overflow: TextOverflow.ellipsis, ), child: Stack( - alignment: _titleCenter ? Alignment.center : Alignment.centerLeft, + alignment: titleCenter ? Alignment.center : Alignment.centerLeft, children: [ if (leadingIcon != null) Positioned( @@ -103,7 +96,7 @@ class ZetaBanner extends MaterialBanner { ), Padding( padding: - !_titleCenter && leadingIcon != null ? const EdgeInsets.only(left: 40) : EdgeInsets.zero, + !titleCenter && leadingIcon != null ? const EdgeInsets.only(left: 40) : EdgeInsets.zero, child: Text( title, style: ZetaTextStyles.labelLarge.copyWith( diff --git a/lib/src/components/breadcrumb/breadcrumb.dart b/lib/src/components/breadcrumb/breadcrumb.dart index eb78c105..d4dfb78e 100644 --- a/lib/src/components/breadcrumb/breadcrumb.dart +++ b/lib/src/components/breadcrumb/breadcrumb.dart @@ -24,7 +24,7 @@ class ZetaBreadcrumb extends ZetaStatefulWidget { /// Breadcrumb children final List children; - /// Semantic label passed to [_TruncatedItem]. + /// Semantic label passed to [TruncatedItem]. /// {@macro zeta-widget-semantic-label} final String? moreSemanticLabel; @@ -121,7 +121,7 @@ class _ZetaBreadcrumbsState extends State { truncatedChildren.add(createBreadCrumb(element, index + 1)); } returnList - .add(_TruncatedItem(semanticLabel: widget.moreSemanticLabel ?? 'View More', children: truncatedChildren)); + .add(TruncatedItem(semanticLabel: widget.moreSemanticLabel ?? 'View More', children: truncatedChildren)); for (final (index, element) in children.sublist(children.length - (widget.maxItemsShown - 1)).indexed) { returnList.add(createBreadCrumb(element, index + children.length - (widget.maxItemsShown) + 1)); @@ -246,13 +246,12 @@ class ZetaBreadcrumbItem extends ZetaStatelessWidget { } } -/// Class for [_TruncatedItem] -@Deprecated('This functionality is not needed anymore. Use [ZetaBreadcrumb] instead. ' 'Deprecated since 0.14.1') -typedef TruncatedItem = _TruncatedItem; - -class _TruncatedItem extends StatefulWidget { - ///Constructor for [_TruncatedItem] - const _TruncatedItem({ +/// Class for truncated [ZetaBreadcrumbItem]. +@visibleForTesting +class TruncatedItem extends StatefulWidget { + ///Constructor for [TruncatedItem] + const TruncatedItem({ + super.key, required this.children, required this.semanticLabel, }); @@ -266,7 +265,7 @@ class _TruncatedItem extends StatefulWidget { final String semanticLabel; @override - State<_TruncatedItem> createState() => _TruncatedItemState(); + State createState() => _TruncatedItemState(); @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); @@ -274,7 +273,7 @@ class _TruncatedItem extends StatefulWidget { } } -class _TruncatedItemState extends State<_TruncatedItem> { +class _TruncatedItemState extends State { bool _expanded = false; @override diff --git a/lib/src/components/chat_item/chat_item.dart b/lib/src/components/chat_item/chat_item.dart index b5cb93fa..268ad657 100644 --- a/lib/src/components/chat_item/chat_item.dart +++ b/lib/src/components/chat_item/chat_item.dart @@ -1,4 +1,3 @@ -// ignore_for_file: deprecated_member_use_from_same_package import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; @@ -31,10 +30,6 @@ class ZetaChatItem extends ZetaStatelessWidget { this.slidableActions = const [], this.explicitChildNodes = true, this.paleButtonColors, - @Deprecated('Use slidableActions instead.' ' This variable has been replaced as of 0.12.1') this.onMenuMoreTap, - @Deprecated('Use slidableActions instead.' ' This variable has been replaced as of 0.12.1') this.onCallTap, - @Deprecated('Use slidableActions instead.' ' This variable has been replaced as of 0.12.1') this.onDeleteTap, - @Deprecated('Use slidableActions instead.' ' This variable has been replaced as of 0.12.1') this.onPttTap, }); /// Whether to apply different background color. @@ -87,22 +82,6 @@ class ZetaChatItem extends ZetaStatelessWidget { /// Pale buttons was the default behavior before 0.15.2, but now buttons have darker colors by default. final bool? paleButtonColors; - /// Callback for slidable action - menu more. - @Deprecated('Use slidableActions instead.' ' This variable has been replaced as of 0.12.1') - final VoidCallback? onMenuMoreTap; - - /// Callback for slidable action - call. - @Deprecated('Use slidableActions instead.' ' This variable has been replaced as of 0.12.1') - final VoidCallback? onCallTap; - - /// Callback for slidable action - delete. - @Deprecated('Use slidableActions instead.' ' This variable has been replaced as of 0.12.1') - final VoidCallback? onDeleteTap; - - /// Callback for slidable action - ptt. - @Deprecated('Use slidableActions instead.' ' This variable has been replaced as of 0.12.1') - final VoidCallback? onPttTap; - /// List of slidable actions. /// /// The actions are displayed in the order they are provided; from left to right. @@ -138,21 +117,6 @@ class ZetaChatItem extends ZetaStatelessWidget { final actions = [...slidableActions]; - // coverage:ignore-start - if (onMenuMoreTap != null) { - actions.add(ZetaSlidableAction.menuMore(onPressed: onMenuMoreTap)); - } - if (onCallTap != null) { - actions.add(ZetaSlidableAction.call(onPressed: onCallTap)); - } - if (onPttTap != null) { - actions.add(ZetaSlidableAction.ptt(onPressed: onPttTap)); - } - if (onDeleteTap != null) { - actions.add(ZetaSlidableAction.delete(onPressed: onDeleteTap)); - } - // coverage:ignore-end - return ZetaRoundedScope( rounded: context.rounded, child: Semantics( @@ -344,10 +308,6 @@ class ZetaChatItem extends ZetaStatelessWidget { ..add(IntProperty('count', count)) ..add(ObjectFlagProperty.has('onTap', onTap)) ..add(DiagnosticsProperty('starred', starred)) - ..add(ObjectFlagProperty.has('onMenuMoreTap', onMenuMoreTap)) - ..add(ObjectFlagProperty.has('onCallTap', onCallTap)) - ..add(ObjectFlagProperty.has('onDeleteTap', onDeleteTap)) - ..add(ObjectFlagProperty.has('onPttTap', onPttTap)) ..add(DiagnosticsProperty('explicitChildNodes', explicitChildNodes)) ..add(DiagnosticsProperty('paleButtonColors', paleButtonColors)); } diff --git a/lib/src/components/components.dart b/lib/src/components/components.dart index acaa56b2..e5c03397 100644 --- a/lib/src/components/components.dart +++ b/lib/src/components/components.dart @@ -9,7 +9,7 @@ export 'badges/tag.dart'; export 'banner/banner.dart'; export 'bottom sheets/bottom_sheet.dart'; export 'bottom sheets/menu_items.dart'; -export 'breadcrumb/breadcrumb.dart'; +export 'breadcrumb/breadcrumb.dart' hide TruncatedItem; export 'button_group/button_group.dart'; export 'buttons/button.dart'; export 'buttons/button_style.dart'; diff --git a/lib/src/components/dropdown/dropdown.dart b/lib/src/components/dropdown/dropdown.dart index cf788bd1..6b4d0cda 100644 --- a/lib/src/components/dropdown/dropdown.dart +++ b/lib/src/components/dropdown/dropdown.dart @@ -66,7 +66,6 @@ class ZetaDropdown extends ZetaStatefulWidget { super.rounded, required this.items, this.onChange, - @Deprecated('Set onChange to null. ' 'Disabled is deprecated as of 0.11.0') bool disabled = false, this.value, this.type = ZetaDropdownMenuType.standard, this.size = ZetaDropdownSize.standard, diff --git a/lib/src/components/fabs/fab.dart b/lib/src/components/fabs/fab.dart index 2e731ef1..183b70fe 100644 --- a/lib/src/components/fabs/fab.dart +++ b/lib/src/components/fabs/fab.dart @@ -108,10 +108,9 @@ class ZetaFAB extends StatefulWidget { this.shape = ZetaWidgetBorder.full, this.icon = ZetaIcons.add, bool? expanded, - @Deprecated('Please use expanded instead. ' 'Deprecated in 0.15.0') bool? initiallyExpanded, this.focusNode, super.key, - }) : expanded = expanded ?? initiallyExpanded ?? label != null; + }) : expanded = expanded ?? label != null; /// Defines the color of the button. /// diff --git a/lib/src/components/global_header/global_header.dart b/lib/src/components/global_header/global_header.dart index c34d3049..00bac4d4 100644 --- a/lib/src/components/global_header/global_header.dart +++ b/lib/src/components/global_header/global_header.dart @@ -8,7 +8,7 @@ import '../../../zeta_flutter.dart'; /// This component should not be used as an appbar in a scaffold. /// It can be used in custom scroll views and columns. /// -/// ``` +/// ```dart /// SingleChildScrollView( /// child: Column(children: [ /// ZetaGlobalHeader( diff --git a/lib/src/components/navigation_rail/navigation_rail.dart b/lib/src/components/navigation_rail/navigation_rail.dart index 6b7834cc..772c7af4 100644 --- a/lib/src/components/navigation_rail/navigation_rail.dart +++ b/lib/src/components/navigation_rail/navigation_rail.dart @@ -40,21 +40,21 @@ class ZetaNavigationRail extends ZetaStatelessWidget { /// The margin around the [ZetaNavigationRail]. /// If undefined, defaults to: - /// ``` + /// ```dart /// EdgeInsets.all(Zeta.of(context).spacing.xl) /// ``` final EdgeInsets? margin; /// The spacing between items in [ZetaNavigationRail]. /// If undefined, defaults to: - /// ``` + /// ```dart /// EdgeInsets.only(bottom: Zeta.of(context).spacing.minimum) /// ``` final EdgeInsets? itemSpacing; /// The padding within an item in [ZetaNavigationRail]. /// Default is: - /// ``` + /// ```dart /// EdgeInsets.symmetric( /// horizontal: Zeta.of(context).spacing.small, /// vertical: Zeta.of(context).spacing.medium, diff --git a/lib/src/components/pagination/pagination.dart b/lib/src/components/pagination/pagination.dart index 872fdcc3..6bc26d36 100644 --- a/lib/src/components/pagination/pagination.dart +++ b/lib/src/components/pagination/pagination.dart @@ -29,7 +29,6 @@ class ZetaPagination extends ZetaStatefulWidget { this.type = ZetaPaginationType.standard, this.onChange, this.currentPage = 1, - @Deprecated('Set onChange to null. ' 'Disabled is deprecated as of 0.11.0') bool disabled = false, this.semanticFirst, this.semanticPrevious, this.semanticNext, diff --git a/lib/src/components/password/password_input.dart b/lib/src/components/password/password_input.dart index 152de9f8..680b22e8 100644 --- a/lib/src/components/password/password_input.dart +++ b/lib/src/components/password/password_input.dart @@ -26,7 +26,6 @@ class ZetaPasswordInput extends ZetaTextFormField { this.size = ZetaWidgetSize.medium, super.validator, this.onSubmit, - @Deprecated('Use disabled instead. ' 'This property has been renamed as of 0.11.2') bool enabled = true, super.controller, this.hintText, this.errorText, diff --git a/lib/src/components/phone_input/phone_input.dart b/lib/src/components/phone_input/phone_input.dart index 8dff36ad..b32c0afb 100644 --- a/lib/src/components/phone_input/phone_input.dart +++ b/lib/src/components/phone_input/phone_input.dart @@ -39,24 +39,14 @@ class ZetaPhoneInput extends ZetaFormField { super.onSaved, super.initialValue, super.validator, - @Deprecated('Use onChange instead. ' 'Deprecated as of 0.15.0') ValueChanged? onChanged, super.onChange, super.requirementLevel = ZetaFormFieldRequirement.none, this.label, - @Deprecated('Use hintText instead. ' 'Deprecated as of 0.15.0') String? hint, this.hintText, - @Deprecated('Use disabled instead. ' 'Deprecated as of 0.15.0') bool enabled = true, super.disabled = false, - @Deprecated('Use errorText instead. ' 'Deprecated as of 0.15.0') bool hasError = false, this.errorText, - @Deprecated('Use initialValue instead. ' 'Deprecated as of 0.15.0') String? initialCountry, this.countries, this.size = ZetaWidgetSize.medium, - @Deprecated('Set this as part of the initial value instead. ' 'Deprecated as of 0.15.0') String? countryDialCode, - @Deprecated('Set this as part of the initial value instead. ' 'enabled is deprecated as of 0.15.0') - String? phoneNumber, - @Deprecated('Country search hint is deprecated as of 0.15.0') String? countrySearchHint, - @Deprecated('Deprecated as of 0.15.0') bool? useRootNavigator, this.selectCountrySemanticLabel, super.autovalidateMode, }) : super( diff --git a/lib/src/components/progress/progress_circle.dart b/lib/src/components/progress/progress_circle.dart index b9f025e0..e4ac570b 100644 --- a/lib/src/components/progress/progress_circle.dart +++ b/lib/src/components/progress/progress_circle.dart @@ -66,10 +66,6 @@ class ZetaProgressCircle extends ZetaProgress { } } -/// Class definition for [_ZetaProgressCircleState] -@Deprecated('Deprecated in 0.14.1') -typedef ZetaProgressCircleState = _ZetaProgressCircleState; - /// Class definition for [_ZetaProgressCircleState] class _ZetaProgressCircleState extends ZetaProgressState { final _controller = WidgetStatesController(); @@ -198,10 +194,6 @@ class _ZetaProgressCircleState extends ZetaProgressState { } } -/// Class definition for [CirclePainter] -@Deprecated('Deprecated in 0.14.1') -typedef CirclePainter = _CirclePainter; - /// Class definition for [_CirclePainter] class _CirclePainter extends CustomPainter { ///Constructor for [_CirclePainter] diff --git a/lib/src/components/search_bar/search_bar.dart b/lib/src/components/search_bar/search_bar.dart index 8735983a..4287965c 100644 --- a/lib/src/components/search_bar/search_bar.dart +++ b/lib/src/components/search_bar/search_bar.dart @@ -18,7 +18,6 @@ class ZetaSearchBar extends ZetaTextFormField { super.validator, super.onSaved, super.onChange, - @Deprecated('Use onFieldSubmitted instead. ' 'deprecated as of 0.15.0') ValueChanged? onSubmit, super.onFieldSubmitted, super.requirementLevel, super.controller, @@ -26,19 +25,14 @@ class ZetaSearchBar extends ZetaTextFormField { super.initialValue, this.size = ZetaWidgetSize.medium, this.shape = ZetaWidgetBorder.rounded, - @Deprecated('hint has been removed. ' 'deprecated as of 0.15.0') String? hint, - @Deprecated('Use placeholder instead. ' 'deprecated as of 0.16.0') String? hintText, this.placeholder, this.onSpeechToText, this.showSpeechToText = true, - @Deprecated('Use disabled instead. ' 'enabled is deprecated as of 0.11.0') bool enabled = true, this.focusNode, this.textInputAction, this.microphoneSemanticLabel, this.clearSemanticLabel, super.key, - @Deprecated('Show leading icon is deprecated as of 0.14.2') bool showLeadingIcon = true, - @Deprecated('Use onChange instead') ValueChanged? onChanged, }) : super( builder: (field) { final zeta = Zeta.of(field.context); diff --git a/lib/src/components/slider/slider.dart b/lib/src/components/slider/slider.dart index 9df25cb1..6058590f 100644 --- a/lib/src/components/slider/slider.dart +++ b/lib/src/components/slider/slider.dart @@ -130,10 +130,6 @@ class _ZetaSliderState extends State { } } -/// Custom slider thumb component -@Deprecated('Deprecated in 0.14.1') -typedef SliderThumb = _SliderThumb; - /// Custom slider thumb component class _SliderThumb extends SliderComponentShape { /// Constructor for [_SliderThumb] diff --git a/lib/src/components/snack_bar/snack_bar.dart b/lib/src/components/snack_bar/snack_bar.dart index 82fbf86e..96ea7433 100644 --- a/lib/src/components/snack_bar/snack_bar.dart +++ b/lib/src/components/snack_bar/snack_bar.dart @@ -70,16 +70,6 @@ class ZetaSnackBar extends SnackBar { /// Depending on the `type`, the default label will be used; 'Undo' for [ZetaSnackBarType.deletion] and 'View' for [ZetaSnackBarType.view]. String? actionLabel, - /// Label for the delete action button. - /// - /// If null, 'Delete' will be used. - @Deprecated('Use actionLabel instead.' ' Deprecated in 0.12.1') String? deleteActionLabel, - - /// Label for the view action button. - /// - /// If null, 'View' will be used. - @Deprecated('Use actionLabel instead.' ' Deprecated in 0.12.1') String? viewActionLabel, - /// Semantic label for the action button. /// /// If null, the `actionLabel` will be used. @@ -119,8 +109,6 @@ class ZetaSnackBar extends SnackBar { type: type, actionLabel: actionLabel, onPressed: onPressed, - deleteActionLabel: deleteActionLabel, - viewActionLabel: viewActionLabel, semanticLabel: actionSemanticLabel, ), ], @@ -194,16 +182,12 @@ class _Action extends StatelessWidget { required this.type, required this.actionLabel, required this.onPressed, - required this.deleteActionLabel, - required this.viewActionLabel, this.semanticLabel, }); final String? actionLabel; - final String? deleteActionLabel; final VoidCallback? onPressed; final ZetaSnackBarType? type; - final String? viewActionLabel; final String? semanticLabel; @override @@ -212,9 +196,7 @@ class _Action extends StatelessWidget { properties ..add(EnumProperty('type', type)) ..add(StringProperty('actionLabel', actionLabel)) - ..add(StringProperty('deleteActionLabel', deleteActionLabel)) ..add(ObjectFlagProperty.has('onPressed', onPressed)) - ..add(StringProperty('viewActionLabel', viewActionLabel)) ..add(StringProperty('semanticLabel', semanticLabel)); } @@ -225,9 +207,9 @@ class _Action extends StatelessWidget { String? label = actionLabel; if (label == null) { if (type case ZetaSnackBarType.deletion) { - label = deleteActionLabel ?? 'Undo'; + label = 'Undo'; // TODO(UX-1003): Localize } else if (type case ZetaSnackBarType.view) { - label = viewActionLabel ?? 'View'; + label = 'View'; // TODO(UX-1003): Localize } } diff --git a/lib/src/components/stepper/stepper.dart b/lib/src/components/stepper/stepper.dart index c6bf2670..4ca47bbd 100644 --- a/lib/src/components/stepper/stepper.dart +++ b/lib/src/components/stepper/stepper.dart @@ -493,20 +493,11 @@ class ZetaStep { /// Creates a step for a [ZetaStepper]. const ZetaStep({ required this.title, - @Deprecated('Steps no longer manage their own content. ' 'Deprecated as of 0.16.1') this.content, this.subtitle, this.disabled = false, this.semanticLabel, - @Deprecated( - 'To disable a step, set its disabled prop to true. To complete a step, set the currentStep prop on the stepper greater than the step index. ' - 'Deprecated as of 0.16.1') - this.type = ZetaStepType.disabled, }); - /// The content of the step that appears below the [title] and [subtitle]. - @Deprecated('Steps no longer manage their own content. ' 'Deprecated as of 0.16.1') - final Widget? content; - /// The subtitle of the step that appears above the title. final Widget? subtitle; @@ -518,28 +509,6 @@ class ZetaStep { /// Whether the step is disabled and does not react to taps. final bool disabled; - - /// The type of the step which determines the styling of its components - /// and whether steps are interactive. - @Deprecated( - 'To disable a step, set its disabled prop to true. To complete a step, set the activeStep prop on the stepper greater than the step index. ' - 'Deprecated as of 0.16.1') - final ZetaStepType type; -} - -/// The type of a [ZetaStep] which is used to control the style of the circle and text. -@Deprecated( - 'To disable a step, set its disabled prop to true. To complete a step, set the activeStep prop on the stepper greater than the step index. ' - 'Deprecated as of 0.16.1') -enum ZetaStepType { - /// A step that is currently selected with primary color icon - enabled, - - /// A step that displays a tick icon in its circle. - complete, - - /// A step that is disabled and does not to react to taps. - disabled, } /// Defines the [ZetaStepper]'s main axis. diff --git a/lib/src/components/stepper_input/stepper_input.dart b/lib/src/components/stepper_input/stepper_input.dart index 34e7e843..e4061ae0 100644 --- a/lib/src/components/stepper_input/stepper_input.dart +++ b/lib/src/components/stepper_input/stepper_input.dart @@ -27,16 +27,14 @@ class ZetaStepperInput extends ZetaStatefulWidget { super.key, super.rounded, this.size = ZetaStepperInputSize.medium, - int? value, - @Deprecated('Use value instead. ' 'Deprecated in 0.15.0') int? initialValue, + this.value, this.min, this.max, this.onChange, this.semanticDecrement, this.semanticIncrement, - }) : value = value ?? initialValue, - assert( - (min == null || (initialValue ?? 0) >= min) && (max == null || (initialValue ?? 0) <= max), + }) : assert( + (min == null || (value ?? 0) >= min) && (max == null || (value ?? 0) <= max), 'Initial value must be inside given min and max values', ); diff --git a/lib/src/components/switch/material_switch.dart b/lib/src/components/switch/material_switch.dart index c4084e3d..991981da 100644 --- a/lib/src/components/switch/material_switch.dart +++ b/lib/src/components/switch/material_switch.dart @@ -1,3 +1,4 @@ +// Ignored as this file is a copy of the original Flutter file and should not be used by end users. // ignore_for_file: prefer_asserts_with_message, public_member_api_docs // The content of this file is taken from diff --git a/lib/src/components/time_input/time_input.dart b/lib/src/components/time_input/time_input.dart index cbe22a76..074f3a01 100644 --- a/lib/src/components/time_input/time_input.dart +++ b/lib/src/components/time_input/time_input.dart @@ -28,7 +28,6 @@ class ZetaTimeInput extends ZetaFormField { super.onChange, super.requirementLevel = ZetaFormFieldRequirement.none, super.validator, - @Deprecated('Use use24HourFormat instead') bool use12Hr = true, this.use24HourFormat = true, this.label, this.hintText, diff --git a/lib/src/components/tooltip/tooltip.dart b/lib/src/components/tooltip/tooltip.dart index 17eced21..c6002757 100644 --- a/lib/src/components/tooltip/tooltip.dart +++ b/lib/src/components/tooltip/tooltip.dart @@ -45,7 +45,7 @@ class ZetaTooltip extends ZetaStatelessWidget { /// The padding inside the [ZetaTooltip]. /// Default is: - /// ``` + /// ```dart /// EdgeInsets.symmetric( /// horizontal: Zeta.of(context).spacing.small, /// vertical: Zeta.of(context).spacing.minimum, @@ -59,7 +59,7 @@ class ZetaTooltip extends ZetaStatelessWidget { /// The text style of the tooltip. /// Default is: - /// ``` + /// ```dart /// ZetaTextStyles.bodyXSmall.copyWith( /// color: zeta.colors.mainInverse, /// fontWeight: FontWeight.w500, diff --git a/lib/src/components/top_app_bar/search_top_app_bar.dart b/lib/src/components/top_app_bar/search_top_app_bar.dart index 2be1f15e..973b7e3d 100644 --- a/lib/src/components/top_app_bar/search_top_app_bar.dart +++ b/lib/src/components/top_app_bar/search_top_app_bar.dart @@ -182,10 +182,6 @@ class _ZetaTopAppBarSearchFieldState extends State wit } } -/// A controller used to control the search field in the app bar. -@Deprecated('Use ZetaSearchController instead. ' 'Deprecated as of 0.14.1') -typedef AppBarSearchController = ZetaSearchController; - /// A controller used to control the search field in the app bar. class ZetaSearchController extends ChangeNotifier { bool _enabled = false; diff --git a/lib/src/components/top_app_bar/top_app_bar.dart b/lib/src/components/top_app_bar/top_app_bar.dart index feb7dfa8..7062c14b 100644 --- a/lib/src/components/top_app_bar/top_app_bar.dart +++ b/lib/src/components/top_app_bar/top_app_bar.dart @@ -26,11 +26,6 @@ class ZetaTopAppBar extends ZetaStatefulWidget implements PreferredSizeWidget { this.title, this.titleTextStyle, this.type = ZetaTopAppBarType.defaultAppBar, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') ValueChanged? onSearch, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') String? searchHintText, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') ZetaSearchController? searchController, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') - VoidCallback? onSearchMicrophoneIconPressed, }) : shrinks = false, onSearch = null, searchHintText = null, @@ -50,11 +45,6 @@ class ZetaTopAppBar extends ZetaStatefulWidget implements PreferredSizeWidget { this.leading, this.title, this.titleTextStyle, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') ValueChanged? onSearch, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') String? searchHintText, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') ZetaSearchController? searchController, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') - VoidCallback? onSearchMicrophoneIconPressed, }) : type = ZetaTopAppBarType.centered, onSearch = null, searchHintText = null, @@ -103,11 +93,6 @@ class ZetaTopAppBar extends ZetaStatefulWidget implements PreferredSizeWidget { this.title, this.titleTextStyle, this.shrinks = true, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') ValueChanged? onSearch, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') String? searchHintText, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') ZetaSearchController? searchController, - @Deprecated('Use ZetaTopAppBar.search instead. ' 'Deprecated as of 0.16.0') - VoidCallback? onSearchMicrophoneIconPressed, }) : type = ZetaTopAppBarType.extended, onSearch = null, searchHintText = null, @@ -360,17 +345,9 @@ enum ZetaTopAppBarType { /// Title positioned on the left side. defaultAppBar, - /// Title in the center. - @Deprecated('Use ZetaTopAppBar.centered instead. ' 'Deprecated as of 0.16.0') - centeredTitle, - /// Aligns the title to the center of the app bar. centered, - /// Title below the app bar. - @Deprecated('Use ZetaTopAppBar.extended instead. ' 'Deprecated as of 0.16.0') - extendedTitle, - /// Title extends over 2 lines and collapses when scrolled. extended, } diff --git a/lib/src/theme/breakpoints.dart b/lib/src/theme/breakpoints.dart index 72c26deb..53139072 100644 --- a/lib/src/theme/breakpoints.dart +++ b/lib/src/theme/breakpoints.dart @@ -1,3 +1,4 @@ +// Ignored as the breakpoint values are here for reference. // ignore_for_file: unused_field import 'package:flutter/widgets.dart'; diff --git a/lib/src/theme/color_extensions.dart b/lib/src/theme/color_extensions.dart index 2b95e9a7..8f9d8426 100644 --- a/lib/src/theme/color_extensions.dart +++ b/lib/src/theme/color_extensions.dart @@ -248,7 +248,7 @@ extension ZetaColorExtensions on Color { /// * [background] (Default = [Colors.white]) - The color used to determine the contrast of the colors in the swatch. Generally, this should be the background color that the color swatch will be displayed on. /// * [adjustPrimary] (Default = true) - Determines whether to adjust the contrast of the primary color on the background color. Useful in cases the brand color is being used. /// - /// Returns a Map object. + /// Returns a `Map` object. Map generateSwatch({ int primary = kZetaSwatchPrimaryIndex, Map targetContrasts = kZetaSwatchTargetContrasts, diff --git a/lib/src/utils/platform/universal_platform_web.dart b/lib/src/utils/platform/universal_platform_web.dart index baaac9ae..1084980a 100644 --- a/lib/src/utils/platform/universal_platform_web.dart +++ b/lib/src/utils/platform/universal_platform_web.dart @@ -1,8 +1,6 @@ // The content of this file is adapted from Mike Rydstrom: // https://gist.github.com/rydmike/1771fe24c050ebfe792fa309371154d8 -// ignore: avoid_web_libraries_in_flutter - import 'package:web/web.dart'; import 'platform_is.dart'; @@ -49,6 +47,9 @@ class UniversalPlatform implements AbstractPlatform { } bool _hasMatch(String? value, String pattern) { - // ignore: avoid_bool_literals_in_conditional_expressions - return (value == null) ? false : RegExp(pattern).hasMatch(value); + if (value == null) { + return false; + } else { + return RegExp(pattern).hasMatch(value); + } } diff --git a/lib/src/utils/zeta_provider.dart b/lib/src/utils/zeta_provider.dart index b99564f3..31f33f99 100644 --- a/lib/src/utils/zeta_provider.dart +++ b/lib/src/utils/zeta_provider.dart @@ -246,6 +246,7 @@ class ZetaProviderState extends State with Diagnosticable, Widgets } return FutureBuilder( + // Ignored as the FutureBuilder is used to wait for the theme values to be loaded. // ignore: discarded_futures future: getThemeValuesFromPreferences(), builder: (BuildContext context, AsyncSnapshot snapshot) { diff --git a/lib/zeta_flutter.dart b/lib/zeta_flutter.dart index 27172c51..cb8a5a1a 100644 --- a/lib/zeta_flutter.dart +++ b/lib/zeta_flutter.dart @@ -1,5 +1,5 @@ /// Zebra Design System (Zeta) - Flutter Component Library -library zeta_flutter; +library; export 'generated/generated.dart'; export 'src/components/components.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index b8ed517b..65d308ac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,7 +26,7 @@ dependencies: flutter: sdk: flutter flutter_slidable: ^3.1.0 - intl: ^0.19.0 + intl: ^0.20.1 mask_text_input_formatter: ^2.9.0 shared_preferences: ^2.3.2 web: ^1.0.0 @@ -39,7 +39,7 @@ dev_dependencies: image: ^4.2.0 mockito: ^5.4.4 path: ^1.9.0 - zds_analysis: ^1.0.0 + zds_analysis: ^1.0.1 flutter: fonts: diff --git a/test/scripts/test_counter.dart b/test/scripts/test_counter.dart index a74a69d3..60be7b0f 100644 --- a/test/scripts/test_counter.dart +++ b/test/scripts/test_counter.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:analyzer/dart/analysis/utilities.dart'; import 'package:analyzer/dart/ast/ast.dart'; import 'package:analyzer/dart/ast/visitor.dart'; +import 'package:flutter/material.dart'; import 'utils/utils.dart'; @@ -239,6 +240,5 @@ void main() async { // generate MD table await writeMDToFile('${outputDirectory.path}/test_table.md', generateMD(testCount)); - // ignore: avoid_print - print('Test table generated successfully!'); + debugPrint('Test table generated successfully!'); } diff --git a/test/src/components/breadcrumb/breadcrumb_test.dart b/test/src/components/breadcrumb/breadcrumb_test.dart index db66e075..be5269a5 100644 --- a/test/src/components/breadcrumb/breadcrumb_test.dart +++ b/test/src/components/breadcrumb/breadcrumb_test.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:zeta_flutter/src/components/breadcrumb/breadcrumb.dart'; import 'package:zeta_flutter/zeta_flutter.dart'; import '../../../test_utils/test_app.dart'; @@ -74,7 +75,6 @@ void main() { ); expect(find.byType(ZetaBreadcrumbItem), findsNWidgets(maxItemsShown)); - // ignore: deprecated_member_use_from_same_package await tester.tap(find.byType(TruncatedItem)); await tester.pumpAndSettle(); @@ -94,7 +94,6 @@ void main() { expect(find.text('Breadcrumb'), findsOneWidget); expect(find.text('Item ${children.length - 1}'), findsOneWidget); - // ignore: deprecated_member_use_from_same_package await tester.tap(find.byType(TruncatedItem)); await tester.pumpAndSettle(); @@ -121,7 +120,6 @@ void main() { }); expect(iconFinder, findsOneWidget); - // ignore: deprecated_member_use_from_same_package await tester.tap(find.byType(TruncatedItem)); await tester.pumpAndSettle(); diff --git a/test/src/components/chat_item/chat_item_test.dart b/test/src/components/chat_item/chat_item_test.dart index e62493fa..70330ee8 100644 --- a/test/src/components/chat_item/chat_item_test.dart +++ b/test/src/components/chat_item/chat_item_test.dart @@ -1,4 +1,3 @@ -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart'; @@ -28,10 +27,6 @@ void main() { 'count': '1', 'onTap': 'null', 'starred': 'true', - 'onMenuMoreTap': 'null', - 'onCallTap': 'null', - 'onDeleteTap': 'null', - 'onPttTap': 'null', 'explicitChildNodes': 'true', 'paleButtonColors': 'null', }; @@ -453,55 +448,6 @@ void main() { ); }); - testWidgets('debugFillProperties works correctly', (WidgetTester tester) async { - final diagnosticsZetaChatItem = DiagnosticPropertiesBuilder(); - final time = DateTime.now(); - ZetaChatItem( - title: const Text('Title'), - subtitle: const Text('Subtitle'), - time: time, - leading: const ZetaAvatar(initials: 'AZ'), - slidableActions: [ - ZetaSlidableAction.menuMore(onPressed: () {}), - ZetaSlidableAction.call(onPressed: () {}), - ZetaSlidableAction.ptt(onPressed: () {}), - ZetaSlidableAction.delete(onPressed: () {}), - ], - count: 1, - enabledNotificationIcon: true, - highlighted: true, - enabledWarningIcon: true, - starred: true, - ).debugFillProperties(diagnosticsZetaChatItem); - - expect(diagnosticsZetaChatItem.finder('rounded'), 'null'); - expect(diagnosticsZetaChatItem.finder('highlighted'), 'true'); - expect(diagnosticsZetaChatItem.finder('time'), time.toString()); - expect(diagnosticsZetaChatItem.finder('timeFormat'), 'null'); - expect(diagnosticsZetaChatItem.finder('enabledWarningIcon'), 'true'); - expect(diagnosticsZetaChatItem.finder('enabledNotificationIcon'), 'true'); - expect(diagnosticsZetaChatItem.finder('count'), '1'); - expect(diagnosticsZetaChatItem.finder('onTap'), 'null'); - expect(diagnosticsZetaChatItem.finder('starred'), 'true'); - expect(diagnosticsZetaChatItem.finder('onMenuMoreTap'), 'null'); - expect(diagnosticsZetaChatItem.finder('onCallTap'), 'null'); - expect(diagnosticsZetaChatItem.finder('onDeleteTap'), 'null'); - expect(diagnosticsZetaChatItem.finder('onPttTap'), 'null'); - expect(diagnosticsZetaChatItem.finder('explicitChildNodes'), 'true'); - expect(diagnosticsZetaChatItem.finder('paleButtonColors'), 'null'); - - final diagnosticsZetaSlidableAction = DiagnosticPropertiesBuilder(); - const ZetaSlidableAction(icon: Icons.star).debugFillProperties(diagnosticsZetaSlidableAction); - - expect(diagnosticsZetaSlidableAction.finder('onPressed'), 'null'); - expect(diagnosticsZetaSlidableAction.finder('icon'), 'IconData(U+0E5F9)'); - expect(diagnosticsZetaSlidableAction.finder('foregroundColor'), null); - expect(diagnosticsZetaSlidableAction.finder('backgroundColor'), null); - expect(diagnosticsZetaSlidableAction.finder('color'), 'null'); - expect(diagnosticsZetaSlidableAction.finder('semanticLabel'), 'null'); - expect(diagnosticsZetaSlidableAction.finder('paleColor'), 'false'); - }); - testWidgets('ZetaChatItem displays correctly', (WidgetTester tester) async { tester.view.devicePixelRatio = 1.0; tester.view.physicalSize = const Size(315, 480); diff --git a/test/src/components/search_bar/search_bar_test.dart b/test/src/components/search_bar/search_bar_test.dart index 6869471a..a445cca4 100644 --- a/test/src/components/search_bar/search_bar_test.dart +++ b/test/src/components/search_bar/search_bar_test.dart @@ -1,3 +1,6 @@ +// Ignored as we are using a custom abstract class to mock the events +// ignore_for_file: unreachable_from_main + import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; @@ -10,13 +13,10 @@ import '../../../test_utils/utils.dart'; import 'search_bar_test.mocks.dart'; abstract class ISearchBarEvents { - // ignore: unreachable_from_main void onChange(String? text); - // ignore: unreachable_from_main void onSubmit(String text); - // ignore: unreachable_from_main Future onSpeech(); } diff --git a/test/src/components/tooltip/tooltip_test.dart b/test/src/components/tooltip/tooltip_test.dart index 7e052eb7..a35f5822 100644 --- a/test/src/components/tooltip/tooltip_test.dart +++ b/test/src/components/tooltip/tooltip_test.dart @@ -1,4 +1,3 @@ -// ignore_for_file: avoid_dynamic_calls import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; diff --git a/test/src/utils/debounce_test.dart b/test/src/utils/debounce_test.dart index 46a3e7fc..0cb03fee 100644 --- a/test/src/utils/debounce_test.dart +++ b/test/src/utils/debounce_test.dart @@ -1,5 +1,3 @@ -// ignore_for_file: inference_failure_on_instance_creation - import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:zeta_flutter/zeta_flutter.dart'; @@ -20,7 +18,7 @@ void main() { const debounceDuration = Duration(milliseconds: 100); ZetaDebounce(mockCallback.call, duration: debounceDuration); - await Future.delayed(debounceDuration + const Duration(milliseconds: 50)); + await Future.delayed(debounceDuration + const Duration(milliseconds: 50)); verify(mockCallback()).called(1); }); @@ -29,7 +27,7 @@ void main() { const debounceDuration = Duration(milliseconds: 100); ZetaDebounce(mockCallback.call, duration: debounceDuration).cancel(); - await Future.delayed(debounceDuration + const Duration(milliseconds: 50)); + await Future.delayed(debounceDuration + const Duration(milliseconds: 50)); verifyNever(mockCallback()); }); @@ -38,13 +36,13 @@ void main() { const debounceDuration = Duration(milliseconds: 100); final debouncer = ZetaDebounce(mockCallback.call, duration: debounceDuration); - await Future.delayed(const Duration(milliseconds: 50)); + await Future.delayed(const Duration(milliseconds: 50)); debouncer.debounce(); - await Future.delayed(const Duration(milliseconds: 75)); + await Future.delayed(const Duration(milliseconds: 75)); verifyNever(mockCallback()); - await Future.delayed(const Duration(milliseconds: 50)); + await Future.delayed(const Duration(milliseconds: 50)); verify(mockCallback()).called(1); }); @@ -52,7 +50,7 @@ void main() { const debounceDuration = Duration(milliseconds: 100); ZetaDebounce.stopped(mockCallback.call, duration: debounceDuration); - await Future.delayed(debounceDuration + const Duration(milliseconds: 50)); + await Future.delayed(debounceDuration + const Duration(milliseconds: 50)); verifyNever(mockCallback()); }); @@ -64,7 +62,7 @@ void main() { final newCallback = MockCallback(); debouncer.debounce(newCallback: newCallback.call); - await Future.delayed(debounceDuration + const Duration(milliseconds: 50)); + await Future.delayed(debounceDuration + const Duration(milliseconds: 50)); verifyNever(mockCallback()); verify(newCallback()).called(1); diff --git a/test/src/utils/zeta_test.dart b/test/src/utils/zeta_test.dart index 4ea52d56..9cf8437a 100644 --- a/test/src/utils/zeta_test.dart +++ b/test/src/utils/zeta_test.dart @@ -105,6 +105,7 @@ void main() { testWidgets('provides custom semantics in AA mode', (WidgetTester tester) async { await tester.pumpWidget( Zeta( + // Ignored in case this ever changes in the future and alters the test. // ignore: avoid_redundant_argument_values contrast: ZetaContrast.aa, customSemantics: ZetaSemanticsAAA(primitives: const ZetaPrimitivesLight()), diff --git a/test/test_utils/utils.dart b/test/test_utils/utils.dart index bb35d331..1461c406 100644 --- a/test/test_utils/utils.dart +++ b/test/test_utils/utils.dart @@ -1,5 +1,3 @@ -// ignore_for_file: avoid_print - import 'dart:io'; import 'package:collection/collection.dart'; @@ -82,7 +80,7 @@ void debugFillPropertiesTest(Widget widget, Map properties) { try { expect(diagnostics.finder(key), value); } catch (e) { - print('Error on $key'); + debugPrint('Error on $key'); rethrow; } });