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

@@ -3,8 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../theme/app_theme.dart';
import '../../models/user_profile.dart';
import '../../models/cycle_entry.dart';
import '../../models/scripture.dart';
import '../calendar/calendar_screen.dart';
import '../log/log_screen.dart';
import '../log/pad_tracker_screen.dart';
@@ -20,7 +19,7 @@ import '../settings/privacy_settings_screen.dart';
import '../settings/supplies_settings_screen.dart';
import '../settings/export_data_screen.dart';
import '../learn/wife_learn_screen.dart';
import '../../widgets/tip_card.dart';
import '../../widgets/cycle_ring.dart';
import '../../widgets/scripture_card.dart';
import '../../widgets/pad_tracker_card.dart';
@@ -135,7 +134,7 @@ class HomeScreen extends ConsumerWidget {
color: (Theme.of(context).brightness == Brightness.dark
? Colors.black
: AppColors.charcoal)
.withOpacity(0.1),
.withValues(alpha: 0.1),
blurRadius: 10,
offset: const Offset(0, -2),
),
@@ -153,7 +152,7 @@ class HomeScreen extends ConsumerWidget {
}
class _DashboardTab extends ConsumerStatefulWidget {
const _DashboardTab({super.key});
const _DashboardTab();
@override
ConsumerState<_DashboardTab> createState() => _DashboardTabState();
@@ -190,8 +189,6 @@ class _DashboardTabState extends ConsumerState<_DashboardTab> {
BibleTranslation.esv;
final role =
ref.watch(userProfileProvider.select((u) => u?.role)) ?? UserRole.wife;
final isMarried =
ref.watch(userProfileProvider.select((u) => u?.isMarried)) ?? false;
final averageCycleLength =
ref.watch(userProfileProvider.select((u) => u?.averageCycleLength)) ??
28;
@@ -244,7 +241,7 @@ class _DashboardTabState extends ConsumerState<_DashboardTab> {
Positioned(
left: 0,
child: IconButton(
icon: Icon(Icons.arrow_back_ios),
icon: const Icon(Icons.arrow_back_ios),
onPressed: () => ref
.read(scriptureProvider.notifier)
.getPreviousScripture(),
@@ -254,7 +251,7 @@ class _DashboardTabState extends ConsumerState<_DashboardTab> {
Positioned(
right: 0,
child: IconButton(
icon: Icon(Icons.arrow_forward_ios),
icon: const Icon(Icons.arrow_forward_ios),
onPressed: () => ref
.read(scriptureProvider.notifier)
.getNextScripture(),
@@ -336,7 +333,7 @@ class _DashboardTabState extends ConsumerState<_DashboardTab> {
width: 48,
height: 48,
decoration: BoxDecoration(
color: theme.colorScheme.primaryContainer.withOpacity(0.5),
color: theme.colorScheme.primaryContainer.withValues(alpha: 0.5),
borderRadius: BorderRadius.circular(12),
),
child: Icon(
@@ -357,7 +354,8 @@ class _SettingsTab extends ConsumerWidget {
{VoidCallback? onTap}) {
return ListTile(
leading: Icon(icon,
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.8)),
color:
Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.8)),
title: Text(
title,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
@@ -445,7 +443,7 @@ class _SettingsTab extends ConsumerWidget {
color: Theme.of(context)
.colorScheme
.outline
.withOpacity(0.05)),
.withValues(alpha: 0.05)),
),
child: Row(
children: [
@@ -458,11 +456,11 @@ class _SettingsTab extends ConsumerWidget {
Theme.of(context)
.colorScheme
.primary
.withOpacity(0.7),
.withValues(alpha: 0.7),
Theme.of(context)
.colorScheme
.secondary
.withOpacity(0.7)
.withValues(alpha: 0.7)
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
@@ -613,7 +611,7 @@ class _SettingsTab extends ConsumerWidget {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CycleHistoryScreen()));
builder: (context) => const CycleHistoryScreen()));
}),
_buildSettingsTile(
context, Icons.download_outlined, 'Export Data', onTap: () {
@@ -655,7 +653,10 @@ class _SettingsTab extends ConsumerWidget {
color: Theme.of(context).cardTheme.color,
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: Theme.of(context).colorScheme.outline.withOpacity(0.05)),
color: Theme.of(context)
.colorScheme
.outline
.withValues(alpha: 0.05)),
),
child: Column(
children: tiles,
@@ -767,74 +768,6 @@ class _SettingsTab extends ConsumerWidget {
),
);
}
void _showShareDialog(BuildContext context, WidgetRef ref) {
// Generate a simple pairing code (in a real app, this would be stored/validated)
final userProfile = ref.read(userProfileProvider);
final pairingCode =
userProfile?.id?.substring(0, 6).toUpperCase() ?? 'ABC123';
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Row(
children: [
Icon(Icons.share_outlined,
color: Theme.of(context).colorScheme.primary),
const SizedBox(width: 8),
const Text('Share with Husband'),
],
),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Share this code with your husband so he can connect to your cycle data:',
style:
GoogleFonts.outfit(fontSize: 14, color: AppColors.warmGray),
),
const SizedBox(height: 24),
Container(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color:
Theme.of(context).colorScheme.primary.withOpacity(0.3)),
),
child: SelectableText(
pairingCode,
style: GoogleFonts.outfit(
fontSize: 32,
fontWeight: FontWeight.bold,
letterSpacing: 4,
color: Theme.of(context).colorScheme.primary,
),
),
),
const SizedBox(height: 16),
Text(
'He can enter this in his app under Settings > Connect with Wife.',
style:
GoogleFonts.outfit(fontSize: 12, color: AppColors.warmGray),
textAlign: TextAlign.center,
),
],
),
actions: [
ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.primary,
foregroundColor: Colors.white,
),
child: const Text('Done'),
),
],
),
);
}
}
Widget _buildWifeTipsSection(BuildContext context) {
@@ -900,7 +833,7 @@ Widget _buildTipCard(
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
color: Theme.of(context).colorScheme.primary.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(8),
),
child: Icon(