From 37e7e7d9e8fe4ce2223a8a21672a712396b29cb6 Mon Sep 17 00:00:00 2001 From: Osman Date: Tue, 5 Mar 2024 14:10:36 +0000 Subject: [PATCH] Fix lint errors and add tokens --- lib/src/components/progress/progress.dart | 2 +- lib/src/components/progress/progress_bar.dart | 14 ++++++------- .../components/progress/progress_circle.dart | 20 +++++++++++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/lib/src/components/progress/progress.dart b/lib/src/components/progress/progress.dart index 8730a303..40503d2d 100644 --- a/lib/src/components/progress/progress.dart +++ b/lib/src/components/progress/progress.dart @@ -35,7 +35,7 @@ abstract class ZetaProgressState extends State 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 f7793fc8..0a81e61f 100644 --- a/lib/src/components/progress/progress_bar.dart +++ b/lib/src/components/progress/progress_bar.dart @@ -26,7 +26,7 @@ class ZetaProgressBar extends ZetaProgress { required this.rounded, required this.type, required this.isThin, - this.label}); + this.label,}); /// Constructs a standard progress bar const ZetaProgressBar.standard( @@ -34,7 +34,7 @@ class ZetaProgressBar extends ZetaProgress { required super.progress, this.rounded = true, this.isThin = false, - this.label}) + this.label,}) : type = ZetaBarType.standard; /// Constructs buffering example @@ -43,7 +43,7 @@ class ZetaProgressBar extends ZetaProgress { required super.progress, this.rounded = true, this.isThin = false, - this.label}) + this.label,}) : type = ZetaBarType.buffering; /// Constructs indeterminate example @@ -52,7 +52,7 @@ class ZetaProgressBar extends ZetaProgress { required super.progress, this.rounded = true, this.isThin = false, - this.label}) + this.label,}) : type = ZetaBarType.indeterminate; /// Is progress bar rounded or sharp. @@ -108,7 +108,7 @@ class _ZetaProgressBarState extends ZetaProgressState { ), ), _extraWidgets(), - ]) + ],), ], ); } @@ -130,9 +130,9 @@ class _ZetaProgressBarState extends ZetaProgressState { height: _weight, decoration: const BoxDecoration( color: Color.fromRGBO(224, 227, 233, 1), - borderRadius: ZetaRadius.rounded), + borderRadius: ZetaRadius.rounded,), ), - ]); + ],); final Widget extraWidgets = Row( children: widget.type == ZetaBarType.buffering diff --git a/lib/src/components/progress/progress_circle.dart b/lib/src/components/progress/progress_circle.dart index 3e52667d..28b546c1 100644 --- a/lib/src/components/progress/progress_circle.dart +++ b/lib/src/components/progress/progress_circle.dart @@ -1,7 +1,6 @@ import 'dart:math' as math; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import '../../../zeta_flutter.dart'; import 'progress.dart'; @@ -74,15 +73,15 @@ class ZetaProgressCircleState extends ZetaProgressState { Size _getSize() { switch (widget.size) { case ZetaCircleSizes.xs: - return const Size(24, 24); + return const Size(ZetaSpacing.x6, ZetaSpacing.x6); case ZetaCircleSizes.s: - return const Size(36, 36); + return const Size(ZetaSpacing.x9, ZetaSpacing.x9); case ZetaCircleSizes.m: - return const Size(40, 40); + return const Size(ZetaSpacing.x10, ZetaSpacing.x10); case ZetaCircleSizes.l: - return const Size(48, 48); + return const Size(ZetaSpacing.x12, ZetaSpacing.x12); case ZetaCircleSizes.xl: - return const Size(64, 64); + return const Size(ZetaSpacing.x16, ZetaSpacing.x16); } } @@ -118,8 +117,13 @@ class CirclePainter extends CustomPainter { const double fullCircle = 2 * math.pi; - canvas.drawArc(Rect.fromLTRB(0, 0, size.width, size.height), - 3 * math.pi / 2, progress * fullCircle, false, _paint); + canvas.drawArc( + Rect.fromLTRB(0, 0, size.width, size.height), + 3 * math.pi / 2, + progress * fullCircle, + false, + _paint, + ); } @override