|
|
@ -18,6 +18,7 @@ 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';
|
|
|
|
|
|
|
|
import '../home/call.dart';
|
|
|
|
import 'content_details_page.dart';
|
|
|
|
import 'content_details_page.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import '../home/home_page.dart';
|
|
|
|
import '../home/home_page.dart';
|
|
|
@ -34,27 +35,28 @@ final Telephony telephony = Telephony.instance;
|
|
|
|
class _UserPageState extends State<UserPage> {
|
|
|
|
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 isVip = false;
|
|
|
|
bool isVip = false;
|
|
|
|
String? endDate;
|
|
|
|
String? endDate;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
if (userProvider.isLogin) {
|
|
|
|
if ( UserTool.userProvider.isLogin) {
|
|
|
|
if (userProvider.userInfo.isVip == 1) {
|
|
|
|
if (UserTool.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);
|
|
|
|
endDate=DateUtil.formatDateMs(UserTool.userProvider.userInfo.end * 1000, format: DateFormats.y_mo_d);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return CloudScaffold(
|
|
|
|
return CloudScaffold(
|
|
|
|
|
|
|
|
|
|
|
|
systemStyle: const SystemUiOverlayStyle(
|
|
|
|
systemStyle: const SystemUiOverlayStyle(
|
|
|
|
statusBarIconBrightness: Brightness.dark,
|
|
|
|
statusBarIconBrightness: Brightness.dark,
|
|
|
|
// systemNavigationBarColor: Colors.white,
|
|
|
|
// systemNavigationBarColor: Colors.white,
|
|
|
@ -62,6 +64,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
path: Assets.images.bg.path,
|
|
|
|
path: Assets.images.bg.path,
|
|
|
|
bodyColor: Colors.white,
|
|
|
|
bodyColor: Colors.white,
|
|
|
|
extendBody: true,
|
|
|
|
extendBody: true,
|
|
|
|
|
|
|
|
|
|
|
|
body: Column(children: [
|
|
|
|
body: Column(children: [
|
|
|
|
_getUser(),
|
|
|
|
_getUser(),
|
|
|
|
72.hb,
|
|
|
|
72.hb,
|
|
|
@ -73,7 +76,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
_getSwitch(Assets.icons.sms.path, "短信标签", false),
|
|
|
|
_getSwitch(Assets.icons.sms.path, "短信标签", false),
|
|
|
|
// const Spacer(),
|
|
|
|
// const Spacer(),
|
|
|
|
182.hb,
|
|
|
|
182.hb,
|
|
|
|
userProvider.isLogin
|
|
|
|
UserTool. userProvider.isLogin
|
|
|
|
? PloneBottom(
|
|
|
|
? PloneBottom(
|
|
|
|
border: false,
|
|
|
|
border: false,
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
@ -110,7 +113,8 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
userProvider.isLogin ? userProvider.userInfo.name : "登录/注册",
|
|
|
|
UserTool.userProvider.isLogin ?UserTool.userProvider.userInfo.name : "登录/注册",
|
|
|
|
|
|
|
|
// UserTool.userProvider.userInfo.name ,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: BaseStyle.fontSize48,
|
|
|
|
fontSize: BaseStyle.fontSize48,
|
|
|
|
color: BaseStyle.color333333,
|
|
|
|
color: BaseStyle.color333333,
|
|
|
@ -118,7 +122,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
24.hb,
|
|
|
|
24.hb,
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
userProvider.isLogin ? "欢迎您登录短信帮手" : "登录获取更多信息",
|
|
|
|
UserTool.userProvider.isLogin ? "欢迎您登录短信帮手" : "登录获取更多信息",
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: BaseStyle.fontSize28,
|
|
|
|
fontSize: BaseStyle.fontSize28,
|
|
|
|
color: BaseStyle.color333333),
|
|
|
|
color: BaseStyle.color333333),
|
|
|
@ -137,7 +141,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: ClipOval(
|
|
|
|
child: ClipOval(
|
|
|
|
child: Image.asset(
|
|
|
|
child: Image.asset(
|
|
|
|
userProvider.isLogin?Assets.images.portraitDeep.path:Assets.images.portrait.path,
|
|
|
|
UserTool.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,
|
|
|
@ -248,6 +252,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
|
|
|
|
|
|
|
//内容
|
|
|
|
//内容
|
|
|
|
_getSwitch(String url, String name, bool pd) {
|
|
|
|
_getSwitch(String url, String name, bool pd) {
|
|
|
|
|
|
|
|
bool vle = true;
|
|
|
|
return GestureDetector(
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
|
if (!pd) {
|
|
|
|
if (!pd) {
|
|
|
@ -255,7 +260,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
case "短信标签":
|
|
|
|
case "短信标签":
|
|
|
|
Get.to(() => ContentDetailsPage(
|
|
|
|
Get.to(() => ContentDetailsPage(
|
|
|
|
content:
|
|
|
|
content:
|
|
|
|
userProvider.isLogin ? userProvider.userInfo.tag : "",
|
|
|
|
UserTool.userProvider.isLogin ? UserTool.userProvider.userInfo.tag : "",
|
|
|
|
ploneBack: (String textContent) {
|
|
|
|
ploneBack: (String textContent) {
|
|
|
|
// print("这是数据" + textContent);
|
|
|
|
// print("这是数据" + textContent);
|
|
|
|
// textList.setAll(index, {textContent});
|
|
|
|
// textList.setAll(index, {textContent});
|
|
|
@ -296,7 +301,9 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
? Switch(
|
|
|
|
? Switch(
|
|
|
|
value: vle,
|
|
|
|
value: vle,
|
|
|
|
onChanged: (value) async {
|
|
|
|
onChanged: (value) async {
|
|
|
|
await Permission.phone.request();
|
|
|
|
// vle=value;
|
|
|
|
|
|
|
|
// await initializeService();
|
|
|
|
|
|
|
|
// await Permission.phone.request();
|
|
|
|
// List<Permission> permissions = [
|
|
|
|
// List<Permission> permissions = [
|
|
|
|
// Permission.sms,
|
|
|
|
// Permission.sms,
|
|
|
|
// Permission.phone,
|
|
|
|
// Permission.phone,
|
|
|
@ -309,9 +316,9 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
// print('onOpenSetting');
|
|
|
|
// print('onOpenSetting');
|
|
|
|
// openAppSettings();
|
|
|
|
// openAppSettings();
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// setState(() {
|
|
|
|
setState(() {
|
|
|
|
// vle = value;
|
|
|
|
vle=value;
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
: const Icon(Icons.keyboard_arrow_right)),
|
|
|
|
: const Icon(Icons.keyboard_arrow_right)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|