@@ -7,11 +7,9 @@ import 'package:tuikit_atomic_x/call/call_view.dart';
77import '../../common/call_colors.dart' ;
88
99class MultiCallControlsWidget extends StatefulWidget {
10- final List <CallFeature > disableFeatures;
1110
1211 const MultiCallControlsWidget ({
1312 super .key,
14- required this .disableFeatures,
1513 });
1614
1715 @override
@@ -36,7 +34,7 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
3634 @override
3735 Widget build (BuildContext context) {
3836 return ValueListenableBuilder (
39- valueListenable: CallParticipantStore .shared.state.selfInfo,
37+ valueListenable: CallStore .shared.state.selfInfo,
4038 builder: (context, selfInfo, child) {
4139 if (selfInfo.status == CallParticipantStatus .waiting &&
4240 selfInfo.id != CallStore .shared.state.activeCall.value.inviterId) {
@@ -57,6 +55,7 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
5755 _getAcceptButton (),
5856 ],
5957 ),
58+ const SizedBox (height: 40 ,),
6059 ],
6160 );
6261 }
@@ -148,7 +147,6 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
148147
149148 Widget _getRejectButton () {
150149 return ControlsButton (
151- isDisabled: _isWidgetDisabled (CallFeature .hangup),
152150 imgUrl: "call_assets/hangup.png" ,
153151 tips: CallKit_t ("hangUp" ),
154152 textColor: CallColors .colorG7,
@@ -161,7 +159,6 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
161159
162160 Widget _getAcceptButton () {
163161 return ControlsButton (
164- isDisabled: _isWidgetDisabled (CallFeature .accept),
165162 imgUrl: "call_assets/dialing.png" ,
166163 tips: CallKit_t ("accept" ),
167164 textColor: CallColors .colorG7,
@@ -177,7 +174,6 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
177174 valueListenable: DeviceStore .shared.state.microphoneStatus,
178175 builder: (context, value, child) {
179176 return ControlsButton (
180- isDisabled: _isWidgetDisabled (CallFeature .toggleMicrophone),
181177 imgUrl: value == DeviceStatus .on ? "call_assets/mute.png" : "call_assets/mute_on.png" ,
182178 tips: isFunctionExpand
183179 ? (value == DeviceStatus .on ? CallKit_t ("microphoneIsOn" ) : CallKit_t ("microphoneIsOff" ))
@@ -202,7 +198,6 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
202198 valueListenable: DeviceStore .shared.state.currentAudioRoute,
203199 builder: (context, value, child) {
204200 return ControlsButton (
205- isDisabled: _isWidgetDisabled (CallFeature .selectAudioRoute),
206201 imgUrl: value == AudioRoute .speakerphone ? "call_assets/handsfree_on.png" : "call_assets/handsfree.png" ,
207202 tips: isFunctionExpand
208203 ? (value == AudioRoute .speakerphone ? CallKit_t ("speakerIsOn" ) : CallKit_t ("speakerIsOff" ))
@@ -227,7 +222,6 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
227222 valueListenable: DeviceStore .shared.state.cameraStatus,
228223 builder: (context, value, child) {
229224 return ControlsButton (
230- isDisabled: _isWidgetDisabled (CallFeature .toggleCamera),
231225 imgUrl: value == DeviceStatus .on ? "call_assets/camera_on.png" : "call_assets/camera_off.png" ,
232226 tips:
233227 isFunctionExpand ? (value == DeviceStatus .on ? CallKit_t ("cameraIsOn" ) : CallKit_t ("cameraIsOff" )) : '' ,
@@ -248,7 +242,6 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
248242
249243 Widget _getAnimatedHangupButton (bool isFunctionExpand) {
250244 return ControlsButton (
251- isDisabled: _isWidgetDisabled (CallFeature .hangup),
252245 imgUrl: "call_assets/hangup.png" ,
253246 textColor: CallColors .colorG7,
254247 imgHeight: isFunctionExpand ? bigBtnHeight : smallBtnHeight,
@@ -259,8 +252,4 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
259252 duration: Duration (milliseconds: duration),
260253 );
261254 }
262-
263- bool _isWidgetDisabled (CallFeature feature) {
264- return widget.disableFeatures.contains (CallFeature .all) || widget.disableFeatures.contains (feature);
265- }
266255}
0 commit comments