record_max_dialog.dart 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 '../resource/colors.gen.dart';
  6. void showRecordMaxDialog(String contentTxt, {required String tag}) {
  7. if (SmartDialog.checkExist(tag: tag)) {
  8. return;
  9. }
  10. SmartDialog.show(
  11. tag: tag,
  12. builder: (_) {
  13. return Container(
  14. padding: EdgeInsets.all(16.w),
  15. width: 280.w,
  16. decoration: BoxDecoration(
  17. color: Colors.white,
  18. borderRadius: BorderRadius.circular(12),
  19. ),
  20. child: IntrinsicHeight(
  21. child: Column(
  22. children: [
  23. SizedBox(height: 24.h),
  24. Text(
  25. contentTxt,
  26. style: TextStyle(
  27. fontSize: 15.sp,
  28. color: ColorName.primaryTextColor,
  29. fontWeight: FontWeight.bold),
  30. ),
  31. SizedBox(height: 35.h),
  32. GestureDetector(
  33. onTap: () {
  34. SmartDialog.dismiss();
  35. },
  36. child: Container(
  37. padding: EdgeInsets.symmetric(vertical: 8.h),
  38. decoration: BoxDecoration(
  39. color: ColorName.colorPrimary,
  40. borderRadius: BorderRadius.circular(8),
  41. ),
  42. child: Center(
  43. child: Text(
  44. '确定',
  45. style:
  46. TextStyle(fontSize: 16.sp, color: ColorName.white),
  47. ),
  48. ),
  49. ),
  50. ),
  51. SizedBox(height: 4.h),
  52. ],
  53. ),
  54. ),
  55. );
  56. });
  57. }