menu_account.dart 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. import 'package:app_settings/app_settings.dart';
  2. import 'package:auto_route/auto_route.dart';
  3. import 'package:easy_localization/easy_localization.dart';
  4. import 'package:flutter/material.dart';
  5. import 'package:page_transition/page_transition.dart';
  6. import 'package:provider/provider.dart';
  7. import 'package:qr_flutter/qr_flutter.dart';
  8. import 'package:telnow_mobile_new/src/api/api_auth_provider.dart';
  9. import 'package:telnow_mobile_new/src/layouts/functions/account.dart';
  10. import 'package:telnow_mobile_new/src/layouts/components/template.dart';
  11. import 'package:telnow_mobile_new/src/layouts/web/password.dart';
  12. import 'package:telnow_mobile_new/src/utils/U.dart';
  13. import 'package:telnow_mobile_new/src/utils/provider.dart';
  14. import 'package:permission_handler/permission_handler.dart';
  15. import '../../utils/C.dart';
  16. class WebAccountPage extends StatefulWidget {
  17. const WebAccountPage({super.key});
  18. @override
  19. State<WebAccountPage> createState() => _WebAccountPageState();
  20. }
  21. class _WebAccountPageState extends State<WebAccountPage> {
  22. final AccountFunction accFunc = AccountFunction();
  23. bool isDeniedNotifPermission = false;
  24. bool serDis = false;
  25. bool dnd = false;
  26. bool autoTranslate = false;
  27. List lang = [];
  28. var codeOflang = {};
  29. bool _timeLimit = false;
  30. @override
  31. void initState() {
  32. Provider.of<UserModule>(context, listen: false).reset();
  33. accFunc.getUser(context);
  34. setToggle();
  35. checkPermission(0);
  36. // TODO: implement initState
  37. super.initState();
  38. }
  39. checkPermission(seconds){
  40. Future.delayed(Duration(seconds: seconds)).then((value)async {
  41. bool denied = await Permission.notification.isDenied;
  42. if(!U.getNotifPermission() && !denied) U.setNotifPermissionDismissed(false);
  43. U.setNotifPermission(!denied);
  44. setState(() => isDeniedNotifPermission = denied);
  45. });
  46. }
  47. setToggle() async{
  48. var license = await U.getLicense();
  49. setState(() {
  50. dnd = Provider.of<UserModule>(context, listen: false).dndStatus();
  51. serDis = U.servantDisplay();
  52. autoTranslate = U.autoTranslate();
  53. if(U.isCompatibleWith(VersionKey.multiBahasa)){
  54. lang = license['_validLang'] ?? [];
  55. } else {
  56. lang = license['languages'] != null ? license['languages'].split(',') : [];
  57. }
  58. });
  59. }
  60. @override
  61. Widget build(BuildContext context) {
  62. codeOflang = {
  63. "id": 'bahasa'.tr(),
  64. "en": 'english'.tr(),
  65. "ja": 'japanese'.tr(),
  66. "zh": 'chinese'.tr(),
  67. "ko": 'korean'.tr(),
  68. "ar": 'arabic'.tr(),
  69. "de": 'german'.tr(),
  70. "fr": 'french'.tr(),
  71. "hi": 'hindi'.tr(),
  72. "nl": 'dutch'.tr()
  73. };
  74. return Provider.of<UserModule>(context).user().isNotEmpty ? Scaffold(
  75. backgroundColor: backgroundColor,
  76. appBar: PreferredSize(preferredSize: Size.fromHeight(0), child: AppBar(elevation: 0, backgroundColor: primaryColor)),
  77. body: Column(
  78. children: [
  79. Container(
  80. padding: EdgeInsets.symmetric(vertical: 25, horizontal: 100),
  81. child: Row(
  82. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  83. children: [
  84. Text('account'.tr(), style: TextStyle(color: textColor, fontSize: 17, fontWeight: FontWeight.w500), overflow: TextOverflow.ellipsis),
  85. GestureDetector(
  86. child: Text('buttonBack'.tr(), style: TextStyle(color: primaryColor, fontSize: 14)),
  87. onTap: (){
  88. var pid = U.getPidFromUrl(context.router.currentUrl);
  89. context.router.removeLast();
  90. context.navigateToPath("/app/$pid/menu");
  91. },
  92. )
  93. ],
  94. ),
  95. ),
  96. divider(),
  97. Expanded(
  98. child: SingleChildScrollView(
  99. padding: EdgeInsets.symmetric(vertical: 25, horizontal: 100),
  100. child: Row(
  101. crossAxisAlignment: CrossAxisAlignment.start,
  102. children: [
  103. Expanded(
  104. child: Column(
  105. children: [
  106. Container(
  107. padding: EdgeInsets.all(20),
  108. decoration: BoxDecoration(color: Colors.white, border: Border.all(color: textColor.withValues(alpha: 0.15)), borderRadius: BorderRadius.all(Radius.circular(12))),
  109. child: Column(
  110. children: [
  111. Container(
  112. padding: EdgeInsets.only(bottom: 20),
  113. child: Row(
  114. children: [
  115. CircleAvatar(
  116. child: Text(Provider.of<UserModule>(context).user()['name'][0].toString().toUpperCase(), style: TextStyle(color: Colors.white)),
  117. backgroundColor: primaryColor,
  118. radius: 25,
  119. ),
  120. SizedBox(width: 16),
  121. Expanded(child: Text(Provider.of<UserModule>(context).user()['name'], style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: textColor), maxLines: 2, overflow: TextOverflow.ellipsis))
  122. ],
  123. ),
  124. ),
  125. separator(),
  126. Container(
  127. padding: EdgeInsets.only(top: 20),
  128. child: Column(
  129. crossAxisAlignment: CrossAxisAlignment.start,
  130. children: [
  131. Text('info_label'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
  132. SizedBox(height: 20),
  133. textHorizontal('userId'.tr(), Provider.of<UserModule>(context).user()['relatedTo'] != null ? Provider.of<UserModule>(context).user()['relatedTo'] : Provider.of<UserModule>(context).user()['userId'], size: 16, opacity: 0.75),
  134. SizedBox(height: 12),
  135. textHorizontal('location'.tr(), Provider.of<UserModule>(context).user()['location'] != null ? Provider.of<UserModule>(context).user()['location'] : '-', size: 16, opacity: 0.75),
  136. SizedBox(height: 12),
  137. textHorizontal('servantGroup'.tr(), Provider.of<UserModule>(context).user()['requestTypeListDescriptionMobile'] != null ? Provider.of<UserModule>(context).user()['requestTypeListDescriptionMobile'].toLowerCase() == 'semua' ? 'all'.tr() : Provider.of<UserModule>(context).user()['requestTypeListDescriptionMobile'] : '-', size: 16, opacity: 0.75),
  138. ],
  139. ),
  140. ),
  141. ],
  142. ),
  143. ),
  144. Padding(
  145. padding: const EdgeInsets.only(top: 30),
  146. child: Center(child: Column(
  147. children: [
  148. Text("${"version".tr()} ${ApiAuthProvider().displayVersion}"),
  149. Text("Build ${ApiAuthProvider().buildNumber}", style: TextStyle(fontSize: 13),),
  150. ],
  151. )),
  152. )
  153. ],
  154. ),
  155. ),
  156. SizedBox(width: 50),
  157. Expanded(
  158. child: Container(
  159. padding: EdgeInsets.all(20),
  160. decoration: BoxDecoration(color: Colors.white, border: Border.all(color: textColor.withValues(alpha: 0.15)), borderRadius: BorderRadius.all(Radius.circular(12))),
  161. child: Column(
  162. crossAxisAlignment: CrossAxisAlignment.start,
  163. children: [
  164. Provider.of<UserModule>(context).houseKeeping()?Container(
  165. child: Column(
  166. crossAxisAlignment: CrossAxisAlignment.start,
  167. children: [
  168. Text('doNotDisturb'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
  169. SizedBox(height: 20),
  170. Row(
  171. children: [
  172. Expanded(child: Text('set_dnd_status'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16))),
  173. Text(dnd?'active_dnd'.tr():'inactive_dnd'.tr(), style: TextStyle(color: textColor, fontSize: 14)),
  174. SizedBox(width: 5),
  175. GestureDetector(
  176. child: Container(
  177. decoration: BoxDecoration(border: Border.all(color: Provider.of<UserModule>(context).user()['checkedIn']?primaryColor:Colors.black38, width: 1.5), borderRadius: BorderRadius.all(Radius.circular(50))),
  178. child: Row(
  179. children: [
  180. !dnd?Container(
  181. width: 20, height: 20, decoration: BoxDecoration(color: Provider.of<UserModule>(context).user()['checkedIn']?primaryColor:Colors.black38, borderRadius: BorderRadius.all(Radius.circular(20))),
  182. ):Container(width: 20, height: 20),
  183. dnd?Container(
  184. width: 20, height: 20, decoration: BoxDecoration(color: Provider.of<UserModule>(context).user()['checkedIn']?primaryColor:Colors.black38, borderRadius: BorderRadius.all(Radius.circular(20))),
  185. ):Container(width: 20, height: 20),
  186. ],
  187. ),
  188. ),
  189. onTap: Provider.of<UserModule>(context).user()['checkedIn']?(){
  190. dialogConfirm(context: context, title: 'set_dnd_status'.tr(), text: dnd?'msg_change_inactive'.tr():'msg_change_active'.tr(), actionYes: ()async{
  191. bool res = await accFunc.setDndStatus(context, dnd);
  192. if(res){
  193. setState(() => dnd = !dnd);
  194. }
  195. });
  196. }:null,
  197. ),
  198. ],
  199. )
  200. ],
  201. ),
  202. ):Container(),
  203. Provider.of<UserModule>(context).houseKeeping()?Padding(padding: EdgeInsets.symmetric(vertical: 16), child: separator()):Container(),
  204. !Provider.of<UserModule>(context).user()['_profile']['isRoom']?Container(
  205. child: Column(
  206. crossAxisAlignment: CrossAxisAlignment.start,
  207. children: [
  208. Text('display_menu'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
  209. SizedBox(height: 20),
  210. Row(
  211. children: [
  212. Expanded(child: Text(serDis?'ser_group'.tr():'req_group'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16))),
  213. SizedBox(width: 5),
  214. GestureDetector(
  215. child: Container(
  216. decoration: BoxDecoration(border: Border.all(color: primaryColor, width: 1.5), borderRadius: BorderRadius.all(Radius.circular(50))),
  217. child: Row(
  218. children: [
  219. !serDis?Container(
  220. width: 20, height: 20, decoration: BoxDecoration(color: primaryColor, borderRadius: BorderRadius.all(Radius.circular(20))),
  221. ):Container(width: 20, height: 20),
  222. serDis?Container(
  223. width: 20, height: 20, decoration: BoxDecoration(color: primaryColor, borderRadius: BorderRadius.all(Radius.circular(20))),
  224. ):Container(width: 20, height: 20),
  225. ],
  226. ),
  227. ),
  228. onTap: (){
  229. setState(() {
  230. if(serDis){
  231. U.setServantDisplay(false);
  232. serDis = false;
  233. }
  234. else{
  235. U.setServantDisplay(true);
  236. serDis = true;
  237. }
  238. });
  239. },
  240. ),
  241. ],
  242. )
  243. ],
  244. ),
  245. ):Container(),
  246. !Provider.of<UserModule>(context).user()['_profile']['isRoom']?Padding(padding: EdgeInsets.symmetric(vertical: 16), child: separator()):Container(),
  247. Container(
  248. child: Column(
  249. crossAxisAlignment: CrossAxisAlignment.start,
  250. children: [
  251. Text('setting'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
  252. SizedBox(height: 6),
  253. GestureDetector(
  254. child: Container(
  255. color: Colors.white,
  256. padding: EdgeInsets.symmetric(vertical: 16),
  257. child: Row(
  258. children: [
  259. U.iconsax('bold/global', color: textColor.withValues(alpha: 0.75)),
  260. SizedBox(width: 16),
  261. Expanded(child: Text('language'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16), overflow: TextOverflow.ellipsis)),
  262. Text(codeOflang[context.locale.toString()]!, style: TextStyle(color: textColor)),
  263. SizedBox(width: 12),
  264. U.iconsax('arrow-right-3', size: 16, color: textColor.withValues(alpha: 0.75)),
  265. ],
  266. ),
  267. ),
  268. onTap: () => changeLang(context, Provider.of<UserModule>(context, listen: false).user()),
  269. ),
  270. divider(),
  271. Container(
  272. color: Colors.white,
  273. padding: EdgeInsets.symmetric(vertical: 16),
  274. child: Row(
  275. children: [
  276. Icon(Icons.g_translate_rounded, color: textColor.withValues(alpha: 0.75)),
  277. SizedBox(width: 16),
  278. Expanded(child: Text('auto_translate'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16), overflow: TextOverflow.ellipsis)),
  279. Text(autoTranslate?'ON':'OFF', style: TextStyle(color: textColor)),
  280. SizedBox(width: 5),
  281. GestureDetector(
  282. child: Container(
  283. decoration: BoxDecoration(border: Border.all(color: autoTranslate?primaryColor:Colors.black38, width: 1.5), borderRadius: BorderRadius.all(Radius.circular(50))),
  284. child: Row(
  285. children: [
  286. !autoTranslate?Container(
  287. width: 20, height: 20, decoration: BoxDecoration(color: Colors.black38, borderRadius: BorderRadius.all(Radius.circular(20))),
  288. ):Container(width: 20, height: 20),
  289. autoTranslate?Container(
  290. width: 20, height: 20, decoration: BoxDecoration(color: primaryColor, borderRadius: BorderRadius.all(Radius.circular(20))),
  291. ):Container(width: 20, height: 20),
  292. ],
  293. ),
  294. ),
  295. onTap: (){
  296. setState(() {
  297. if(autoTranslate){
  298. U.setAutoTranslate(false);
  299. autoTranslate = false;
  300. }
  301. else{
  302. U.setAutoTranslate(true);
  303. autoTranslate = true;
  304. }
  305. });
  306. },
  307. ),
  308. ],
  309. ),
  310. ),
  311. divider(),
  312. GestureDetector(
  313. child: Container(
  314. color: Colors.white,
  315. padding: EdgeInsets.symmetric(vertical: 16),
  316. child: Row(
  317. children: [
  318. U.iconsax('bold/key', color: textColor.withValues(alpha: 0.75)),
  319. SizedBox(width: 16),
  320. Text('password'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16)),
  321. Expanded(child: Text('settingPasswordText'.tr(), style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis, textAlign: TextAlign.end)),
  322. SizedBox(width: 12),
  323. U.iconsax('arrow-right-3', size: 16, color: textColor.withValues(alpha: 0.75)),
  324. ],
  325. ),
  326. ),
  327. onTap: ()=>Navigator.push(context, PageTransition(type: PageTransitionType.rightToLeft, child: WebPasswordPage(user: Provider.of<UserModule>(context, listen: false).user()))).then((value) {
  328. value??false;
  329. if (value) showSuccess(context, 'messagePassChanged'.tr());
  330. }),
  331. ),
  332. divider(),
  333. GestureDetector(
  334. child: Container(
  335. color: Colors.white,
  336. padding: EdgeInsets.symmetric(vertical: 16),
  337. child: Row(
  338. children: [
  339. U.iconsax('bold/logout', color: textColor.withValues(alpha: 0.75)),
  340. SizedBox(width: 16),
  341. Expanded(child: Text('logout'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16), overflow: TextOverflow.ellipsis)),
  342. U.iconsax('arrow-right-3', size: 16, color: textColor.withValues(alpha: 0.75)),
  343. ],
  344. ),
  345. ),
  346. onTap: (){
  347. showDialog(
  348. context: context,
  349. builder: (BuildContext context) {
  350. return AlertDialog(
  351. title: Text("logout".tr()),
  352. content: Text("textLogout".tr()),
  353. actions: <Widget>[
  354. TextButton(
  355. child: Text("buttonNo".tr()),
  356. onPressed: () {
  357. Navigator.of(context).pop();
  358. },
  359. ),
  360. TextButton(
  361. onPressed: () => accFunc.logoutAction(context),
  362. child: Text("buttonYes".tr())),
  363. ],
  364. );
  365. },
  366. );
  367. },
  368. ),
  369. ],
  370. ),
  371. ),
  372. separator(),
  373. GestureDetector(
  374. child: Container(
  375. color: Colors.white,
  376. padding: EdgeInsets.only(top: 16),
  377. child: Row(
  378. children: [
  379. U.iconsax('bold/scan', color: textColor.withValues(alpha: 0.75)),
  380. SizedBox(width: 16),
  381. Expanded(child: Text('scan_qr'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16), overflow: TextOverflow.ellipsis)),
  382. U.iconsax('arrow-right-3', size: 16, color: textColor.withValues(alpha: 0.75)),
  383. ],
  384. ),
  385. ),
  386. onTap: (){
  387. var size = MediaQuery.of(context).size.height/2;
  388. var pid = U.getPidFromUrl(context.router.currentUrl);
  389. var qr_data = 'https://telnow.telmessenger.com/#/app/${pid}%23${U.getBaseUrl()}';
  390. showDialog(
  391. context: context,
  392. builder: (BuildContext context) {
  393. return AlertDialog(
  394. title: Text("show_qr".tr(), style: TextStyle(fontSize: 16, color: Colors.black), textAlign: TextAlign.center),
  395. content: Column(
  396. mainAxisSize: MainAxisSize.min,
  397. crossAxisAlignment: CrossAxisAlignment.center,
  398. children: [
  399. SizedBox(
  400. width: size,
  401. height: size,
  402. child: QrImageView(
  403. data: qr_data,
  404. version: QrVersions.auto,
  405. gapless: true,
  406. ),
  407. ),
  408. SizedBox(height: 15),
  409. Text("show_qr_desc".tr(), style: TextStyle(fontSize: 14, color: Colors.black), textAlign: TextAlign.center)
  410. ],
  411. ),
  412. );
  413. },
  414. );
  415. },
  416. ),
  417. isDeniedNotifPermission ? Padding(padding: EdgeInsets.symmetric(vertical: 16), child: separator()) : Container(),
  418. isDeniedNotifPermission ? Container(
  419. child: GestureDetector(
  420. child: Column(
  421. crossAxisAlignment: CrossAxisAlignment.start,
  422. children: [
  423. Text("not_allow_permission".tr()),
  424. SizedBox(height: 8,),
  425. Text("tap_here".tr(), style: TextStyle(color: Color(0xFF198AF2)),),
  426. ],
  427. ),
  428. onTap: () => AppSettings.openAppSettings(type: AppSettingsType.notification).then((value) async {
  429. // print("after open setting");
  430. // checkPermission(2);
  431. }),
  432. ),
  433. ) : Container(),
  434. ],
  435. ),
  436. ),
  437. )
  438. ],
  439. )
  440. ),
  441. )
  442. ],
  443. ),
  444. ) : Provider.of<UserModule>(context).resetData() ? RefreshPage(() {
  445. Provider.of<UserModule>(context, listen: false).setResetData(false);
  446. accFunc.getUser(context);
  447. }) : _timeLimit ? showButton(context) : loadingTemplate(() {if(mounted) setState(()=>_timeLimit=true);},);
  448. }
  449. changeLang(context, user) {
  450. showDialog(
  451. context: context,
  452. builder: (BuildContext contextDialog) {
  453. return AlertDialog(
  454. contentPadding: EdgeInsets.symmetric(vertical: 0, horizontal: 10),
  455. content: Column(
  456. mainAxisSize: MainAxisSize.min,
  457. children: <Widget>[
  458. Padding(
  459. padding: EdgeInsets.symmetric(vertical: 16),
  460. child: Center(
  461. child: Text('chooseLanguage'.tr(), style: TextStyle(color: textColor)),
  462. ),
  463. ),
  464. divider(),
  465. SizedBox(height: 16),
  466. listOfLang(user, contextDialog),
  467. SizedBox(height: 16)
  468. ],
  469. ),
  470. );
  471. }
  472. );
  473. }
  474. listOfLang(user, cd){
  475. return !mounted ? SizedBox() : SafeArea(
  476. child: Column(
  477. crossAxisAlignment: CrossAxisAlignment.start,
  478. children: [
  479. ListTile(
  480. title: Text('bahasa'.tr(), style: TextStyle(color: textColor, fontSize: 14)),
  481. trailing: Icon(context.locale.toString()=='id'?Icons.radio_button_checked:Icons.radio_button_off, color: primaryColor, size: 18),
  482. onTap: context.locale.toString() != 'id' ? () async {
  483. accFunc.switchLang(context, 'id', user);
  484. Navigator.of(cd).pop();
  485. } : null,
  486. ),
  487. ListTile(
  488. title: Text('english'.tr(), style: TextStyle(color: textColor, fontSize: 14)),
  489. trailing: Icon(context.locale.toString()=='en'?Icons.radio_button_checked:Icons.radio_button_off, color: primaryColor, size: 18),
  490. onTap: context.locale.toString() != 'en' ? () async {
  491. accFunc.switchLang(context, 'en', user);
  492. Navigator.of(cd).pop();
  493. } : null,
  494. ),
  495. lang.length - 1 > 1 ? ListTile(
  496. title: Text(codeOflang[lang[2]], style: TextStyle(color: textColor, fontSize: 14)),
  497. trailing: Icon(context.locale.toString()==lang[2]?Icons.radio_button_checked:Icons.radio_button_off, color: primaryColor, size: 18),
  498. onTap: context.locale.toString() != lang[2] ? () async {
  499. accFunc.switchLang(context, 1, user);
  500. Navigator.of(cd).pop();
  501. } : null,
  502. ) : Container(),
  503. lang.length - 1 > 2 ? ListTile(
  504. title: Text(codeOflang[lang[3]], style: TextStyle(color: textColor, fontSize: 14)),
  505. trailing: Icon(context.locale.toString()==lang[3]?Icons.radio_button_checked:Icons.radio_button_off, color: primaryColor, size: 18),
  506. onTap: context.locale.toString() != lang[3] ? () async {
  507. accFunc.switchLang(context, 2, user);
  508. Navigator.of(cd).pop();
  509. } : null,
  510. ) : Container(),
  511. lang.length - 1 > 3 ? ListTile(
  512. title: Text(codeOflang[lang[4]], style: TextStyle(color: textColor, fontSize: 14)),
  513. trailing: Icon(context.locale.toString()==lang[4]?Icons.radio_button_checked:Icons.radio_button_off, color: primaryColor, size: 18),
  514. onTap: context.locale.toString() != lang[4] ? () async {
  515. accFunc.switchLang(context, 3, user);
  516. Navigator.of(cd).pop();
  517. } : null,
  518. ) : Container(),
  519. ],
  520. ),
  521. );
  522. }
  523. }