Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
anhappdev committed Feb 29, 2024
2 parents 3fb4f01 + 89991f5 commit f489f52
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 166 deletions.
12 changes: 6 additions & 6 deletions flutter/lib/ui/home/benchmark_running_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:mlperfbench/localizations/app_localizations.dart';
import 'package:mlperfbench/state/task_runner.dart';
import 'package:mlperfbench/ui/app_styles.dart';
import 'package:mlperfbench/ui/formatter.dart';
import 'package:mlperfbench/ui/home/progress_circles.dart';
import 'package:mlperfbench/ui/home/progress_circle.dart';
import 'package:mlperfbench/ui/icons.dart';

class BenchmarkRunningScreen extends StatefulWidget {
Expand Down Expand Up @@ -114,9 +114,9 @@ class _BenchmarkRunningScreenState extends State<BenchmarkRunningScreen> {
),
),
),
InfiniteProgressCircle(
ProgressCircle(
strokeWidth: 6,
size: containerWidth + 20,
strokeWidth: 6.0,
),
],
);
Expand Down Expand Up @@ -201,9 +201,9 @@ class _BenchmarkRunningScreenState extends State<BenchmarkRunningScreen> {
const trailingWidth = 24.0;
Widget? doneIcon;
if (progress.currentBenchmark?.taskName == benchmarkInfo.taskName) {
doneIcon = const InfiniteProgressCircle(
size: trailingWidth,
doneIcon = const ProgressCircle(
strokeWidth: 2,
size: trailingWidth - 4,
);
} else if (progress.completedBenchmarks.contains(benchmarkInfo)) {
doneIcon = const Icon(
Expand Down Expand Up @@ -238,7 +238,7 @@ class _BenchmarkRunningScreenState extends State<BenchmarkRunningScreen> {
trailing: SizedBox(
width: trailingWidth,
height: trailingWidth,
child: doneIcon,
child: Center(child: doneIcon),
),
);
}
Expand Down
106 changes: 0 additions & 106 deletions flutter/lib/ui/home/gradient_circular_progress_indicator.dart

This file was deleted.

62 changes: 62 additions & 0 deletions flutter/lib/ui/home/progress_circle.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import 'package:flutter/material.dart';

class ProgressCircle extends StatelessWidget {
final double strokeWidth;
final double size;

const ProgressCircle({
super.key,
required this.size,
required this.strokeWidth,
});

@override
Widget build(BuildContext context) {
return _BorderedCircle(
strokeWidth: strokeWidth,
radius: size / 2,
color: Colors.white.withOpacity(0.88),
);
}
}

class _BorderedCircle extends StatelessWidget {
final double strokeWidth;
final double radius;
final Color color;

const _BorderedCircle({
required this.strokeWidth,
required this.radius,
required this.color,
});

@override
Widget build(BuildContext context) {
return CustomPaint(
painter: DrawCircle(strokeWidth, radius, color),
);
}
}

class DrawCircle extends CustomPainter {
final double strokeWidth;
final double radius;
final Color color;

DrawCircle(this.strokeWidth, this.radius, this.color);

@override
void paint(Canvas canvas, Size size) {
final paint = Paint()
..color = color
..strokeWidth = strokeWidth
..style = PaintingStyle.stroke;
canvas.drawCircle(const Offset(0.0, 0.0), radius, paint);
}

@override
bool shouldRepaint(CustomPainter oldDelegate) {
return false;
}
}
54 changes: 0 additions & 54 deletions flutter/lib/ui/home/progress_circles.dart

This file was deleted.

0 comments on commit f489f52

Please sign in to comment.