Énergie : - Écran Énergie reécrit : line chart (production/conso/autoconso/batterie) et bar chart (bilan Wh par période) avec onglets 15 min / 1 h / 1 j / 1 sem - Datepicker pour sélectionner une période historique (chip dismissible) - Timelines des deux graphiques alignées (même x=i → data[i].timestamp) - PowerBalanceEntry + fetchPowerBalanceLogs() + simulation sinusoïdale - Overflow fixes : energy_flow_widget (Expanded sur titre), production_card Things : - Navigation 3 niveaux : ThingsScreen → CategoryOverviewScreen → ThingDetailScreen - Catégorie Cars ajoutée, carrousel corrigé (clamp RangeError) - ThingDetailScreen : executeAction, setStateValue, activeThumbColor fix - NymeaTile widget, state_history_chart widget (générique Logging.GetLogEntries) Modèles / service : - HistoryEntry, PowerBalanceEntry ajoutés - fetchHistory(), fetchPowerBalanceLogs() dans NymeaService - interfaceToCategoryMap étendu (Cars, etc.) - AppTheme : nouvelles couleurs (accentTeal, boostRed, pvGreen, minPvBlue…) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
69 lines
2.9 KiB
Dart
69 lines
2.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class AppTheme {
|
|
// ── Couleurs historiques (dashboard, widgets existants) ──────────────────────
|
|
static const Color primaryGreen = Color(0xFF4CAF50);
|
|
static const Color solarYellow = Color(0xFFF5C842);
|
|
static const Color gridGray = Color(0xFF5A6473);
|
|
static const Color homeBlue = Color(0xFF5BA4CF);
|
|
static const Color batteryGreen = Color(0xFF4CAF50);
|
|
static const Color accentOrange = Color(0xFFFF7043);
|
|
static const Color backgroundGray = Color(0xFFF0F2F5);
|
|
static const Color cardWhite = Color(0xFFFFFFFF);
|
|
static const Color textDark = Color(0xFF1A1A2E);
|
|
static const Color textLight = Color(0xFF6B7280);
|
|
static const Color boostRed = Color(0xFFEF5350);
|
|
static const Color pvGreen = Color(0xFF43A047);
|
|
static const Color minPvBlue = Color(0xFF42A5F5);
|
|
|
|
// ── Couleurs nymea-style ─────────────────────────────────────────────────────
|
|
|
|
/// Couleur d'accent principale nymea (teal/turquoise — #57baae de StyleBase.qml)
|
|
static const Color accentTeal = Color(0xFF57BAAE);
|
|
|
|
/// Fond de tuile nymea — légèrement teinté (tileBackgroundColor dans StyleBase.qml)
|
|
static const Color tileBackground = Color(0xFFF2F4F7);
|
|
|
|
/// Rayon d'arrondi nymea standard (cornerRadius: 10 dans StyleBase.qml)
|
|
static const double cornerRadius = 10.0;
|
|
|
|
// ── Couleurs flux énergie (miroir de StyleBase.qml) ──────────────────────────
|
|
|
|
/// Soutirer du réseau (grid import) — indianred
|
|
static const Color powerAcquisitionColor = Color(0xFFCD5C5C);
|
|
|
|
/// Injection sur le réseau (grid export) — yellow
|
|
static const Color powerReturnColor = Color(0xFFCDCD5C);
|
|
|
|
/// Consommation maison — blue
|
|
static const Color powerConsumptionColor = Color(0xFF5C95CD);
|
|
|
|
/// PV → maison (autoconsommation) — green
|
|
static const Color powerSelfProductionColor = Color(0xFF5CCD5C);
|
|
|
|
/// Charge batterie — purple
|
|
static const Color powerBatteryChargingColor = Color(0xFF955CCD);
|
|
|
|
/// Décharge batterie — orange
|
|
static const Color powerBatteryDischargingColor = Color(0xFFCD955C);
|
|
|
|
// ── Thème Material3 ───────────────────────────────────────────────────────────
|
|
static ThemeData get theme => ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: accentTeal,
|
|
surface: backgroundGray,
|
|
),
|
|
scaffoldBackgroundColor: backgroundGray,
|
|
cardTheme: CardThemeData(
|
|
color: cardWhite,
|
|
elevation: 0,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
margin: EdgeInsets.zero,
|
|
),
|
|
fontFamily: 'Roboto',
|
|
useMaterial3: true,
|
|
);
|
|
}
|