mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Create Footer button widget
This commit is contained in:
		@@ -436,34 +436,50 @@ class _CallScreenState extends SafeState<CallScreen> {
 | 
			
		||||
        mainAxisAlignment: MainAxisAlignment.center,
 | 
			
		||||
        children: <Widget>[
 | 
			
		||||
          // Toggle audio button
 | 
			
		||||
          Expanded(
 | 
			
		||||
            child: IconButton(
 | 
			
		||||
              icon: Icon(isStreamingAudio && !isAudioMuted
 | 
			
		||||
                  ? Icons.mic
 | 
			
		||||
                  : Icons.mic_off),
 | 
			
		||||
              onPressed: () => _toggleStreaming(false),
 | 
			
		||||
            ),
 | 
			
		||||
          _FooterButton(
 | 
			
		||||
            onPressed: () => _toggleStreaming(false),
 | 
			
		||||
            icon: Icon(
 | 
			
		||||
                isStreamingAudio && !isAudioMuted ? Icons.mic : Icons.mic_off),
 | 
			
		||||
          ),
 | 
			
		||||
 | 
			
		||||
          // Hang up call
 | 
			
		||||
          Expanded(
 | 
			
		||||
            child: IconButton(
 | 
			
		||||
              icon: Icon(Icons.phone, color: Colors.red),
 | 
			
		||||
              onPressed: () => _leaveCall(),
 | 
			
		||||
            ),
 | 
			
		||||
          _FooterButton(
 | 
			
		||||
            icon: Icon(Icons.phone, color: Colors.red),
 | 
			
		||||
            onPressed: () => _leaveCall(),
 | 
			
		||||
          ),
 | 
			
		||||
 | 
			
		||||
          // Toggle video button
 | 
			
		||||
          Expanded(
 | 
			
		||||
            child: IconButton(
 | 
			
		||||
              icon: Icon(isStreamingVideo && !isVideoMuted
 | 
			
		||||
                  ? Icons.videocam
 | 
			
		||||
                  : Icons.videocam_off),
 | 
			
		||||
              onPressed: () => _toggleStreaming(true),
 | 
			
		||||
            ),
 | 
			
		||||
          _FooterButton(
 | 
			
		||||
            icon: Icon(isStreamingVideo && !isVideoMuted
 | 
			
		||||
                ? Icons.videocam
 | 
			
		||||
                : Icons.videocam_off),
 | 
			
		||||
            onPressed: () => _toggleStreaming(true),
 | 
			
		||||
          ),
 | 
			
		||||
        ],
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _FooterButton extends StatelessWidget {
 | 
			
		||||
  final Function() onPressed;
 | 
			
		||||
  final Widget icon;
 | 
			
		||||
 | 
			
		||||
  const _FooterButton({
 | 
			
		||||
    Key key,
 | 
			
		||||
    @required this.onPressed,
 | 
			
		||||
    @required this.icon,
 | 
			
		||||
  })  : assert(onPressed != null),
 | 
			
		||||
        assert(icon != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return Expanded(
 | 
			
		||||
      child: IconButton(
 | 
			
		||||
        icon: icon,
 | 
			
		||||
        onPressed: () => onPressed(),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user