🧐 Flutter tips
⏰ Adding " 1 day" in Flutter can completely break your UI if you aren't careful.
Using date.add(Duration(days: 1)) adds exactly 24 hours. But on Daylight Saving Time (DST) transition days, a day can be 23 or 25 hours long!
Ex: In France on Oct 26, this results in the exact same calendar day instead of moving to the 27th.
💡 The Fix for Calendars: Use DateTime(year, month, day 1) instead. This safely shifts the calendar day while letting Flutter automatically handle the underlying timezone/DST adjustments.
#FlutterDev #DartLang #ProgrammingTips #MobileDev #ApparenceKit