| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- import 'package:flutter/material.dart';
- import 'package:flutter/src/widgets/framework.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:keyboard/module/user_info/user_info_controller.dart';
- import 'package:get/get.dart';
- import 'package:keyboard/resource/string.gen.dart';
- import 'package:keyboard/utils/styles.dart';
- import '../../base/base_page.dart';
- import '../../resource/assets.gen.dart';
- import '../../router/app_pages.dart';
- import '../../widget/commonAppBar.dart';
- class UserInfoPage extends BasePage<UserInfoController> {
- const UserInfoPage({super.key});
- /// 跳转
- static start() {
- Get.toNamed(RoutePath.userInfo);
- }
- @override
- bool immersive() {
- return false;
- }
- @override
- statusBarDarkFont() {
- return true;
- }
- @override
- Color backgroundColor() {
- return const Color(0xFFF6F5FA);
- }
- @override
- Widget buildBody(BuildContext context) {
- return Scaffold(
- backgroundColor: backgroundColor(),
- appBar: CommonAppBar(
- title: StringName.userInfo,
- backgroundColor: () {
- return Colors.transparent;
- },
- onBack: () {
- controller.clickBack();
- },
- ),
- body: Column(
- children: [
- Container(
- margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 20.w),
- padding: EdgeInsets.all(16.w),
- decoration: ShapeDecoration(
- color: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(12.r),
- ),
- ),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- StringName.personalInfo,
- style: TextStyle(
- color: const Color(0xFFBBBCCC),
- fontSize: 14.sp,
- fontWeight: FontWeight.w500,
- ),
- ),
- SizedBox(height: 24.h),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text(
- StringName.loginAccount,
- style: Styles.getTextStyleBlack204W400(14.sp),
- ),
- Text(
- controller.userInfo?.account ?? "",
- style: TextStyle(
- color: Colors.black.withAlpha(102),
- fontSize: 14.sp,
- fontWeight: FontWeight.w400,
- ),
- ),
- ],
- ),
- ],
- ),
- ),
- SizedBox(height: 8.h),
- _buildDeprecateButton(),
- const Spacer(),
- _buildLogoutButton(),
- ],
- ),
- );
- }
- Widget _buildLogoutButton() {
- return Row(
- children: [
- Expanded(
- child: Container(
- margin: EdgeInsets.only(bottom: 20.w, left: 16.w, right: 16.w),
- height: 48.h,
- child: Material(
- color: const Color(0xFFEDE8FF),
- borderRadius: BorderRadius.circular(50.r),
- child: InkWell(
- splashColor: Color(0xFFB983FF),
- borderRadius: BorderRadius.circular(50.r),
- onTap: () {
- controller.clickLogout();
- },
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Container(
- width: 22.w,
- height: 22.w,
- margin: EdgeInsets.only(right: 6.w),
- child: Assets.images.iconUserInfoLogout.image(
- width: 22.w,
- height: 22.w,
- fit: BoxFit.contain,
- ),
- ),
- Text(
- StringName.logout,
- textAlign: TextAlign.center,
- style: TextStyle(
- color: const Color(0xFF7D46FC),
- fontSize: 16.sp,
- fontWeight: FontWeight.w500,
- height: 1.25,
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- ),
- ],
- );
- }
- Widget _buildDeprecateButton() {
- return Padding(
- padding: EdgeInsets.symmetric(horizontal: 16.w),
- child: Material(
- color: Colors.white,
- borderRadius: BorderRadius.circular(12.r),
- child: InkWell(
- borderRadius: BorderRadius.circular(12.r),
- onTap: () {
- controller.clickDeprecate();
- },
- child: Padding(
- padding: EdgeInsets.all(16.w),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text(
- StringName.loginDeleteAccount,
- style: Styles.getTextStyleBlack204W400(14.sp),
- ),
- Assets.images.iconUserInfoArrowLeft.image(
- width: 20.w,
- height: 20.w,
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
- }
|