Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [2.2.0+2]
* Formatter updates

## [2.2.0+1]
* Support Dart 3.9.2
* Update dependencies
Expand Down
13 changes: 7 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ class _WidgetGalleryState extends State<WidgetGallery> {
SidebarItem(
leading: MacosImageIcon(
AssetImage(
'assets/sf_symbols/button_programmable_2x.png'),
'assets/sf_symbols/button_programmable_2x.png',
),
),
label: Text('Buttons'),
),
Expand All @@ -191,7 +192,8 @@ class _WidgetGalleryState extends State<WidgetGallery> {
SidebarItem(
leading: MacosImageIcon(
AssetImage(
'assets/sf_symbols/rectangle_3_group_2x.png'),
'assets/sf_symbols/rectangle_3_group_2x.png',
),
),
label: Text('Colors'),
),
Expand Down Expand Up @@ -241,7 +243,8 @@ class _WidgetGalleryState extends State<WidgetGallery> {
SidebarItem(
leading: MacosImageIcon(
AssetImage(
'assets/sf_symbols/filemenu_and_selection_2x.png'),
'assets/sf_symbols/filemenu_and_selection_2x.png',
),
),
label: Text('Selectors'),
),
Expand All @@ -266,9 +269,7 @@ class _WidgetGalleryState extends State<WidgetGallery> {
maxWidth: 300,
shownByDefault: false,
builder: (context, _) {
return const Center(
child: Text('End Sidebar'),
);
return const Center(child: Text('End Sidebar'));
},
),
child: [
Expand Down
53 changes: 18 additions & 35 deletions example/lib/pages/buttons_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ class _ButtonsPageState extends State<ButtonsPage> {
ToolBarIconButton(
label: 'Toggle End Sidebar',
tooltipMessage: 'Toggle End Sidebar',
icon: const MacosIcon(
CupertinoIcons.sidebar_right,
),
icon: const MacosIcon(CupertinoIcons.sidebar_right),
onPressed: () => MacosWindowScope.of(context).toggleEndSidebar(),
showLabel: false,
),
Expand All @@ -71,10 +69,7 @@ class _ButtonsPageState extends State<ButtonsPage> {
children: [
const WidgetTextTitle1(widgetName: 'PushButton'),
Divider(color: MacosTheme.of(context).dividerColor),
Text(
'Primary',
style: MacosTypography.of(context).title2,
),
Text('Primary', style: MacosTypography.of(context).title2),
Row(
children: [
PushButton(
Expand Down Expand Up @@ -247,10 +242,7 @@ class _ButtonsPageState extends State<ButtonsPage> {
],
),
const SizedBox(height: 16),
Text(
'Secondary',
style: MacosTypography.of(context).title2,
),
Text('Secondary', style: MacosTypography.of(context).title2),
Row(
children: [
PushButton(
Expand Down Expand Up @@ -449,9 +441,7 @@ class _ButtonsPageState extends State<ButtonsPage> {
fillColor: Colors.transparent,
),
const SizedBox(width: 16.0),
MacosBackButton(
onPressed: () => debugPrint('click'),
),
MacosBackButton(onPressed: () => debugPrint('click')),
],
),
const SizedBox(height: 20),
Expand All @@ -477,26 +467,20 @@ class _ButtonsPageState extends State<ButtonsPage> {
Row(
children: [
MacosIconButton(
icon: const MacosIcon(
CupertinoIcons.star_fill,
),
icon: const MacosIcon(CupertinoIcons.star_fill),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
onPressed: () {},
),
const SizedBox(width: 8),
const MacosIconButton(
icon: MacosIcon(
CupertinoIcons.plus_app,
),
icon: MacosIcon(CupertinoIcons.plus_app),
shape: BoxShape.circle,
//onPressed: () {},
),
const SizedBox(width: 8),
MacosIconButton(
icon: const MacosIcon(
CupertinoIcons.minus_square,
),
icon: const MacosIcon(CupertinoIcons.minus_square),
backgroundColor: Colors.transparent,
onPressed: () {},
),
Expand Down Expand Up @@ -567,10 +551,7 @@ class _ButtonsPageState extends State<ButtonsPage> {
},
),
const SizedBox(width: 8),
MacosCheckbox(
value: switchValue,
onChanged: null,
),
MacosCheckbox(value: switchValue, onChanged: null),
],
),
const SizedBox(height: 16),
Expand Down Expand Up @@ -732,11 +713,12 @@ class _ButtonsPageState extends State<ButtonsPage> {
},
items: <String>['One', 'Two', 'Three', 'Four']
.map<MacosPopupMenuItem<String>>((String value) {
return MacosPopupMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
return MacosPopupMenuItem<String>(
value: value,
child: Text(value),
);
})
.toList(),
),
const SizedBox(width: 20),
MacosPopupButton<String>(
Expand All @@ -752,8 +734,9 @@ class _ButtonsPageState extends State<ButtonsPage> {
onChanged: (String? newValue) {
setState(() => languagePopupValue = newValue!);
},
items: languages
.map<MacosPopupMenuItem<String>>((String value) {
items: languages.map<MacosPopupMenuItem<String>>((
String value,
) {
return MacosPopupMenuItem<String>(
value: value,
child: Text(value),
Expand Down Expand Up @@ -825,5 +808,5 @@ const languages = [
'Polish',
'Ukrainian',
'Romanian',
'Dutch'
'Dutch',
];
82 changes: 20 additions & 62 deletions example/lib/pages/colors_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ class _ColorsPageState extends State<ColorsPage> {
children: [
const MacosTooltip(
message: 'System Red',
child: ColorBox(
color: MacosColors.systemRedColor,
),
child: ColorBox(color: MacosColors.systemRedColor),
),
MacosTooltip(
message: 'System Red Dark',
Expand All @@ -62,9 +60,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'System Green',
child: ColorBox(
color: MacosColors.systemGreenColor,
),
child: ColorBox(color: MacosColors.systemGreenColor),
),
MacosTooltip(
message: 'System Green Dark',
Expand All @@ -74,9 +70,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'System Blue',
child: ColorBox(
color: MacosColors.systemBlueColor,
),
child: ColorBox(color: MacosColors.systemBlueColor),
),
MacosTooltip(
message: 'System Blue Dark',
Expand All @@ -86,9 +80,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'System Orange',
child: ColorBox(
color: MacosColors.systemOrangeColor,
),
child: ColorBox(color: MacosColors.systemOrangeColor),
),
MacosTooltip(
message: 'System Orange Dark',
Expand All @@ -98,9 +90,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'System Yellow',
child: ColorBox(
color: MacosColors.systemYellowColor,
),
child: ColorBox(color: MacosColors.systemYellowColor),
),
MacosTooltip(
message: 'System Yellow Dark',
Expand All @@ -110,9 +100,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'System Brown',
child: ColorBox(
color: MacosColors.systemBrownColor,
),
child: ColorBox(color: MacosColors.systemBrownColor),
),
MacosTooltip(
message: 'System Brown Dark',
Expand All @@ -122,9 +110,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'System Pink',
child: ColorBox(
color: MacosColors.systemPinkColor,
),
child: ColorBox(color: MacosColors.systemPinkColor),
),
MacosTooltip(
message: 'System Pink Dark',
Expand All @@ -134,9 +120,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'System Purple',
child: ColorBox(
color: MacosColors.systemPurpleColor,
),
child: ColorBox(color: MacosColors.systemPurpleColor),
),
MacosTooltip(
message: 'System Purple Dark',
Expand All @@ -146,9 +130,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'System Teal',
child: ColorBox(
color: MacosColors.systemTealColor,
),
child: ColorBox(color: MacosColors.systemTealColor),
),
MacosTooltip(
message: 'System Teal Dark',
Expand All @@ -158,9 +140,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'System Indigo',
child: ColorBox(
color: MacosColors.systemIndigoColor,
),
child: ColorBox(color: MacosColors.systemIndigoColor),
),
MacosTooltip(
message: 'System Indigo Dark',
Expand All @@ -170,9 +150,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'System Gray',
child: ColorBox(
color: MacosColors.systemGrayColor,
),
child: ColorBox(color: MacosColors.systemGrayColor),
),
MacosTooltip(
message: 'System Gray Dark',
Expand All @@ -182,15 +160,11 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'Link',
child: ColorBox(
color: MacosColors.linkColor,
),
child: ColorBox(color: MacosColors.linkColor),
),
MacosTooltip(
message: 'Link Dark',
child: ColorBox(
color: MacosColors.linkColor.darkColor,
),
child: ColorBox(color: MacosColors.linkColor.darkColor),
),
const MacosTooltip(
message: 'Unemphasized Background',
Expand Down Expand Up @@ -221,9 +195,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'Control',
child: ColorBox(
color: MacosColors.controlColor,
),
child: ColorBox(color: MacosColors.controlColor),
),
MacosTooltip(
message: 'Control Dark',
Expand All @@ -233,9 +205,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'Control Text',
child: ColorBox(
color: MacosColors.controlTextColor,
),
child: ColorBox(color: MacosColors.controlTextColor),
),
MacosTooltip(
message: 'Control Text Dark',
Expand Down Expand Up @@ -294,9 +264,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'Label',
child: ColorBox(
color: MacosColors.labelColor,
),
child: ColorBox(color: MacosColors.labelColor),
),
MacosTooltip(
message: 'Label Dark',
Expand All @@ -306,9 +274,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'Secondary Label',
child: ColorBox(
color: MacosColors.secondaryLabelColor,
),
child: ColorBox(color: MacosColors.secondaryLabelColor),
),
MacosTooltip(
message: 'Secondary Label Dark',
Expand All @@ -318,9 +284,7 @@ class _ColorsPageState extends State<ColorsPage> {
),
const MacosTooltip(
message: 'Tertiary Label',
child: ColorBox(
color: MacosColors.tertiaryLabelColor,
),
child: ColorBox(color: MacosColors.tertiaryLabelColor),
),
MacosTooltip(
message: 'Tertiary Label Dark',
Expand Down Expand Up @@ -353,21 +317,15 @@ class _ColorsPageState extends State<ColorsPage> {
}

class ColorBox extends StatelessWidget {
const ColorBox({
super.key,
required this.color,
});
const ColorBox({super.key, required this.color});

final Color color;

@override
Widget build(BuildContext context) {
return ColoredBox(
color: color,
child: const SizedBox(
height: 50,
width: 50,
),
child: const SizedBox(height: 50, width: 50),
);
}
}
Loading
Loading