Skip to content

Commit

Permalink
Merge branch 'main' into feature/radiobutton-overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
smallTrogdor authored Jan 14, 2025
2 parents e550c80 + 744506a commit 1cd315a
Show file tree
Hide file tree
Showing 11 changed files with 1,401 additions and 1,341 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ It is expected that you keep this format strictly, since we depend on it in our
- `SBBCheckboxListItem`
- `SBBRadioButtonListItem`
- `SBBRadioListItem`
- updated the SBB Icons version to 1.2.0

### Added

Expand All @@ -31,6 +32,7 @@ It is expected that you keep this format strictly, since we depend on it in our
- `SBBRadioButtonListItem`
- `SBBRadioListItem`
- added animation to `SBBPagination`
- added the `SBBIconsIndex` allowing String to IconData mapping

### Fixed

Expand Down
1 change: 0 additions & 1 deletion example/lib/pages/icon_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:sbb_design_system_mobile/sbb_design_system_mobile.dart';
import 'package:flutter/material.dart';

import '../native_app.dart';
import '../sbb_icons_index.dart';

class IconPage extends StatelessWidget {
@override
Expand Down
Binary file modified lib/fonts/sbb_icons_large.ttf
Binary file not shown.
Binary file modified lib/fonts/sbb_icons_medium.ttf
Binary file not shown.
Binary file modified lib/fonts/sbb_icons_small.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions lib/sbb_design_system_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export 'src/text/sbb_text_field.dart';
export 'src/text/sbb_text_form_field.dart';
export 'src/theme/sbb_colors.dart';
export 'src/theme/sbb_icons/sbb_icons.dart';
export 'src/theme/sbb_icons/sbb_icons_index.dart';
export 'src/theme/sbb_theme.dart';
export 'src/theme/sbb_typography.dart';
export 'src/theme/styles/sbb_styles.dart';
Expand Down
40 changes: 19 additions & 21 deletions lib/src/checkbox/sbb_checkbox_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -252,29 +252,27 @@ class SBBCheckboxListItem extends StatelessWidget {
return MergeSemantics(
child: Material(
color: resolvedBackgroundColor,
child: Column(children: [
Stack(
alignment: AlignmentDirectional.bottomStart,
children: [
ConstrainedBox(
constraints: const BoxConstraints(minHeight: _minListTileHeight),
child: InkWell(
onTap: _isInteractive ? _handleTap : null,
splashColor: style?.listItem?.backgroundColorHighlighted,
focusColor: style?.listItem?.backgroundColorHighlighted,
highlightColor: SBBColors.transparent,
hoverColor: SBBColors.transparent,
child: Semantics(
enabled: _isInteractive,
child: _checkboxBody(style),
),
child: Stack(
alignment: AlignmentDirectional.bottomStart,
children: [
ConstrainedBox(
constraints: const BoxConstraints(minHeight: _minListTileHeight),
child: InkWell(
onTap: _isInteractive ? _handleTap : null,
splashColor: style?.listItem?.backgroundColorHighlighted,
focusColor: style?.listItem?.backgroundColorHighlighted,
highlightColor: SBBColors.transparent,
hoverColor: SBBColors.transparent,
child: Semantics(
enabled: _isInteractive,
child: _checkboxBody(style),
),
),
if (isLoading) BottomLoadingIndicator()
],
),
if (!isLastElement) const Divider(),
]),
),
if (!isLastElement) const Divider(),
if (isLoading) BottomLoadingIndicator()
],
),
),
);
}
Expand Down
2,628 changes: 1,333 additions & 1,295 deletions lib/src/theme/sbb_icons/sbb_icons.dart

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tool/font_scripts/icons/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.3
1.2.0
15 changes: 4 additions & 11 deletions tool/font_scripts/lib/update_icon_fonts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ Future<void> main() async {
final icons = responseJson['icons'] as List<dynamic>;
final total = icons
.cast<Map<String, dynamic>>()
.where((e) =>
(e['tags'] as List).cast<String>().any((t) => t.contains('Size=')))
.where((e) => (e['tags'] as List).cast<String>().any((t) => t.contains('Size=')))
.length;
progress = FillingBar(total: total + 4, width: 10, desc: 'Downloading icons');

Expand Down Expand Up @@ -76,20 +75,16 @@ Uri makeUrlUri(String path) {
Future<void> prepareIcons(String type, List<dynamic> icons) async {
final filter = icons.where((e) => e['tags'].contains('Size=$type'));
final dir = await Directory('icons/$type-tmp').create(recursive: true);
final downloads = <Future<void>>[];
for (final icon in filter) {
final name = icon['name'];
final fileName = '$name.svg';
final svgUri = makeUrlUri(fileName);
final download = downloadSvg(
await downloadSvg(
svgUri,
fileName.replaceAll('-', '_'),
dir.path,
);
downloads.add(download);
}

await Future.wait(downloads);
}

Future<void> downloadSvg(Uri uri, String fileName, String path) async {
Expand All @@ -104,8 +99,7 @@ Future<void> createFlutterFontMap() async {
final small = await getMap('small');
final medium = await getMap('medium');
final large = await getMap('large');
mapFont(String name, String value) =>
sb.writeln(' static const $name = $value;');
mapFont(String name, String value) => sb.writeln(' static const $name = $value;');

sb.writeln('library sbb_icons;');
sb.writeln();
Expand All @@ -129,8 +123,7 @@ Future<void> createFlutterFontMap() async {

await File('icons/sbb_icons.dart').writeAsString(sb.toString());

mapFont2(String name) =>
sb.writeln(' {\'icon\': SBBIcons.$name, \'name\': \'$name\'},');
mapFont2(String name) => sb.writeln(' {\'icon\': SBBIcons.$name, \'name\': \'$name\'},');

sb.clear();
sb.writeln('import \'package:sbb_design_system_mobile/sbb_design_system_mobile.dart\';');
Expand Down

0 comments on commit 1cd315a

Please sign in to comment.