From 6c3143ee5ec30e988f4b91ff2a9c64b752e1b494 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Mar 2024 17:23:41 +0000 Subject: [PATCH] [automated commit] lint format and import sort --- .../lib/pages/components/button_example.dart | 35 ++++++------------- .../pages/components/progress_example.dart | 16 +++------ lib/src/components/buttons/button_style.dart | 15 +++----- lib/src/components/progress/progress.dart | 4 ++- lib/src/components/progress/progress_bar.dart | 22 +++++------- .../components/progress/progress_circle.dart | 5 ++- 6 files changed, 34 insertions(+), 63 deletions(-) diff --git a/example/lib/pages/components/button_example.dart b/example/lib/pages/components/button_example.dart index 4728b39f..edb7849c 100644 --- a/example/lib/pages/components/button_example.dart +++ b/example/lib/pages/components/button_example.dart @@ -111,16 +111,10 @@ class _ButtonExampleState extends State { Column( children: groupButtons(ZetaWidgetBorder.rounded), ), - Text('Floating Action Buttons', - style: ZetaTextStyles.displayMedium), - Text('Tap buttons to change current FAB: ', - style: ZetaTextStyles.bodyMedium), - Wrap( - children: - fabs.divide(SizedBox.square(dimension: 10)).toList()), - ] - .divide(const SizedBox.square(dimension: ZetaSpacing.m)) - .toList(), + Text('Floating Action Buttons', style: ZetaTextStyles.displayMedium), + Text('Tap buttons to change current FAB: ', style: ZetaTextStyles.bodyMedium), + Wrap(children: fabs.divide(SizedBox.square(dimension: 10)).toList()), + ].divide(const SizedBox.square(dimension: ZetaSpacing.m)).toList(), ), ), Expanded(child: const SizedBox()), @@ -178,10 +172,7 @@ class _ButtonExampleState extends State { List groupButtons(ZetaWidgetBorder) { return [ - ZetaButtonGroup( - isLarge: true, - rounded: true, - buttons: [ + ZetaButtonGroup(isLarge: true, rounded: true, buttons: [ GroupButton( label: "Label", ), @@ -189,10 +180,7 @@ class _ButtonExampleState extends State { label: "Label", ), ]), - ZetaButtonGroup( - isLarge: true, - rounded: true, - buttons: [ + ZetaButtonGroup(isLarge: true, rounded: true, buttons: [ GroupButton( label: "Label", ), @@ -202,8 +190,8 @@ class _ButtonExampleState extends State { ), ]), ZetaButtonGroup( - isLarge: true, - rounded: true, + isLarge: true, + rounded: true, buttons: [ GroupButton.icon( icon: ZetaIcons.star_round, @@ -214,7 +202,6 @@ class _ButtonExampleState extends State { label: "Label", ), GroupButton.icon( - icon: ZetaIcons.star_round, label: "Label", ), @@ -222,14 +209,14 @@ class _ButtonExampleState extends State { ), ZetaButtonGroup( isLarge: true, - rounded: true, + rounded: true, buttons: [ - GroupButton.icon( + GroupButton.icon( icon: ZetaIcons.star_round, label: "Label", onPressed: () {}, ), - GroupButton.icon( + GroupButton.icon( icon: ZetaIcons.star_round, label: "Label", onPressed: () {}, diff --git a/example/lib/pages/components/progress_example.dart b/example/lib/pages/components/progress_example.dart index 3622cd0d..5bfc6642 100644 --- a/example/lib/pages/components/progress_example.dart +++ b/example/lib/pages/components/progress_example.dart @@ -41,11 +41,7 @@ class ProgressExampleState extends State { SizedBox( height: 20, ), - Wrapper( - stepsCompleted: 0, - type: ZetaProgressBarType.standard, - isThin: false, - stateChangeable: true), + Wrapper(stepsCompleted: 0, type: ZetaProgressBarType.standard, isThin: false, stateChangeable: true), SizedBox( height: 20, ), @@ -118,9 +114,7 @@ class _WrapperState extends State { void setLoading() { setState(() { - type = type == ZetaProgressBarType.buffering - ? ZetaProgressBarType.standard - : ZetaProgressBarType.buffering; + type = type == ZetaProgressBarType.buffering ? ZetaProgressBarType.standard : ZetaProgressBarType.buffering; }); } @@ -150,13 +144,11 @@ class _WrapperState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ widget.type != ZetaProgressBarType.indeterminate - ? FilledButton( - onPressed: increasePercentage, child: Text("Increase")) + ? FilledButton(onPressed: increasePercentage, child: Text("Increase")) : Container(), const SizedBox(width: 40), widget.stateChangeable! - ? FilledButton( - onPressed: setLoading, child: Text("Start Buffering")) + ? FilledButton(onPressed: setLoading, child: Text("Start Buffering")) : SizedBox.shrink() ], ) diff --git a/lib/src/components/buttons/button_style.dart b/lib/src/components/buttons/button_style.dart index 26662d9b..8a3ed9fb 100644 --- a/lib/src/components/buttons/button_style.dart +++ b/lib/src/components/buttons/button_style.dart @@ -55,8 +55,7 @@ extension ButtonFunctions on ZetaButtonType { } /// Returns if button has border - bool get border => - this == ZetaButtonType.outline || this == ZetaButtonType.outlineSubtle; + bool get border => this == ZetaButtonType.outline || this == ZetaButtonType.outlineSubtle; ///Returns if button is solid bool get solid => index < 4; @@ -86,9 +85,8 @@ ButtonStyle buttonStyle( ZetaButtonType type, Color? backgroundColor, ) { - final ZetaColorSwatch color = backgroundColor != null - ? ZetaColorSwatch.fromColor(backgroundColor) - : type.color(colors); + final ZetaColorSwatch color = + backgroundColor != null ? ZetaColorSwatch.fromColor(backgroundColor) : type.color(colors); final bool isSolid = type.solid || backgroundColor != null; @@ -131,8 +129,7 @@ ButtonStyle buttonStyle( } }, ), - overlayColor: - MaterialStateProperty.resolveWith((Set states) { + overlayColor: MaterialStateProperty.resolveWith((Set states) { return null; }), side: MaterialStateProperty.resolveWith((Set states) { @@ -145,9 +142,7 @@ ButtonStyle buttonStyle( } if (type.border) { return BorderSide( - color: type == ZetaButtonType.outline - ? colors.primary.border - : colors.borderDefault, + color: type == ZetaButtonType.outline ? colors.primary.border : colors.borderDefault, ); } diff --git a/lib/src/components/progress/progress.dart b/lib/src/components/progress/progress.dart index 732da64c..3ad63440 100644 --- a/lib/src/components/progress/progress.dart +++ b/lib/src/components/progress/progress.dart @@ -34,7 +34,9 @@ abstract class ZetaProgressState extends State with T super.initState(); progress = widget.progress; controller = AnimationController( - vsync: this, duration: const Duration(milliseconds: 200),); + vsync: this, + duration: const Duration(milliseconds: 200), + ); animation = Tween( begin: widget.progress, // Start value end: widget.progress, // End value (initially same as start value) diff --git a/lib/src/components/progress/progress_bar.dart b/lib/src/components/progress/progress_bar.dart index 939e9fe2..37a2ce86 100644 --- a/lib/src/components/progress/progress_bar.dart +++ b/lib/src/components/progress/progress_bar.dart @@ -98,8 +98,7 @@ class _ZetaProgressBarState extends ZetaProgressState { children: [ Text( widget.label ?? - (widget.label == null && - widget.type != ZetaProgressBarType.indeterminate + (widget.label == null && widget.type != ZetaProgressBarType.indeterminate ? '${(animation.value * 100).toInt()}%' : ''), style: ZetaTextStyles.titleMedium, @@ -115,17 +114,13 @@ class _ZetaProgressBarState extends ZetaProgressState { height: _weight, child: LinearProgressIndicator( borderRadius: _border, - value: widget.type == ZetaProgressBarType.indeterminate - ? null - : animation.value, - backgroundColor: widget.type == ZetaProgressBarType.buffering - ? colors.surfaceDisabled - : Colors.transparent, + value: widget.type == ZetaProgressBarType.indeterminate ? null : animation.value, + backgroundColor: + widget.type == ZetaProgressBarType.buffering ? colors.surfaceDisabled : Colors.transparent, ), ), ), - if (widget.type == ZetaProgressBarType.buffering) - bufferingWidget(colors), + if (widget.type == ZetaProgressBarType.buffering) bufferingWidget(colors), ], ), ], @@ -133,8 +128,7 @@ class _ZetaProgressBarState extends ZetaProgressState { } /// Returns border based on widgets border type. - BorderRadius get _border => - widget.rounded ? ZetaRadius.rounded : ZetaRadius.none; + BorderRadius get _border => widget.rounded ? ZetaRadius.rounded : ZetaRadius.none; /// Returns thickness of progress bar based on its weight. double get _weight => widget.isThin ? ZetaSpacing.x2 : ZetaSpacing.x4; @@ -148,7 +142,9 @@ class _ZetaProgressBarState extends ZetaProgressState { width: _weight, height: _weight, decoration: BoxDecoration( - color: colors.surfaceDisabled, borderRadius: ZetaRadius.rounded,), + color: colors.surfaceDisabled, + borderRadius: ZetaRadius.rounded, + ), ), ], ); diff --git a/lib/src/components/progress/progress_circle.dart b/lib/src/components/progress/progress_circle.dart index 0156ffcc..90f48c5b 100644 --- a/lib/src/components/progress/progress_circle.dart +++ b/lib/src/components/progress/progress_circle.dart @@ -36,7 +36,7 @@ class ZetaProgressCircle extends ZetaProgress { ///Size of [ZetaProgressCircle] final ZetaCircleSizes size; - ///{@macro zeta-component-rounded} + ///{@macro zeta-component-rounded} final bool rounded; @override @@ -102,7 +102,7 @@ class ZetaProgressCircleState extends ZetaProgressState { ///Class definition for [CirclePainter] class CirclePainter extends CustomPainter { ///Constructor for [CirclePainter] - CirclePainter({this.progress = 0, this.rounded = true,required this.colors}); + CirclePainter({this.progress = 0, this.rounded = true, required this.colors}); ///Percentage of progress in decimal value, defaults to 0 final double progress; @@ -122,7 +122,6 @@ class CirclePainter extends CustomPainter { if (rounded) _paint.strokeCap = StrokeCap.round; _paint.color = colors.primary; - const double fullCircle = 2 * math.pi; canvas.drawArc(