Skip to content

Commit a493129

Browse files
fix: Allow custom icons in ZetaFilterSelection (#152)
ci: Update to latest version of flutter-code-quality action chore: Remve support for deprecated buttonBarTheme in ThemeData
1 parent faaa6fe commit a493129

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

.github/workflows/pull-request.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
cache: true
2323
- run: dart run build_runner build --delete-conflicting-outputs
24-
- uses: ZebraDevs/[email protected].7
24+
- uses: ZebraDevs/[email protected].8
2525
with:
2626
token: ${{secrets.GITHUB_TOKEN}}
2727

example/macos/Runner/AppDelegate.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Cocoa
22
import FlutterMacOS
33

4-
@NSApplicationMain
4+
@main
55
class AppDelegate: FlutterAppDelegate {
66
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
77
return true

lib/src/components/filter_selection/filter_selection.dart

+9-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ZetaFilterSelection extends ZetaStatelessWidget {
1313
required this.items,
1414
this.onPressed,
1515
this.buttonSemanticLabel,
16+
this.icon = ZetaIcons.filter,
1617
});
1718

1819
/// The filter items - list of [ZetaFilterChip].
@@ -26,6 +27,11 @@ class ZetaFilterSelection extends ZetaStatelessWidget {
2627
/// {@macro zeta-widget-semantic-label}
2728
final String? buttonSemanticLabel;
2829

30+
/// Icon for the filter button.
31+
///
32+
/// Default is [ZetaIcons.filter].
33+
final IconData icon;
34+
2935
@override
3036
Widget build(BuildContext context) {
3137
return SizedBox(
@@ -43,10 +49,7 @@ class ZetaFilterSelection extends ZetaStatelessWidget {
4349
child: IconButton(
4450
visualDensity: VisualDensity.compact,
4551
onPressed: onPressed,
46-
icon: const ZetaIcon(
47-
ZetaIcons.filter,
48-
size: ZetaSpacing.xl_2,
49-
),
52+
icon: ZetaIcon(icon, size: ZetaSpacing.xl_2),
5053
),
5154
),
5255
),
@@ -70,6 +73,7 @@ class ZetaFilterSelection extends ZetaStatelessWidget {
7073
properties
7174
..add(DiagnosticsProperty<bool>('rounded', rounded))
7275
..add(ObjectFlagProperty<VoidCallback?>.has('onPressed', onPressed))
73-
..add(StringProperty('buttonSemanticLabel', buttonSemanticLabel));
76+
..add(StringProperty('buttonSemanticLabel', buttonSemanticLabel))
77+
..add(DiagnosticsProperty<IconData>('icon', icon));
7478
}
7579
}

lib/src/utils/zeta_provider.dart

-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,6 @@ ThemeData generateZetaTheme({
434434
bottomAppBarTheme: existingTheme.bottomAppBarTheme,
435435
bottomNavigationBarTheme: existingTheme.bottomNavigationBarTheme,
436436
bottomSheetTheme: existingTheme.bottomSheetTheme,
437-
buttonBarTheme: existingTheme.buttonBarTheme,
438437
buttonTheme: existingTheme.buttonTheme,
439438
cardTheme: existingTheme.cardTheme,
440439
checkboxTheme: existingTheme.checkboxTheme,

0 commit comments

Comments
 (0)