character_add_dialog.dart 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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:keyboard/data/bean/keyboard_info.dart';
  6. import '../resource/assets.gen.dart';
  7. import '../resource/colors.gen.dart';
  8. import 'content/character_add_tab_view.dart';
  9. class CharacterAddDialog {
  10. static const String tag = 'CharacterAddDialog';
  11. static void show({
  12. required KeyboardInfo currentKeyboardInfo,
  13. required VoidCallback clickCallback,
  14. }) {
  15. SmartDialog.show(
  16. tag: tag,
  17. backType: SmartBackType.block,
  18. clickMaskDismiss: false,
  19. maskColor: ColorName.black70,
  20. builder: (_) {
  21. return SizedBox(
  22. width: double.infinity,
  23. height: double.infinity,
  24. child: Column(
  25. mainAxisAlignment: MainAxisAlignment.end,
  26. children: [
  27. Container(
  28. padding: EdgeInsets.only(
  29. bottom: 28.h,
  30. left: 16.w,
  31. right: 16.w,
  32. top: 22.h,
  33. ),
  34. alignment: Alignment.topCenter,
  35. width: double.infinity,
  36. height: 712.h,
  37. decoration: BoxDecoration(
  38. color: const Color(0xFFF6F5FA),
  39. borderRadius: BorderRadius.circular(20.r),
  40. ),
  41. child: Column(
  42. crossAxisAlignment: CrossAxisAlignment.start,
  43. mainAxisAlignment: MainAxisAlignment.start,
  44. children: [
  45. Row(
  46. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  47. children: [
  48. Assets.images.iconCharacterMarket.image(
  49. width: 73.w,
  50. height: 25.h,
  51. ),
  52. GestureDetector(
  53. onTap: () {
  54. clickCallback();
  55. SmartDialog.dismiss();
  56. },
  57. child: Assets.images.iconDialogCloseBlack.image(
  58. width: 24.w,
  59. height: 24.w,
  60. ),
  61. ),
  62. ],
  63. ),
  64. SizedBox(height: 20.h),
  65. Expanded(
  66. child: CharacterAddTabView(
  67. currentKeyboardInfo: currentKeyboardInfo,
  68. ),
  69. ),
  70. ],
  71. ),
  72. ),
  73. ],
  74. ),
  75. );
  76. },
  77. );
  78. }
  79. }