feat: environment widgets layout redesign with always-visible widgets
Build and Push / release (push) Successful in 3s
Build and Push / build (push) Successful in 3m11s

- Desktop: 4-in-a-row layout (30/20/20/30 distribution)
- Tablet: 2x2 grid layout
- Mobile: Stacked vertically
- All widgets show "No data available" state instead of being hidden
- Sun position calculates from clock, defaults to 6am/6pm
- Environment refresh changed from 5min to 1 hour

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jeroen Schweitzer
2026-01-07 11:21:48 +01:00
co-authored by Claude Opus 4.5
parent fffc3d5baf
commit d200cad8be
9 changed files with 276 additions and 45 deletions
+12 -9
View File
@@ -130,9 +130,13 @@ class SunPositionWidget extends StatelessWidget {
}
bool get _isDaytime {
if (sunTimes?.sunrise == null || sunTimes?.sunset == null) return true;
final now = DateTime.now();
return now.isAfter(sunTimes!.sunrise!) && now.isBefore(sunTimes!.sunset!);
// Use actual sun times if available, otherwise default to 6am/6pm
final sunrise = sunTimes?.sunrise ??
DateTime(now.year, now.month, now.day, 6, 0);
final sunset = sunTimes?.sunset ??
DateTime(now.year, now.month, now.day, 18, 0);
return now.isAfter(sunrise) && now.isBefore(sunset);
}
String _formatTime(DateTime? time) {
@@ -370,14 +374,13 @@ class _SunArcPainter extends CustomPainter {
}
double _calculateSunPosition() {
if (sunTimes?.sunrise == null || sunTimes?.sunset == null) {
// Default to noon position
return 0.5;
}
final now = DateTime.now();
final sunrise = sunTimes!.sunrise!;
final sunset = sunTimes!.sunset!;
// Use actual sun times if available, otherwise default to 6am/6pm (12-hour cycles)
final sunrise = sunTimes?.sunrise ??
DateTime(now.year, now.month, now.day, 6, 0);
final sunset = sunTimes?.sunset ??
DateTime(now.year, now.month, now.day, 18, 0);
// Before sunrise
if (now.isBefore(sunrise)) {