173 lines
4.8 KiB
Dart
173 lines
4.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// Costanti dell'applicazione
|
|
class AppConstants {
|
|
// API Configuration
|
|
static const String apiBaseUrl = 'http://10.0.2.2:8000'; // Android emulator
|
|
// static const String apiBaseUrl = 'http://localhost:8000'; // iOS simulator
|
|
// static const String apiBaseUrl = 'http://YOUR_IP:8000'; // Device reale
|
|
|
|
static const String apiVersion = 'v1';
|
|
|
|
// App Info
|
|
static const String appName = 'ASE Monitor';
|
|
static const String companyName = 'ASE Advanced Slope Engineering';
|
|
static const String appVersion = '1.0.0';
|
|
|
|
// Storage Keys
|
|
static const String storageKeyToken = 'auth_token';
|
|
static const String storageKeyUser = 'user_data';
|
|
static const String storageKeyFcmToken = 'fcm_token';
|
|
|
|
// Pagination
|
|
static const int defaultPageSize = 20;
|
|
}
|
|
|
|
/// Colori del tema ASE
|
|
class AppColors {
|
|
// Brand Colors
|
|
static const Color primary = Color(0xFF1565C0);
|
|
static const Color primaryDark = Color(0xFF0D47A1);
|
|
static const Color primaryLight = Color(0xFF42A5F5);
|
|
|
|
static const Color secondary = Color(0xFF00897B);
|
|
static const Color secondaryDark = Color(0xFF00695C);
|
|
static const Color secondaryLight = Color(0xFF4DB6AC);
|
|
|
|
static const Color accent = Color(0xFFFF6F00);
|
|
|
|
// Severity Colors
|
|
static const Color critical = Color(0xFFD32F2F);
|
|
static const Color warning = Color(0xFFF57C00);
|
|
static const Color info = Color(0xFF1976D2);
|
|
static const Color success = Color(0xFF388E3C);
|
|
|
|
// Neutral Colors
|
|
static const Color background = Color(0xFFF5F7FA);
|
|
static const Color surface = Color(0xFFFFFFFF);
|
|
static const Color surfaceDark = Color(0xFF263238);
|
|
|
|
static const Color textPrimary = Color(0xFF212121);
|
|
static const Color textSecondary = Color(0xFF757575);
|
|
static const Color textLight = Color(0xFFBDBDBD);
|
|
|
|
// Status Colors
|
|
static const Color statusNuovo = Color(0xFFE91E63);
|
|
static const Color statusVisualizzato = Color(0xFF3F51B5);
|
|
static const Color statusInGestione = Color(0xFFFF9800);
|
|
static const Color statusRisolto = Color(0xFF4CAF50);
|
|
|
|
// Gradients
|
|
static const LinearGradient primaryGradient = LinearGradient(
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
colors: [primary, primaryDark],
|
|
);
|
|
|
|
static const LinearGradient criticalGradient = LinearGradient(
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
colors: [Color(0xFFD32F2F), Color(0xFFC62828)],
|
|
);
|
|
}
|
|
|
|
/// Dimensioni e spacing
|
|
class AppSizes {
|
|
static const double paddingXS = 4.0;
|
|
static const double paddingS = 8.0;
|
|
static const double paddingM = 16.0;
|
|
static const double paddingL = 24.0;
|
|
static const double paddingXL = 32.0;
|
|
|
|
static const double radiusS = 8.0;
|
|
static const double radiusM = 12.0;
|
|
static const double radiusL = 16.0;
|
|
static const double radiusXL = 24.0;
|
|
|
|
static const double iconS = 16.0;
|
|
static const double iconM = 24.0;
|
|
static const double iconL = 32.0;
|
|
static const double iconXL = 48.0;
|
|
|
|
static const double buttonHeight = 48.0;
|
|
static const double inputHeight = 56.0;
|
|
}
|
|
|
|
/// Stili di testo
|
|
class AppTextStyles {
|
|
static const TextStyle h1 = TextStyle(
|
|
fontSize: 32,
|
|
fontWeight: FontWeight.bold,
|
|
color: AppColors.textPrimary,
|
|
letterSpacing: -0.5,
|
|
);
|
|
|
|
static const TextStyle h2 = TextStyle(
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.bold,
|
|
color: AppColors.textPrimary,
|
|
letterSpacing: -0.3,
|
|
);
|
|
|
|
static const TextStyle h3 = TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w600,
|
|
color: AppColors.textPrimary,
|
|
);
|
|
|
|
static const TextStyle bodyLarge = TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.normal,
|
|
color: AppColors.textPrimary,
|
|
height: 1.5,
|
|
);
|
|
|
|
static const TextStyle bodyMedium = TextStyle(
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.normal,
|
|
color: AppColors.textPrimary,
|
|
height: 1.5,
|
|
);
|
|
|
|
static const TextStyle bodySmall = TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.normal,
|
|
color: AppColors.textSecondary,
|
|
height: 1.4,
|
|
);
|
|
|
|
static const TextStyle button = TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w600,
|
|
letterSpacing: 0.5,
|
|
);
|
|
|
|
static const TextStyle caption = TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w500,
|
|
color: AppColors.textSecondary,
|
|
letterSpacing: 0.3,
|
|
);
|
|
}
|
|
|
|
/// Icone per tipi di allarme
|
|
class AlarmTypeIcons {
|
|
static const Map<String, IconData> icons = {
|
|
'movimento_terreno': Icons.move_down,
|
|
'deformazione': Icons.transform,
|
|
'accelerazione': Icons.speed,
|
|
'inclinazione': Icons.rotate_right,
|
|
'fessurazione': Icons.broken_image,
|
|
'vibrazione': Icons.vibration,
|
|
'temperatura_anomala': Icons.thermostat,
|
|
'umidita_anomala': Icons.water_drop,
|
|
'perdita_segnale': Icons.signal_wifi_off,
|
|
'batteria_scarica': Icons.battery_alert,
|
|
'altro': Icons.warning,
|
|
};
|
|
|
|
static IconData getIcon(String type) {
|
|
return icons[type.toLowerCase()] ?? Icons.warning;
|
|
}
|
|
}
|