account_replace_dialog.dart 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
  5. import 'package:location/resource/string.gen.dart';
  6. import 'package:location/utils/common_expand.dart';
  7. import '../resource/assets.gen.dart';
  8. import '../resource/colors.gen.dart';
  9. class AccountReplaceDialog {
  10. static const String _tag = 'AccountReplaceDialog';
  11. static void show() {
  12. SmartDialog.show(
  13. builder: (_) => _AccountReplaceView(),
  14. tag: _tag,
  15. clickMaskDismiss: false);
  16. }
  17. static void dismiss() {
  18. SmartDialog.dismiss(tag: _tag);
  19. }
  20. }
  21. class _AccountReplaceView extends StatelessWidget {
  22. @override
  23. Widget build(BuildContext context) {
  24. return Container(
  25. width: 274.w,
  26. decoration: BoxDecoration(
  27. borderRadius: BorderRadius.circular(16.r),
  28. border: Border.all(
  29. color: Colors.white,
  30. width: 2.w,
  31. ),
  32. gradient: LinearGradient(
  33. begin: Alignment.topCenter,
  34. end: Alignment.bottomCenter,
  35. colors: [
  36. '#E4E4FF'.color,
  37. '#FFFFFF'.color,
  38. ])),
  39. child: Stack(
  40. alignment: Alignment.center,
  41. children: [
  42. Positioned(
  43. top: 16.w,
  44. right: 16.w,
  45. child: GestureDetector(
  46. onTap: onCloseClick,
  47. child: Assets.images.iconDialogClose2
  48. .image(width: 20.w, height: 20.w),
  49. )),
  50. buildAccountReplaceContent(),
  51. ],
  52. ),
  53. );
  54. }
  55. Widget buildAccountReplaceContent() {
  56. return IntrinsicHeight(
  57. child: Column(
  58. children: [
  59. SizedBox(height: 33.w),
  60. Assets.images.iconAccountReplaceLogo.image(height: 76.w),
  61. SizedBox(height: 29.w),
  62. Text(StringName.accountReplaceTitle,
  63. style: TextStyle(
  64. fontSize: 17.sp,
  65. color: '#333333'.color,
  66. fontWeight: FontWeight.bold)),
  67. SizedBox(height: 8.w),
  68. Text(StringName.accountReplaceDesc,
  69. style: TextStyle(fontSize: 14.sp, color: '#999999'.color)),
  70. SizedBox(height: 20.w),
  71. GestureDetector(
  72. onTap: onKnowClick,
  73. child: Container(
  74. width: 229.w,
  75. height: 43.w,
  76. decoration: BoxDecoration(
  77. color: ColorName.colorPrimary,
  78. borderRadius: BorderRadius.circular(100.r),
  79. ),
  80. child: Center(
  81. child: Text(StringName.accountReplaceBtnTxt,
  82. style: TextStyle(
  83. fontSize: 14.sp,
  84. color: Colors.white,
  85. fontWeight: FontWeight.w500)),
  86. ),
  87. ),
  88. ),
  89. SizedBox(height: 20.w),
  90. ],
  91. ),
  92. );
  93. }
  94. void onCloseClick() {
  95. AccountReplaceDialog.dismiss();
  96. }
  97. void onKnowClick() {
  98. AccountReplaceDialog.dismiss();
  99. }
  100. }