new targets

This commit is contained in:
2025-12-23 16:30:36 +01:00
parent e111f0a99b
commit b727e65d14
32 changed files with 379 additions and 55 deletions
+16 -3
View File
@@ -6,6 +6,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
import '../services/google_calendar_service.dart';
import '../utils/translations.dart';
import '../utils/target_colors.dart';
class Contact {
final String firstName;
@@ -45,6 +46,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
String _selectedLanguage = 'English';
bool _showContacts = false;
bool _showDebugPreview = false;
late Color _backgroundColor;
// Members contact list
final List<Contact> _contacts = [
@@ -69,8 +71,11 @@ class _CalendarScreenState extends State<CalendarScreen> {
void initState() {
super.initState();
initializeDateFormatting('sl_SI', null); // Initialize Slovenian locale
// Initialize with default target background color
_backgroundColor = TargetColors.getBackgroundColor('assets/target.png');
_loadBulletColor();
_loadLanguage();
_loadSelectedTargetColor();
_loadEvents();
}
@@ -85,6 +90,14 @@ class _CalendarScreenState extends State<CalendarScreen> {
});
}
Future<void> _loadSelectedTargetColor() async {
final prefs = await SharedPreferences.getInstance();
final selectedTarget = prefs.getString('selectedTarget') ?? 'assets/target.png';
setState(() {
_backgroundColor = TargetColors.getBackgroundColor(selectedTarget);
});
}
void _toggleDebugPreview() {
setState(() {
_showDebugPreview = !_showDebugPreview;
@@ -490,12 +503,12 @@ class _CalendarScreenState extends State<CalendarScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Grey header bar with white text (matching book screen style)
// Header bar with bullet color and transparency
Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
color: Colors.grey[900],
color: accentColor.withValues(alpha: 0.6),
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(12),
topRight: Radius.circular(12),
@@ -733,7 +746,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
}
return Scaffold(
backgroundColor: Colors.white,
backgroundColor: _backgroundColor,
body: Column(
children: [
// Tab buttons