Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.9.1 #341

Merged
merged 50 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6e3aa4c
Sidebar top (#244)
GroovinChip May 11, 2022
41c56a2
chore: update issue templates
GroovinChip May 11, 2022
de258e5
chore: update pr_prelaunch script
GroovinChip May 11, 2022
4bb29a8
Merge branch 'stable' into dev
GroovinChip May 11, 2022
e4c37d6
Flutter 3 upgrade & MacosColor update (#248)
GroovinChip May 13, 2022
ac6870c
Merge branch 'stable' into dev
GroovinChip May 13, 2022
ab47743
Starter app (#251)
GroovinChip May 13, 2022
880c308
Full screen opaque toolbar issue (closes #249) (#252)
whiplashoo May 16, 2022
eb06cc4
Merge branch 'stable' into dev
GroovinChip May 16, 2022
77778ed
Version 1.4.1 (#255)
GroovinChip May 16, 2022
ee2297f
Merge branch 'stable' into dev
GroovinChip May 16, 2022
ba99684
Merge branch 'stable' into dev
GroovinChip May 16, 2022
3f0d09e
chore: repository, homepage fields
GroovinChip May 16, 2022
3f6d9ac
Merge branch 'stable' into dev
GroovinChip May 16, 2022
1857b58
chore: update readme
GroovinChip May 16, 2022
1dbab59
feat(starter_app): Version 1.1.0
GroovinChip May 16, 2022
99cce50
feat(starter_app): multi-window support
GroovinChip May 17, 2022
a7b34dd
feat: starter_app 1.2.1
GroovinChip May 21, 2022
f6cb9cd
chore: move brick to its own repo & go back to old pana action
GroovinChip May 23, 2022
a4e85c3
Expand remaining part of row in MacosListTile (#265)
jonsaw Jun 24, 2022
6d89861
End sidebar (#267)
GroovinChip Jun 26, 2022
9b8f75d
Merge branch 'stable' into dev
GroovinChip Jun 30, 2022
098c22f
fix: Correct the placement of the leading widget in disclosure sideba…
GroovinChip Jul 1, 2022
c7719c2
chore: Update changelog
GroovinChip Jul 2, 2022
5687498
test: fix issues with date_picker_test
GroovinChip Jul 7, 2022
f09843c
Update Actions (#279)
GroovinChip Jul 7, 2022
d534f79
Version 1.6.0 - `MacosTabView` & `MacosSegmentedControl` (#273)
GroovinChip Jul 9, 2022
4f13234
Version 1.7.0: `MacosImageIcon` & sidebar updates (#274)
GroovinChip Jul 10, 2022
fa1deed
Merge branch 'stable' into dev
GroovinChip Jul 10, 2022
1d33004
chore: fix typo in pr template
GroovinChip Jul 10, 2022
7487f97
feat: gh action to auto-generate releases on push to stable
GroovinChip Jul 10, 2022
91de6b7
Merge branch 'stable' into dev
GroovinChip Jul 10, 2022
85eaed4
chore: update release action with latest from stable
GroovinChip Jul 10, 2022
285c398
feat: add action to publish to pub
GroovinChip Jul 10, 2022
6c90a36
docs: update readme
GroovinChip Jul 9, 2022
eae4c3d
fix: 1.7.1
GroovinChip Jul 27, 2022
085c44c
Merge branch 'stable' into dev
GroovinChip Jul 27, 2022
92f0b00
Tab view padding (#285)
stMerlHin Aug 14, 2022
4f538ef
fix: use prepared title wrapped with a DefaultTextStyle instead of th…
jtdLab Aug 15, 2022
53c1d24
chore: fix typo
GroovinChip Aug 17, 2022
1bd9180
feat: add `backgroundColor` to `MacosSheet` (#291)
GroovinChip Aug 17, 2022
b0efefa
chore: fix Flutter 3.3 warnings
GroovinChip Sep 5, 2022
d6d4a27
fix: address ScrollController bug in MacosPopupButton (#300)
GroovinChip Sep 10, 2022
6e17403
fix(tests): account for Jan -> Dec & Dec -> Jan
GroovinChip Jan 14, 2023
79b89c5
fix(plugin): Ensure the native color panel releases when closed
GroovinChip Jan 25, 2023
13fdb43
Update flutter_analysis.yml
GroovinChip Jan 27, 2023
9894aba
Various bug fixes & minor updates (#338)
GroovinChip Feb 2, 2023
ced5193
Macos slider (#337)
Norbert515 Feb 3, 2023
2a9fc25
Adds `intialDate` to `MacosDatePicker` (#329)
Luckey-Elijah Feb 3, 2023
c35f319
Merge branch 'stable' into 1.9.1-conflicts
GroovinChip Feb 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
## [1.9.1]
* Adds optional `initialDate` to `MacosDatePicker`

## [1.9.0]
* Implement `MacosSlider`

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

Expand Down Expand Up @@ -34,20 +37,20 @@ Other changes

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

## [1.6.0]
* New widgets: `MacosTabView` and `MacosTabView`
* BREAKING CHANGE: `Label.yAxis` has been renamed to `Label.crossAxisAlignment`
* BREAKING CHANGE: `TooltipTheme` and `TooltipThemeData` have been renamed to `MacosTooltipTheme` and
* BREAKING CHANGE: `TooltipTheme` and `TooltipThemeData` have been renamed to `MacosTooltipTheme` and
`MacosTooltipThemeData`

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

## [1.4.1]
* 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)
* 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)

## [1.4.0]
* Migration to Flutter 3.0
* Minimum dart sdk version is now 2.17.0
* Use new super parameters feature
* Update to `flutter_lints: ^2.0.1` with subsequent fixes
* `MacosScrollbar` API more closely matches its material counterpart
* `MacosScrollbar` API more closely matches its material counterpart
* Update `MacosColor` to more closely match the `Color` class
* Adds `MacosColor.fromARGB` constructor
* Adds `MacosColor.fromRGBO` constructor
Expand All @@ -86,7 +89,7 @@ leading widget, and the font size of the item's label widget according to the gi
* Fix `MacosApp` documentation

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

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

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

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

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

## [0.9.3]
* Update to `PushButton`:
Expand Down Expand Up @@ -257,7 +260,7 @@ leading widget, and the font size of the item's label widget according to the gi
## [0.6.0]
* Improved `MacosAlertDialog` design
* Added `showMacosAlertDialog` to display a `MacosAlertDialog` with standard macOS animations and behaviour.

## [0.5.2]
* Fixes maximum height issue with `MacosAlertDialog`

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

## [0.0.3]

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Guides, codelabs, and other documentation can be found at https://macosui.dev

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

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

pub.dev shows that `macos_ui` only supports macOS. This is because `macos_ui` calls some native code, and therefore
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.9.0"
version: "1.9.1"
matcher:
dependency: transitive
description:
Expand Down
12 changes: 10 additions & 2 deletions lib/src/selectors/date_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class MacosDatePicker extends StatefulWidget {
super.key,
this.style = DatePickerStyle.combined,
required this.onDateChanged,
this.initialDate,
});

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

/// Set an initial date for the picker.
///
/// Defaults to `DateTime.now()`.
final DateTime? initialDate;

@override
State<MacosDatePicker> createState() => _MacosDatePickerState();
}

class _MacosDatePickerState extends State<MacosDatePicker> {
final _initialDate = DateTime.now();
final _today = DateTime.now();
late final _initialDate = widget.initialDate ?? _today;

late int _selectedDay;
late int _selectedMonth;
late int _selectedYear;
Expand Down Expand Up @@ -474,7 +482,7 @@ class _MacosDatePickerState extends State<MacosDatePicker> {
DateTime(_selectedYear, _selectedMonth, _selectedDay),
dayToBuild,
);
final isToday = DateUtils.isSameDay(_initialDate, dayToBuild);
final isToday = DateUtils.isSameDay(_today, dayToBuild);

BoxDecoration? decoration;
Widget? dayText;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: macos_ui
description: Flutter widgets and themes implementing the current macOS design language.
version: 1.9.0
version: 1.9.1
homepage: "https://macosui.dev"
repository: "https://github.com/GroovinChip/macos_ui"

Expand Down
40 changes: 39 additions & 1 deletion test/selectors/date_picker_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,45 @@ import 'package:macos_ui/macos_ui.dart';
void main() {
group('MacosDatePicker tests', () {
testWidgets(
'Textual MacosDatePicker renders the expected date',
'Textual MacosDatePicker renders the expected initial date',
(tester) async {
final initialDate = DateTime.now().add(const Duration(days: 30));
await tester.pumpWidget(
MacosApp(
home: MacosWindow(
child: MacosScaffold(
children: [
ContentArea(
builder: (context) {
return Center(
child: MacosDatePicker(
onDateChanged: (date) {},
initialDate: initialDate,
style: DatePickerStyle.textual,
),
);
},
),
],
),
),
),
);

expect(find.text('/'), findsNWidgets(2));
expect(find.text('${initialDate.year}'), findsOneWidget);
if (initialDate.month == initialDate.day) {
expect(find.text('${initialDate.day}'), findsNWidgets(2));
expect(find.text('${initialDate.month}'), findsNWidgets(2));
} else {
expect(find.text('${initialDate.day}'), findsOneWidget);
expect(find.text('${initialDate.month}'), findsOneWidget);
}
},
);

testWidgets(
"Textual MacosDatePicker renders the today's date by default",
(tester) async {
final today = DateTime.now();
await tester.pumpWidget(
Expand Down