基础组件库
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

share_alert_content.dart 3.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:zhiying_base_widget/widgets/others/dotted_line/dotted_line.dart';
  4. import 'package:zhiying_base_widget/widgets/share/models/share_alert_model.dart';
  5. import 'package:zhiying_comm/zhiying_comm.dart';
  6. class ShareAlertContent extends StatelessWidget {
  7. final ShareAlertModel model;
  8. const ShareAlertContent(this.model, {Key key}) : super(key: key);
  9. @override
  10. Widget build(BuildContext context) {
  11. return SafeArea(
  12. child: Center(
  13. child: UnconstrainedBox(
  14. child: Container(
  15. padding: EdgeInsets.all(14),
  16. width: 220,
  17. decoration: BoxDecoration(
  18. color: Colors.white,
  19. borderRadius: BorderRadius.circular(12),
  20. ),
  21. child: Column(
  22. children: <Widget>[
  23. Container(
  24. width: 92,
  25. height: 92,
  26. margin: EdgeInsets.only(top: 10),
  27. child: CachedNetworkImage(
  28. imageUrl: model?.successImg ?? '',
  29. ),
  30. ),
  31. Padding(
  32. padding: const EdgeInsets.only(top: 8.0),
  33. child: Text(
  34. model?.sucText ?? '',
  35. style: TextStyle(
  36. color: HexColor.fromHex('#333333'),
  37. fontSize: 18,
  38. fontWeight: FontWeight.bold,
  39. ),
  40. ),
  41. ),
  42. Padding(
  43. padding: const EdgeInsets.only(top: 4, left: 30, right: 30),
  44. child: Text(
  45. model?.sucTips ?? '',
  46. textAlign: TextAlign.center,
  47. style: TextStyle(
  48. color: HexColor.fromHex('#999999'),
  49. fontSize: 11,
  50. fontWeight: FontWeight.normal,
  51. ),
  52. ),
  53. ),
  54. Padding(
  55. padding: const EdgeInsets.only(top: 10.0),
  56. child: _createLine(
  57. model?.selectImg ?? '', model?.selectText1 ?? ''),
  58. ),
  59. Padding(
  60. padding: const EdgeInsets.only(top: 10.0),
  61. child: _createLine(
  62. model?.selectTextImg ?? '', model?.selectText2 ?? ''),
  63. ),
  64. ],
  65. ),
  66. ),
  67. ),
  68. ),
  69. );
  70. }
  71. Widget _createLine(String imgUrl, String text) {
  72. return Row(
  73. children: <Widget>[
  74. Container(
  75. width: 12,
  76. height: 12,
  77. // color: Colors.redAccent,
  78. child: CachedNetworkImage(
  79. imageUrl: imgUrl ?? '',
  80. ),
  81. ),
  82. Padding(
  83. padding: const EdgeInsets.only(left: 4, right: 4),
  84. child: Text(
  85. text ?? '',
  86. style: TextStyle(fontSize: 11, color: HexColor.fromHex('#999999')),
  87. ),
  88. ),
  89. Expanded(
  90. child: DottedLine(
  91. width: 2,
  92. height: 0.5,
  93. color: HexColor.fromHex('#a8a8a8'),
  94. )),
  95. Container(
  96. margin: EdgeInsets.only(left: 6),
  97. width: 15,
  98. height: 15,
  99. child: CachedNetworkImage(
  100. imageUrl: model?.selectIcon ?? '',
  101. ),
  102. ),
  103. ],
  104. );
  105. }
  106. }