Skip to content

Commit

Permalink
revert separation of icons in different sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
mosberger committed Dec 8, 2023
1 parent e843910 commit 137842b
Show file tree
Hide file tree
Showing 54 changed files with 6,886 additions and 6,925 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
- `SBBRadioButtonListItem`: Adjusted paddings to match the current specifications
- `SBBSelect`: Field `label` is now optional because there is now a variant without label
- `SBBAccordion`: Adjusted paddings, text style and icon rotation to match the current specifications
- `SBBIcons`: Imported version 0.1.61 from https://icons.app.sbb.ch/. The icons are now split into `SBBIconsSmall`, `SBBIconsMedium` and `SBBIconsLarge`
- `SBBIcons`: Imported version 0.1.61 from https://icons.app.sbb.ch/.

### Deprecated

Expand Down
6 changes: 3 additions & 3 deletions example/lib/native_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class _DemoEntry extends StatelessWidget {
color: style.groupBackgroundColor,
child: SBBListItem(
title: title,
trailingIcon: SBBIconsSmall.chevron_small_right_small,
trailingIcon: SBBIcons.chevron_small_right_small,
onPressed: action,
isLastElement: isLastElement,
),
Expand Down Expand Up @@ -296,8 +296,8 @@ class ThemeModeSegmentedButton extends StatelessWidget {
Widget build(BuildContext context) {
return SBBSegmentedButton.icon(
icons: {
SBBIconsSmall.sunshine_small: 'Light theme',
SBBIconsSmall.moon_small: 'Dark theme',
SBBIcons.sunshine_small: 'Light theme',
SBBIcons.moon_small: 'Dark theme',
},
selectedIndexChanged: (value) {
Provider.of<AppState>(
Expand Down
4 changes: 2 additions & 2 deletions example/lib/pages/autocompletion_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class _AutocompletionPageState extends State<AutocompletionPage> {
super.initState();
_autocompletion = SBBAutocompletion<String>(
key: GlobalKey(debugLabel: 'bla'),
icon: SBBIconsSmall.route_circle_start_small,
icon: SBBIcons.route_circle_start_small,
itemFilter: (String item, String query) {
return item.toLowerCase().startsWith(query.toLowerCase());
},
Expand All @@ -39,7 +39,7 @@ class _AutocompletionPageState extends State<AutocompletionPage> {
'ccdd',
'eee',
],
suggestionIcon: SBBIconsSmall.train_station_small,
suggestionIcon: SBBIcons.train_station_small,
enableFavorites: true,
itemAddedToFavorites: (String item) {
_autocompletion.addFavorite(item);
Expand Down
36 changes: 18 additions & 18 deletions example/lib/pages/button_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,21 @@ class ButtonPage extends StatelessWidget {
const SizedBox(height: sbbDefaultSpacing),
SBBTertiaryButtonLarge(
label: 'Tertiary Button Large Icon',
icon: SBBIconsSmall.plus_small,
icon: SBBIcons.plus_small,
onPressed: () {
sbbToast.show(message: 'SBBTertiaryButtonLarge');
},
),
const SizedBox(height: sbbDefaultSpacing),
SBBTertiaryButtonLarge(
label: 'Tertiary Button Large Icon Disabled',
icon: SBBIconsSmall.plus_small,
icon: SBBIcons.plus_small,
onPressed: null,
),
const SizedBox(height: sbbDefaultSpacing),
SBBTertiaryButtonLarge(
label: 'Tertiary Button Large Icon Loading',
icon: SBBIconsSmall.plus_small,
icon: SBBIcons.plus_small,
onPressed: () {},
isLoading: true,
),
Expand Down Expand Up @@ -175,21 +175,21 @@ class ButtonPage extends StatelessWidget {
const SizedBox(height: sbbDefaultSpacing),
SBBTertiaryButtonSmall(
label: 'Tertiary Button Small Icon',
icon: SBBIconsSmall.plus_small,
icon: SBBIcons.plus_small,
onPressed: () {
sbbToast.show(message: 'SBBTertiaryButtonSmall');
},
),
const SizedBox(height: sbbDefaultSpacing),
const SBBTertiaryButtonSmall(
label: 'Tertiary Button Small Icon Disabled',
icon: SBBIconsSmall.plus_small,
icon: SBBIcons.plus_small,
onPressed: null,
),
const SizedBox(height: sbbDefaultSpacing),
const SBBTertiaryButtonSmall(
label: 'Tertiary Button Small Icon Loading',
icon: SBBIconsSmall.plus_small,
icon: SBBIcons.plus_small,
onPressed: null,
isLoading: true,
),
Expand All @@ -208,12 +208,12 @@ class ButtonPage extends StatelessWidget {
onPressed: () {
sbbToast.show(message: 'SBBIconButtonLarge');
},
icon: SBBIconsSmall.pen_small,
icon: SBBIcons.pen_small,
),
const SizedBox(width: sbbDefaultSpacing),
const SBBIconButtonLarge(
onPressed: null,
icon: SBBIconsSmall.pen_small,
icon: SBBIcons.pen_small,
),
],
),
Expand All @@ -229,12 +229,12 @@ class ButtonPage extends StatelessWidget {
onPressed: () {
sbbToast.show(message: 'SBBIconButtonSmall');
},
icon: SBBIconsSmall.circle_information_small_small,
icon: SBBIcons.circle_information_small_small,
),
const SizedBox(width: sbbDefaultSpacing),
const SBBIconButtonSmall(
onPressed: null,
icon: SBBIconsSmall.circle_information_small_small,
icon: SBBIcons.circle_information_small_small,
),
const SizedBox(width: sbbDefaultSpacing),
],
Expand All @@ -253,12 +253,12 @@ class ButtonPage extends StatelessWidget {
onPressed: () {
sbbToast.show(message: 'SBBIconButtonSmallNegative');
},
icon: SBBIconsSmall.circle_information_small_small,
icon: SBBIcons.circle_information_small_small,
),
const SizedBox(width: sbbDefaultSpacing),
const SBBIconButtonSmallNegative(
onPressed: null,
icon: SBBIconsSmall.circle_information_small_small,
icon: SBBIcons.circle_information_small_small,
),
const SizedBox(width: sbbDefaultSpacing),
],
Expand All @@ -276,12 +276,12 @@ class ButtonPage extends StatelessWidget {
onPressed: () {
sbbToast.show(message: 'SBBIconButtonSmallBorderless');
},
icon: SBBIconsSmall.drag_small,
icon: SBBIcons.drag_small,
),
const SizedBox(width: sbbDefaultSpacing),
const SBBIconButtonSmallBorderless(
onPressed: null,
icon: SBBIconsSmall.drag_small,
icon: SBBIcons.drag_small,
),
const SizedBox(width: sbbDefaultSpacing),
],
Expand All @@ -298,12 +298,12 @@ class ButtonPage extends StatelessWidget {
onPressed: () {
sbbToast.show(message: 'SBBIconFormButton');
},
icon: SBBIconsSmall.pen_small,
icon: SBBIcons.pen_small,
),
const SizedBox(width: sbbDefaultSpacing),
const SBBIconFormButton(
onPressed: null,
icon: SBBIconsSmall.pen_small,
icon: SBBIcons.pen_small,
),
],
),
Expand All @@ -317,13 +317,13 @@ class ButtonPage extends StatelessWidget {
onPressed: () {
sbbToast.show(message: 'SBBIconTextButton');
},
icon: SBBIconsLarge.station_large,
icon: SBBIcons.station_large,
label: 'Default',
),
const SizedBox(width: sbbDefaultSpacing),
const SBBIconTextButton(
onPressed: null,
icon: SBBIconsLarge.station_large,
icon: SBBIcons.station_large,
label: 'Disabled',
),
],
Expand Down
12 changes: 6 additions & 6 deletions example/lib/pages/checkbox_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,29 +74,29 @@ class _CheckboxPageState extends State<CheckboxPage> {
value: _listItemValue3,
label: 'Call to Action',
onChanged: (value) => setState(() => _listItemValue3 = value),
trailingIcon: SBBIconsSmall.circle_information_small_small,
trailingIcon: SBBIcons.circle_information_small_small,
onCallToAction: () => sbbToast.show(message: 'Call to Action'),
),
SBBCheckboxListItem(
value: _listItemValue4,
label: 'Icon',
onChanged: (value) => setState(() => _listItemValue4 = value),
leadingIcon: SBBIconsSmall.alarm_clock_small,
leadingIcon: SBBIcons.alarm_clock_small,
),
SBBCheckboxListItem(
value: _listItemValue5,
label: 'Icon, Call to Action',
onChanged: (value) => setState(() => _listItemValue5 = value),
leadingIcon: SBBIconsSmall.alarm_clock_small,
trailingIcon: SBBIconsSmall.circle_information_small_small,
leadingIcon: SBBIcons.alarm_clock_small,
trailingIcon: SBBIcons.circle_information_small_small,
onCallToAction: () => sbbToast.show(message: 'Call to Action'),
),
SBBCheckboxListItem(
value: _listItemValue5,
label: 'Disabled, Icon, Call to Action',
onChanged: null,
leadingIcon: SBBIconsSmall.alarm_clock_small,
trailingIcon: SBBIconsSmall.circle_information_small_small,
leadingIcon: SBBIcons.alarm_clock_small,
trailingIcon: SBBIcons.circle_information_small_small,
onCallToAction: () => sbbToast.show(message: 'Call to Action'),
),
SBBCheckboxListItem.custom(
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/launchpad_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class _DemoEntry extends StatelessWidget {
color: style.groupBackgroundColor,
child: SBBListItem(
title: title,
trailingIcon: SBBIconsSmall.chevron_small_right_small,
trailingIcon: SBBIcons.chevron_small_right_small,
onPressed: action,
isLastElement: isLastElement,
),
Expand Down
22 changes: 11 additions & 11 deletions example/lib/pages/list_item_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,49 +27,49 @@ class ListItemPage extends StatelessWidget {
),
SBBListItem(
title: 'Icon',
leadingIcon: SBBIconsSmall.clock_small,
leadingIcon: SBBIcons.clock_small,
onPressed: () => sbbToast.show(message: 'ListItem with Icon'),
),
SBBListItem(
title: 'Trailing Icon',
trailingIcon: SBBIconsSmall.chevron_small_right_small,
trailingIcon: SBBIcons.chevron_small_right_small,
onPressed: () => sbbToast.show(message: 'ListItem with Icon'),
),
SBBListItem.button(
title: 'Button',
onPressed: () =>
sbbToast.show(message: 'ListItem with Button'),
buttonIcon: SBBIconsSmall.chevron_small_right_small,
buttonIcon: SBBIcons.chevron_small_right_small,
onPressedButton: () => sbbToast.show(message: 'Button'),
),
SBBListItem.button(
title: 'Subtitle, Button',
subtitle: 'This is the Subtitle',
buttonIcon: SBBIconsSmall.chevron_small_right_small,
buttonIcon: SBBIcons.chevron_small_right_small,
onPressedButton: () => sbbToast.show(message: 'Button'),
onPressed: () => sbbToast.show(
message: 'ListItem with Subtitle and Button'),
),
SBBListItem.button(
title: 'Icon, Button',
leadingIcon: SBBIconsSmall.clock_small,
buttonIcon: SBBIconsSmall.chevron_small_right_small,
leadingIcon: SBBIcons.clock_small,
buttonIcon: SBBIcons.chevron_small_right_small,
onPressedButton: () => sbbToast.show(message: 'Button'),
onPressed: () => sbbToast.show(
message: 'ListItem with Icon and Button'),
),
SBBListItem(
title: 'Icon, Subtitle',
leadingIcon: SBBIconsSmall.clock_small,
leadingIcon: SBBIcons.clock_small,
subtitle: 'This is the Subtitle',
onPressed: () =>
sbbToast.show(message: 'ListItem with Icon and Subtitle'),
),
SBBListItem.button(
title: 'Icon, Subtitle, Button',
subtitle: 'This is the Subtitle',
leadingIcon: SBBIconsSmall.clock_small,
buttonIcon: SBBIconsSmall.chevron_small_right_small,
leadingIcon: SBBIcons.clock_small,
buttonIcon: SBBIcons.chevron_small_right_small,
onPressedButton: () => sbbToast.show(message: 'Button'),
onPressed: () => sbbToast.show(
message: 'ListItem with Icon, Subtitle and Button'),
Expand All @@ -78,9 +78,9 @@ class ListItemPage extends StatelessWidget {
title: 'Disabled, Icon, Subtitle, Button',
subtitle: 'This is the Subtitle',
isLastElement: true,
leadingIcon: SBBIconsSmall.clock_small,
leadingIcon: SBBIcons.clock_small,
onPressed: null,
buttonIcon: SBBIconsSmall.chevron_small_right_small,
buttonIcon: SBBIcons.chevron_small_right_small,
onPressedButton: () => sbbToast.show(message: 'Button'),
),
],
Expand Down
12 changes: 6 additions & 6 deletions example/lib/pages/radio_button_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class _RadiobuttonPageState extends State<RadiobuttonPage> {
});
},
label: 'Call to Action',
trailingIcon: SBBIconsSmall.circle_information_small_small,
trailingIcon: SBBIcons.circle_information_small_small,
onCallToAction: () => sbbToast.show(message: 'Call to Action'),
),
SBBRadioButtonListItem<int>(
Expand All @@ -87,7 +87,7 @@ class _RadiobuttonPageState extends State<RadiobuttonPage> {
});
},
label: 'Icon',
leadingIcon: SBBIconsSmall.alarm_clock_small,
leadingIcon: SBBIcons.alarm_clock_small,
),
SBBRadioButtonListItem<int>(
value: 4,
Expand All @@ -98,17 +98,17 @@ class _RadiobuttonPageState extends State<RadiobuttonPage> {
});
},
label: 'Icon, Call to Action',
leadingIcon: SBBIconsSmall.alarm_clock_small,
trailingIcon: SBBIconsSmall.circle_information_small_small,
leadingIcon: SBBIcons.alarm_clock_small,
trailingIcon: SBBIcons.circle_information_small_small,
onCallToAction: () => sbbToast.show(message: 'Call to Action'),
),
SBBRadioButtonListItem<int>(
value: 4,
groupValue: _listItemGroupValue,
onChanged: null,
label: 'Disabled, Icon, Call to Action',
leadingIcon: SBBIconsSmall.alarm_clock_small,
trailingIcon: SBBIconsSmall.circle_information_small_small,
leadingIcon: SBBIcons.alarm_clock_small,
trailingIcon: SBBIcons.circle_information_small_small,
onCallToAction: () => sbbToast.show(message: 'Call to Action'),
),
SBBRadioButtonListItem<int>.custom(
Expand Down
12 changes: 6 additions & 6 deletions example/lib/pages/segmented_button_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class _SegmentedButtonPageState extends State<SegmentedButtonPage> {
padding: const EdgeInsets.all(sbbDefaultSpacing),
child: SBBSegmentedButton.icon(
icons: {
SBBIconsSmall.microscooter_profile_small: 'Microscooter',
SBBIconsSmall.bicycle_small: 'Bicycle',
SBBIconsSmall.scooter_profile_small: 'Scooter',
SBBIcons.microscooter_profile_small: 'Microscooter',
SBBIcons.bicycle_small: 'Bicycle',
SBBIcons.scooter_profile_small: 'Scooter',
},
selectedIndexChanged: (value) =>
setState(() => _selectedStateIndex2 = value),
Expand All @@ -59,9 +59,9 @@ class _SegmentedButtonPageState extends State<SegmentedButtonPage> {
padding: const EdgeInsets.all(sbbDefaultSpacing),
child: SBBSegmentedButton.redIcon(
icons: {
SBBIconsSmall.microscooter_profile_small: 'Microscooter',
SBBIconsSmall.bicycle_small: 'Bicycle',
SBBIconsSmall.scooter_profile_small: 'Scooter',
SBBIcons.microscooter_profile_small: 'Microscooter',
SBBIcons.bicycle_small: 'Bicycle',
SBBIcons.scooter_profile_small: 'Scooter',
},
selectedIndexChanged: (value) =>
setState(() => _selectedStateIndex4 = value),
Expand Down
Loading

0 comments on commit 137842b

Please sign in to comment.