11import 'package:flutter/material.dart' ;
22import 'package:tencent_calls_uikit/tencent_calls_uikit.dart' ;
3- import 'package:rtc_room_engine/rtc_room_engine.dart' ;
43import 'package:tencent_calls_uikit_example/src/settings/settings_config.dart' ;
54import 'package:tencent_calls_uikit_example/src/settings/settings_detail_widget.dart' ;
65import 'package:tencent_calls_uikit_example/generate/app_localizations.dart' ;
@@ -13,10 +12,6 @@ class SettingsWidget extends StatefulWidget {
1312}
1413
1514class _SettingsWidgetState extends State <SettingsWidget > {
16- Resolution _resolution = SettingsConfig .resolution;
17- ResolutionMode _resolutionMode = SettingsConfig .resolutionMode;
18- FillMode _fillMode = SettingsConfig .fillMode;
19- Rotation _rotation = SettingsConfig .rotation;
2015
2116 @override
2217 Widget build (BuildContext context) {
@@ -355,41 +350,6 @@ class _SettingsWidgetState extends State<SettingsWidget> {
355350 ],
356351 ),
357352 ),
358- SizedBox (
359- height: 40 ,
360- child: Row (
361- mainAxisAlignment: MainAxisAlignment .spaceBetween,
362- children: [
363- Text (
364- AppLocalizations .of (context)! .offline_push_info,
365- style: const TextStyle (
366- fontSize: 16 ,
367- fontStyle: FontStyle .normal,
368- fontWeight: FontWeight .normal,
369- color: Colors .black),
370- ),
371- InkWell (
372- onTap: () => _goDetailSettings (SettingWidgetType .offlinePush),
373- child: Row (children: [
374- Text (
375- SettingsConfig .offlinePushInfo == null
376- ? AppLocalizations .of (context)! .not_set
377- : AppLocalizations .of (context)! .go_set,
378- maxLines: 1 ,
379- style: const TextStyle (
380- fontSize: 16 ,
381- fontStyle: FontStyle .normal,
382- fontWeight: FontWeight .normal,
383- color: Colors .black),
384- textAlign: TextAlign .right,
385- ),
386- const SizedBox (width: 10 ),
387- const Text ('>' )
388- ]))
389- ],
390- ),
391- ),
392- const SizedBox (height: 10 ),
393353 ],
394354 );
395355 }
@@ -409,171 +369,6 @@ class _SettingsWidgetState extends State<SettingsWidget> {
409369 color: Colors .black54),
410370 ),
411371 ),
412- SizedBox (
413- height: 40 ,
414- child: Row (
415- mainAxisAlignment: MainAxisAlignment .spaceBetween,
416- children: [
417- Text (
418- AppLocalizations .of (context)! .resolution,
419- style: const TextStyle (
420- fontSize: 16 ,
421- fontStyle: FontStyle .normal,
422- fontWeight: FontWeight .normal,
423- color: Colors .black),
424- ),
425- DropdownButton (
426- value: _resolution,
427- items: const [
428- DropdownMenuItem (value: Resolution .resolution_640_360, child: Text ('640_360' )),
429- DropdownMenuItem (value: Resolution .resolution_960_540, child: Text ('960_540' )),
430- DropdownMenuItem (value: Resolution .resolution_1280_720, child: Text ('1280_720' )),
431- DropdownMenuItem (value: Resolution .resolution_1920_1080, child: Text ('1920_1080' )),
432- ],
433- onChanged: (value) {
434- setState (() {
435- _resolution = value! ;
436- SettingsConfig .resolution = _resolution;
437- });
438-
439- VideoEncoderParams params = VideoEncoderParams (
440- resolution: SettingsConfig .resolution,
441- resolutionMode: SettingsConfig .resolutionMode);
442- TUICallEngine .instance.setVideoEncoderParams (params);
443- },
444- underline: Container (height: 0 ),
445- ),
446- ],
447- ),
448- ),
449- SizedBox (
450- height: 40 ,
451- child: Row (
452- mainAxisAlignment: MainAxisAlignment .spaceBetween,
453- children: [
454- Text (
455- AppLocalizations .of (context)! .resolution_mode,
456- style: const TextStyle (
457- fontSize: 16 ,
458- fontStyle: FontStyle .normal,
459- fontWeight: FontWeight .normal,
460- color: Colors .black),
461- ),
462- DropdownButton (
463- value: _resolutionMode,
464- items: [
465- DropdownMenuItem (value: ResolutionMode .landscape, child: Text (AppLocalizations .of (context)! .horizontal)),
466- DropdownMenuItem (value: ResolutionMode .portrait, child: Text (AppLocalizations .of (context)! .vertical)),
467- ],
468- onChanged: (value) {
469- setState (() {
470- _resolutionMode = value! ;
471- SettingsConfig .resolutionMode = _resolutionMode;
472- });
473-
474- VideoEncoderParams params = VideoEncoderParams (
475- resolution: SettingsConfig .resolution,
476- resolutionMode: SettingsConfig .resolutionMode);
477- TUICallEngine .instance.setVideoEncoderParams (params);
478- },
479- underline: Container (height: 0 ),
480- ),
481- ],
482- ),
483- ),
484- SizedBox (
485- height: 40 ,
486- child: Row (
487- mainAxisAlignment: MainAxisAlignment .spaceBetween,
488- children: [
489- Text (
490- AppLocalizations .of (context)! .fill_pattern,
491- style: const TextStyle (
492- fontSize: 16 ,
493- fontStyle: FontStyle .normal,
494- fontWeight: FontWeight .normal,
495- color: Colors .black),
496- ),
497- DropdownButton (
498- value: _fillMode,
499- items: [
500- DropdownMenuItem (value: FillMode .fill, child: Text (AppLocalizations .of (context)! .fill)),
501- DropdownMenuItem (value: FillMode .fit, child: Text (AppLocalizations .of (context)! .fit)),
502- ],
503- onChanged: (value) {
504- setState (() {
505- _fillMode = value! ;
506- SettingsConfig .fillMode = _fillMode;
507- });
508- _setVideoRenderParams ();
509- },
510- underline: Container (height: 0 ),
511- ),
512- ],
513- ),
514- ),
515- SizedBox (
516- height: 40 ,
517- child: Row (
518- mainAxisAlignment: MainAxisAlignment .spaceBetween,
519- children: [
520- Text (
521- AppLocalizations .of (context)! .rotation,
522- style: const TextStyle (
523- fontSize: 16 ,
524- fontStyle: FontStyle .normal,
525- fontWeight: FontWeight .normal,
526- color: Colors .black),
527- ),
528- DropdownButton (
529- value: _rotation,
530- items: const [
531- DropdownMenuItem (value: Rotation .rotation_0, child: Text ('0' )),
532- DropdownMenuItem (value: Rotation .rotation_90, child: Text ('90' )),
533- DropdownMenuItem (value: Rotation .rotation_180, child: Text ('180' )),
534- DropdownMenuItem (value: Rotation .rotation_270, child: Text ('270' )),
535- ],
536- onChanged: (value) {
537- setState (() {
538- _rotation = value! ;
539- SettingsConfig .rotation = _rotation;
540- });
541- _setVideoRenderParams ();
542- },
543- underline: Container (height: 0 ),
544- ),
545- ],
546- ),
547- ),
548- SizedBox (
549- height: 40 ,
550- child: Row (
551- mainAxisAlignment: MainAxisAlignment .spaceBetween,
552- children: [
553- Text (
554- AppLocalizations .of (context)! .beauty_level,
555- style: const TextStyle (
556- fontSize: 16 ,
557- fontStyle: FontStyle .normal,
558- fontWeight: FontWeight .normal,
559- color: Colors .black),
560- ),
561- SizedBox (
562- width: MediaQuery .of (context).size.width / 3 ,
563- child: TextField (
564- autofocus: true ,
565- textAlign: TextAlign .right,
566- decoration: InputDecoration (
567- hintText: '${SettingsConfig .beautyLevel }' ,
568- border: InputBorder .none,
569- ),
570- onChanged: (value) {
571- SettingsConfig .beautyLevel = double .parse (value);
572- TUICallEngine .instance.setBeautyLevel (SettingsConfig .beautyLevel);
573- }))
574- ],
575- ),
576- ),
577372 ],
578373 );
579374 }
@@ -589,10 +384,4 @@ class _SettingsWidgetState extends State<SettingsWidget> {
589384 },
590385 ));
591386 }
592-
593- _setVideoRenderParams () {
594- final params =
595- VideoRenderParams (fillMode: SettingsConfig .fillMode, rotation: SettingsConfig .rotation);
596- TUICallEngine .instance.setVideoRenderParams (CallParticipantStore .shared.state.selfInfo.value.avatarURL, params);
597- }
598387}
0 commit comments