feat: environment widgets layout redesign with always-visible widgets
- 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:
co-authored by
Claude Opus 4.5
parent
fffc3d5baf
commit
d200cad8be
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user