选择自定义短信模板

master
戴余标 3 years ago
parent 1071e60061
commit 2751dc6d9f

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -1,15 +1,17 @@
import 'environment/environment.dart'; import 'environment/environment.dart';
class API { class API {
static const tokenKey = 'Telephony-Manage-Token'; static const tokenKey = 'Manage-Token';
///HOST ///HOST
static String get host { static String get host {
if (DevEV.instance.dev) { if (DevEV.instance.dev) {
// return 'http://10.0.2.2:8088/'; return 'http://10.0.2.2:8088/';
return 'http://api.dxbs.vip'; // return 'http://api.dxbs.vip';
} else { } else {
return 'http://api.dxbs.vip/'; return 'http://10.0.2.2:8088/';
// return 'http://api.dxbs.vip/';
} }
} }
@ -43,6 +45,8 @@ class _App {
String get content => '/app/user/content'; String get content => '/app/user/content';
/// ///
String get delete => '/app/user/content/delete'; String get delete => '/app/user/content/delete';
///
String get checked => '/app/user/content/checked';
///VIP ///VIP
String get updateVip => '/app/user/updateVip'; String get updateVip => '/app/user/updateVip';
} }

@ -14,7 +14,7 @@ class $AssetsIconsGen {
/// File path: assets/icons/home_ selected.png /// File path: assets/icons/home_ selected.png
AssetGenImage get homeSelected => AssetGenImage get homeSelected =>
const AssetGenImage('assets/icons/home_ selected.png'); const AssetGenImage('assets/icons/home_selected.png');
/// File path: assets/icons/home_noSelected.png /// File path: assets/icons/home_noSelected.png
AssetGenImage get homeNoSelected => AssetGenImage get homeNoSelected =>
@ -68,6 +68,10 @@ class $AssetsImagesGen {
AssetGenImage get portrait => AssetGenImage get portrait =>
const AssetGenImage('assets/images/portrait.png'); const AssetGenImage('assets/images/portrait.png');
/// File path: assets/images/portrait_deep.png
AssetGenImage get portraitDeep =>
const AssetGenImage('assets/images/portrait_deep.png');
/// File path: assets/images/refused.png /// File path: assets/images/refused.png
AssetGenImage get refused => const AssetGenImage('assets/images/refused.png'); AssetGenImage get refused => const AssetGenImage('assets/images/refused.png');

@ -12,8 +12,8 @@ class UserInfoModel extends Equatable {
final int isVip; final int isVip;
final String tag; final String tag;
final int status; final int status;
final num start; final int start;
final num end; final int end;
final List<Content>? contentRef; final List<Content>? contentRef;
final List<Content>? contentCon; final List<Content>? contentCon;
@ -35,8 +35,8 @@ class UserInfoModel extends Equatable {
contentRef: [], contentRef: [],
); );
const UserInfoModel( const UserInfoModel({
{required this.id, required this.id,
required this.name, required this.name,
required this.phone, required this.phone,
required this.isVip, required this.isVip,
@ -47,19 +47,22 @@ class UserInfoModel extends Equatable {
required this.contentCon, required this.contentCon,
required this.contentRef, required this.contentRef,
}); });
@override @override
List<Object?> get props => List<Object?> get props =>
[id, name, phone, isVip, tag, status, start, end, contentCon,contentRef]; [id, name, phone, isVip, tag, status, start, end, contentCon, contentRef];
} }
@JsonSerializable() @JsonSerializable()
class Content extends Equatable { class Content extends Equatable {
final int id; final int id;
final String content; final String content;
final int isChecked;
const Content({ const Content({
required this.id, required this.id,
required this.content, required this.content,
required this.isChecked,
}); });
factory Content.fromJson(Map<String, dynamic> json) => factory Content.fromJson(Map<String, dynamic> json) =>
@ -68,5 +71,5 @@ class Content extends Equatable {
Map<String, dynamic> toJson() => _$ContentToJson(this); Map<String, dynamic> toJson() => _$ContentToJson(this);
@override @override
List<Object?> get props => [id, content]; List<Object?> get props => [id, content, isChecked];
} }

@ -14,8 +14,8 @@ UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
isVip: json['is_vip'] as int, isVip: json['is_vip'] as int,
tag: json['tag']as String, tag: json['tag']as String,
status: json['status'] as int, status: json['status'] as int,
start: json['start']as num, start: json['start']as int,
end: json['end']as num, end: json['end']as int,
contentCon:(json['content_con'] as List<dynamic>?) contentCon:(json['content_con'] as List<dynamic>?)
?.map((e) => Content.fromJson(e as Map<String, dynamic>)) ?.map((e) => Content.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
@ -41,9 +41,11 @@ Map<String, dynamic> _$UserInfoModelToJson(UserInfoModel instance) =>
Content _$ContentFromJson(Map<String, dynamic> json) => Content( Content _$ContentFromJson(Map<String, dynamic> json) => Content(
id: json['id'] as int, id: json['id'] as int,
content: json['content'] as String, content: json['content'] as String,
isChecked: json['is_checked'] as int,
); );
Map<String, dynamic> _$ContentToJson(Content instance) => <String, dynamic>{ Map<String, dynamic> _$ContentToJson(Content instance) => <String, dynamic>{
'id': instance.id, 'id': instance.id,
'content': instance.content, 'content': instance.content,
'is_checked':instance.isChecked,
}; };

@ -7,7 +7,11 @@ import 'package:project_telephony/ui/widget/centertipsalterwidget.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart'; import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/headers.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../constants/api.dart';
import '../../model/network/api_client.dart';
import '../../model/network/base_model.dart';
import '../../providers/user_provider.dart'; import '../../providers/user_provider.dart';
import '../../utils/toast/cloud_toast.dart';
class ContentConnectPage extends StatefulWidget { class ContentConnectPage extends StatefulWidget {
const ContentConnectPage({Key? key}) : super(key: key); const ContentConnectPage({Key? key}) : super(key: key);
@ -17,20 +21,14 @@ class ContentConnectPage extends StatefulWidget {
} }
class _ContentConnectPageState extends State<ContentConnectPage> { class _ContentConnectPageState extends State<ContentConnectPage> {
int _select = 0; List<String> textList = ['欢迎您的来电,祝您生活愉快', '自定义短信内容'];
List<String> textList = [ List<int> smsIdList = [];
'欢迎您的来电,祝您生活愉快',
'祝您万事顺心',
'感谢您的来电,我们会尽快处理的',
"自定义短信内容"
];
List<int> smsIdList =[];
List<String> textListSMS = []; List<String> textListSMS = [];
int isCheck=0;
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false); final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
final EasyRefreshController _easyRefreshController = EasyRefreshController(); final EasyRefreshController _easyRefreshController = EasyRefreshController();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -43,13 +41,18 @@ class _ContentConnectPageState extends State<ContentConnectPage> {
super.dispose(); super.dispose();
} }
updateList(){ updateList() {
if (userProvider.isLogin) { if (userProvider.isLogin) {
textListSMS.clear(); textListSMS.clear();
smsIdList.clear(); smsIdList.clear();
int i=0;
userProvider.userInfo.contentCon?.forEach((model) { userProvider.userInfo.contentCon?.forEach((model) {
textListSMS.add(model.content); textListSMS.add(model.content);
smsIdList.add(model.id); smsIdList.add(model.id);
if(model.isChecked==1){
isCheck=i;
}
i++;
}); });
textListSMS.add("自定义短信内容"); textListSMS.add("自定义短信内容");
} else { } else {
@ -89,48 +92,61 @@ class _ContentConnectPageState extends State<ContentConnectPage> {
updateList(); updateList();
setState(() {}); setState(() {});
}, },
child:ListView.builder( child: ListView.builder(
itemBuilder: (context, index) { itemBuilder: (context, index) {
return _getBox(textListSMS[index], index == _select, index); return _getBox(textListSMS[index], index);
}, },
itemCount: textListSMS.length, itemCount: textListSMS.length,
), ),
); );
} }
_getBox(String content, bool pd, int index) { _getBox(String content, int index) {
return GestureDetector( return GestureDetector(
onTap: () async { onTap: () async {
if (content != "自定义短信内容") { if (content != "自定义短信内容") {
_select = index; BaseModel res = await apiClient.request(API.app.checked,
data: {'id': smsIdList[index], 'status': 1});
if (res.code == 0) {
setState(() {});
userProvider.updateUserInfo();
_easyRefreshController.callRefresh();
} else { } else {
if(userProvider.isLogin){ CloudToast.show(res.msg);
if(textListSMS.length>5){ }
} else {
if (userProvider.isLogin) {
if (textListSMS.length > 5) {
BotToast.showText(text: '自定义数量已达上限,请先删除不需要的短信'); BotToast.showText(text: '自定义数量已达上限,请先删除不需要的短信');
}else{ } else {
Get.to(AddSmsPage( Get.to(AddSmsPage(
status: 1, ploneBack: (String textContent) { status: 1,
ploneBack: (String textContent) {
_easyRefreshController.callRefresh(); _easyRefreshController.callRefresh();
}, },
)); ));
} }
}else{ } else {
BotToast.showText(text: '请先登录'); BotToast.showText(text: '请先登录');
} }
} }
setState(() {}); setState(() {});
}, },
onLongPress: () { onLongPress: () {
if(content != "自定义短信内容"){ if (content != "自定义短信内容") {
if (textListSMS.length<2 ) { if (textListSMS.length == 1) {
BotToast.showText(text: '不能再删了'); BotToast.showText(text: '不能再删了');
}else{ } else {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return Centertipsalterwidget( return Centertipsalterwidget(
desText: '你确定要删除这个短信模版吗,删除之后无法还原。', desText: '你确定要删除这个短信模版吗,删除之后无法还原。',
title: '删除短信模板', id: smsIdList[index], title: '删除短信模板',
id: smsIdList[index],
callback: (bool status) {
_easyRefreshController.callRefresh();
},
); );
}); });
} }
@ -143,13 +159,13 @@ class _ContentConnectPageState extends State<ContentConnectPage> {
padding: EdgeInsets.all(40.w), padding: EdgeInsets.all(40.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
color: pd ? Colors.blue : const Color(0xFFF9F9F9), color: index==isCheck?Colors.blue:const Color(0xFFF9F9F9),
), ),
child: Text( child: Text(
content, content,
style: TextStyle( style: TextStyle(
fontSize: BaseStyle.fontSize28, fontSize: BaseStyle.fontSize28,
color: pd ? const Color(0xFFF9F9F9) : BaseStyle.color333333, color: index==isCheck?const Color(0xFFF9F9F9):BaseStyle.color333333,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
), ),

@ -7,7 +7,11 @@ import 'package:project_telephony/ui/widget/centertipsalterwidget.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart'; import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/headers.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../constants/api.dart';
import '../../model/network/api_client.dart';
import '../../model/network/base_model.dart';
import '../../providers/user_provider.dart'; import '../../providers/user_provider.dart';
import '../../utils/toast/cloud_toast.dart';
import 'add_sms_page.dart'; import 'add_sms_page.dart';
class ContentRefusePage extends StatefulWidget { class ContentRefusePage extends StatefulWidget {
@ -18,10 +22,11 @@ class ContentRefusePage extends StatefulWidget {
} }
class _ContentRefusePageState extends State<ContentRefusePage> { class _ContentRefusePageState extends State<ContentRefusePage> {
int _select = 0; List<String> textList = ['现在无法接听。有什么事吗?', '自定义短信内容'];
List<String> textList = ['现在无法接听。有什么事吗?', '我马上会打给你。', '我稍后会打给你。', "自定义短信内容"];
List<String> textListSMS = []; List<String> textListSMS = [];
List<int> smsIdList =[]; List<int> smsIdList = [];
int isCheck=0;
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false); final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
final EasyRefreshController _easyRefreshController = EasyRefreshController(); final EasyRefreshController _easyRefreshController = EasyRefreshController();
@ -38,12 +43,18 @@ class _ContentRefusePageState extends State<ContentRefusePage> {
super.dispose(); super.dispose();
} }
Future updateList() async{ updateList() async {
if (userProvider.isLogin) { if (userProvider.isLogin) {
textListSMS.clear(); textListSMS.clear();
smsIdList.clear();
int i=0;
userProvider.userInfo.contentRef?.forEach((model) { userProvider.userInfo.contentRef?.forEach((model) {
textListSMS.add(model.content); textListSMS.add(model.content);
smsIdList.add(model.id); smsIdList.add(model.id);
if(model.isChecked==1){
isCheck=i;
}
i++;
}); });
textListSMS.add("自定义短信内容"); textListSMS.add("自定义短信内容");
} else { } else {
@ -79,55 +90,70 @@ class _ContentRefusePageState extends State<ContentRefusePage> {
footer: MaterialFooter(), footer: MaterialFooter(),
controller: _easyRefreshController, controller: _easyRefreshController,
onRefresh: () async { onRefresh: () async {
await updateList(); await userProvider.updateUserInfo();
updateList();
setState(() {});
}, },
child:ListView.builder( child: ListView.builder(
itemBuilder: (context, index) { itemBuilder: (context, index) {
return _getBox(textListSMS[index], index == _select, index); return _getBox(textListSMS[index], index);
}, },
itemCount: textListSMS.length, itemCount: textListSMS.length,
), ),
); );
} }
_getBox(String content, bool pd, int index) { _getBox(String content, int index) {
return GestureDetector( return GestureDetector(
onTap: () async { onTap: () async {
if (content != "自定义短信内容") { if (content != "自定义短信内容") {
_select = index; BaseModel res = await apiClient.request(API.app.checked,
data: {'id': smsIdList[index], 'status': 2});
if (res.code == 0) {
setState(() {});
userProvider.updateUserInfo();
_easyRefreshController.callRefresh();
} else {
CloudToast.show(res.msg);
}
} else { } else {
if(userProvider.isLogin){ if (userProvider.isLogin) {
if(textListSMS.length>5){ if (textListSMS.length > 5) {
BotToast.showText(text: '自定义数量已达上限,请先删除不需要的短信'); BotToast.showText(text: '自定义数量已达上限,请先删除不需要的短信');
}else{ } else {
Get.to(AddSmsPage( Get.to(AddSmsPage(
status: 2, ploneBack: (String textContent) { }, status: 2,
ploneBack: (String textContent) {
_easyRefreshController.callRefresh();
},
)); ));
} }
}else{ } else {
BotToast.showText(text: '请先登录'); BotToast.showText(text: '请先登录');
} }
} }
setState(() {}); setState(() {});
}, },
onLongPress: () { onLongPress: () {
if(content != "自定义短信内容"){ if (content != "自定义短信内容") {
if (textListSMS.length<2 ) { if (textListSMS.length == 1) {
BotToast.showText(text: '不能再删了'); BotToast.showText(text: '不能再删了');
}else{ } else {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return Centertipsalterwidget( return Centertipsalterwidget(
desText: '你确定要删除这个短信模版吗,删除之后无法还原。', desText: '你确定要删除这个短信模版吗,删除之后无法还原。',
title: '删除短信模板', id: smsIdList[index], title: '删除短信模板',
id: smsIdList[index],
callback: (bool status) {
_easyRefreshController.callRefresh();
},
); );
}); });
} }
} }
setState(() { setState(() {});
_easyRefreshController.callRefresh();
});
}, },
child: Container( child: Container(
// width: 686.w, // width: 686.w,
@ -135,13 +161,13 @@ class _ContentRefusePageState extends State<ContentRefusePage> {
padding: EdgeInsets.all(40.w), padding: EdgeInsets.all(40.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
color: pd ? const Color(0xFF72E4C8) : const Color(0xFFF9F9F9), color: index==isCheck?const Color(0xFF72E4C8) :const Color(0xFFF9F9F9),
), ),
child: Text( child: Text(
content, content,
style: TextStyle( style: TextStyle(
fontSize: BaseStyle.fontSize28, fontSize: BaseStyle.fontSize28,
color: pd ? const Color(0xFFF9F9F9) : BaseStyle.color333333, color: index==isCheck?const Color(0xFFF9F9F9):BaseStyle.color333333,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
), ),

@ -131,6 +131,7 @@ class _LoginPageState extends State<LoginPage> {
var base = await apiClient.request(API.app.login, var base = await apiClient.request(API.app.login,
data: {'phone': _phoneController.text, 'code': _smsCodeController.text}); data: {'phone': _phoneController.text, 'code': _smsCodeController.text});
if (base.code == 0) { if (base.code == 0) {
print(base.data['token']);
await UserTool.userProvider.setToken(base.data['token']); await UserTool.userProvider.setToken(base.data['token']);
Get.offAll(() => const TabNavigator()); Get.offAll(() => const TabNavigator());
} else { } else {
@ -293,7 +294,6 @@ class _LoginPageState extends State<LoginPage> {
if (kDebugMode) { if (kDebugMode) {
print("点击协议了"); print("点击协议了");
} }
/// ///
}; };
return recognizer; return recognizer;

@ -1,29 +1,20 @@
import 'package:flustars/flustars.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:permission_handler_platform_interface/permission_handler_platform_interface.dart';
import 'package:project_telephony/base/base_style.dart'; import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/login/login_page.dart'; import 'package:project_telephony/ui/login/login_page.dart';
import 'package:project_telephony/ui/tab_navigator.dart'; import 'package:project_telephony/ui/tab_navigator.dart';
import 'package:project_telephony/ui/user/content_authority_page.dart'; import 'package:project_telephony/ui/user/content_authority_page.dart';
import 'package:project_telephony/ui/user/members_page.dart'; import 'package:project_telephony/ui/user/members_page.dart';
import 'package:project_telephony/ui/user/privacy_rights_page.dart'; import 'package:project_telephony/ui/user/privacy_rights_page.dart';
import 'package:project_telephony/ui/widget/image_scaffold.dart'; import 'package:project_telephony/ui/widget/image_scaffold.dart';
import 'package:project_telephony/ui/widget/plone_bottom.dart'; import 'package:project_telephony/ui/widget/plone_bottom.dart';
import 'package:project_telephony/ui/widget/plone_image_picker.dart';
import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/headers.dart';
import 'package:project_telephony/utils/permissionutils.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:telephony/telephony.dart'; import 'package:telephony/telephony.dart';
import 'package:velocity_x/velocity_x.dart';
import '../../constants/api.dart'; import '../../constants/api.dart';
import '../../model/network/api_client.dart'; import '../../model/network/api_client.dart';
import '../../providers/user_provider.dart'; import '../../providers/user_provider.dart';
import '../../utils/toast/cloud_toast.dart'; import '../../utils/toast/cloud_toast.dart';
import '../../utils/user_tool.dart'; import '../../utils/user_tool.dart';
@ -44,18 +35,20 @@ class _UserPageState extends State<UserPage> {
// bool vle = PermissionStatus.denied.isGranted; // bool vle = PermissionStatus.denied.isGranted;
//bool vle =PermissionStatus.denied.isGranted; //bool vle =PermissionStatus.denied.isGranted;
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false); final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
bool vle=false; bool vle = false;
bool isVip=false; bool isVip = false;
String? endDate;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if(userProvider.isLogin){ if (userProvider.isLogin) {
if(userProvider.userInfo.isVip==1){ if (userProvider.userInfo.isVip == 1) {
isVip=true; isVip = true;
}else{ } else {
isVip=false; isVip = false;
} }
endDate=DateUtil.formatDateMs(userProvider.userInfo.end * 1000, format: DateFormats.y_mo_d);
} }
} }
@ -136,15 +129,15 @@ class _UserPageState extends State<UserPage> {
const Spacer(), const Spacer(),
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
var value = await CloudImagePicker.pickSingleImage(title: '选择图片'); // var value = await CloudImagePicker.pickSingleImage(title: '选择图片');
if (value != null) { // if (value != null) {
BotToast.showText(text: '头像成功'); // BotToast.showText(text: '头像成功');
setState(() {}); // setState(() {});
} // }//
}, },
child: ClipOval( child: ClipOval(
child: Image.asset( child: Image.asset(
Assets.images.portrait.path, userProvider.isLogin?Assets.images.portraitDeep.path:Assets.images.portrait.path,
height: 128.w, height: 128.w,
width: 128.w, width: 128.w,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -152,7 +145,6 @@ class _UserPageState extends State<UserPage> {
), ),
) )
], ],
), ),
); );
} }
@ -200,7 +192,7 @@ class _UserPageState extends State<UserPage> {
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight)), end: Alignment.centerRight)),
child: Text( child: Text(
isVip?"立即续费":"立即购买", isVip ? "立即续费" : "立即购买",
style: TextStyle( style: TextStyle(
color: const Color(0xFF001F3F), fontSize: BaseStyle.fontSize24), color: const Color(0xFF001F3F), fontSize: BaseStyle.fontSize24),
)), )),
@ -215,7 +207,7 @@ class _UserPageState extends State<UserPage> {
_getVip(), _getVip(),
16.hb, 16.hb,
Text( Text(
isVip?"{$userProvider.userInfo.end}到期":"解锁全部功能", isVip ? "$endDate到期" : "解锁全部功能",
style: TextStyle(color: Colors.white, fontSize: BaseStyle.fontSize24), style: TextStyle(color: Colors.white, fontSize: BaseStyle.fontSize24),
) )
], ],
@ -243,7 +235,7 @@ class _UserPageState extends State<UserPage> {
), ),
), ),
Text( Text(
isVip?"已成为会员":"未开通会员", isVip ? "已成为会员" : "未开通会员",
style: const TextStyle( style: const TextStyle(
color: Color( color: Color(
0xFFFFEAB0, 0xFFFFEAB0,
@ -258,9 +250,8 @@ class _UserPageState extends State<UserPage> {
_getSwitch(String url, String name, bool pd) { _getSwitch(String url, String name, bool pd) {
return GestureDetector( return GestureDetector(
onTap: () async { onTap: () async {
if (!pd) {
if(!pd){ switch (name) {
switch(name){
case "短信标签": case "短信标签":
Get.to(() => ContentDetailsPage( Get.to(() => ContentDetailsPage(
content: content:
@ -271,10 +262,10 @@ class _UserPageState extends State<UserPage> {
}, },
)); ));
break; break;
case"隐私政策": case "隐私政策":
Get.to(() => const ContentAuthorityPage()); Get.to(() => const ContentAuthorityPage());
break; break;
case"权限说明": case "权限说明":
Get.to(() => PrivacyRightsPage( Get.to(() => PrivacyRightsPage(
name: name, name: name,
)); ));
@ -321,8 +312,7 @@ class _UserPageState extends State<UserPage> {
// setState(() { // setState(() {
// vle = value; // vle = value;
// }); // });
} })
)
: const Icon(Icons.keyboard_arrow_right)), : const Icon(Icons.keyboard_arrow_right)),
), ),
); );

@ -9,12 +9,17 @@ import '../../model/network/base_model.dart';
import '../../providers/user_provider.dart'; import '../../providers/user_provider.dart';
import '../../utils/toast/cloud_toast.dart'; import '../../utils/toast/cloud_toast.dart';
typedef Callback = Function(bool status);
class Centertipsalterwidget extends StatefulWidget { class Centertipsalterwidget extends StatefulWidget {
final String title; final String title;
final String desText; final String desText;
final int id; final int id;
final Callback callback;
const Centertipsalterwidget( const Centertipsalterwidget(
{Key? key, required this.desText, required this.title, required this.id}) {Key? key, required this.desText, required this.title, required this.id, required this.callback})
: super(key: key); : super(key: key);
@override @override
@ -45,6 +50,7 @@ class _CentertipsalterwidgetState extends State<Centertipsalterwidget> {
style: TextStyle(color: Color(0xFF999999)), style: TextStyle(color: Color(0xFF999999)),
), ),
onPressed: () { onPressed: () {
widget.callback(false);
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -60,6 +66,7 @@ class _CentertipsalterwidgetState extends State<Centertipsalterwidget> {
} else { } else {
CloudToast.show(res.msg); CloudToast.show(res.msg);
} }
widget.callback(true);
Navigator.pop(context); Navigator.pop(context);
}, },
) )

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "40.0.0" version: "46.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.0" version: "4.6.0"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@ -112,7 +112,7 @@ packages:
name: built_value name: built_value
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "8.4.0" version: "8.4.1"
call_log: call_log:
dependency: "direct main" dependency: "direct main"
description: description:
@ -161,7 +161,7 @@ packages:
name: code_builder name: code_builder
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.0" version: "4.2.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
@ -287,7 +287,7 @@ packages:
name: equatable name: equatable
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.3" version: "2.0.5"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
@ -308,7 +308,7 @@ packages:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.2" version: "6.1.4"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:
@ -397,7 +397,7 @@ packages:
name: flutter_native_splash name: flutter_native_splash
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.2" version: "1.3.3"
flutter_plugin_android_lifecycle: flutter_plugin_android_lifecycle:
dependency: transitive dependency: transitive
description: description:
@ -470,7 +470,7 @@ packages:
name: grinder name: grinder
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.9.1" version: "0.9.2"
highlight: highlight:
dependency: transitive dependency: transitive
description: description:
@ -743,7 +743,7 @@ packages:
name: path_provider_android name: path_provider_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.12" version: "2.0.19"
path_provider_ios: path_provider_ios:
dependency: transitive dependency: transitive
description: description:
@ -820,7 +820,7 @@ packages:
name: petitparser name: petitparser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.4.0" version: "5.0.0"
platform: platform:
dependency: transitive dependency: transitive
description: description:
@ -876,7 +876,7 @@ packages:
name: pubspec_parse name: pubspec_parse
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
rational: rational:
dependency: transitive dependency: transitive
description: description:
@ -946,7 +946,7 @@ packages:
name: shelf name: shelf
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.3.2"
shelf_web_socket: shelf_web_socket:
dependency: transitive dependency: transitive
description: description:
@ -1079,7 +1079,7 @@ packages:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.1"
universal_io: universal_io:
dependency: transitive dependency: transitive
description: description:
@ -1128,7 +1128,7 @@ packages:
name: win32 name: win32
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.2" version: "2.6.1"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
@ -1142,7 +1142,7 @@ packages:
name: xml name: xml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.3.1" version: "5.4.1"
yaml: yaml:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -1151,5 +1151,5 @@ packages:
source: hosted source: hosted
version: "3.1.1" version: "3.1.1"
sdks: sdks:
dart: ">=2.17.0-206.0.dev <3.0.0" dart: ">=2.17.0 <3.0.0"
flutter: ">=2.8.0" flutter: ">=2.8.1"

Loading…
Cancel
Save