Skip to content

Commit e9da375

Browse files
Fix radio button issue (#497)
* Update radio_button.dart * Update CHANGELOG.md --------- Co-authored-by: Adrian Samoticha <[email protected]>
1 parent e2ae2c4 commit e9da375

File tree

2 files changed

+85
-81
lines changed

2 files changed

+85
-81
lines changed

CHANGELOG.md

Lines changed: 84 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [2.0.5]
2+
### 🛠️ Fixed 🛠️
3+
* Fixed `MacosRadioButton` check null value issue.
4+
15
## [2.0.4]
26
### 🔄 Updated 🔄
37
* Added `initialTime` parameter to `MacosTimePicker`, allowing to set an initial time for the picker.This provides more customization options for selecting time.
@@ -16,21 +20,21 @@
1620
## [2.0.1]
1721
### 🔄 Updated 🔄
1822
* `PushButton` has received a facelift. It now mimics the look and feel of native macOS buttons more closely.
19-
* **Note:** As a result, its `pressedOpacity` property and the `PushButtonTheme` class have been deprecated.
23+
* **Note:** As a result, its `pressedOpacity` property and the `PushButtonTheme` class have been deprecated.
2024

2125
## [2.0.0]
2226
### 🚨 Breaking Changes 🚨
2327
* `macos_ui` has been migrated to utilize [macos_window_utils](https://pub.dev/packages/macos_window_utils) under the hood, which provides the following benefits:
24-
* Window animation smoothness is drastically improved, particularly when miniaturizing and deminiaturizing the application window.
25-
* Some visual artifacts that occurred while the window was being (de)miniaturized (such as the application's shadow going missing) no longer occur.
26-
* The sidebar remains transparent when the app's brightness setting mismatches the OS setting.
27-
* Wallpaper tinting is now supported.
28-
* To migrate an existing application, please refer to the “Modern window look” section in the README.
28+
* Window animation smoothness is drastically improved, particularly when miniaturizing and deminiaturizing the application window.
29+
* Some visual artifacts that occurred while the window was being (de)miniaturized (such as the application's shadow going missing) no longer occur.
30+
* The sidebar remains transparent when the app's brightness setting mismatches the OS setting.
31+
* Wallpaper tinting is now supported.
32+
* To migrate an existing application, please refer to the “Modern window look” section in the README.
2933

3034
* Support for Flutter 3.10 and Dart 3
3135
* `PushButton` has been updated to support the `ControlSize` enum.
32-
* The `buttonSize` property has been changed to `controlSize`.
33-
* Buttons can now be any of the following sizes: mini, small, regular, or large.
36+
* The `buttonSize` property has been changed to `controlSize`.
37+
* Buttons can now be any of the following sizes: mini, small, regular, or large.
3438
* `PushButton.isSecondary` is now `PushButton.secondary`.
3539
* `MacosAlertDialog`: `primaryButton` and `secondaryButton` are now declared to be of type `PushButton`.
3640
* `RelevanceIndicator` has been deprecated
@@ -41,22 +45,22 @@
4145
* `MacosSwitch` has been completely rewritten and now matches the native macOS switch in appearance and behavior.
4246
* A `ControlSize` enum has been introduced, which will allow widgets to more closely match their native counterparts.
4347
* `MacosTypography`
44-
* You can now call `MacosTypography.of(context)` as a shorthand for retrieving the typography used in your `MacosTheme`.
45-
* `MacosFontWeight` allows using Apple-specific font weights like `w510`, `w590`, and `w860`.
48+
* You can now call `MacosTypography.of(context)` as a shorthand for retrieving the typography used in your `MacosTheme`.
49+
* `MacosFontWeight` allows using Apple-specific font weights like `w510`, `w590`, and `w860`.
4650
* Localization
47-
* Added support for `weekdayAbbreviations` and `monthAbbreviations` to `MacosDatePicker`.
48-
* Added support for `dateFormat` to `MacosDatePicker`.
49-
* Added support for `startWeekOnMonday` to `MacosDatePicker`.
51+
* Added support for `weekdayAbbreviations` and `monthAbbreviations` to `MacosDatePicker`.
52+
* Added support for `dateFormat` to `MacosDatePicker`.
53+
* Added support for `startWeekOnMonday` to `MacosDatePicker`.
5054

5155
### 🔄 Updated 🔄
5256
* `MacosColor` has been updated with some previously missing elements.
5357
* `PushButton`
54-
* Now uses the correct `body` text style instead of the incorrect `headline`
58+
* Now uses the correct `body` text style instead of the incorrect `headline`
5559
* `PushButton`'s secondary and disabled colors more closely match their native counterparts.
5660
* `MacosCheckbox` appearance more closely matches its native counterpart.
5761
* `MacosAlertDialog`
58-
* `primaryButton` and `secondaryButton` are now required to have `controlSize`s of `ControlSize.large`.
59-
* Docs now suggest that `appIcon` should be of size 64x64.
62+
* `primaryButton` and `secondaryButton` are now required to have `controlSize`s of `ControlSize.large`.
63+
* Docs now suggest that `appIcon` should be of size 64x64.
6064
* `Toolbar` now uses the correct `title3` text style instead of the incorrect `headline`
6165
* `MacosTheme` sets the global typography more efficiently
6266
* `HelpButton` now sizes itself according to specification
@@ -96,9 +100,9 @@
96100
## [1.11.0]
97101
* 🚨 Breaking Changes 🚨
98102
* `ResizablePane` can now be vertically resized
99-
* `ResizablePane.startWidth` has been changed to `ResizablePane.startSize`
100-
* `ResizablePane.minWidth` has been changed to `ResizablePane.minSize`
101-
* `ResizablePane.maxWidth` has been changed to `ResizablePane.maxSize`
103+
* `ResizablePane.startWidth` has been changed to `ResizablePane.startSize`
104+
* `ResizablePane.minWidth` has been changed to `ResizablePane.minSize`
105+
* `ResizablePane.maxWidth` has been changed to `ResizablePane.maxSize`
102106

103107
## [1.10.0]
104108
🚨 Breaking Changes 🚨
@@ -121,8 +125,8 @@ Other changes:
121125
## [1.8.0]
122126
🚨 Breaking Changes 🚨
123127
* `ContentArea.builder` has been changed from a `ScrollableWidgetBuilder` to a `WidgetBuilder` due to
124-
changes in Flutter 3.7. The `MacosScrollbar` widget needs to undergo radical changes in order to achieve the
125-
native macOS scrollbar look and feel in the future, so this will be revisited at that time.
128+
changes in Flutter 3.7. The `MacosScrollbar` widget needs to undergo radical changes in order to achieve the
129+
native macOS scrollbar look and feel in the future, so this will be revisited at that time.
126130

127131
Other changes:
128132
* Per Flutter 3.7.0: Replace deprecated `MacosTextField.toolbarOptions` with `MacosTextField.contextMenuBuilder`
@@ -151,21 +155,21 @@ Other changes:
151155

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

164168
## [1.6.0]
165169
* New widgets: `MacosTabView` and `MacosTabView`
166170
* BREAKING CHANGE: `Label.yAxis` has been renamed to `Label.crossAxisAlignment`
167171
* BREAKING CHANGE: `TooltipTheme` and `TooltipThemeData` have been renamed to `MacosTooltipTheme` and
168-
`MacosTooltipThemeData`
172+
`MacosTooltipThemeData`
169173

170174
## [1.5.1]
171175
* Correct the placement of the leading widget in disclosure sidebar items [#268](https://github.com/GroovinChip/macos_ui/issues/268)
@@ -185,15 +189,15 @@ leading widget, and the font size of the item's label widget according to the gi
185189

186190
## [1.4.0]
187191
* Migration to Flutter 3.0
188-
* Minimum dart sdk version is now 2.17.0
189-
* Use new super parameters feature
190-
* Update to `flutter_lints: ^2.0.1` with subsequent fixes
191-
* `MacosScrollbar` API more closely matches its material counterpart
192+
* Minimum dart sdk version is now 2.17.0
193+
* Use new super parameters feature
194+
* Update to `flutter_lints: ^2.0.1` with subsequent fixes
195+
* `MacosScrollbar` API more closely matches its material counterpart
192196
* Update `MacosColor` to more closely match the `Color` class
193-
* Adds `MacosColor.fromARGB` constructor
194-
* Adds `MacosColor.fromRGBO` constructor
195-
* Adds `alphaBlend` function
196-
* Adds `getAlphaFromOpacity` function
197+
* Adds `MacosColor.fromARGB` constructor
198+
* Adds `MacosColor.fromRGBO` constructor
199+
* Adds `alphaBlend` function
200+
* Adds `getAlphaFromOpacity` function
197201

198202
## [1.3.0]
199203
* Add a `top` property to `Sidebar`
@@ -207,8 +211,8 @@ leading widget, and the font size of the item's label widget according to the gi
207211

208212
## [1.2.0]
209213
* Improved styling for `MacosTooltip`:
210-
* Better color and shadows.
211-
* Displays left-aligned, below the mouse cursor.
214+
* Better color and shadows.
215+
* Displays left-aligned, below the mouse cursor.
212216
* New widget: `ToolBarDivider` that can be used as a divider (vertical/horizontal line) in the `ToolBar` [#231](https://github.com/GroovinChip/macos_ui/issues/231).
213217
* All toolbar widgets can now receive a `tooltipMessage` property to display a `MacosTooltip` when user hovers over them [#232](https://github.com/GroovinChip/macos_ui/issues/232).
214218

@@ -217,17 +221,17 @@ leading widget, and the font size of the item's label widget according to the gi
217221

218222
## [1.1.0]
219223
* New functionality for `MacosSearchField`
220-
* Shows a list of search results in an overlay below the field
221-
* A result can be selected and customized.
224+
* Shows a list of search results in an overlay below the field
225+
* A result can be selected and customized.
222226
* A `MacosOverlayFilter` widget can now be used to apply the blurry "frosted glass" effect on surfaces.
223227
* New widget: `CustomToolbarItem` that enables any widget to be used in the `Toolbar`.
224228

225229
## [1.0.1]
226230
* Improvements to the graphical `MacosTimePicker`
227-
* Better color gradient on the border
228-
* Better inner shadow
229-
* Minor size adjustments
230-
* API improvements
231+
* Better color gradient on the border
232+
* Better inner shadow
233+
* Minor size adjustments
234+
* API improvements
231235
* Throw an exception if `MacosColorWell` is clicked on a non-macOS platform
232236

233237
## [1.0.0+1]
@@ -299,9 +303,9 @@ leading widget, and the font size of the item's label widget according to the gi
299303

300304
## [0.10.2]
301305
* Updates to `MacosIconButton` and `MacosBackButton`:
302-
* Added a hover effect when mouse moves over the buttons ([#168](https://github.com/GroovinChip/macos_ui/issues/168))
303-
* Added `hoverColor` property.
304-
* Default shape is now `BoxShape.rectangle` with border radius, as it seems to be the most used in macOS design.
306+
* Added a hover effect when mouse moves over the buttons ([#168](https://github.com/GroovinChip/macos_ui/issues/168))
307+
* Added `hoverColor` property.
308+
* Default shape is now `BoxShape.rectangle` with border radius, as it seems to be the most used in macOS design.
305309

306310
## [0.10.1]
307311
* Added support for transparent sidebar. Please note that changes to `MainFlutterWindow.swift` are required for this to work. [(#175)](https://github.com/GroovinChip/macos_ui/pull/175)
@@ -315,15 +319,15 @@ leading widget, and the font size of the item's label widget according to the gi
315319

316320
## [0.9.3]
317321
* Update to `PushButton`:
318-
* Added `isSecondary` property
322+
* Added `isSecondary` property
319323

320324
## [0.9.2]
321325
* Nearly all `MouseRegion`s have been updated to use `SystemMouseCursors.basic` in order to more closely adhere to Apple norms
322326
* `mouseCursor` properties have been added to most buttons
323327

324328
## [0.9.1]
325329
* Added top-level theming for `MacosIconButton`
326-
* Introduces the `MacosIconButtonTheme` InheritedTheme and the `MacosIconButtonThemeData` theme class
330+
* Introduces the `MacosIconButtonTheme` InheritedTheme and the `MacosIconButtonThemeData` theme class
327331
* Updates `MacosThemeData` and `MacosIconButton` to use the new `MacosIconButtonThemeData`
328332
* Removes an unnecessary setting of VisualDensity from `MacosThemeData.dark()`
329333

@@ -332,10 +336,10 @@ leading widget, and the font size of the item's label widget according to the gi
332336

333337
## [0.8.2]
334338
* Updates to `MacosListTile`:
335-
* Added `leadingWhitespace` property
336-
* Added `onClick` callback
337-
* Added `onLongPress` callback
338-
* Added `mouseCursor` property
339+
* Added `leadingWhitespace` property
340+
* Added `onClick` callback
341+
* Added `onLongPress` callback
342+
* Added `mouseCursor` property
339343

340344
## [0.8.1]
341345
* Fix the outer border of `MacosSheet` not having a border radius
@@ -397,16 +401,16 @@ leading widget, and the font size of the item's label widget according to the gi
397401

398402
## [0.3.0]
399403
* Add `MacosPrefix` to widgets/classes with names that overlap with the material/cupertino libraries:
400-
* `TextField` -> `MacosTextField`
401-
* `Scaffold` -> `MacosTextField`
402-
* `IconButton` -> `MacosIconButton`
403-
* `BackButton` -> `MacosBackButton`
404-
* `Scrollbar` -> `MacosScrollbar`
405-
* `Checkbox` -> `MacosCheckbox`
406-
* `RadioButton` -> `MacosRadioButton`
407-
* `Tooltip` -> `MacosTooltip`
408-
* `Typography` -> `MacosTypography`
409-
* `Switch` -> `MacosSwitch`
404+
* `TextField` -> `MacosTextField`
405+
* `Scaffold` -> `MacosTextField`
406+
* `IconButton` -> `MacosIconButton`
407+
* `BackButton` -> `MacosBackButton`
408+
* `Scrollbar` -> `MacosScrollbar`
409+
* `Checkbox` -> `MacosCheckbox`
410+
* `RadioButton` -> `MacosRadioButton`
411+
* `Tooltip` -> `MacosTooltip`
412+
* `Typography` -> `MacosTypography`
413+
* `Switch` -> `MacosSwitch`
410414

411415
## [0.2.4]
412416
* Fix text field prefix icon alignment
@@ -420,9 +424,9 @@ leading widget, and the font size of the item's label widget according to the gi
420424

421425
## [0.2.1]
422426
* `IconButton` updates:
423-
- The `color` property is now `backgroundColor`
424-
- The widget now takes a `Widget icon` rather than `IconData iconData` for better control over widget properties
425-
- Deprecate and remove internal `foregroundColor` value
427+
- The `color` property is now `backgroundColor`
428+
- The widget now takes a `Widget icon` rather than `IconData iconData` for better control over widget properties
429+
- Deprecate and remove internal `foregroundColor` value
426430

427431
## [0.2.0]
428432
* New widget: `BackButton`, `IconButton`
@@ -439,9 +443,9 @@ leading widget, and the font size of the item's label widget according to the gi
439443

440444
## [0.1.2]
441445
* Updated the theme api
442-
* Properties in `MacosThemeData` and in `Typography` can't be null
443-
* Renamed `DynamicColorX` to `MacosDynamicColor`
444-
* Added the method `lerp` on all theme data classes.
446+
* Properties in `MacosThemeData` and in `Typography` can't be null
447+
* Renamed `DynamicColorX` to `MacosDynamicColor`
448+
* Added the method `lerp` on all theme data classes.
445449

446450
## [0.1.1]
447451
* Implemented `Label` ([#61](https://github.com/GroovinChip/macos_ui/issues/61))
@@ -488,12 +492,12 @@ leading widget, and the font size of the item's label widget according to the gi
488492

489493
## [0.0.4]
490494
* Major theme refactor that more closely resembles flutter/material and flutter/cupertino
491-
* The `Style` class is now `MacosThemeData`
492-
* `MacosTheme` is now a `StatelessWidget` that returns a private `_InheritedMacosTheme`.
493-
The static `MacosTheme.of(context)` is now defined here.
494-
* `MacosApp` now takes a `theme` and `darkTheme` rather than `style` and `darkStyle`.
495-
Additionally, there are minor changes to the way `MacosApp` is built that more closely
496-
resemble how `MaterialApp` is built.
495+
* The `Style` class is now `MacosThemeData`
496+
* `MacosTheme` is now a `StatelessWidget` that returns a private `_InheritedMacosTheme`.
497+
The static `MacosTheme.of(context)` is now defined here.
498+
* `MacosApp` now takes a `theme` and `darkTheme` rather than `style` and `darkStyle`.
499+
Additionally, there are minor changes to the way `MacosApp` is built that more closely
500+
resemble how `MaterialApp` is built.
497501

498502
## [0.0.3]
499503

@@ -509,6 +513,6 @@ leading widget, and the font size of the item's label widget according to the gi
509513
## [0.0.1]
510514

511515
* Project creation
512-
* `MacosApp` widget
513-
* Basic `Typography`
514-
* Basic theming via `MacosTheme` and `Style`
516+
* `MacosApp` widget
517+
* Basic `Typography`
518+
* Basic theming via `MacosTheme` and `Style`

lib/src/buttons/radio_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class MacosRadioButton<T> extends StatelessWidget {
9191
final MacosThemeData theme = MacosTheme.of(context);
9292
final isLight = !theme.brightness.isDark;
9393
return GestureDetector(
94-
onTap: () => onChanged!(value),
94+
onTap: isDisabled ? null : () => onChanged!(value),
9595
child: Semantics(
9696
checked: selected,
9797
label: semanticLabel,

0 commit comments

Comments
 (0)