Skip to content

Commit 02cd183

Browse files
GroovinChipwhiplashoojonsawstMerlHinjtdLab
authored
Version 1.9.1 (#341)
* Sidebar top (#244) * chore: refactor dir structure * feat: Sidebar top & updated default control color * feat(example): search results in top * chore: bump version, changelog * chore: run flutter pub upgrade * Update CHANGELOG.md * Update lib/src/layout/sidebar/sidebar.dart Co-authored-by: Minas Giannekas <whiplashoo@users.noreply.github.com> * chore: update issue templates * chore: update pr_prelaunch script * Flutter 3 upgrade & MacosColor update (#248) * chore: Update pubspec.yaml files to support Flutter 3 * chore: run dart fix --apply * chore: migrate Scrollbar to Flutter 3 * chore: update flutter_lints & subsequent fixes * feat: add missing functions to MacosColor the Color class has a number of functions that MacosColor had not implemented * chore: use super parameters * chore: update changelog * chore: tweak example app Uses the new PlatformMenuBar. Also update product name. * chore: small changelog tweak * chore: run flutter format . * chore: run dart fix --apply * chore: run flutter format . * chore: remove unused code in example * chore: remove unused import * chore: remove unused code * Starter app (#251) * chore: Update pubspec.yaml files to support Flutter 3 * chore: run dart fix --apply * chore: migrate Scrollbar to Flutter 3 * chore: update flutter_lints & subsequent fixes * feat: add missing functions to MacosColor the Color class has a number of functions that MacosColor had not implemented * chore: use super parameters * chore: update changelog * chore: tweak example app Uses the new PlatformMenuBar. Also update product name. * chore: small changelog tweak * chore: run flutter format . * chore: run dart fix --apply * chore: run flutter format . * chore: remove unused code in example * chore: remove unused import * feat: first pass at starter app brick * chore: improve starter app brick * chore: fix widget test in starter app * feat: conditional prompts & running pub get * chore: finalize brick * chore: run flutter format * chore: exclude starter app from analyzer * Full screen opaque toolbar issue (closes #249) (#252) * fix: don't show app window toolbar when in full screen * chore: update README * chore: update brick app window code * chore: update pubspec and changelog * chore: update actions Co-authored-by: Reuben Turner <groovinchip@gmail.com> * Version 1.4.1 (#255) * Sidebar top (#244) * chore: refactor dir structure * feat: Sidebar top & updated default control color * feat(example): search results in top * chore: bump version, changelog * chore: run flutter pub upgrade * Update CHANGELOG.md * Update lib/src/layout/sidebar/sidebar.dart Co-authored-by: Minas Giannekas <whiplashoo@users.noreply.github.com> * chore: update issue templates * chore: update pr_prelaunch script * Flutter 3 upgrade & MacosColor update (#248) * chore: Update pubspec.yaml files to support Flutter 3 * chore: run dart fix --apply * chore: migrate Scrollbar to Flutter 3 * chore: update flutter_lints & subsequent fixes * feat: add missing functions to MacosColor the Color class has a number of functions that MacosColor had not implemented * chore: use super parameters * chore: update changelog * chore: tweak example app Uses the new PlatformMenuBar. Also update product name. * chore: small changelog tweak * chore: run flutter format . * chore: run dart fix --apply * chore: run flutter format . * chore: remove unused code in example * chore: remove unused import * chore: remove unused code * Starter app (#251) * chore: Update pubspec.yaml files to support Flutter 3 * chore: run dart fix --apply * chore: migrate Scrollbar to Flutter 3 * chore: update flutter_lints & subsequent fixes * feat: add missing functions to MacosColor the Color class has a number of functions that MacosColor had not implemented * chore: use super parameters * chore: update changelog * chore: tweak example app Uses the new PlatformMenuBar. Also update product name. * chore: small changelog tweak * chore: run flutter format . * chore: run dart fix --apply * chore: run flutter format . * chore: remove unused code in example * chore: remove unused import * feat: first pass at starter app brick * chore: improve starter app brick * chore: fix widget test in starter app * feat: conditional prompts & running pub get * chore: finalize brick * chore: run flutter format * chore: exclude starter app from analyzer * Full screen opaque toolbar issue (closes #249) (#252) * fix: don't show app window toolbar when in full screen * chore: update README * chore: update brick app window code * chore: update pubspec and changelog * chore: update actions Co-authored-by: Reuben Turner <groovinchip@gmail.com> Co-authored-by: Minas Giannekas <whiplashoo@users.noreply.github.com> * chore: repository, homepage fields * chore: update readme * feat(starter_app): Version 1.1.0 * feat(starter_app): multi-window support * feat: starter_app 1.2.1 * chore: move brick to its own repo & go back to old pana action * Expand remaining part of row in MacosListTile (#265) * Expand remaining part of row #264 * Increment to version 1.4.2 * End sidebar (#267) * chore: add missing trailing comma * chore: improve MacosIconButton animation curve * chore: remove false_secrets from pubspec.yaml * feat: end sidebar Also fixes the tests portion of the pr_prelaunch_tasks script * feat: add "isEndSidebarShown" to MacosWindowScope * fix: Correct the placement of the leading widget in disclosure sidebar items (#272) * chore: Update changelog * test: fix issues with date_picker_test * Account for cases where the month and the day are the same * Fix offstage warnings by removing tester taps that disabled the caret controls * Update Actions (#279) * Update flutter_analysis.yml * Update dart_code_metrics.yaml * Update gh_pages.yml * Update pana_analysis.yml * Update codecov.yaml * fix syntax issue * Version 1.6.0 - `MacosTabView` & `MacosSegmentedControl` (#273) * feat: MacosTabView & MacosSegmentedControl * chore: fixup scripts * test: tests for segmented control & tab view * chore: remove unused code * chore: run flutter format . * chore: bump code metrics * docs: dartdoc updates * docs: fix a documentation error * chore: run flutter format . * refactor: make active property of MacosTab optional, since it is handled via MacosSegmentedControl * chore: fix import change * refactor: change colors to match default native app design * docs: update tab view screenshot in readme * chore: update README example for MacosTabView * chore: fix typo in MacosSegmentedControl * chore: fix typo in MacosSegmentedControl docstring * test: remove explicitly setting active property of MacosTabs Co-authored-by: Minas Giannekas <whiplashoo721@gmail.com> * Version 1.7.0: `MacosImageIcon` & sidebar updates (#274) * feat: MacosTabView & MacosSegmentedControl * chore: fixup scripts * test: tests for segmented control & tab view * chore: remove unused code * chore: run flutter format . * chore: bump code metrics * docs: dartdoc updates * docs: fix a documentation error * chore: run flutter format . * feat: MacosImageIcon & sidebar updates * test: fix issues with date_picker_test * Account for cases where the month and the day are the same * Fix offstage warnings by removing tester taps that disabled the caret controls * refactor: make active property of MacosTab optional, since it is handled via MacosSegmentedControl * chore: fix import change * refactor: change colors to match default native app design * docs: update tab view screenshot in readme * chore: fix README * test: fix date picker test Co-authored-by: Minas Giannekas <whiplashoo721@gmail.com> * chore: fix typo in pr template * feat: gh action to auto-generate releases on push to stable * chore: update release action with latest from stable * feat: add action to publish to pub * docs: update readme * Addresses #237 * Adds MacosColorWell to selectors section * Adds code snippets for date & time pickers * fix: 1.7.1 Fixes issue where end sidebar window breakpoint wasn’t being respected * Tab view padding (#285) * fix: use prepared title wrapped with a DefaultTextStyle instead of the raw title (#289) * chore: fix typo Closes #290 * feat: add `backgroundColor` to `MacosSheet` (#291) * chore: fix Flutter 3.3 warnings * fix: address ScrollController bug in MacosPopupButton (#300) * fix(tests): account for Jan -> Dec & Dec -> Jan date_picker_test.dart was failing due to not accounting for going from January to December and vice-versa. * fix(plugin): Ensure the native color panel releases when closed * Update flutter_analysis.yml Closes #334 * Various bug fixes & minor updates (#338) * Macos slider (#337) * chore: run flutter format . * chore: fix analysis * chore: Bump version and update CHANGELOG.md * chore: Update images to self taken ones as MacOS images are outdated * fix: fix position offset by a small value * fix: PR review feedback * Update lib/src/indicators/slider.dart --------- Co-authored-by: Reuben Turner <groovinchip@gmail.com> * Adds `intialDate` to `MacosDatePicker` (#329) * Adds `intialDate` to `MacosDatePicker` * Bumps `macos_ui` version to `1.7.7` * Apply suggestions from code review * spelling correction --------- Co-authored-by: Reuben Turner <groovinchip@gmail.com> --------- Co-authored-by: Minas Giannekas <whiplashoo@users.noreply.github.com> Co-authored-by: Jon Saw <jon.saw@gmail.com> Co-authored-by: Minas Giannekas <whiplashoo721@gmail.com> Co-authored-by: st merlhin <77164238+stMerlHin@users.noreply.github.com> Co-authored-by: jtdLab <72231111+jtdLab@users.noreply.github.com> Co-authored-by: Norbert Kozsir <norbertkozsir@gmail.com> Co-authored-by: Elijah Luckey <luckeyelijah112@gmail.com>
1 parent b55c500 commit 02cd183

File tree

6 files changed

+71
-22
lines changed

6 files changed

+71
-22
lines changed

CHANGELOG.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
## [1.9.1]
2+
* Adds optional `initialDate` to `MacosDatePicker`
3+
14
## [1.9.0]
25
* Implement `MacosSlider`
36

47
## [1.8.0]
58
🚨 Breaking Changes 🚨
6-
* `ContentArea.builder` has been changed from a `ScrollableWidgetBuilder` to a `WidgetBuilder` due to
9+
* `ContentArea.builder` has been changed from a `ScrollableWidgetBuilder` to a `WidgetBuilder` due to
710
changes in Flutter 3.7. The `MacosScrollBar` widget needs to undergo radical changes in order to achieve the
811
native macOS scrollbar look and feel in the future, so this will be revisited at that time.
912

@@ -34,20 +37,20 @@ Other changes
3437

3538
## [1.7.0]
3639
* ✨ New
37-
* `MacosImageIcon` widget. Identical to the `ImageIcon` from `flutter/widgets.dart` except it will obey a
40+
* `MacosImageIcon` widget. Identical to the `ImageIcon` from `flutter/widgets.dart` except it will obey a
3841
`MacosIconThemeData` instead of an `IconThemeData`
3942
* `SidebarItemSize` enum, which determines the height of sidebar items and the maximum size their `leading` widgets.
4043
* `SidebarItem` now accepts an optional `trailing` widget.
4144
* 🔄 Updated
42-
* `SidebarItems` now supports `SidebarItemSize` via the `itemSize` property, which defaults to
43-
`SidebarItemSize.medium`. The widget has been updated to manage the item's height, the maximum size of the item's
45+
* `SidebarItems` now supports `SidebarItemSize` via the `itemSize` property, which defaults to
46+
`SidebarItemSize.medium`. The widget has been updated to manage the item's height, the maximum size of the item's
4447
leading widget, and the font size of the item's label widget according to the given `SidebarItemSize`.
4548
* The example app has been tweaked to use some icons from the SF Symbols 4 Beta via the new `MacosImageIcon` widget.
4649

4750
## [1.6.0]
4851
* New widgets: `MacosTabView` and `MacosTabView`
4952
* BREAKING CHANGE: `Label.yAxis` has been renamed to `Label.crossAxisAlignment`
50-
* BREAKING CHANGE: `TooltipTheme` and `TooltipThemeData` have been renamed to `MacosTooltipTheme` and
53+
* BREAKING CHANGE: `TooltipTheme` and `TooltipThemeData` have been renamed to `MacosTooltipTheme` and
5154
`MacosTooltipThemeData`
5255

5356
## [1.5.1]
@@ -64,14 +67,14 @@ leading widget, and the font size of the item's label widget according to the gi
6467
* Update `pubspec.yaml` with `repository` and new `homepage` field.
6568

6669
## [1.4.1]
67-
* Fixes an issue where if the app was displayed in full screen mode, an opaque empty toolbar would appear at the top [#249](https://github.com/GroovinChip/macos_ui/issues/249)
68-
70+
* Fixes an issue where if the app was displayed in full screen mode, an opaque empty toolbar would appear at the top [#249](https://github.com/GroovinChip/macos_ui/issues/249)
71+
6972
## [1.4.0]
7073
* Migration to Flutter 3.0
7174
* Minimum dart sdk version is now 2.17.0
7275
* Use new super parameters feature
7376
* Update to `flutter_lints: ^2.0.1` with subsequent fixes
74-
* `MacosScrollbar` API more closely matches its material counterpart
77+
* `MacosScrollbar` API more closely matches its material counterpart
7578
* Update `MacosColor` to more closely match the `Color` class
7679
* Adds `MacosColor.fromARGB` constructor
7780
* Adds `MacosColor.fromRGBO` constructor
@@ -86,7 +89,7 @@ leading widget, and the font size of the item's label widget according to the gi
8689
* Fix `MacosApp` documentation
8790

8891
## [1.2.1]
89-
* Fixes issue with error thrown when toolbar actions are modified programmatically [#239](https://github.com/GroovinChip/macos_ui/issues/239)
92+
* Fixes issue with error thrown when toolbar actions are modified programmatically [#239](https://github.com/GroovinChip/macos_ui/issues/239)
9093

9194
## [1.2.0]
9295
* Improved styling for `MacosTooltip`:
@@ -144,7 +147,7 @@ leading widget, and the font size of the item's label widget according to the gi
144147
* Switch over to `flutter_lints`
145148

146149
## [0.12.4+1]
147-
* Improve visual design of `MacosPopupButton` and `MacosPulldownButton`, to better match the styling and translucency effect of Apple design.
150+
* Improve visual design of `MacosPopupButton` and `MacosPulldownButton`, to better match the styling and translucency effect of Apple design.
148151
* Remove unnecessary properties of `MacosPopupButton`
149152

150153
## [0.12.4]
@@ -194,7 +197,7 @@ leading widget, and the font size of the item's label widget according to the gi
194197

195198
## [0.10.0]
196199
* New widget - `MacosIcon`! `MacosIcon` is identical to regular icons, with the exception that it respects a `MacosTheme`. Also includes corresponding theme classes
197-
* `MacosThemeData` now sets a global, configurable `iconTheme` for `MacosIcon`s
200+
* `MacosThemeData` now sets a global, configurable `iconTheme` for `MacosIcon`s
198201

199202
## [0.9.3]
200203
* Update to `PushButton`:
@@ -257,7 +260,7 @@ leading widget, and the font size of the item's label widget according to the gi
257260
## [0.6.0]
258261
* Improved `MacosAlertDialog` design
259262
* Added `showMacosAlertDialog` to display a `MacosAlertDialog` with standard macOS animations and behaviour.
260-
263+
261264
## [0.5.2]
262265
* Fixes maximum height issue with `MacosAlertDialog`
263266

@@ -372,11 +375,11 @@ leading widget, and the font size of the item's label widget according to the gi
372375
## [0.0.4]
373376
* Major theme refactor that more closely resembles flutter/material and flutter/cupertino
374377
* The `Style` class is now `MacosThemeData`
375-
* `MacosTheme` is now a `StatelessWidget` that returns a private `_InheritedMacosTheme`.
378+
* `MacosTheme` is now a `StatelessWidget` that returns a private `_InheritedMacosTheme`.
376379
The static `MacosTheme.of(context)` is now defined here.
377-
* `MacosApp` now takes a `theme` and `darkTheme` rather than `style` and `darkStyle`.
378-
Additionally, there are minor changes to the way `MacosApp` is built that more closely
379-
resemble how `MaterialApp` is built.
380+
* `MacosApp` now takes a `theme` and `darkTheme` rather than `style` and `darkStyle`.
381+
Additionally, there are minor changes to the way `MacosApp` is built that more closely
382+
resemble how `MaterialApp` is built.
380383

381384
## [0.0.3]
382385

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Guides, codelabs, and other documentation can be found at https://macosui.dev
1616

1717
<img src="https://imgur.com/5mFQKBU.png" width="75%"/>
1818

19-
## 🚨 Usage notes
19+
## 🚨 Usage notes
2020
### <img src="https://storage.googleapis.com/cms-storage-bucket/0dbfcc7a59cd1cf16282.png" height="14"/> Platform Compatibility
2121

2222
pub.dev shows that `macos_ui` only supports macOS. This is because `macos_ui` calls some native code, and therefore

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ packages:
9797
path: ".."
9898
relative: true
9999
source: path
100-
version: "1.9.0"
100+
version: "1.9.1"
101101
matcher:
102102
dependency: transitive
103103
description:

lib/src/selectors/date_picker.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class MacosDatePicker extends StatefulWidget {
4343
super.key,
4444
this.style = DatePickerStyle.combined,
4545
required this.onDateChanged,
46+
this.initialDate,
4647
});
4748

4849
/// The [DatePickerStyle] to use.
@@ -53,12 +54,19 @@ class MacosDatePicker extends StatefulWidget {
5354
/// {macro onDateChanged}
5455
final OnDateChanged onDateChanged;
5556

57+
/// Set an initial date for the picker.
58+
///
59+
/// Defaults to `DateTime.now()`.
60+
final DateTime? initialDate;
61+
5662
@override
5763
State<MacosDatePicker> createState() => _MacosDatePickerState();
5864
}
5965

6066
class _MacosDatePickerState extends State<MacosDatePicker> {
61-
final _initialDate = DateTime.now();
67+
final _today = DateTime.now();
68+
late final _initialDate = widget.initialDate ?? _today;
69+
6270
late int _selectedDay;
6371
late int _selectedMonth;
6472
late int _selectedYear;
@@ -474,7 +482,7 @@ class _MacosDatePickerState extends State<MacosDatePicker> {
474482
DateTime(_selectedYear, _selectedMonth, _selectedDay),
475483
dayToBuild,
476484
);
477-
final isToday = DateUtils.isSameDay(_initialDate, dayToBuild);
485+
final isToday = DateUtils.isSameDay(_today, dayToBuild);
478486

479487
BoxDecoration? decoration;
480488
Widget? dayText;

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: macos_ui
22
description: Flutter widgets and themes implementing the current macOS design language.
3-
version: 1.9.0
3+
version: 1.9.1
44
homepage: "https://macosui.dev"
55
repository: "https://github.com/GroovinChip/macos_ui"
66

test/selectors/date_picker_test.dart

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,45 @@ import 'package:macos_ui/macos_ui.dart';
66
void main() {
77
group('MacosDatePicker tests', () {
88
testWidgets(
9-
'Textual MacosDatePicker renders the expected date',
9+
'Textual MacosDatePicker renders the expected initial date',
10+
(tester) async {
11+
final initialDate = DateTime.now().add(const Duration(days: 30));
12+
await tester.pumpWidget(
13+
MacosApp(
14+
home: MacosWindow(
15+
child: MacosScaffold(
16+
children: [
17+
ContentArea(
18+
builder: (context) {
19+
return Center(
20+
child: MacosDatePicker(
21+
onDateChanged: (date) {},
22+
initialDate: initialDate,
23+
style: DatePickerStyle.textual,
24+
),
25+
);
26+
},
27+
),
28+
],
29+
),
30+
),
31+
),
32+
);
33+
34+
expect(find.text('/'), findsNWidgets(2));
35+
expect(find.text('${initialDate.year}'), findsOneWidget);
36+
if (initialDate.month == initialDate.day) {
37+
expect(find.text('${initialDate.day}'), findsNWidgets(2));
38+
expect(find.text('${initialDate.month}'), findsNWidgets(2));
39+
} else {
40+
expect(find.text('${initialDate.day}'), findsOneWidget);
41+
expect(find.text('${initialDate.month}'), findsOneWidget);
42+
}
43+
},
44+
);
45+
46+
testWidgets(
47+
"Textual MacosDatePicker renders the today's date by default",
1048
(tester) async {
1149
final today = DateTime.now();
1250
await tester.pumpWidget(

0 commit comments

Comments
 (0)