@@ -115,11 +115,10 @@ class _MyHomePageState extends State<MyHomePage> {
115115 },
116116 ),
117117 builder: (context, roomCtx) {
118- var deviceScreenType = getDeviceType (MediaQuery .of (context).size);
118+ final deviceScreenType = getDeviceType (MediaQuery .of (context).size);
119119 return Scaffold (
120120 appBar: AppBar (
121- title: const Text ('LiveKit Components' ,
122- style: TextStyle (color: Colors .white)),
121+ title: const Text ('LiveKit Components' , style: TextStyle (color: Colors .white)),
123122 actions: [
124123 /// show clear pin button
125124 if (roomCtx.connected) const ClearPinButton (),
@@ -141,16 +140,13 @@ class _MyHomePageState extends State<MyHomePage> {
141140 Row (
142141 children: [
143142 /// show chat widget on mobile
144- (deviceScreenType == DeviceScreenType .mobile &&
145- roomCtx.isChatEnabled)
143+ (deviceScreenType == DeviceScreenType .mobile && roomCtx.isChatEnabled)
146144 ? Expanded (
147145 child: ChatBuilder (
148- builder:
149- (context, enabled, chatCtx, messages) {
146+ builder: (context, enabled, chatCtx, messages) {
150147 return ChatWidget (
151148 messages: messages,
152- onSend: (message) =>
153- chatCtx.sendMessage (message),
149+ onSend: (message) => chatCtx.sendMessage (message),
154150 onClose: () {
155151 chatCtx.toggleChat (false );
156152 },
@@ -179,37 +175,28 @@ class _MyHomePageState extends State<MyHomePage> {
179175 showParticipantPlaceholder: true ,
180176
181177 /// layout builder
182- layoutBuilder:
183- roomCtx.pinnedTracks.isNotEmpty
184- ? const CarouselLayoutBuilder ()
185- : const GridLayoutBuilder (),
178+ layoutBuilder: roomCtx.pinnedTracks.isNotEmpty
179+ ? const CarouselLayoutBuilder ()
180+ : const GridLayoutBuilder (),
186181
187182 /// participant builder
188- participantTrackBuilder:
189- (context, identifier) {
183+ participantTrackBuilder: (context, identifier) {
190184 // build participant widget for each Track
191185 return Padding (
192186 padding: const EdgeInsets .all (2.0 ),
193187 child: Stack (
194188 children: [
195189 /// video track widget in the background
196- identifier.isAudio &&
197- roomCtx
198- .enableAudioVisulizer
190+ identifier.isAudio && roomCtx.enableAudioVisulizer
199191 ? const AudioVisualizerWidget (
200- backgroundColor:
201- LKColors .lkDarkBlue,
192+ backgroundColor: LKColors .lkDarkBlue,
202193 )
203194 : IsSpeakingIndicator (
204- builder: (context,
205- isSpeaking) {
206- return isSpeaking !=
207- null
195+ builder: (context, isSpeaking) {
196+ return isSpeaking != null
208197 ? IsSpeakingIndicatorWidget (
209- isSpeaking:
210- isSpeaking,
211- child:
212- const VideoTrackWidget (),
198+ isSpeaking: isSpeaking,
199+ child: const VideoTrackWidget (),
213200 )
214201 : const VideoTrackWidget ();
215202 },
@@ -254,19 +241,16 @@ class _MyHomePageState extends State<MyHomePage> {
254241 ),
255242
256243 /// show chat widget on desktop
257- (deviceScreenType != DeviceScreenType .mobile &&
258- roomCtx.isChatEnabled)
244+ (deviceScreenType != DeviceScreenType .mobile && roomCtx.isChatEnabled)
259245 ? Expanded (
260246 flex: 2 ,
261247 child: SizedBox (
262248 width: 400 ,
263249 child: ChatBuilder (
264- builder:
265- (context, enabled, chatCtx, messages) {
250+ builder: (context, enabled, chatCtx, messages) {
266251 return ChatWidget (
267252 messages: messages,
268- onSend: (message) =>
269- chatCtx.sendMessage (message),
253+ onSend: (message) => chatCtx.sendMessage (message),
270254 onClose: () {
271255 chatCtx.toggleChat (false );
272256 },
0 commit comments