Resolve all lints and deprecation warnings
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../models/user_profile.dart'; // Import UserProfile
|
||||
import '../../providers/user_provider.dart';
|
||||
|
||||
class NotificationSettingsScreen extends ConsumerWidget {
|
||||
@@ -26,29 +25,30 @@ class NotificationSettingsScreen extends ConsumerWidget {
|
||||
children: [
|
||||
SwitchListTile(
|
||||
title: const Text('Period Estimate'),
|
||||
subtitle: const Text('Get notified when your period is predicted to start soon.'),
|
||||
subtitle: const Text(
|
||||
'Get notified when your period is predicted to start soon.'),
|
||||
value: userProfile.notifyPeriodEstimate,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(userProfileProvider.notifier)
|
||||
.updateProfile(userProfile.copyWith(notifyPeriodEstimate: value));
|
||||
await ref.read(userProfileProvider.notifier).updateProfile(
|
||||
userProfile.copyWith(notifyPeriodEstimate: value));
|
||||
},
|
||||
),
|
||||
const Divider(),
|
||||
SwitchListTile(
|
||||
title: const Text('Period Start'),
|
||||
subtitle: const Text('Get notified when a period starts (or husband needs to know).'),
|
||||
subtitle: const Text(
|
||||
'Get notified when a period starts (or husband needs to know).'),
|
||||
value: userProfile.notifyPeriodStart,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(userProfileProvider.notifier)
|
||||
.updateProfile(userProfile.copyWith(notifyPeriodStart: value));
|
||||
await ref.read(userProfileProvider.notifier).updateProfile(
|
||||
userProfile.copyWith(notifyPeriodStart: value));
|
||||
},
|
||||
),
|
||||
const Divider(),
|
||||
SwitchListTile(
|
||||
title: const Text('Low Supply Alert'),
|
||||
subtitle: const Text('Get notified when pad inventory is running low.'),
|
||||
subtitle:
|
||||
const Text('Get notified when pad inventory is running low.'),
|
||||
value: userProfile.notifyLowSupply,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
@@ -58,14 +58,15 @@ class NotificationSettingsScreen extends ConsumerWidget {
|
||||
),
|
||||
if (userProfile.isPadTrackingEnabled) ...[
|
||||
const Divider(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
||||
child: Text(
|
||||
'Pad Change Reminders',
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
CheckboxListTile(
|
||||
@@ -100,12 +101,14 @@ class NotificationSettingsScreen extends ConsumerWidget {
|
||||
),
|
||||
CheckboxListTile(
|
||||
title: const Text('Change Now (Time\'s Up)'),
|
||||
subtitle: const Text('Get notified when it\'s recommended to change.'),
|
||||
subtitle:
|
||||
const Text('Get notified when it\'s recommended to change.'),
|
||||
value: userProfile.notifyPadNow,
|
||||
onChanged: (value) async {
|
||||
if (value != null) {
|
||||
await ref.read(userProfileProvider.notifier).updateProfile(
|
||||
userProfile.copyWith(notifyPadNow: value));
|
||||
await ref
|
||||
.read(userProfileProvider.notifier)
|
||||
.updateProfile(userProfile.copyWith(notifyPadNow: value));
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user