|
|
@@ -12,6 +12,7 @@ import 'package:telnow_mobile_new/src/layouts/web/password.dart';
|
|
|
import 'package:telnow_mobile_new/src/utils/U.dart';
|
|
|
import 'package:telnow_mobile_new/src/utils/provider.dart';
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
+import 'package:telnow_mobile_new/src/utils/ui_service.dart';
|
|
|
|
|
|
import '../../utils/C.dart';
|
|
|
|
|
|
@@ -62,7 +63,6 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
lang = license['languages'] != null ? license['languages'].split(',') : [];
|
|
|
}
|
|
|
setState(() {
|
|
|
- dnd = Provider.of<UserModule>(context, listen: false).dndStatus();
|
|
|
serDis = U.servantDisplay();
|
|
|
autoTranslate = U.autoTranslate();
|
|
|
});
|
|
|
@@ -70,6 +70,9 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
+ final UserModule userModule = Provider.of<UserModule>(context);
|
|
|
+ dnd = userModule.dndStatus();
|
|
|
+
|
|
|
codeOflang = {
|
|
|
"id": 'bahasa'.tr(),
|
|
|
"en": 'english'.tr(),
|
|
|
@@ -82,7 +85,7 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
"hi": 'hindi'.tr(),
|
|
|
"nl": 'dutch'.tr()
|
|
|
};
|
|
|
- return Provider.of<UserModule>(context).user().isNotEmpty ? Scaffold(
|
|
|
+ return userModule.user().isNotEmpty ? Scaffold(
|
|
|
backgroundColor: backgroundColor,
|
|
|
appBar: PreferredSize(preferredSize: Size.fromHeight(0), child: AppBar(elevation: 0, backgroundColor: primaryColor)),
|
|
|
body: Column(
|
|
|
@@ -124,12 +127,12 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
child: Row(
|
|
|
children: [
|
|
|
CircleAvatar(
|
|
|
- child: Text(Provider.of<UserModule>(context).user()['name'][0].toString().toUpperCase(), style: TextStyle(color: Colors.white)),
|
|
|
backgroundColor: primaryColor,
|
|
|
radius: 25,
|
|
|
+ child: Text(userModule.user()['name'][0].toString().toUpperCase(), style: TextStyle(color: Colors.white)),
|
|
|
),
|
|
|
SizedBox(width: 16),
|
|
|
- Expanded(child: Text(Provider.of<UserModule>(context).user()['name'], style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: textColor), maxLines: 2, overflow: TextOverflow.ellipsis))
|
|
|
+ Expanded(child: Text(userModule.user()['name'], style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: textColor), maxLines: 2, overflow: TextOverflow.ellipsis))
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -141,11 +144,11 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
children: [
|
|
|
Text('info_label'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
|
|
|
SizedBox(height: 20),
|
|
|
- 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),
|
|
|
+ textHorizontal('userId'.tr(), userModule.user()['relatedTo'] ?? userModule.user()['userId'], size: 16, opacity: 0.75),
|
|
|
SizedBox(height: 12),
|
|
|
- textHorizontal('location'.tr(), Provider.of<UserModule>(context).user()['location'] != null ? Provider.of<UserModule>(context).user()['location'] : '-', size: 16, opacity: 0.75),
|
|
|
+ textHorizontal('location'.tr(), userModule.user()['location'] ?? '-', size: 16, opacity: 0.75),
|
|
|
SizedBox(height: 12),
|
|
|
- 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),
|
|
|
+ textHorizontal('servantGroup'.tr(), userModule.user()['requestTypeListDescriptionMobile'] != null ? userModule.user()['requestTypeListDescriptionMobile'].toLowerCase() == 'semua' ? 'all'.tr() : userModule.user()['requestTypeListDescriptionMobile'] : '-', size: 16, opacity: 0.75),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -172,215 +175,213 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- Provider.of<UserModule>(context).houseKeeping()?Container(
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Text('doNotDisturb'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
|
|
|
- SizedBox(height: 20),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Expanded(child: Text('set_dnd_status'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16))),
|
|
|
- Text(dnd?'active_dnd'.tr():'inactive_dnd'.tr(), style: TextStyle(color: textColor, fontSize: 14)),
|
|
|
- SizedBox(width: 5),
|
|
|
- GestureDetector(
|
|
|
- child: Container(
|
|
|
- decoration: BoxDecoration(border: Border.all(color: Provider.of<UserModule>(context).user()['checkedIn']?primaryColor:Colors.black38, width: 1.5), borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- !dnd?Container(
|
|
|
- width: 20, height: 20, decoration: BoxDecoration(color: Provider.of<UserModule>(context).user()['checkedIn']?primaryColor:Colors.black38, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
- ):Container(width: 20, height: 20),
|
|
|
- dnd?Container(
|
|
|
- width: 20, height: 20, decoration: BoxDecoration(color: Provider.of<UserModule>(context).user()['checkedIn']?primaryColor:Colors.black38, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
- ):Container(width: 20, height: 20),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- onTap: Provider.of<UserModule>(context).user()['checkedIn']?(){
|
|
|
- dialogConfirm(context: context, title: 'set_dnd_status'.tr(), text: dnd?'msg_change_inactive'.tr():'msg_change_active'.tr(), actionYes: ()async{
|
|
|
- bool res = await accFunc.setDndStatus(context, dnd);
|
|
|
- if(res){
|
|
|
- setState(() => dnd = !dnd);
|
|
|
- }
|
|
|
+ if (userModule.houseKeeping()) Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Text('doNotDisturb'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
|
|
|
+ SizedBox(height: 20),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Expanded(child: Text('set_dnd_status'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16))),
|
|
|
+ Text(dnd?'active_dnd'.tr():'inactive_dnd'.tr(), style: TextStyle(color: textColor, fontSize: 14)),
|
|
|
+ SizedBox(width: 5),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: (){
|
|
|
+ if(userModule.user()['checkedIn']){
|
|
|
+ dialogConfirm(
|
|
|
+ context: context,
|
|
|
+ title: 'set_dnd_status'.tr(),
|
|
|
+ text: dnd ? 'msg_change_inactive'.tr() : 'msg_change_active'.tr(),
|
|
|
+ actionYes: ()async{
|
|
|
+ bool res = await accFunc.setDndStatus(userModule.user()['id'], dnd);
|
|
|
+ if(res){
|
|
|
+ userModule.setDndStatus(!dnd);
|
|
|
+ }
|
|
|
});
|
|
|
- }:null,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(border: Border.all(color: userModule.user()['checkedIn']?primaryColor:Colors.black38, width: 1.5), borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ !dnd?Container(
|
|
|
+ width: 20, height: 20, decoration: BoxDecoration(color: userModule.user()['checkedIn']?primaryColor:Colors.black38, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
+ ):SizedBox(width: 20, height: 20),
|
|
|
+ dnd?Container(
|
|
|
+ width: 20, height: 20, decoration: BoxDecoration(color: userModule.user()['checkedIn']?primaryColor:Colors.black38, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
+ ):SizedBox(width: 20, height: 20),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ],
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- ):Container(),
|
|
|
- Provider.of<UserModule>(context).houseKeeping()?Padding(padding: EdgeInsets.symmetric(vertical: 16), child: separator()):Container(),
|
|
|
-
|
|
|
- !Provider.of<UserModule>(context).user()['_profile']['isRoom']?Container(
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Text('display_menu'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
|
|
|
- SizedBox(height: 20),
|
|
|
- Row(
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ if(userModule.houseKeeping()) Padding(padding: EdgeInsets.symmetric(vertical: 16), child: separator()),
|
|
|
+ if(!userModule.user()['_profile']['isRoom']) Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Text('display_menu'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
|
|
|
+ SizedBox(height: 20),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Expanded(child: Text(serDis?'ser_group'.tr():'req_group'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16))),
|
|
|
+ SizedBox(width: 5),
|
|
|
+ GestureDetector(
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(border: Border.all(color: primaryColor, width: 1.5), borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ !serDis?Container(
|
|
|
+ width: 20, height: 20, decoration: BoxDecoration(color: primaryColor, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
+ ):SizedBox(width: 20, height: 20),
|
|
|
+ serDis?Container(
|
|
|
+ width: 20, height: 20, decoration: BoxDecoration(color: primaryColor, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
+ ):SizedBox(width: 20, height: 20),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ onTap: (){
|
|
|
+ setState(() {
|
|
|
+ if(serDis){
|
|
|
+ U.setServantDisplay(false);
|
|
|
+ serDis = false;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ U.setServantDisplay(true);
|
|
|
+ serDis = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ if(!userModule.user()['_profile']['isRoom']) Padding(padding: EdgeInsets.symmetric(vertical: 16), child: separator()),
|
|
|
+ Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Text('setting'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
|
|
|
+ SizedBox(height: 6),
|
|
|
+ GestureDetector(
|
|
|
+ child: Container(
|
|
|
+ color: Colors.white,
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 16),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ U.iconsax('bold/global', color: textColor.withValues(alpha: 0.75)),
|
|
|
+ SizedBox(width: 16),
|
|
|
+ Expanded(child: Text('language'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16), overflow: TextOverflow.ellipsis)),
|
|
|
+ Text(codeOflang[context.locale.toString()]!, style: TextStyle(color: textColor)),
|
|
|
+ SizedBox(width: 12),
|
|
|
+ U.iconsax('arrow-right-3', size: 16, color: textColor.withValues(alpha: 0.75)),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ onTap: () => changeLang(context, Provider.of<UserModule>(context, listen: false).user()),
|
|
|
+ ),
|
|
|
+ divider(),
|
|
|
+ Container(
|
|
|
+ color: Colors.white,
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 16),
|
|
|
+ child: Row(
|
|
|
children: [
|
|
|
- Expanded(child: Text(serDis?'ser_group'.tr():'req_group'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16))),
|
|
|
+ Icon(Icons.g_translate_rounded, color: textColor.withValues(alpha: 0.75)),
|
|
|
+ SizedBox(width: 16),
|
|
|
+ Expanded(child: Text('auto_translate'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16), overflow: TextOverflow.ellipsis)),
|
|
|
+ Text(autoTranslate?'ON':'OFF', style: TextStyle(color: textColor)),
|
|
|
SizedBox(width: 5),
|
|
|
GestureDetector(
|
|
|
child: Container(
|
|
|
- decoration: BoxDecoration(border: Border.all(color: primaryColor, width: 1.5), borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
+ decoration: BoxDecoration(border: Border.all(color: autoTranslate?primaryColor:Colors.black38, width: 1.5), borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
child: Row(
|
|
|
children: [
|
|
|
- !serDis?Container(
|
|
|
- width: 20, height: 20, decoration: BoxDecoration(color: primaryColor, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
- ):Container(width: 20, height: 20),
|
|
|
- serDis?Container(
|
|
|
+ !autoTranslate?Container(
|
|
|
+ width: 20, height: 20, decoration: BoxDecoration(color: Colors.black38, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
+ ):SizedBox(width: 20, height: 20),
|
|
|
+ autoTranslate?Container(
|
|
|
width: 20, height: 20, decoration: BoxDecoration(color: primaryColor, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
- ):Container(width: 20, height: 20),
|
|
|
+ ):SizedBox(width: 20, height: 20),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
onTap: (){
|
|
|
setState(() {
|
|
|
- if(serDis){
|
|
|
- U.setServantDisplay(false);
|
|
|
- serDis = false;
|
|
|
+ if(autoTranslate){
|
|
|
+ U.setAutoTranslate(false);
|
|
|
+ autoTranslate = false;
|
|
|
}
|
|
|
else{
|
|
|
- U.setServantDisplay(true);
|
|
|
- serDis = true;
|
|
|
+ U.setAutoTranslate(true);
|
|
|
+ autoTranslate = true;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
),
|
|
|
],
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- ):Container(),
|
|
|
- !Provider.of<UserModule>(context).user()['_profile']['isRoom']?Padding(padding: EdgeInsets.symmetric(vertical: 16), child: separator()):Container(),
|
|
|
-
|
|
|
- Container(
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Text('setting'.tr(), style: TextStyle(color: textColor, fontSize: 16, fontWeight: FontWeight.w500)),
|
|
|
- SizedBox(height: 6),
|
|
|
- GestureDetector(
|
|
|
- child: Container(
|
|
|
- color: Colors.white,
|
|
|
- padding: EdgeInsets.symmetric(vertical: 16),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- U.iconsax('bold/global', color: textColor.withValues(alpha: 0.75)),
|
|
|
- SizedBox(width: 16),
|
|
|
- Expanded(child: Text('language'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16), overflow: TextOverflow.ellipsis)),
|
|
|
- Text(codeOflang[context.locale.toString()]!, style: TextStyle(color: textColor)),
|
|
|
- SizedBox(width: 12),
|
|
|
- U.iconsax('arrow-right-3', size: 16, color: textColor.withValues(alpha: 0.75)),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- onTap: () => changeLang(context, Provider.of<UserModule>(context, listen: false).user()),
|
|
|
),
|
|
|
- divider(),
|
|
|
- Container(
|
|
|
+ ),
|
|
|
+ divider(),
|
|
|
+ GestureDetector(
|
|
|
+ child: Container(
|
|
|
color: Colors.white,
|
|
|
padding: EdgeInsets.symmetric(vertical: 16),
|
|
|
child: Row(
|
|
|
children: [
|
|
|
- Icon(Icons.g_translate_rounded, color: textColor.withValues(alpha: 0.75)),
|
|
|
+ U.iconsax('bold/key', color: textColor.withValues(alpha: 0.75)),
|
|
|
SizedBox(width: 16),
|
|
|
- Expanded(child: Text('auto_translate'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16), overflow: TextOverflow.ellipsis)),
|
|
|
- Text(autoTranslate?'ON':'OFF', style: TextStyle(color: textColor)),
|
|
|
- SizedBox(width: 5),
|
|
|
- GestureDetector(
|
|
|
- child: Container(
|
|
|
- decoration: BoxDecoration(border: Border.all(color: autoTranslate?primaryColor:Colors.black38, width: 1.5), borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- !autoTranslate?Container(
|
|
|
- width: 20, height: 20, decoration: BoxDecoration(color: Colors.black38, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
- ):Container(width: 20, height: 20),
|
|
|
- autoTranslate?Container(
|
|
|
- width: 20, height: 20, decoration: BoxDecoration(color: primaryColor, borderRadius: BorderRadius.all(Radius.circular(20))),
|
|
|
- ):Container(width: 20, height: 20),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- onTap: (){
|
|
|
- setState(() {
|
|
|
- if(autoTranslate){
|
|
|
- U.setAutoTranslate(false);
|
|
|
- autoTranslate = false;
|
|
|
- }
|
|
|
- else{
|
|
|
- U.setAutoTranslate(true);
|
|
|
- autoTranslate = true;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- ),
|
|
|
+ Text('password'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16)),
|
|
|
+ Expanded(child: Text('settingPasswordText'.tr(), style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis, textAlign: TextAlign.end)),
|
|
|
+ SizedBox(width: 12),
|
|
|
+ U.iconsax('arrow-right-3', size: 16, color: textColor.withValues(alpha: 0.75)),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
- divider(),
|
|
|
- GestureDetector(
|
|
|
- child: Container(
|
|
|
- color: Colors.white,
|
|
|
- padding: EdgeInsets.symmetric(vertical: 16),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- U.iconsax('bold/key', color: textColor.withValues(alpha: 0.75)),
|
|
|
- SizedBox(width: 16),
|
|
|
- Text('password'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16)),
|
|
|
- Expanded(child: Text('settingPasswordText'.tr(), style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis, textAlign: TextAlign.end)),
|
|
|
- SizedBox(width: 12),
|
|
|
- U.iconsax('arrow-right-3', size: 16, color: textColor.withValues(alpha: 0.75)),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- onTap: ()=>Navigator.push(context, PageTransition(type: PageTransitionType.rightToLeft, child: WebPasswordPage(user: Provider.of<UserModule>(context, listen: false).user()))).then((value) {
|
|
|
- value??false;
|
|
|
- if (value) showSuccess(context, 'messagePassChanged'.tr());
|
|
|
- }),
|
|
|
- ),
|
|
|
- divider(),
|
|
|
- GestureDetector(
|
|
|
- child: Container(
|
|
|
- color: Colors.white,
|
|
|
- padding: EdgeInsets.symmetric(vertical: 16),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- U.iconsax('bold/logout', color: textColor.withValues(alpha: 0.75)),
|
|
|
- SizedBox(width: 16),
|
|
|
- Expanded(child: Text('logout'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16), overflow: TextOverflow.ellipsis)),
|
|
|
- U.iconsax('arrow-right-3', size: 16, color: textColor.withValues(alpha: 0.75)),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ onTap: ()=>Navigator.push(context, PageTransition(type: PageTransitionType.rightToLeft, child: WebPasswordPage(user: Provider.of<UserModule>(context, listen: false).user()))).then((value) {
|
|
|
+ value??false;
|
|
|
+ if (value) UIService.showSuccess('messagePassChanged'.tr());
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ divider(),
|
|
|
+ GestureDetector(
|
|
|
+ child: Container(
|
|
|
+ color: Colors.white,
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 16),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ U.iconsax('bold/logout', color: textColor.withValues(alpha: 0.75)),
|
|
|
+ SizedBox(width: 16),
|
|
|
+ Expanded(child: Text('logout'.tr(), style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 16), overflow: TextOverflow.ellipsis)),
|
|
|
+ U.iconsax('arrow-right-3', size: 16, color: textColor.withValues(alpha: 0.75)),
|
|
|
+ ],
|
|
|
),
|
|
|
- onTap: (){
|
|
|
- showDialog(
|
|
|
- context: context,
|
|
|
- builder: (BuildContext context) {
|
|
|
- return AlertDialog(
|
|
|
- title: Text("logout".tr()),
|
|
|
- content: Text("textLogout".tr()),
|
|
|
- actions: <Widget>[
|
|
|
- TextButton(
|
|
|
- child: Text("buttonNo".tr()),
|
|
|
- onPressed: () {
|
|
|
- Navigator.of(context).pop();
|
|
|
- },
|
|
|
- ),
|
|
|
- TextButton(
|
|
|
- onPressed: () => accFunc.logoutAction(context),
|
|
|
- child: Text("buttonYes".tr())),
|
|
|
- ],
|
|
|
- );
|
|
|
- },
|
|
|
- );
|
|
|
- },
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ onTap: (){
|
|
|
+ showDialog(
|
|
|
+ context: context,
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ return AlertDialog(
|
|
|
+ title: Text("logout".tr()),
|
|
|
+ content: Text("textLogout".tr()),
|
|
|
+ actions: <Widget>[
|
|
|
+ TextButton(
|
|
|
+ child: Text("buttonNo".tr()),
|
|
|
+ onPressed: () {
|
|
|
+ Navigator.of(context).pop();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ TextButton(
|
|
|
+ onPressed: () => accFunc.logoutAction(context),
|
|
|
+ child: Text("buttonYes".tr())),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ },
|
|
|
+ );
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
separator(),
|
|
|
GestureDetector(
|
|
|
@@ -399,7 +400,7 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
onTap: (){
|
|
|
var size = MediaQuery.of(context).size.height/2;
|
|
|
var pid = U.getPidFromUrl(context.router.currentUrl);
|
|
|
- var qr_data = 'https://telnow.telmessenger.com/#/app/${pid}%23${U.getBaseUrl()}';
|
|
|
+ var qrData = 'https://telnow.telmessenger.com/#/app/$pid%23${U.getBaseUrl()}';
|
|
|
showDialog(
|
|
|
context: context,
|
|
|
builder: (BuildContext context) {
|
|
|
@@ -413,7 +414,7 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
width: size,
|
|
|
height: size,
|
|
|
child: QrImageView(
|
|
|
- data: qr_data,
|
|
|
+ data: qrData,
|
|
|
version: QrVersions.auto,
|
|
|
gapless: true,
|
|
|
),
|
|
|
@@ -428,21 +429,19 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
},
|
|
|
),
|
|
|
isDeniedNotifPermission ? Padding(padding: EdgeInsets.symmetric(vertical: 16), child: separator()) : Container(),
|
|
|
- isDeniedNotifPermission ? Container(
|
|
|
- child: GestureDetector(
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Text("not_allow_permission".tr()),
|
|
|
- SizedBox(height: 8,),
|
|
|
- Text("tap_here".tr(), style: TextStyle(color: Color(0xFF198AF2)),),
|
|
|
- ],
|
|
|
- ),
|
|
|
- onTap: () => AppSettings.openAppSettings(type: AppSettingsType.notification).then((value) async {
|
|
|
- // print("after open setting");
|
|
|
- // checkPermission(2);
|
|
|
- }),
|
|
|
+ isDeniedNotifPermission ? GestureDetector(
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Text("not_allow_permission".tr()),
|
|
|
+ SizedBox(height: 8,),
|
|
|
+ Text("tap_here".tr(), style: TextStyle(color: Color(0xFF198AF2)),),
|
|
|
+ ],
|
|
|
),
|
|
|
+ onTap: () => AppSettings.openAppSettings(type: AppSettingsType.notification).then((value) async {
|
|
|
+ // print("after open setting");
|
|
|
+ // checkPermission(2);
|
|
|
+ }),
|
|
|
) : Container(),
|
|
|
],
|
|
|
),
|
|
|
@@ -454,7 +453,7 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
)
|
|
|
],
|
|
|
),
|
|
|
- ) : Provider.of<UserModule>(context).resetData() ? RefreshPage(() {
|
|
|
+ ) : userModule.resetData() ? RefreshPage(() {
|
|
|
Provider.of<UserModule>(context, listen: false).setResetData(false);
|
|
|
accFunc.getUser(context);
|
|
|
}) : _timeLimit ? showButton(context) : loadingTemplate(() {if(mounted) setState(()=>_timeLimit=true);},);
|
|
|
@@ -495,7 +494,7 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
title: Text('bahasa'.tr(), style: TextStyle(color: textColor, fontSize: 14)),
|
|
|
trailing: Icon(context.locale.toString()=='id'?Icons.radio_button_checked:Icons.radio_button_off, color: primaryColor, size: 18),
|
|
|
onTap: context.locale.toString() != 'id' ? () async {
|
|
|
- accFunc.switchLang(context, 'id', user);
|
|
|
+ accFunc.switchLang('id', user);
|
|
|
Navigator.of(cd).pop();
|
|
|
} : null,
|
|
|
),
|
|
|
@@ -503,7 +502,7 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
title: Text('english'.tr(), style: TextStyle(color: textColor, fontSize: 14)),
|
|
|
trailing: Icon(context.locale.toString()=='en'?Icons.radio_button_checked:Icons.radio_button_off, color: primaryColor, size: 18),
|
|
|
onTap: context.locale.toString() != 'en' ? () async {
|
|
|
- accFunc.switchLang(context, 'en', user);
|
|
|
+ accFunc.switchLang('en', user);
|
|
|
Navigator.of(cd).pop();
|
|
|
} : null,
|
|
|
),
|
|
|
@@ -511,7 +510,7 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
title: Text(codeOflang[lang[2]], style: TextStyle(color: textColor, fontSize: 14)),
|
|
|
trailing: Icon(context.locale.toString()==lang[2]?Icons.radio_button_checked:Icons.radio_button_off, color: primaryColor, size: 18),
|
|
|
onTap: context.locale.toString() != lang[2] ? () async {
|
|
|
- accFunc.switchLang(context, 1, user);
|
|
|
+ accFunc.switchLang(1, user);
|
|
|
Navigator.of(cd).pop();
|
|
|
} : null,
|
|
|
) : Container(),
|
|
|
@@ -519,7 +518,7 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
title: Text(codeOflang[lang[3]], style: TextStyle(color: textColor, fontSize: 14)),
|
|
|
trailing: Icon(context.locale.toString()==lang[3]?Icons.radio_button_checked:Icons.radio_button_off, color: primaryColor, size: 18),
|
|
|
onTap: context.locale.toString() != lang[3] ? () async {
|
|
|
- accFunc.switchLang(context, 2, user);
|
|
|
+ accFunc.switchLang(2, user);
|
|
|
Navigator.of(cd).pop();
|
|
|
} : null,
|
|
|
) : Container(),
|
|
|
@@ -527,7 +526,7 @@ class _WebAccountPageState extends State<WebAccountPage> {
|
|
|
title: Text(codeOflang[lang[4]], style: TextStyle(color: textColor, fontSize: 14)),
|
|
|
trailing: Icon(context.locale.toString()==lang[4]?Icons.radio_button_checked:Icons.radio_button_off, color: primaryColor, size: 18),
|
|
|
onTap: context.locale.toString() != lang[4] ? () async {
|
|
|
- accFunc.switchLang(context, 3, user);
|
|
|
+ accFunc.switchLang(3, user);
|
|
|
Navigator.of(cd).pop();
|
|
|
} : null,
|
|
|
) : Container(),
|