refactoring and checkpoint
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Classe utilitaire pour gérer les couleurs de l'application en mode clair et sombre.
|
||||
class AppColors {
|
||||
// Thème clair
|
||||
static const Color lightPrimary = Color(0xFF0057D9);
|
||||
static const Color lightSecondary = Color(0xFFFFC107);
|
||||
static const Color lightOnPrimary = Colors.white;
|
||||
static const Color lightOnSecondary = Color(0xFF212121);
|
||||
static const Color lightBackground = Colors.white;
|
||||
static const Color lightSurface = Color(0xFFFFFFFF);
|
||||
static const Color lightTextPrimary = Color(0xFF212121);
|
||||
static const Color lightTextSecondary = Color(0xFF616161);
|
||||
static const Color lightCardColor = Color(0xFFFFFFFF);
|
||||
static const Color lightAccentColor = Color(0xFF4CAF50);
|
||||
static const Color lightError = Color(0xFFB00020);
|
||||
static const Color lightIconPrimary = Color(0xFF212121); // Icône primaire sombre
|
||||
static const Color lightIconSecondary = Color(0xFF757575); // Icône secondaire gris clair
|
||||
// Thème sombre
|
||||
static const Color darkPrimary = Color(0xFF121212);
|
||||
static const Color darkSecondary = Color(0xFFFF5722);
|
||||
static const Color darkOnPrimary = Colors.white;
|
||||
static const Color darkOnSecondary = Colors.white;
|
||||
static const Color darkBackground = Color(0xFF121212);
|
||||
static const Color darkSurface = Color(0xFF1F1F1F);
|
||||
static const Color darkTextPrimary = Color(0xFFE0E0E0);
|
||||
static const Color darkTextSecondary = Color(0xFFBDBDBD);
|
||||
static const Color darkCardColor = Color(0xFF2C2C2C);
|
||||
static const Color darkAccentColor = Color(0xFF81C784);
|
||||
static const Color darkError = Color(0xFFCF6679);
|
||||
static const Color darkIconPrimary = Colors.white; // Icône primaire blanche
|
||||
static const Color darkIconSecondary = Color(0xFFBDBDBD); // Icône secondaire gris clair
|
||||
|
||||
// Sélection automatique des couleurs en fonction du mode de thème
|
||||
static Color get primary => isDarkMode() ? darkPrimary : lightPrimary;
|
||||
static Color get secondary => isDarkMode() ? darkSecondary : lightSecondary;
|
||||
static Color get onPrimary => isDarkMode() ? darkOnPrimary : lightOnPrimary;
|
||||
static Color get onSecondary => isDarkMode() ? darkOnSecondary : lightOnSecondary;
|
||||
static Color get backgroundColor => isDarkMode() ? darkBackground : lightBackground;
|
||||
static Color get surface => isDarkMode() ? darkSurface : lightSurface;
|
||||
static Color get textPrimary => isDarkMode() ? darkTextPrimary : lightTextPrimary;
|
||||
static Color get textSecondary => isDarkMode() ? darkTextSecondary : lightTextSecondary;
|
||||
static Color get cardColor => isDarkMode() ? darkCardColor : lightCardColor;
|
||||
static Color get accentColor => isDarkMode() ? darkAccentColor : lightAccentColor;
|
||||
static Color get errorColor => isDarkMode() ? darkError : lightError;
|
||||
static Color get iconPrimary => isDarkMode() ? darkIconPrimary : lightIconPrimary;
|
||||
static Color get iconSecondary => isDarkMode() ? darkIconSecondary : lightIconSecondary;
|
||||
|
||||
/// Méthode utilitaire pour vérifier si le mode sombre est activé.
|
||||
static bool isDarkMode() {
|
||||
final brightness = WidgetsBinding.instance.platformDispatcher.platformBrightness;
|
||||
return brightness == Brightness.dark;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,31 @@
|
||||
class Urls {
|
||||
static const String baseUrl = 'http://192.168.1.145:8085';
|
||||
// static const String login = baseUrl + 'auth/login';
|
||||
static const String eventsUrl = '$baseUrl/events';
|
||||
// Ajoute d'autres URLs ici
|
||||
|
||||
// Authentication and Users Endpoints
|
||||
static const String authenticateUser = '$baseUrl/users/authenticate';
|
||||
static const String createUser = '$baseUrl/users';
|
||||
static const String getUserById = '$baseUrl/users'; // Append '/{id}' dynamically
|
||||
static const String deleteUser = '$baseUrl/users'; // Append '/{id}' dynamically
|
||||
static const String updateUserProfileImage = '$baseUrl/users'; // Append '/{id}/profile-image' dynamically
|
||||
|
||||
// Events Endpoints
|
||||
static const String createEvent = '$baseUrl/events';
|
||||
static const String getEventById = '$baseUrl/events'; // Append '/{id}' dynamically
|
||||
static const String deleteEvent = '$baseUrl/events'; // Append '/{id}' dynamically
|
||||
static const String getEventsAfterDate = '$baseUrl/events/after-date';
|
||||
static const String addParticipant = '$baseUrl/events'; // Append '/{id}/participants' dynamically
|
||||
static const String removeParticipant = '$baseUrl/events'; // Append '/{id}/participants/{userId}' dynamically
|
||||
static const String getNumberOfParticipants = '$baseUrl/events'; // Append '/{id}/participants/count' dynamically
|
||||
static const String closeEvent = '$baseUrl/events'; // Append '/{id}/close' dynamically
|
||||
static const String updateEvent = '$baseUrl/events'; // Append '/{id}' dynamically
|
||||
static const String updateEventImage = '$baseUrl/events'; // Append '/{id}/image' dynamically
|
||||
static const String getAllEvents = '$baseUrl/events';
|
||||
static const String getEventsByCategory = '$baseUrl/events/category'; // Append '/{category}' dynamically
|
||||
static const String updateEventStatus = '$baseUrl/events'; // Append '/{id}/status' dynamically
|
||||
static const String searchEvents = '$baseUrl/events/search'; // Use query parameter for 'keyword'
|
||||
static const String getEventsByUser = '$baseUrl/events/user'; // Append '/{userId}' dynamically
|
||||
static const String getEventsByStatus = '$baseUrl/events/status'; // Append '/{status}' dynamically
|
||||
static const String getEventsBetweenDates = '$baseUrl/events/between-dates'; // Use query parameters for startDate and endDate
|
||||
|
||||
// Other URLs can be added here as the project expands
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user