-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: performance drop caused by UI animation (#857)
* Remove InfiniteProgressCircle * Use GitHub vars for --num-flaky-test-attempts flag * Format Dart code * Add DottedProgressCircle * Add setting for progress animation style * Revert "Add setting for progress animation style" This reverts commit c14cc63. * Revert "Add DottedProgressCircle" This reverts commit ef1c427. * Use ProgressCircle with no animation * Format Dart code
- Loading branch information
Showing
5 changed files
with
72 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 0 additions & 106 deletions
106
flutter/lib/ui/home/gradient_circular_progress_indicator.dart
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.