fixed deprecated warnings
This commit is contained in:
@@ -114,7 +114,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
// context,
|
||||
// useRootNavigator: true,
|
||||
// builder: (context) => SlidingSheetDialog(
|
||||
// color: Colors.black.withOpacity(0.99),
|
||||
// color: Colors.black.withValues(alpha: 0.99),
|
||||
// duration: const Duration(milliseconds: 400),
|
||||
// scrollSpec: const ScrollSpec.bouncingScroll(),
|
||||
// snapSpec: const SnapSpec(
|
||||
@@ -162,7 +162,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
// color: Theme.of(context)
|
||||
// .colorScheme
|
||||
// .secondary
|
||||
// .withOpacity(.85),
|
||||
// .withValues(alpha: .85),
|
||||
// fontStyle: liveCard.nextLesson!.subject.isRenamed &&
|
||||
// settingsProvider.renamedSubjectsItalics
|
||||
// ? FontStyle.italic
|
||||
@@ -176,7 +176,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
// color: Theme.of(context)
|
||||
// .colorScheme
|
||||
// .secondary
|
||||
// .withOpacity(.85),
|
||||
// .withValues(alpha: .85),
|
||||
// ),
|
||||
// ),
|
||||
// TextSpan(text: "first_lesson_3".i18n),
|
||||
@@ -188,7 +188,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
// color: Theme.of(context)
|
||||
// .colorScheme
|
||||
// .secondary
|
||||
// .withOpacity(.85),
|
||||
// .withValues(alpha: .85),
|
||||
// ),
|
||||
// ),
|
||||
// TextSpan(text: "first_lesson_4".i18n),
|
||||
@@ -281,7 +281,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(.15),
|
||||
.withValues(alpha: .15),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Text(
|
||||
@@ -294,7 +294,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(.9),
|
||||
.withValues(alpha: .9),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -469,7 +469,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(.75),
|
||||
.withValues(alpha: .75),
|
||||
height: 1.1,
|
||||
),
|
||||
),
|
||||
@@ -547,7 +547,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.tertiary
|
||||
.withOpacity(.15),
|
||||
.withValues(alpha: .15),
|
||||
borderRadius:
|
||||
BorderRadius.circular(10.0),
|
||||
),
|
||||
@@ -561,7 +561,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(.9),
|
||||
.withValues(alpha: .9),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -730,10 +730,11 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
fontSize: 16.5,
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(!liveCard
|
||||
.nextLesson!.isEmpty
|
||||
? 1.0
|
||||
: 0.5),
|
||||
.withValues(
|
||||
alpha: !liveCard
|
||||
.nextLesson!.isEmpty
|
||||
? 1.0
|
||||
: 0.5),
|
||||
fontStyle: liveCard.nextLesson!
|
||||
.subject.isRenamed &&
|
||||
settingsProvider
|
||||
@@ -752,7 +753,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
height: 1.0,
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(.75),
|
||||
.withValues(alpha: .75),
|
||||
),
|
||||
maxLines: !(nextSubject == null &&
|
||||
progressCurrent == null &&
|
||||
@@ -830,7 +831,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(.9),
|
||||
.withValues(alpha: .9),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -899,7 +900,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(.75),
|
||||
.withValues(alpha: .75),
|
||||
height: 1.1,
|
||||
),
|
||||
),
|
||||
@@ -977,7 +978,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.tertiary
|
||||
.withOpacity(.15),
|
||||
.withValues(alpha: .15),
|
||||
borderRadius:
|
||||
BorderRadius.circular(10.0),
|
||||
),
|
||||
@@ -991,7 +992,7 @@ class LiveCardStateA extends State<LiveCard> {
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(.9),
|
||||
.withValues(alpha: .9),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -132,7 +132,7 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(0.5),
|
||||
.withValues(alpha: 0.5),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
),
|
||||
@@ -220,8 +220,9 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
||||
context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(
|
||||
.3),
|
||||
.withValues(
|
||||
alpha:
|
||||
.3),
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
@@ -267,7 +268,7 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
||||
size: 26.0,
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(.75),
|
||||
.withValues(alpha: .75),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -283,7 +284,7 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
||||
height: 1.0,
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(.75),
|
||||
.withValues(alpha: .75),
|
||||
),
|
||||
maxLines:
|
||||
!(widget.nextSubject == null &&
|
||||
@@ -341,7 +342,8 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(.25),
|
||||
.withValues(
|
||||
alpha: .25),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
4.0),
|
||||
@@ -356,7 +358,8 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(.9),
|
||||
.withValues(
|
||||
alpha: .9),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -366,7 +369,7 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
||||
style: TextStyle(
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(.8),
|
||||
.withValues(alpha: .8),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
maxLines: 1,
|
||||
@@ -393,7 +396,7 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(.75),
|
||||
.withValues(alpha: .75),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -24,7 +24,8 @@ class SegmentedCountdownState extends State<SegmentedCountdown> {
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.secondary.withOpacity(0.05),
|
||||
color:
|
||||
Theme.of(context).colorScheme.secondary.withValues(alpha: 0.05),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 2.0),
|
||||
@@ -46,7 +47,7 @@ class SegmentedCountdownState extends State<SegmentedCountdown> {
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.of(context).text.withOpacity(0.6),
|
||||
color: AppColors.of(context).text.withValues(alpha: 0.6),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
@@ -54,7 +55,8 @@ class SegmentedCountdownState extends State<SegmentedCountdown> {
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.secondary.withOpacity(0.05),
|
||||
color:
|
||||
Theme.of(context).colorScheme.secondary.withValues(alpha: 0.05),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 2.0),
|
||||
@@ -71,7 +73,10 @@ class SegmentedCountdownState extends State<SegmentedCountdown> {
|
||||
if (diffMins.length == 2)
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.secondary.withOpacity(0.05),
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withValues(alpha: 0.05),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 2.0),
|
||||
@@ -94,7 +99,7 @@ class SegmentedCountdownState extends State<SegmentedCountdown> {
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.of(context).text.withOpacity(0.6),
|
||||
color: AppColors.of(context).text.withValues(alpha: 0.6),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
@@ -102,7 +107,8 @@ class SegmentedCountdownState extends State<SegmentedCountdown> {
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.secondary.withOpacity(0.05),
|
||||
color:
|
||||
Theme.of(context).colorScheme.secondary.withValues(alpha: 0.05),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 2.0),
|
||||
@@ -119,7 +125,10 @@ class SegmentedCountdownState extends State<SegmentedCountdown> {
|
||||
if (diffSecs.length == 2)
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.secondary.withOpacity(0.05),
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withValues(alpha: 0.05),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 2.0),
|
||||
@@ -142,7 +151,7 @@ class SegmentedCountdownState extends State<SegmentedCountdown> {
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.of(context).text.withOpacity(0.6),
|
||||
color: AppColors.of(context).text.withValues(alpha: 0.6),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -36,7 +36,8 @@ class FourRandomSlotParticle extends Particle {
|
||||
|
||||
final double relativeDistanceToMiddle;
|
||||
|
||||
FourRandomSlotParticle({required this.children, this.relativeDistanceToMiddle = 2.0});
|
||||
FourRandomSlotParticle(
|
||||
{required this.children, this.relativeDistanceToMiddle = 2.0});
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size, double progress, int seed) {
|
||||
@@ -53,13 +54,17 @@ class FourRandomSlotParticle extends Particle {
|
||||
|
||||
Offset sideToOffset(int side, Size size, Random random) {
|
||||
if (side == 0) {
|
||||
return Offset(-random.nextDouble() * (size.width / 2), -random.nextDouble() * (size.height / 2));
|
||||
return Offset(-random.nextDouble() * (size.width / 2),
|
||||
-random.nextDouble() * (size.height / 2));
|
||||
} else if (side == 1) {
|
||||
return Offset(random.nextDouble() * (size.width / 2), -random.nextDouble() * (size.height / 2));
|
||||
return Offset(random.nextDouble() * (size.width / 2),
|
||||
-random.nextDouble() * (size.height / 2));
|
||||
} else if (side == 2) {
|
||||
return Offset(random.nextDouble() * (size.width / 2), random.nextDouble() * (size.height / 2));
|
||||
return Offset(random.nextDouble() * (size.width / 2),
|
||||
random.nextDouble() * (size.height / 2));
|
||||
} else if (side == 3) {
|
||||
return Offset(-random.nextDouble() * (size.width / 2), random.nextDouble() * (size.height / 2));
|
||||
return Offset(-random.nextDouble() * (size.width / 2),
|
||||
random.nextDouble() * (size.height / 2));
|
||||
} else {
|
||||
throw Exception();
|
||||
}
|
||||
@@ -148,9 +153,16 @@ class CircleMirror extends Particle {
|
||||
|
||||
final int numberOfParticles;
|
||||
|
||||
CircleMirror.builder({required this.particleBuilder, required this.initialRotation, required this.numberOfParticles});
|
||||
CircleMirror.builder(
|
||||
{required this.particleBuilder,
|
||||
required this.initialRotation,
|
||||
required this.numberOfParticles});
|
||||
|
||||
CircleMirror({required Particle child, required this.initialRotation, required this.numberOfParticles}) : particleBuilder = ((index) => child);
|
||||
CircleMirror(
|
||||
{required Particle child,
|
||||
required this.initialRotation,
|
||||
required this.numberOfParticles})
|
||||
: particleBuilder = ((index) => child);
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size, double progress, seed) {
|
||||
@@ -177,9 +189,15 @@ class RectangleMirror extends Particle {
|
||||
|
||||
final int numberOfParticles;
|
||||
|
||||
RectangleMirror.builder({required this.particleBuilder, required this.initialDistance, required this.numberOfParticles});
|
||||
RectangleMirror.builder(
|
||||
{required this.particleBuilder,
|
||||
required this.initialDistance,
|
||||
required this.numberOfParticles});
|
||||
|
||||
RectangleMirror({required Particle child, required this.initialDistance, required this.numberOfParticles})
|
||||
RectangleMirror(
|
||||
{required Particle child,
|
||||
required this.initialDistance,
|
||||
required this.numberOfParticles})
|
||||
: particleBuilder = ((index) => child);
|
||||
|
||||
@override
|
||||
@@ -191,14 +209,17 @@ class RectangleMirror extends Particle {
|
||||
bool onHorizontalAxis = true;
|
||||
int side = 0;
|
||||
|
||||
assert((distanceBetweenParticles * numberOfParticles).round() == totalLength.round());
|
||||
assert((distanceBetweenParticles * numberOfParticles).round() ==
|
||||
totalLength.round());
|
||||
|
||||
canvas.translate(-size.width / 2, -size.height / 2);
|
||||
|
||||
double currentDistance = initialDistance;
|
||||
for (int i = 0; i < numberOfParticles; i++) {
|
||||
while (true) {
|
||||
if (onHorizontalAxis ? currentDistance > size.width : currentDistance > size.height) {
|
||||
if (onHorizontalAxis
|
||||
? currentDistance > size.width
|
||||
: currentDistance > size.height) {
|
||||
currentDistance -= onHorizontalAxis ? size.width : size.height;
|
||||
onHorizontalAxis = !onHorizontalAxis;
|
||||
side = (++side) % 4;
|
||||
@@ -215,7 +236,8 @@ class RectangleMirror extends Particle {
|
||||
});
|
||||
} else if (side == 2) {
|
||||
assert(onHorizontalAxis);
|
||||
moveTo(canvas, size, 2, size.width - currentDistance, size.height, () {
|
||||
moveTo(canvas, size, 2, size.width - currentDistance, size.height,
|
||||
() {
|
||||
particleBuilder(i).paint(canvas, size, progress, seed);
|
||||
});
|
||||
} else if (side == 3) {
|
||||
@@ -233,7 +255,8 @@ class RectangleMirror extends Particle {
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
void moveTo(Canvas canvas, Size size, int side, double x, double y, VoidCallback painter) {
|
||||
void moveTo(Canvas canvas, Size size, int side, double x, double y,
|
||||
VoidCallback painter) {
|
||||
canvas.save();
|
||||
canvas.translate(x, y);
|
||||
canvas.rotate(-atan2(size.width / 2 - x, size.height / 2 - y));
|
||||
@@ -261,7 +284,9 @@ class PositionedParticle extends Particle {
|
||||
|
||||
/// Animates a childs position based on a Tween<Offset>
|
||||
class AnimatedPositionedParticle extends Particle {
|
||||
AnimatedPositionedParticle({required Offset begin, required Offset end, required this.child}) : offsetTween = Tween<Offset>(begin: begin, end: end);
|
||||
AnimatedPositionedParticle(
|
||||
{required Offset begin, required Offset end, required this.child})
|
||||
: offsetTween = Tween<Offset>(begin: begin, end: end);
|
||||
|
||||
final Particle child;
|
||||
|
||||
@@ -270,7 +295,8 @@ class AnimatedPositionedParticle extends Particle {
|
||||
@override
|
||||
void paint(Canvas canvas, Size size, double progress, seed) {
|
||||
canvas.save();
|
||||
canvas.translate(offsetTween.lerp(progress).dx, offsetTween.lerp(progress).dy);
|
||||
canvas.translate(
|
||||
offsetTween.lerp(progress).dx, offsetTween.lerp(progress).dy);
|
||||
child.paint(canvas, size, progress, seed);
|
||||
canvas.restore();
|
||||
}
|
||||
@@ -335,7 +361,9 @@ class AnimatedRotationParticle extends Particle {
|
||||
|
||||
final Tween<double> rotation;
|
||||
|
||||
AnimatedRotationParticle({required this.child, required double begin, required double end}) : rotation = Tween<double>(begin: begin, end: end);
|
||||
AnimatedRotationParticle(
|
||||
{required this.child, required double begin, required double end})
|
||||
: rotation = Tween<double>(begin: begin, end: end);
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size, double progress, int seed) {
|
||||
@@ -362,7 +390,8 @@ class FadingRect extends Particle {
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size, double progress, seed) {
|
||||
canvas.drawRect(Rect.fromLTWH(0.0, 0.0, width, height), Paint()..color = color.withOpacity(1 - progress));
|
||||
canvas.drawRect(Rect.fromLTWH(0.0, 0.0, width, height),
|
||||
Paint()..color = color.withValues(alpha: 1 - progress));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,7 +404,8 @@ class FadingCircle extends Particle {
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size, double progress, seed) {
|
||||
canvas.drawCircle(Offset.zero, radius, Paint()..color = color.withOpacity(1 - progress));
|
||||
canvas.drawCircle(Offset.zero, radius,
|
||||
Paint()..color = color.withValues(alpha: 1 - progress));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,7 +424,11 @@ class FadingTriangle extends Particle {
|
||||
/// This is the factor of how much bigger then length than the width is
|
||||
final double heightToBaseFactor;
|
||||
|
||||
FadingTriangle({required this.variation, required this.color, required this.baseSize, required this.heightToBaseFactor});
|
||||
FadingTriangle(
|
||||
{required this.variation,
|
||||
required this.color,
|
||||
required this.baseSize,
|
||||
required this.heightToBaseFactor});
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size, double progress, int seed) {
|
||||
@@ -403,7 +437,8 @@ class FadingTriangle extends Particle {
|
||||
path.lineTo(baseSize * variation, baseSize * heightToBaseFactor);
|
||||
path.lineTo(baseSize, 0.0);
|
||||
path.close();
|
||||
canvas.drawPath(path, Paint()..color = color.withOpacity(1 - progress));
|
||||
canvas.drawPath(
|
||||
path, Paint()..color = color.withValues(alpha: 1 - progress));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,7 +453,12 @@ class FadingSnake extends Particle {
|
||||
|
||||
final Color color;
|
||||
|
||||
FadingSnake({required this.width, required this.segmentLength, required this.segments, required this.curvyness, required this.color});
|
||||
FadingSnake(
|
||||
{required this.width,
|
||||
required this.segmentLength,
|
||||
required this.segments,
|
||||
required this.curvyness,
|
||||
required this.color});
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size, double progress, int seed) {
|
||||
@@ -426,10 +466,12 @@ class FadingSnake extends Particle {
|
||||
canvas.rotate(pi / 6);
|
||||
Path path = Path();
|
||||
for (int i = 0; i < segments; i++) {
|
||||
path.quadraticBezierTo(curvyness * i, segmentLength * (i + 1), curvyness * (i + 1), segmentLength * (i + 1));
|
||||
path.quadraticBezierTo(curvyness * i, segmentLength * (i + 1),
|
||||
curvyness * (i + 1), segmentLength * (i + 1));
|
||||
}
|
||||
for (int i = segments - 1; i >= 0; i--) {
|
||||
path.quadraticBezierTo(curvyness * (i + 1), segmentLength * i - curvyness, curvyness * i, segmentLength * i - curvyness);
|
||||
path.quadraticBezierTo(curvyness * (i + 1), segmentLength * i - curvyness,
|
||||
curvyness * i, segmentLength * i - curvyness);
|
||||
}
|
||||
path.close();
|
||||
canvas.drawPath(path, Paint()..color = color);
|
||||
|
||||
Reference in New Issue
Block a user