Skip to content

Commit

Permalink
Fix lint errors and add tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Osman authored and Osman committed Mar 5, 2024
1 parent 14ddb66 commit 37e7e7d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/src/components/progress/progress.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class ZetaProgressState<T extends ZetaProgress> extends State<T>
super.initState();
progress = widget.progress;
controller = AnimationController(
vsync: this, duration: const Duration(milliseconds: 200));
vsync: this, duration: const Duration(milliseconds: 200),);
animation = Tween<double>(
begin: widget.progress, // Start value
end: widget.progress, // End value (initially same as start value)
Expand Down
14 changes: 7 additions & 7 deletions lib/src/components/progress/progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ 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(
{super.key,
required super.progress,
this.rounded = true,
this.isThin = false,
this.label})
this.label,})
: type = ZetaBarType.standard;

/// Constructs buffering example
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -108,7 +108,7 @@ class _ZetaProgressBarState extends ZetaProgressState<ZetaProgressBar> {
),
),
_extraWidgets(),
])
],),
],
);
}
Expand All @@ -130,9 +130,9 @@ class _ZetaProgressBarState extends ZetaProgressState<ZetaProgressBar> {
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
Expand Down
20 changes: 12 additions & 8 deletions lib/src/components/progress/progress_circle.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -74,15 +73,15 @@ class ZetaProgressCircleState extends ZetaProgressState<ZetaProgressCircle> {
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);
}
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 37e7e7d

Please sign in to comment.