|
|
|
@ -5,6 +5,7 @@ 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/ui/login/login_page.dart';
|
|
|
|
|
import 'package:project_telephony/ui/tab_navigator.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/widget/image_scaffold.dart';
|
|
|
|
@ -12,9 +13,15 @@ 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/permissionutils.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:telephony/telephony.dart';
|
|
|
|
|
|
|
|
|
|
import '../../constants/api.dart';
|
|
|
|
|
import '../../model/network/api_client.dart';
|
|
|
|
|
import '../../permission.dart';
|
|
|
|
|
import '../../providers/user_provider.dart';
|
|
|
|
|
import '../../utils/toast/cloud_toast.dart';
|
|
|
|
|
import '../../utils/user_tool.dart';
|
|
|
|
|
import '../home/home_page.dart';
|
|
|
|
|
|
|
|
|
|
class UserPage extends StatefulWidget {
|
|
|
|
@ -26,13 +33,9 @@ class UserPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
final Telephony telephony = Telephony.instance;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {}
|
|
|
|
|
|
|
|
|
|
class _UserPageState extends State<UserPage> {
|
|
|
|
|
bool vle = false;
|
|
|
|
|
bool tooken = true;
|
|
|
|
|
|
|
|
|
|
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@ -55,17 +58,24 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
_getSwitch(Assets.icons.sms.path, "短信标签", false),
|
|
|
|
|
// const Spacer(),
|
|
|
|
|
182.hb,
|
|
|
|
|
tooken?
|
|
|
|
|
PloneBottom(
|
|
|
|
|
border: false,
|
|
|
|
|
onTap: () {
|
|
|
|
|
Get.to(() => const HomePage());
|
|
|
|
|
},
|
|
|
|
|
textColor: const Color(0xFF1890FF),
|
|
|
|
|
color1: const Color(0xFFEBF5FF),
|
|
|
|
|
color2: const Color(0xFFEBF5FF),
|
|
|
|
|
text: "退出登录",
|
|
|
|
|
):const SizedBox()
|
|
|
|
|
userProvider.isLogin
|
|
|
|
|
? PloneBottom(
|
|
|
|
|
border: false,
|
|
|
|
|
onTap: () async{
|
|
|
|
|
var cancel = CloudToast.loading;
|
|
|
|
|
var base = await apiClient.request(API.manager.logout, showMessage: true);
|
|
|
|
|
if (base.code == 0) {
|
|
|
|
|
UserTool.userProvider.logout();
|
|
|
|
|
Get.offAll(const HomePage());
|
|
|
|
|
}
|
|
|
|
|
cancel();
|
|
|
|
|
},
|
|
|
|
|
textColor: const Color(0xFF1890FF),
|
|
|
|
|
color1: const Color(0xFFEBF5FF),
|
|
|
|
|
color2: const Color(0xFFEBF5FF),
|
|
|
|
|
text: "退出登录",
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox()
|
|
|
|
|
]),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
@ -84,7 +94,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
tooken? "xxxxx": "登录/注册" ,
|
|
|
|
|
userProvider.isLogin ? userProvider.userInfo.name : "登录/注册",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: BaseStyle.fontSize48,
|
|
|
|
|
color: BaseStyle.color333333,
|
|
|
|
@ -92,7 +102,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
),
|
|
|
|
|
24.hb,
|
|
|
|
|
Text(
|
|
|
|
|
tooken ? "登录获取更多信息" : "欢迎您登录短信帮手",
|
|
|
|
|
userProvider.isLogin ? "欢迎您登录短信帮手" : "登录获取更多信息",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: BaseStyle.fontSize28,
|
|
|
|
|
color: BaseStyle.color333333),
|
|
|
|
|