Resolve all lints and deprecation warnings
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
import '../../theme/app_theme.dart';
|
||||
import '../../models/user_profile.dart';
|
||||
import '../../models/cycle_entry.dart';
|
||||
import '../home/home_screen.dart';
|
||||
import '../husband/husband_home_screen.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -178,6 +175,7 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
// final isDark = theme.brightness == Brightness.dark; - unused
|
||||
final isDark = theme.brightness == Brightness.dark;
|
||||
|
||||
// Different background color for husband flow
|
||||
@@ -208,7 +206,7 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
spacing: 12,
|
||||
activeDotColor:
|
||||
isHusband ? AppColors.navyBlue : AppColors.sageGreen,
|
||||
dotColor: theme.colorScheme.outline.withOpacity(0.2),
|
||||
dotColor: theme.colorScheme.outline.withValues(alpha: 0.2),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -255,7 +253,10 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
height: 80,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [AppColors.blushPink, AppColors.rose.withOpacity(0.7)],
|
||||
colors: [
|
||||
AppColors.blushPink,
|
||||
AppColors.rose.withValues(alpha: 0.7)
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
@@ -311,7 +312,7 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
// Dynamic colors based on role selection
|
||||
final activeColor =
|
||||
role == UserRole.wife ? AppColors.sageGreen : AppColors.navyBlue;
|
||||
final activeBg = activeColor.withOpacity(isDark ? 0.3 : 0.1);
|
||||
final activeBg = activeColor.withValues(alpha: isDark ? 0.3 : 0.1);
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => setState(() => _role = role),
|
||||
@@ -324,7 +325,7 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
border: Border.all(
|
||||
color: isSelected
|
||||
? activeColor
|
||||
: theme.colorScheme.outline.withOpacity(0.1),
|
||||
: theme.colorScheme.outline.withValues(alpha: 0.1),
|
||||
width: isSelected ? 2 : 1,
|
||||
),
|
||||
),
|
||||
@@ -333,8 +334,9 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
isSelected ? activeColor : theme.colorScheme.surfaceVariant,
|
||||
color: isSelected
|
||||
? activeColor
|
||||
: theme.colorScheme.surfaceContainerHighest,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
@@ -501,9 +503,7 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
child: SizedBox(
|
||||
height: 54,
|
||||
child: ElevatedButton(
|
||||
onPressed: (_relationshipStatus != null && !_isNavigating)
|
||||
? _nextPage
|
||||
: null,
|
||||
onPressed: !_isNavigating ? _nextPage : null,
|
||||
child: const Text('Continue'),
|
||||
),
|
||||
),
|
||||
@@ -528,13 +528,13 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? AppColors.sageGreen.withOpacity(isDark ? 0.3 : 0.1)
|
||||
? AppColors.sageGreen.withValues(alpha: isDark ? 0.3 : 0.1)
|
||||
: theme.cardTheme.color,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: isSelected
|
||||
? AppColors.sageGreen
|
||||
: theme.colorScheme.outline.withOpacity(0.1),
|
||||
: theme.colorScheme.outline.withValues(alpha: 0.1),
|
||||
width: isSelected ? 2 : 1,
|
||||
),
|
||||
),
|
||||
@@ -560,7 +560,7 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
),
|
||||
),
|
||||
if (isSelected)
|
||||
Icon(Icons.check_circle, color: AppColors.sageGreen),
|
||||
const Icon(Icons.check_circle, color: AppColors.sageGreen),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -640,13 +640,13 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? AppColors.sageGreen.withOpacity(isDark ? 0.3 : 0.1)
|
||||
? AppColors.sageGreen.withValues(alpha: isDark ? 0.3 : 0.1)
|
||||
: theme.cardTheme.color,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: isSelected
|
||||
? AppColors.sageGreen
|
||||
: theme.colorScheme.outline.withOpacity(0.1),
|
||||
: theme.colorScheme.outline.withValues(alpha: 0.1),
|
||||
width: isSelected ? 2 : 1,
|
||||
),
|
||||
),
|
||||
@@ -672,7 +672,7 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
),
|
||||
),
|
||||
if (isSelected)
|
||||
Icon(Icons.check_circle, color: AppColors.sageGreen),
|
||||
const Icon(Icons.check_circle, color: AppColors.sageGreen),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -681,7 +681,8 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
|
||||
Widget _buildCyclePage() {
|
||||
final theme = Theme.of(context);
|
||||
final isDark = theme.brightness == Brightness.dark;
|
||||
// final isDark = theme.brightness == Brightness.dark; - unused
|
||||
// final isDark = theme.brightness == Brightness.dark;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(32),
|
||||
@@ -812,7 +813,7 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
color: theme.cardTheme.color,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: theme.colorScheme.outline.withOpacity(0.1))),
|
||||
color: theme.colorScheme.outline.withValues(alpha: 0.1))),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.calendar_today,
|
||||
@@ -878,10 +879,10 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
width: 64,
|
||||
height: 64,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.navyBlue.withOpacity(0.1),
|
||||
color: AppColors.navyBlue.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Icon(Icons.link, size: 32, color: AppColors.navyBlue),
|
||||
child: const Icon(Icons.link, size: 32, color: AppColors.navyBlue),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Text(
|
||||
@@ -975,10 +976,11 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
width: 64,
|
||||
height: 64,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.sageGreen.withOpacity(0.1),
|
||||
color: AppColors.sageGreen.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Icon(Icons.favorite, size: 32, color: AppColors.sageGreen),
|
||||
child: const Icon(Icons.favorite,
|
||||
size: 32, color: AppColors.sageGreen),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Text(
|
||||
@@ -1073,12 +1075,13 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? color.withOpacity(isDark ? 0.3 : 0.1)
|
||||
? color.withValues(alpha: isDark ? 0.3 : 0.1)
|
||||
: theme.cardTheme.color,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color:
|
||||
isSelected ? color : theme.colorScheme.outline.withOpacity(0.1),
|
||||
color: isSelected
|
||||
? color
|
||||
: theme.colorScheme.outline.withValues(alpha: 0.1),
|
||||
width: isSelected ? 2 : 1,
|
||||
),
|
||||
),
|
||||
@@ -1087,7 +1090,9 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? color : theme.colorScheme.surfaceVariant,
|
||||
color: isSelected
|
||||
? color
|
||||
: theme.colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
|
||||
Reference in New Issue
Block a user