chore: Fix dart deprecation messages

This commit is contained in:
PartyDonut 2025-01-05 13:53:59 +01:00
parent 607dea3de1
commit 39a7537116
81 changed files with 258 additions and 195 deletions

View file

@ -72,7 +72,7 @@ class AnimatedVisibilityIconState extends State<AnimatedVisibilityIcon> {
child: AnimatedContainer(
duration: const Duration(milliseconds: 300),
decoration: BoxDecoration(
color: (_currentFilledState ? widget.filledColor : widget.outlinedColor)?.withOpacity(0.2),
color: (_currentFilledState ? widget.filledColor : widget.outlinedColor)?.withValues(alpha: 0.2),
shape: BoxShape.circle,
),
child: Padding(

View file

@ -20,9 +20,9 @@ IconData getBackIcon(BuildContext context) {
}
final _shadows = [
BoxShadow(blurRadius: 1, spreadRadius: 1, color: Colors.black.withOpacity(0.2)),
BoxShadow(blurRadius: 4, spreadRadius: 4, color: Colors.black.withOpacity(0.1)),
BoxShadow(blurRadius: 16, spreadRadius: 6, color: Colors.black.withOpacity(0.2)),
BoxShadow(blurRadius: 1, spreadRadius: 1, color: Colors.black.withValues(alpha: 0.2)),
BoxShadow(blurRadius: 4, spreadRadius: 4, color: Colors.black.withValues(alpha: 0.1)),
BoxShadow(blurRadius: 16, spreadRadius: 6, color: Colors.black.withValues(alpha: 0.2)),
];
class ElevatedIconButton extends ConsumerWidget {
@ -36,7 +36,7 @@ class ElevatedIconButton extends ConsumerWidget {
return IconButton(
onPressed: onPressed,
style: IconButtonTheme.of(context).style?.copyWith(
backgroundColor: WidgetStatePropertyAll(color?.withOpacity(0.15)),
backgroundColor: WidgetStatePropertyAll(color?.withValues(alpha: 0.15)),
),
color: color,
icon: Icon(

View file

@ -295,13 +295,13 @@ class _CarouselViewState extends State<FladderCarousel> {
overlayColor: widget.overlayColor ??
WidgetStateProperty.resolveWith((Set<WidgetState> states) {
if (states.contains(WidgetState.pressed)) {
return theme.colorScheme.onSurface.withOpacity(0.1);
return theme.colorScheme.onSurface.withValues(alpha: 0.1);
}
if (states.contains(WidgetState.hovered)) {
return theme.colorScheme.onSurface.withOpacity(0.08);
return theme.colorScheme.onSurface.withValues(alpha: 0.08);
}
if (states.contains(WidgetState.focused)) {
return theme.colorScheme.onSurface.withOpacity(0.1);
return theme.colorScheme.onSurface.withValues(alpha: 0.1);
}
return null;
}),

View file

@ -28,7 +28,7 @@ class FladderScrollbar extends ConsumerWidget {
borderRadius: BorderRadius.circular(5),
color: info.isDragging
? Theme.of(context).colorScheme.secondary
: Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.75),
: Theme.of(context).colorScheme.secondaryContainer.withValues(alpha: 0.75),
),
duration: const Duration(milliseconds: 250),
);

View file

@ -95,6 +95,7 @@ class ItemActionButton extends ItemAction {
minimumSize: const WidgetStatePropertyAll(Size(50, 50)),
elevation: const WidgetStatePropertyAll(0),
foregroundColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onSurface),
iconColor: WidgetStatePropertyAll(Theme.of(context).colorScheme.onSurface),
),
onPressed: () {
if (shouldPop) {

View file

@ -16,7 +16,7 @@ Future<void> showModalSideSheet(
context: context,
transitionDuration: transitionDuration ?? const Duration(milliseconds: 200),
barrierDismissible: barrierDismissible,
barrierColor: Theme.of(context).colorScheme.scrim.withOpacity(0.3),
barrierColor: Theme.of(context).colorScheme.scrim.withValues(alpha: 0.3),
barrierLabel: 'Material 3 side sheet',
useRootNavigator: false,
transitionBuilder: (context, animation, secondaryAnimation, child) {

View file

@ -1,10 +1,12 @@
import 'dart:async';
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:fladder/screens/shared/animated_fade_size.dart';
import 'package:fladder/util/refresh_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
class SelectableIconButton extends ConsumerStatefulWidget {
final FutureOr<dynamic> Function() onPressed;
@ -36,6 +38,7 @@ class _SelectableIconButtonState extends ConsumerState<SelectableIconButton> {
child: ElevatedButton(
style: ButtonStyle(
backgroundColor: widget.selected ? WidgetStatePropertyAll(Theme.of(context).colorScheme.primary) : null,
iconColor: widget.selected ? WidgetStatePropertyAll(Theme.of(context).colorScheme.onPrimary) : null,
foregroundColor: widget.selected ? WidgetStatePropertyAll(Theme.of(context).colorScheme.onPrimary) : null,
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
),