diff --git a/.claude/plugin.json b/.claude/plugin.json index 7139e41..be02698 100644 --- a/.claude/plugin.json +++ b/.claude/plugin.json @@ -1,7 +1,7 @@ { "name": "layrz-theme", "description": "Claude Code skills for layrz-theme Flutter widget library", - "version": "7.5.30", + "version": "7.5.31", "author": { "name": "Golden M, Inc.", "url": "https://github.com/goldenm-software" diff --git a/CHANGELOG.md b/CHANGELOG.md index 99cf80d..6deab90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 7.5.31 + +- Fixed `ThemedDateTimeRangePicker` swapped times when the date range was picked in reverse order: selecting the later date first and the earlier date second caused the times entered in the Time tab to be glued to the wrong endpoint, because `startDate`/`endDate` were left in selection order while only the final save sorted the resulting `DateTime`s. The dialog now sorts `startDate`/`endDate` the moment the second tap closes the range, so the Time tab always shows "Start" for the earlier day and "End" for the later one and the returned `[start, end]` list keeps each time aligned with its intended date. + ## 7.5.30 - Fixed incorrect deprecation of `ThemedTableAvatar`: the class is used by `ThemedScaffoldView.avatarBuilder` in the scaffolds module and is not exclusive to `ThemedTable`. Consumers using `ThemedScaffoldView` were receiving a false `deprecated_member_use` warning. diff --git a/lib/src/inputs/src/pickers/datetime/range.dart b/lib/src/inputs/src/pickers/datetime/range.dart index 644305d..18a48ca 100644 --- a/lib/src/inputs/src/pickers/datetime/range.dart +++ b/lib/src/inputs/src/pickers/datetime/range.dart @@ -420,11 +420,12 @@ class _ThemedDateTimeRangeDialogState extends State w endDate = newDate; tempDate = null; - filledDates = _fillDates( - [startDate, endDate]..sort((a, b) { - return a.compareTo(b); - }), - ); + if (endDate.isBefore(startDate)) { + final swap = startDate; + startDate = endDate; + endDate = swap; + } + filledDates = _fillDates([startDate, endDate]); setState(() {}); }, ), diff --git a/pubspec.yaml b/pubspec.yaml index 09eb3f8..625e675 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: layrz_theme description: Layrz standard styling library for Flutter. Widget library following the Material Design 3 guidelines, with a focus on reliavility and functionality. -version: "7.5.30" +version: "7.5.31" homepage: https://theme.layrz.com repository: https://github.com/goldenm-software/layrz_theme