Resolve all lints and deprecation warnings
This commit is contained in:
@@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../models/user_profile.dart';
|
||||
import '../../providers/user_provider.dart';
|
||||
import '../../theme/app_theme.dart';
|
||||
import '../../widgets/pad_settings_dialog.dart';
|
||||
|
||||
class AppearanceScreen extends ConsumerWidget {
|
||||
const AppearanceScreen({super.key});
|
||||
@@ -43,41 +42,42 @@ class AppearanceScreen extends ConsumerWidget {
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
SegmentedButton<AppThemeMode>(
|
||||
segments: const [
|
||||
ButtonSegment(
|
||||
value: AppThemeMode.light,
|
||||
label: Text('Light'),
|
||||
icon: Icon(Icons.light_mode),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: AppThemeMode.dark,
|
||||
label: Text('Dark'),
|
||||
icon: Icon(Icons.dark_mode),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: AppThemeMode.system,
|
||||
label: Text('System'),
|
||||
icon: Icon(Icons.brightness_auto),
|
||||
),
|
||||
],
|
||||
selected: {currentMode},
|
||||
onSelectionChanged: (Set<AppThemeMode> newSelection) {
|
||||
if (newSelection.isNotEmpty) {
|
||||
ref
|
||||
.read(userProfileProvider.notifier)
|
||||
.updateThemeMode(newSelection.first);
|
||||
}
|
||||
},
|
||||
style: SegmentedButton.styleFrom(
|
||||
fixedSize: const Size.fromHeight(48),
|
||||
)
|
||||
),
|
||||
segments: const [
|
||||
ButtonSegment(
|
||||
value: AppThemeMode.light,
|
||||
label: Text('Light'),
|
||||
icon: Icon(Icons.light_mode),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: AppThemeMode.dark,
|
||||
label: Text('Dark'),
|
||||
icon: Icon(Icons.dark_mode),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: AppThemeMode.system,
|
||||
label: Text('System'),
|
||||
icon: Icon(Icons.brightness_auto),
|
||||
),
|
||||
],
|
||||
selected: {
|
||||
currentMode
|
||||
},
|
||||
onSelectionChanged: (Set<AppThemeMode> newSelection) {
|
||||
if (newSelection.isNotEmpty) {
|
||||
ref
|
||||
.read(userProfileProvider.notifier)
|
||||
.updateThemeMode(newSelection.first);
|
||||
}
|
||||
},
|
||||
style: SegmentedButton.styleFrom(
|
||||
fixedSize: const Size.fromHeight(48),
|
||||
)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAccentColorSelector(BuildContext context, WidgetRef ref,
|
||||
String currentAccent) {
|
||||
Widget _buildAccentColorSelector(
|
||||
BuildContext context, WidgetRef ref, String currentAccent) {
|
||||
final accents = [
|
||||
{'color': AppColors.sageGreen, 'value': '0xFFA8C5A8'},
|
||||
{'color': AppColors.rose, 'value': '0xFFE8A0B0'},
|
||||
@@ -125,7 +125,7 @@ class AppearanceScreen extends ConsumerWidget {
|
||||
boxShadow: [
|
||||
if (isSelected)
|
||||
BoxShadow(
|
||||
color: color.withOpacity(0.4),
|
||||
color: color.withValues(alpha: 0.4),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 4),
|
||||
)
|
||||
@@ -141,4 +141,4 @@ class AppearanceScreen extends ConsumerWidget {
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user