|
|
@@ -1,11 +1,21 @@
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
+import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
|
+import 'package:location/resource/string.gen.dart';
|
|
|
+import 'package:location/utils/common_expand.dart';
|
|
|
+
|
|
|
+import '../resource/assets.gen.dart';
|
|
|
+import '../resource/colors.gen.dart';
|
|
|
|
|
|
class AccountReplaceDialog {
|
|
|
static const String _tag = 'AccountReplaceDialog';
|
|
|
|
|
|
static void show() {
|
|
|
- SmartDialog.show(builder: (_) => _AccountReplaceView(), tag: _tag);
|
|
|
+ SmartDialog.show(
|
|
|
+ builder: (_) => _AccountReplaceView(),
|
|
|
+ tag: _tag,
|
|
|
+ clickMaskDismiss: false);
|
|
|
}
|
|
|
|
|
|
static void dismiss() {
|
|
|
@@ -16,6 +26,83 @@ class AccountReplaceDialog {
|
|
|
class _AccountReplaceView extends StatelessWidget {
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- return Container(child: Text('账号已在其他设备登录,请重新登录'));
|
|
|
+ return Container(
|
|
|
+ width: 274.w,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(16.r),
|
|
|
+ border: Border.all(
|
|
|
+ color: Colors.white,
|
|
|
+ width: 2.w,
|
|
|
+ ),
|
|
|
+ gradient: LinearGradient(
|
|
|
+ begin: Alignment.topCenter,
|
|
|
+ end: Alignment.bottomCenter,
|
|
|
+ colors: [
|
|
|
+ '#E4E4FF'.color,
|
|
|
+ '#FFFFFF'.color,
|
|
|
+ ])),
|
|
|
+ child: Stack(
|
|
|
+ alignment: Alignment.center,
|
|
|
+ children: [
|
|
|
+ Positioned(
|
|
|
+ top: 16.w,
|
|
|
+ right: 16.w,
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: onCloseClick,
|
|
|
+ child: Assets.images.iconDialogClose2
|
|
|
+ .image(width: 20.w, height: 20.w),
|
|
|
+ )),
|
|
|
+ buildAccountReplaceContent(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget buildAccountReplaceContent() {
|
|
|
+ return IntrinsicHeight(
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ SizedBox(height: 33.w),
|
|
|
+ Assets.images.iconAccountReplaceLogo.image(height: 76.w),
|
|
|
+ SizedBox(height: 29.w),
|
|
|
+ Text(StringName.accountReplaceTitle,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 17.sp,
|
|
|
+ color: '#333333'.color,
|
|
|
+ fontWeight: FontWeight.bold)),
|
|
|
+ SizedBox(height: 8.w),
|
|
|
+ Text(StringName.accountReplaceDesc,
|
|
|
+ style: TextStyle(fontSize: 14.sp, color: '#999999'.color)),
|
|
|
+ SizedBox(height: 20.w),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: onKnowClick,
|
|
|
+ child: Container(
|
|
|
+ width: 229.w,
|
|
|
+ height: 43.w,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: ColorName.colorPrimary,
|
|
|
+ borderRadius: BorderRadius.circular(100.r),
|
|
|
+ ),
|
|
|
+ child: Center(
|
|
|
+ child: Text(StringName.accountReplaceBtnTxt,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp,
|
|
|
+ color: Colors.white,
|
|
|
+ fontWeight: FontWeight.w500)),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ SizedBox(height: 20.w),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ void onCloseClick() {
|
|
|
+ AccountReplaceDialog.dismiss();
|
|
|
+ }
|
|
|
+
|
|
|
+ void onKnowClick() {
|
|
|
+ AccountReplaceDialog.dismiss();
|
|
|
}
|
|
|
}
|