Resolve all lints and deprecation warnings
This commit is contained in:
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||
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 '../../providers/user_provider.dart';
|
||||
|
||||
class SharingSettingsScreen extends ConsumerWidget {
|
||||
@@ -31,7 +30,9 @@ class SharingSettingsScreen extends ConsumerWidget {
|
||||
ListTile(
|
||||
leading: const Icon(Icons.link),
|
||||
title: const Text('Link with Husband'),
|
||||
subtitle: Text(userProfile.partnerName != null ? 'Linked to ${userProfile.partnerName}' : 'Not linked'),
|
||||
subtitle: Text(userProfile.partnerName != null
|
||||
? 'Linked to ${userProfile.partnerName}'
|
||||
: 'Not linked'),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
onTap: () => _showShareDialog(context, ref),
|
||||
),
|
||||
@@ -67,9 +68,8 @@ class SharingSettingsScreen extends ConsumerWidget {
|
||||
title: const Text('Share Energy Levels'),
|
||||
value: userProfile.shareEnergyLevels,
|
||||
onChanged: (value) {
|
||||
ref
|
||||
.read(userProfileProvider.notifier)
|
||||
.updateProfile(userProfile.copyWith(shareEnergyLevels: value));
|
||||
ref.read(userProfileProvider.notifier).updateProfile(
|
||||
userProfile.copyWith(shareEnergyLevels: value));
|
||||
},
|
||||
),
|
||||
SwitchListTile(
|
||||
@@ -98,16 +98,17 @@ class SharingSettingsScreen extends ConsumerWidget {
|
||||
void _showShareDialog(BuildContext context, WidgetRef ref) {
|
||||
// Generate a simple pairing code
|
||||
final userProfile = ref.read(userProfileProvider);
|
||||
final pairingCode = userProfile?.id?.substring(0, 6).toUpperCase() ?? 'ABC123';
|
||||
final pairingCode =
|
||||
userProfile?.id.substring(0, 6).toUpperCase() ?? 'ABC123';
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Row(
|
||||
title: const Row(
|
||||
children: [
|
||||
Icon(Icons.share_outlined, color: AppColors.navyBlue),
|
||||
const SizedBox(width: 8),
|
||||
const Text('Share with Husband'),
|
||||
SizedBox(width: 8),
|
||||
Text('Share with Husband'),
|
||||
],
|
||||
),
|
||||
content: Column(
|
||||
@@ -115,15 +116,17 @@ class SharingSettingsScreen extends ConsumerWidget {
|
||||
children: [
|
||||
Text(
|
||||
'Share this code with your husband so he can connect to your cycle data:',
|
||||
style: GoogleFonts.outfit(fontSize: 14, color: AppColors.warmGray),
|
||||
style:
|
||||
GoogleFonts.outfit(fontSize: 14, color: AppColors.warmGray),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.navyBlue.withOpacity(0.1),
|
||||
color: AppColors.navyBlue.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: AppColors.navyBlue.withOpacity(0.3)),
|
||||
border: Border.all(
|
||||
color: AppColors.navyBlue.withValues(alpha: 0.3)),
|
||||
),
|
||||
child: SelectableText(
|
||||
pairingCode,
|
||||
@@ -138,7 +141,8 @@ class SharingSettingsScreen extends ConsumerWidget {
|
||||
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),
|
||||
style:
|
||||
GoogleFonts.outfit(fontSize: 12, color: AppColors.warmGray),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user