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