feat: checkpoint API migration and dzikir UX updates
This commit is contained in:
@@ -7,7 +7,7 @@ import '../../../app/theme/app_colors.dart';
|
||||
import '../../../data/local/hive_boxes.dart';
|
||||
import '../../../data/local/models/app_settings.dart';
|
||||
import '../../../data/local/models/quran_bookmark.dart';
|
||||
import '../../../data/services/equran_service.dart';
|
||||
import '../../../data/services/muslim_api_service.dart';
|
||||
|
||||
class QuranScreen extends ConsumerStatefulWidget {
|
||||
final bool isSimpleModeTab;
|
||||
@@ -36,7 +36,8 @@ class _QuranScreenState extends ConsumerState<QuranScreen> {
|
||||
}
|
||||
|
||||
Future<void> _loadSurahs() async {
|
||||
final data = await EQuranService.instance.getAllSurahs();
|
||||
final data = await MuslimApiService.instance.getAllSurahs();
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_surahs = data;
|
||||
_loading = false;
|
||||
@@ -100,8 +101,6 @@ class _QuranScreenState extends ConsumerState<QuranScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final box = Hive.box<AppSettings>(HiveBoxes.settings);
|
||||
final isSimpleMode = box.get('default')?.simpleMode ?? false;
|
||||
final filtered = _searchQuery.isEmpty
|
||||
? _surahs
|
||||
: _surahs
|
||||
@@ -119,7 +118,15 @@ class _QuranScreenState extends ConsumerState<QuranScreen> {
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(LucideIcons.bookmark),
|
||||
onPressed: () => context.push('/tools/quran/bookmarks'),
|
||||
onPressed: () => context.push(widget.isSimpleModeTab
|
||||
? '/quran/bookmarks'
|
||||
: '/tools/quran/bookmarks'),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(LucideIcons.sparkles),
|
||||
onPressed: () => context.push(widget.isSimpleModeTab
|
||||
? '/quran/enrichment'
|
||||
: '/tools/quran/enrichment'),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(LucideIcons.settings2),
|
||||
@@ -198,8 +205,9 @@ class _QuranScreenState extends ConsumerState<QuranScreen> {
|
||||
final hasLastRead = box.values.any((b) => b.isLastRead && b.surahId == number);
|
||||
|
||||
return ListTile(
|
||||
onTap: () =>
|
||||
context.push('/tools/quran/$number'),
|
||||
onTap: () => context.push(widget.isSimpleModeTab
|
||||
? '/quran/$number'
|
||||
: '/tools/quran/$number'),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 0, vertical: 6),
|
||||
leading: Container(
|
||||
@@ -250,6 +258,7 @@ class _QuranScreenState extends ConsumerState<QuranScreen> {
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Amiri',
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user