💄 Use different icon for mute state of outputs
This commit is contained in:
@ -4,7 +4,12 @@ import 'package:gomix_flutter/mixer_state.dart' as mixer;
|
||||
class MixingCard extends StatefulWidget {
|
||||
final mixer.Port port;
|
||||
final Function sendAction;
|
||||
const MixingCard({super.key, required this.port, required this.sendAction});
|
||||
final bool isOutput;
|
||||
const MixingCard(
|
||||
{super.key,
|
||||
required this.port,
|
||||
required this.sendAction,
|
||||
this.isOutput = false});
|
||||
|
||||
@override
|
||||
State<MixingCard> createState() => _MixingCardState();
|
||||
@ -45,21 +50,27 @@ class _MixingCardState extends State<MixingCard> {
|
||||
children: [
|
||||
Expanded(child: Text(widget.port.name, style: labelStyle)),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
width: 40,
|
||||
child: IconButton.filledTonal(
|
||||
iconSize: 20,
|
||||
isSelected: widget.port.state.mute,
|
||||
onPressed: () {
|
||||
widget.sendAction({
|
||||
"method": "setPortState",
|
||||
"UUID": widget.port.uuid,
|
||||
"stateData": {"mute": !widget.port.state.mute}
|
||||
});
|
||||
},
|
||||
icon: widget.port.state.mute
|
||||
height: 40,
|
||||
width: 40,
|
||||
child: IconButton.filledTonal(
|
||||
iconSize: 20,
|
||||
isSelected: widget.port.state.mute,
|
||||
onPressed: () {
|
||||
widget.sendAction({
|
||||
"method": "setPortState",
|
||||
"UUID": widget.port.uuid,
|
||||
"stateData": {"mute": !widget.port.state.mute}
|
||||
});
|
||||
},
|
||||
icon: widget.isOutput
|
||||
? (widget.port.state.mute
|
||||
? const Icon(Icons.volume_off_outlined)
|
||||
: const Icon(Icons.volume_up_outlined))
|
||||
: (widget.port.state.mute
|
||||
? const Icon(Icons.mic_off_outlined)
|
||||
: const Icon(Icons.mic_none_outlined))),
|
||||
: const Icon(Icons.mic_none_outlined)),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
|
||||
Reference in New Issue
Block a user