link_step.dart 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_svg/svg.dart';
  3. import 'package:link/constants.dart';
  4. import '../../utils/size_fit.dart';
  5. class LinkStep extends StatelessWidget {
  6. int step;
  7. String content;
  8. bool hasShadow;
  9. LinkStep(
  10. {Key? key,
  11. required this.step,
  12. required this.content,
  13. required this.hasShadow})
  14. : super(key: key);
  15. @override
  16. Widget build(BuildContext context) {
  17. SizeFit.initialize(context);
  18. if (hasShadow) {
  19. return Container(
  20. height: 48.px,
  21. // padding: EdgeInsets.only(left: 8.px, right: 16.px),
  22. decoration: BoxDecoration(
  23. boxShadow: [
  24. BoxShadow(
  25. color: kThemeColor, blurRadius: 0.0, offset: Offset(0, 8.px)),
  26. BoxShadow(
  27. color: const Color(0x66FFF700),
  28. blurRadius: 20.px,
  29. offset: Offset(0, 14.px))
  30. ],
  31. borderRadius: BorderRadius.circular(24.px),
  32. border: Border.all(color: kThemeColor, width: 4.px)),
  33. child: Container(
  34. height: 40.px,
  35. decoration: BoxDecoration(
  36. color: Colors.black, borderRadius: BorderRadius.circular(20.px)),
  37. alignment: Alignment.center,
  38. child: Row(
  39. children: [
  40. SizedBox(
  41. width: 6.px,
  42. ),
  43. Container(
  44. width: 28.px,
  45. height: 28.px,
  46. decoration: BoxDecoration(
  47. color: kThemeColor,
  48. borderRadius: BorderRadius.circular(14.px)),
  49. alignment: Alignment.center,
  50. child: step==-1?SvgPicture.asset('assets/icons/step_checked.svg',width: 20.px,height: 20.px,):Text(
  51. step.toString(),
  52. style: TextStyle(
  53. color: Colors.black,
  54. fontFamily: 'Link1',
  55. fontWeight: FontWeight.w800,
  56. fontSize: 20.px),
  57. ),
  58. ),
  59. SizedBox(
  60. width: 6.px,
  61. ),
  62. Text(
  63. content,
  64. style: TextStyle(color: kThemeColor, fontSize: 14.px),
  65. ),
  66. SizedBox(
  67. width: 16.px,
  68. )
  69. ],
  70. ),
  71. ),
  72. );
  73. }
  74. return Container(
  75. width: 48.px,
  76. height: 48.px,
  77. decoration: BoxDecoration(
  78. borderRadius: BorderRadius.circular(24.px),
  79. border: Border.all(color: const Color(0xFF74747A), width: 4.px)),
  80. child: Container(
  81. height: 40.px,
  82. width: 40.px,
  83. decoration: BoxDecoration(
  84. color: Colors.black, borderRadius: BorderRadius.circular(20.px)),
  85. alignment: Alignment.center,
  86. child: step==-1?SvgPicture.asset('assets/icons/step_checked.svg',width: 30.px,height: 30.px,):Text(
  87. step.toString(),
  88. style: TextStyle(
  89. color: const Color(0xFF74747A),
  90. fontFamily: 'Link1',
  91. fontSize: 28.px,
  92. fontWeight: FontWeight.w800),
  93. ),
  94. ),
  95. );
  96. }
  97. }