Resolve all lints and deprecation warnings

This commit is contained in:
2026-01-09 10:04:51 -06:00
parent 512577b092
commit a799e9cf59
56 changed files with 2819 additions and 3159 deletions

View File

@@ -6,7 +6,6 @@ import 'package:table_calendar/table_calendar.dart';
import '../../models/user_profile.dart';
import '../../models/cycle_entry.dart';
import '../../providers/user_provider.dart';
import '../../services/cycle_service.dart';
import '../../theme/app_theme.dart';
import '../log/log_screen.dart';
import 'package:uuid/uuid.dart';
@@ -96,7 +95,7 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
color: Colors.black.withValues(alpha: 0.05),
blurRadius: 15,
offset: const Offset(0, 5),
),
@@ -134,7 +133,7 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
AppColors.charcoal,
),
todayDecoration: BoxDecoration(
color: AppColors.sageGreen.withOpacity(0.3),
color: AppColors.sageGreen.withValues(alpha: 0.3),
shape: BoxShape.circle,
),
todayTextStyle: GoogleFonts.outfit(
@@ -303,7 +302,7 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
return Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: AppColors.lightGray.withOpacity(0.5),
color: AppColors.lightGray.withValues(alpha: 0.5),
borderRadius: BorderRadius.circular(12),
),
child: Row(
@@ -332,7 +331,7 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
boxShadow: isSelected
? [
BoxShadow(
color: Colors.black.withOpacity(0.1),
color: Colors.black.withValues(alpha: 0.1),
blurRadius: 4,
offset: const Offset(0, 2),
)
@@ -359,12 +358,12 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: AppColors.blushPink.withOpacity(0.5),
color: AppColors.blushPink.withValues(alpha: 0.5),
borderRadius: BorderRadius.circular(20),
),
child: Row(
children: [
Icon(Icons.info_outline, size: 16, color: AppColors.rose),
const Icon(Icons.info_outline, size: 16, color: AppColors.rose),
const SizedBox(width: 4),
Text(
'Legend',
@@ -451,7 +450,7 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
color: Colors.black.withValues(alpha: 0.05),
blurRadius: 10,
offset: const Offset(0, 4),
),
@@ -482,7 +481,7 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: _getPhaseColor(phase).withOpacity(0.15),
color: _getPhaseColor(phase).withValues(alpha: 0.15),
borderRadius: BorderRadius.circular(20),
),
child: Row(
@@ -625,9 +624,10 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
margin: const EdgeInsets.only(top: 8),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: AppColors.menstrualPhase.withOpacity(0.05),
color: AppColors.menstrualPhase.withValues(alpha: 0.05),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: AppColors.menstrualPhase.withOpacity(0.2)),
border:
Border.all(color: AppColors.menstrualPhase.withValues(alpha: 0.2)),
),
child: Row(
children: [
@@ -703,9 +703,9 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
margin: const EdgeInsets.only(top: 16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: AppColors.softGold.withOpacity(isDark ? 0.15 : 0.1),
color: AppColors.softGold.withValues(alpha: isDark ? 0.15 : 0.1),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: AppColors.softGold.withOpacity(0.3)),
border: Border.all(color: AppColors.softGold.withValues(alpha: 0.3)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -758,7 +758,7 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: color.withOpacity(0.1),
color: color.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(8),
),
child: Icon(icon, color: color, size: 18),
@@ -791,13 +791,24 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
String _getSymptomsString(CycleEntry entry) {
List<String> s = [];
if (entry.crampIntensity != null && entry.crampIntensity! > 0)
if (entry.crampIntensity != null && entry.crampIntensity! > 0) {
s.add('Cramps (${entry.crampIntensity}/5)');
if (entry.hasHeadache) s.add('Headache');
if (entry.hasBloating) s.add('Bloating');
if (entry.hasBreastTenderness) s.add('Breast Tenderness');
if (entry.hasFatigue) s.add('Fatigue');
if (entry.hasAcne) s.add('Acne');
}
if (entry.hasHeadache) {
s.add('Headache');
}
if (entry.hasBloating) {
s.add('Bloating');
}
if (entry.hasBreastTenderness) {
s.add('Breast Tenderness');
}
if (entry.hasFatigue) {
s.add('Fatigue');
}
if (entry.hasAcne) {
s.add('Acne');
}
return s.join(', ');
}
@@ -856,14 +867,9 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
return months[month - 1];
}
bool _isLoggedPeriodDay(DateTime date, List<CycleEntry> entries) {
final entry = _getEntryForDate(date, entries);
return entry?.isPeriodDay ?? false;
}
Widget _buildCalendarDay(DateTime day, DateTime focusedDay,
List<CycleEntry> entries, DateTime? lastPeriodStart, int cycleLength,
{bool isSelected = false, bool isToday = false, bool isWeekend = false}) {
{bool isSelected = false, bool isToday = false}) {
final phase = _getPhaseForDate(day, lastPeriodStart, cycleLength);
final isDark = Theme.of(context).brightness == Brightness.dark;
@@ -888,12 +894,12 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
);
} else if (isToday) {
decoration = BoxDecoration(
color: AppColors.sageGreen.withOpacity(0.2),
color: AppColors.sageGreen.withValues(alpha: 0.2),
shape: BoxShape.circle,
);
} else if (phase != null) {
decoration = BoxDecoration(
color: _getPhaseColor(phase).withOpacity(isDark ? 0.2 : 0.15),
color: _getPhaseColor(phase).withValues(alpha: isDark ? 0.2 : 0.15),
shape: BoxShape.circle,
);
}