mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-25 22:39:22 +00:00
Add active mode
This commit is contained in:
parent
fe163b3c69
commit
d8fa90fc6a
@ -10,19 +10,24 @@ class IconButtonWithBadge extends StatelessWidget {
|
||||
final Widget icon;
|
||||
final void Function() onPressed;
|
||||
final int number;
|
||||
final bool active;
|
||||
|
||||
const IconButtonWithBadge({
|
||||
Key key,
|
||||
@required this.icon,
|
||||
@required this.onPressed,
|
||||
this.number = 0,
|
||||
this.active = false,
|
||||
}) : assert(icon != null),
|
||||
assert(number != null),
|
||||
assert(active != null),
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
return Container(
|
||||
color: active ? Color(0x55000000) : null,
|
||||
child: Stack(
|
||||
alignment: AlignmentDirectional.center,
|
||||
children: <Widget>[
|
||||
IconButton(icon: icon, onPressed: onPressed),
|
||||
@ -45,6 +50,7 @@ class IconButtonWithBadge extends StatelessWidget {
|
||||
))
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user