@@ -36,14 +36,13 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
3636 return ValueListenableBuilder (
3737 valueListenable: CallParticipantStore .shared.state.selfInfo,
3838 builder: (context, selfInfo, child) {
39- if (selfInfo.status == CallParticipantStatus .waiting
40- && selfInfo.id != CallStore .shared.state.activeCall.value.inviterId) {
39+ if (selfInfo.status == CallParticipantStatus .waiting &&
40+ selfInfo.id != CallStore .shared.state.activeCall.value.inviterId) {
4141 return _buildWaitingFunctionView ();
4242 } else {
4343 return _buildAcceptedFunctionView (context);
4444 }
45- }
46- );
45+ });
4746 }
4847
4948 _buildWaitingFunctionView () {
@@ -82,9 +81,7 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
8281 left: isFunctionExpand
8382 ? ((MediaQuery .of (context).size.width / 4 ) - (btnWidth / 2 ))
8483 : (MediaQuery .of (context).size.width * 2 / 6 - btnWidth / 2 ),
85- bottom: isFunctionExpand
86- ? bottomEdge + bigBtnHeight + edge
87- : bottomEdge,
84+ bottom: isFunctionExpand ? bottomEdge + bigBtnHeight + edge : bottomEdge,
8885 child: _getAnimatedMicButton (isFunctionExpand),
8986 ),
9087 AnimatedPositioned (
@@ -93,9 +90,7 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
9390 left: isFunctionExpand
9491 ? (MediaQuery .of (context).size.width / 2 - btnWidth / 2 )
9592 : (MediaQuery .of (context).size.width * 3 / 6 - btnWidth / 2 ),
96- bottom: isFunctionExpand
97- ? bottomEdge + bigBtnHeight + edge
98- : bottomEdge,
93+ bottom: isFunctionExpand ? bottomEdge + bigBtnHeight + edge : bottomEdge,
9994 child: _getAnimatedSpeakerPhoneButton (isFunctionExpand),
10095 ),
10196 AnimatedPositioned (
@@ -104,9 +99,7 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
10499 left: isFunctionExpand
105100 ? (MediaQuery .of (context).size.width * 3 / 4 - btnWidth / 2 )
106101 : (MediaQuery .of (context).size.width * 4 / 6 - btnWidth / 2 ),
107- bottom: isFunctionExpand
108- ? bottomEdge + bigBtnHeight + edge
109- : bottomEdge,
102+ bottom: isFunctionExpand ? bottomEdge + bigBtnHeight + edge : bottomEdge,
110103 child: _getAnimatedCameraButton (isFunctionExpand),
111104 ),
112105 AnimatedPositioned (
@@ -122,18 +115,15 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
122115 curve: curve,
123116 duration: Duration (milliseconds: duration),
124117 left: (MediaQuery .of (context).size.width / 6 - smallBtnHeight / 2 ),
125- bottom: isFunctionExpand
126- ? bottomEdge + smallBtnHeight / 4 + 22
127- : bottomEdge + 22 ,
118+ bottom: isFunctionExpand ? bottomEdge + smallBtnHeight / 4 + 22 : bottomEdge + 22 ,
128119 child: InkWell (
129120 onTap: () {
130121 isFunctionExpand = ! isFunctionExpand;
131122 setState (() {});
132123 },
133124 child: Transform (
134125 alignment: Alignment .center,
135- transform: Matrix4 .identity ()
136- ..scale (1.0 , isFunctionExpand ? 1.0 : - 1.0 , 1.0 ),
126+ transform: Matrix4 .identity ()..scale (1.0 , isFunctionExpand ? 1.0 : - 1.0 , 1.0 ),
137127 child: Image .asset (
138128 'call_assets/arrow.png' ,
139129 package: 'tuikit_atomic_x' ,
@@ -180,27 +170,20 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
180170 );
181171 }
182172
183-
184173 Widget _getAnimatedMicButton (bool isFunctionExpand) {
185174 return ValueListenableBuilder (
186175 valueListenable: DeviceStore .shared.state.microphoneStatus,
187176 builder: (context, value, child) {
188177 return ControlsButton (
189178 isDisabled: _isWidgetDisabled (CallFeature .toggleMicrophone),
190- imgUrl: value == DeviceSwitchStatus .on
191- ? "call_assets/mute.png"
192- : "call_assets/mute_on.png" ,
179+ imgUrl: value == DeviceStatus .on ? "call_assets/mute.png" : "call_assets/mute_on.png" ,
193180 tips: isFunctionExpand
194- ? (value == DeviceSwitchStatus .on
195- ? CallKit_t ("microphoneIsOn" )
196- : CallKit_t ("microphoneIsOff" ))
181+ ? (value == DeviceStatus .on ? CallKit_t ("microphoneIsOn" ) : CallKit_t ("microphoneIsOff" ))
197182 : '' ,
198183 textColor: Colors .white,
199- imgHeight: isFunctionExpand
200- ? bigBtnHeight
201- : smallBtnHeight,
184+ imgHeight: isFunctionExpand ? bigBtnHeight : smallBtnHeight,
202185 onTap: () {
203- if (value == DeviceSwitchStatus .on ) {
186+ if (value == DeviceStatus .on ) {
204187 DeviceStore .shared.closeLocalMicrophone ();
205188 } else {
206189 DeviceStore .shared.openLocalMicrophone ();
@@ -209,8 +192,7 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
209192 useAnimation: true ,
210193 duration: Duration (milliseconds: duration),
211194 );
212- }
213- );
195+ });
214196 }
215197
216198 Widget _getAnimatedSpeakerPhoneButton (bool isFunctionExpand) {
@@ -219,18 +201,12 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
219201 builder: (context, value, child) {
220202 return ControlsButton (
221203 isDisabled: _isWidgetDisabled (CallFeature .selectAudioRoute),
222- imgUrl: value == AudioRoute .speakerphone
223- ? "call_assets/handsfree_on.png"
224- : "call_assets/handsfree.png" ,
204+ imgUrl: value == AudioRoute .speakerphone ? "call_assets/handsfree_on.png" : "call_assets/handsfree.png" ,
225205 tips: isFunctionExpand
226- ? (value == AudioRoute .speakerphone
227- ? CallKit_t ("speakerIsOn" )
228- : CallKit_t ("speakerIsOff" ))
206+ ? (value == AudioRoute .speakerphone ? CallKit_t ("speakerIsOn" ) : CallKit_t ("speakerIsOff" ))
229207 : '' ,
230208 textColor: Colors .white,
231- imgHeight: isFunctionExpand
232- ? bigBtnHeight
233- : smallBtnHeight,
209+ imgHeight: isFunctionExpand ? bigBtnHeight : smallBtnHeight,
234210 onTap: () {
235211 if (value == AudioRoute .speakerphone) {
236212 DeviceStore .shared.setAudioRoute (AudioRoute .earpiece);
@@ -241,8 +217,7 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
241217 useAnimation: true ,
242218 duration: Duration (milliseconds: duration),
243219 );
244- }
245- );
220+ });
246221 }
247222
248223 Widget _getAnimatedCameraButton (bool isFunctionExpand) {
@@ -251,20 +226,13 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
251226 builder: (context, value, child) {
252227 return ControlsButton (
253228 isDisabled: _isWidgetDisabled (CallFeature .toggleCamera),
254- imgUrl: value == DeviceSwitchStatus .on
255- ? "call_assets/camera_on.png"
256- : "call_assets/camera_off.png" ,
257- tips: isFunctionExpand
258- ? (value == DeviceSwitchStatus .on
259- ? CallKit_t ("cameraIsOn" )
260- : CallKit_t ("cameraIsOff" ))
261- : '' ,
229+ imgUrl: value == DeviceStatus .on ? "call_assets/camera_on.png" : "call_assets/camera_off.png" ,
230+ tips:
231+ isFunctionExpand ? (value == DeviceStatus .on ? CallKit_t ("cameraIsOn" ) : CallKit_t ("cameraIsOff" )) : '' ,
262232 textColor: Colors .white,
263- imgHeight: isFunctionExpand
264- ? bigBtnHeight
265- : smallBtnHeight,
233+ imgHeight: isFunctionExpand ? bigBtnHeight : smallBtnHeight,
266234 onTap: () {
267- if (value == DeviceSwitchStatus .on ) {
235+ if (value == DeviceStatus .on ) {
268236 DeviceStore .shared.closeLocalCamera ();
269237 } else {
270238 DeviceStore .shared.openLocalCamera (DeviceStore .shared.state.isFrontCamera.value);
@@ -273,27 +241,24 @@ class _MultiCallControlsWidgetState extends State<MultiCallControlsWidget> {
273241 useAnimation: true ,
274242 duration: Duration (milliseconds: duration),
275243 );
276- }
277- );
244+ });
278245 }
279246
280247 Widget _getAnimatedHangupButton (bool isFunctionExpand) {
281248 return ControlsButton (
282249 isDisabled: _isWidgetDisabled (CallFeature .hangup),
283250 imgUrl: "call_assets/hangup.png" ,
284251 textColor: Colors .white,
285- imgHeight: isFunctionExpand
286- ? bigBtnHeight
287- : smallBtnHeight,
252+ imgHeight: isFunctionExpand ? bigBtnHeight : smallBtnHeight,
288253 onTap: () {
289254 CallStore .shared.hangup ();
290255 },
291256 useAnimation: true ,
292257 duration: Duration (milliseconds: duration),
293258 );
294259 }
295-
260+
296261 bool _isWidgetDisabled (CallFeature feature) {
297262 return widget.disableFeatures.contains (CallFeature .all) || widget.disableFeatures.contains (feature);
298263 }
299- }
264+ }
0 commit comments