level2_view.dart 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import 'package:flutter/material.dart';
  2. import 'title_point.dart';
  3. class Level2View extends StatelessWidget {
  4. const Level2View(
  5. {super.key,
  6. required this.level1,
  7. required this.level2,
  8. required this.level1Title,
  9. required this.level2Title,
  10. required this.level2SubTitle});
  11. final Iterable<Widget> level1;
  12. final Iterable<Widget> level2;
  13. final String level1Title;
  14. final String level2Title;
  15. final Widget level2SubTitle;
  16. @override
  17. Widget build(BuildContext context) {
  18. return Container(
  19. width: double.infinity,
  20. height: double.infinity,
  21. margin: const EdgeInsets.all(20),
  22. padding: const EdgeInsets.fromLTRB(12, 17, 12, 17),
  23. decoration: BoxDecoration(
  24. color: Colors.white, borderRadius: BorderRadius.circular(16)),
  25. child: Row(
  26. children: [
  27. SizedBox(width: 260, height: double.infinity, child: left(context)),
  28. const VerticalDivider(
  29. width: 15, color: Color(0xffd8d8d8), thickness: 1),
  30. Expanded(child: right(context))
  31. ],
  32. ),
  33. );
  34. }
  35. TextStyle get titleStyle => const TextStyle(
  36. fontSize: 14.22, color: Color(0xff333333), fontWeight: FontWeight.w700);
  37. Widget left(BuildContext context) {
  38. return Column(
  39. children: [
  40. Row(
  41. children: [
  42. const Padding(padding: EdgeInsets.all(8), child: TitlePoint()),
  43. Text(level1Title, style: titleStyle),
  44. const Spacer(),
  45. Container(
  46. decoration: BoxDecoration(
  47. border: Border.all(color: const Color(0xffe3e3e3))),
  48. child: const Text('2023-06-26'),
  49. )
  50. ],
  51. ),
  52. const SizedBox(height: 20),
  53. Expanded(
  54. child: ListView(
  55. children: level1.toList(),
  56. )),
  57. ],
  58. );
  59. }
  60. Widget right(BuildContext context) {
  61. return Column(
  62. children: [
  63. Row(
  64. children: [
  65. const Padding(padding: EdgeInsets.all(8), child: TitlePoint()),
  66. Text(level2Title, style: titleStyle),
  67. level2SubTitle,
  68. ],
  69. ),
  70. Expanded(
  71. child: Padding(
  72. padding: const EdgeInsets.all(18),
  73. child: Column(
  74. children: level2.toList(),
  75. )))
  76. ],
  77. );
  78. }
  79. }