mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
@@ -15,7 +15,6 @@
|
||||
* along with PiliPlus. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import 'dart:io' show Platform;
|
||||
import 'dart:math' show pi;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -95,53 +94,29 @@ class RenderLoadingIndicator extends RenderBox {
|
||||
final radius = size.width / 2 - strokeWidth;
|
||||
final center = size.center(.zero);
|
||||
|
||||
// TODO: remove
|
||||
// https://github.com/flutter/flutter/issues/182708
|
||||
// https://github.com/flutter/flutter/issues/183083
|
||||
if (Platform.isIOS) {
|
||||
context.canvas
|
||||
..drawCircle(
|
||||
center,
|
||||
radius,
|
||||
paint..color = Colors.white,
|
||||
)
|
||||
..drawCircle(
|
||||
center,
|
||||
radius - strokeWidth,
|
||||
paint..color = const Color(0x80000000),
|
||||
)
|
||||
..drawArc(
|
||||
Rect.fromCircle(center: center, radius: radius - padding),
|
||||
startAngle,
|
||||
progress * 2 * pi,
|
||||
true,
|
||||
paint..color = Colors.white,
|
||||
);
|
||||
} else {
|
||||
context.canvas
|
||||
..drawCircle(
|
||||
center,
|
||||
radius,
|
||||
paint
|
||||
..style = .fill
|
||||
..color = const Color(0x80000000),
|
||||
)
|
||||
..drawCircle(
|
||||
center,
|
||||
radius,
|
||||
paint
|
||||
..style = .stroke
|
||||
..strokeWidth = strokeWidth
|
||||
..color = Colors.white,
|
||||
)
|
||||
..drawArc(
|
||||
Rect.fromCircle(center: center, radius: radius - padding),
|
||||
startAngle,
|
||||
progress * 2 * pi,
|
||||
true,
|
||||
paint..style = .fill,
|
||||
);
|
||||
}
|
||||
context.canvas
|
||||
..drawCircle(
|
||||
center,
|
||||
radius,
|
||||
paint
|
||||
..style = .fill
|
||||
..color = const Color(0x80000000),
|
||||
)
|
||||
..drawCircle(
|
||||
center,
|
||||
radius,
|
||||
paint
|
||||
..style = .stroke
|
||||
..strokeWidth = strokeWidth
|
||||
..color = Colors.white,
|
||||
)
|
||||
..drawArc(
|
||||
Rect.fromCircle(center: center, radius: radius - padding),
|
||||
startAngle,
|
||||
progress * 2 * pi,
|
||||
true,
|
||||
paint..style = .fill,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user