feat: complete Simple Mode contextual routing and navigation state synchronization
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:lucide_icons/lucide_icons.dart';
|
||||
import '../../../app/theme/app_colors.dart';
|
||||
import '../../../core/widgets/tool_card.dart';
|
||||
import '../../../data/services/equran_service.dart';
|
||||
|
||||
class ToolsScreen extends ConsumerWidget {
|
||||
@@ -18,11 +20,11 @@ class ToolsScreen extends ConsumerWidget {
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(Icons.notifications_outlined),
|
||||
icon: const Icon(LucideIcons.bell),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => context.push('/settings'),
|
||||
icon: const Icon(Icons.settings_outlined),
|
||||
icon: const Icon(LucideIcons.settings),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
],
|
||||
@@ -45,22 +47,22 @@ class ToolsScreen extends ConsumerWidget {
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _ToolCard(
|
||||
icon: Icons.explore,
|
||||
title: 'Arah\nKiblat',
|
||||
color: AppColors.primary,
|
||||
child: ToolCard(
|
||||
icon: LucideIcons.bookOpen,
|
||||
title: 'Al-Quran\nTerjemahan',
|
||||
color: const Color(0xFF00b894),
|
||||
isDark: isDark,
|
||||
onTap: () => context.push('/tools/qibla'),
|
||||
onTap: () => context.push('/quran'),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _ToolCard(
|
||||
icon: Icons.menu_book,
|
||||
title: 'Baca\nQuran',
|
||||
color: const Color(0xFF4A90D9),
|
||||
child: ToolCard(
|
||||
icon: LucideIcons.headphones,
|
||||
title: 'Quran\nMurattal',
|
||||
color: const Color(0xFF7B61FF),
|
||||
isDark: isDark,
|
||||
onTap: () => context.push('/tools/quran'),
|
||||
onTap: () => context.push('/quran/1/murattal'),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -69,22 +71,22 @@ class ToolsScreen extends ConsumerWidget {
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _ToolCard(
|
||||
icon: Icons.auto_awesome,
|
||||
title: 'Penghitung\nDzikir',
|
||||
color: const Color(0xFFE8A838),
|
||||
child: ToolCard(
|
||||
icon: LucideIcons.compass,
|
||||
title: 'Arah\nKiblat',
|
||||
color: const Color(0xFF0984E3),
|
||||
isDark: isDark,
|
||||
onTap: () => context.push('/tools/dzikir'),
|
||||
onTap: () => context.push('/tools/qibla'),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _ToolCard(
|
||||
icon: Icons.headphones,
|
||||
title: 'Quran\nMurattal',
|
||||
color: const Color(0xFF7B61FF),
|
||||
child: ToolCard(
|
||||
icon: LucideIcons.sparkles,
|
||||
title: 'Tasbih\nDigital',
|
||||
color: AppColors.primary,
|
||||
isDark: isDark,
|
||||
onTap: () => context.push('/tools/quran/1/murattal'),
|
||||
onTap: () => context.push('/dzikir'),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -133,7 +135,7 @@ class ToolsScreen extends ConsumerWidget {
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.share,
|
||||
icon: Icon(LucideIcons.share2,
|
||||
size: 18,
|
||||
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight),
|
||||
onPressed: () {},
|
||||
@@ -183,69 +185,3 @@ class ToolsScreen extends ConsumerWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ToolCard extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final String title;
|
||||
final Color color;
|
||||
final bool isDark;
|
||||
final VoidCallback onTap;
|
||||
|
||||
const _ToolCard({
|
||||
required this.icon,
|
||||
required this.title,
|
||||
required this.color,
|
||||
required this.isDark,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
height: 140,
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: isDark ? AppColors.surfaceDark : AppColors.surfaceLight,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(
|
||||
color: isDark
|
||||
? color.withValues(alpha: 0.15)
|
||||
: AppColors.cream,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: color.withValues(alpha: 0.08),
|
||||
blurRadius: 12,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: 44,
|
||||
height: 44,
|
||||
decoration: BoxDecoration(
|
||||
color: color.withValues(alpha: 0.15),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Icon(icon, color: color, size: 24),
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w700,
|
||||
height: 1.3,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user