news_report_dialog.dart 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 NewsReportDialog {
  10. static const String _tag = 'AccountReplaceDialog';
  11. static void show() {
  12. SmartDialog.show(
  13. builder: (_) => _NewsReportDialogView(),
  14. tag: _tag,
  15. clickMaskDismiss: false);
  16. }
  17. static void dismiss() {
  18. SmartDialog.dismiss(tag: _tag);
  19. }
  20. }
  21. class _NewsReportDialogView 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.iconAgreementClose
  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.iconNewsReportAgree.image(height: 76.w),
  61. SizedBox(height: 29.w),
  62. Text("提交成功",
  63. style: TextStyle(
  64. fontSize: 17.sp,
  65. color: '#333333'.color,
  66. fontWeight: FontWeight.bold)),
  67. SizedBox(height: 20.w),
  68. GestureDetector(
  69. onTap: onKnowClick,
  70. child: Container(
  71. width: 229.w,
  72. height: 43.w,
  73. decoration: BoxDecoration(
  74. color: ColorName.colorPrimary,
  75. borderRadius: BorderRadius.circular(100.r),
  76. ),
  77. child: Center(
  78. child: Text("我知道了",
  79. style: TextStyle(
  80. fontSize: 14.sp,
  81. color: Colors.white,
  82. fontWeight: FontWeight.w500)),
  83. ),
  84. ),
  85. ),
  86. SizedBox(height: 20.w),
  87. ],
  88. ),
  89. );
  90. }
  91. void onCloseClick() {
  92. NewsReportDialog.dismiss();
  93. }
  94. void onKnowClick() {
  95. NewsReportDialog.dismiss();
  96. }
  97. }