-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): make filter button more obvious
- Loading branch information
Showing
7 changed files
with
84 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import '../module.dart'; | ||
|
||
Widget defaultIconBuilder(IconData icon, double? size) => Icon( | ||
icon, | ||
size: size, | ||
color: PharMeTheme.iconColor, | ||
); | ||
|
||
class ResizedIconButton extends StatelessWidget { | ||
const ResizedIconButton({ | ||
super.key, | ||
required this.iconWidgetBuilder, | ||
required this.size, | ||
this.onPressed, | ||
this.backgroundColor, | ||
}); | ||
|
||
final Widget Function(double? size) iconWidgetBuilder; | ||
final double size; | ||
final void Function()? onPressed; | ||
final Color? backgroundColor; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final padding = size * 0.2; | ||
return SizedBox( | ||
width: size, | ||
height: size, | ||
child: IconButton( | ||
padding: EdgeInsets.all(padding), | ||
onPressed: onPressed, | ||
icon: iconWidgetBuilder(size - 2 * padding), | ||
style: IconButton.styleFrom(backgroundColor: backgroundColor), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters