Resolve all lints and deprecation warnings
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../models/user_profile.dart';
|
||||
import '../models/scripture.dart';
|
||||
import '../theme/app_theme.dart';
|
||||
import '../providers/user_provider.dart';
|
||||
|
||||
class BibleUtils {
|
||||
static Future<void> showTranslationPicker(BuildContext context, WidgetRef ref) async {
|
||||
static Future<void> showTranslationPicker(
|
||||
BuildContext context, WidgetRef ref) async {
|
||||
final user = ref.read(userProfileProvider);
|
||||
if (user == null) return;
|
||||
|
||||
@@ -28,21 +28,21 @@ class BibleUtils {
|
||||
),
|
||||
),
|
||||
...BibleTranslation.values.map((t) => ListTile(
|
||||
title: Text(t.label),
|
||||
trailing: user.bibleTranslation == t
|
||||
? const Icon(Icons.check, color: AppColors.sageGreen)
|
||||
: null,
|
||||
onTap: () => Navigator.pop(context, t),
|
||||
)),
|
||||
title: Text(t.label),
|
||||
trailing: user.bibleTranslation == t
|
||||
? const Icon(Icons.check, color: AppColors.sageGreen)
|
||||
: null,
|
||||
onTap: () => Navigator.pop(context, t),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
if (selected != null) {
|
||||
await ref.read(userProfileProvider.notifier).updateProfile(
|
||||
user.copyWith(bibleTranslation: selected)
|
||||
);
|
||||
await ref
|
||||
.read(userProfileProvider.notifier)
|
||||
.updateProfile(user.copyWith(bibleTranslation: selected));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user