new_member_with_channel.dart 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. import 'package:flutter/material.dart';
  2. class NewMemberWithChannel extends StatefulWidget {
  3. @override
  4. _NewMemberWithChannelState createState() => _NewMemberWithChannelState();
  5. }
  6. class _NewMemberWithChannelState extends State<NewMemberWithChannel> {
  7. final List<String> tags = [
  8. '学生',
  9. '良家',
  10. 'OL',
  11. '网红',
  12. '模特',
  13. '明星',
  14. '新人',
  15. '兼职',
  16. '短期',
  17. '原装',
  18. 'S身材',
  19. '高颜值',
  20. '三点粉',
  21. '微胖',
  22. '水嫩',
  23. '紧致',
  24. '清纯',
  25. '轻熟',
  26. '气质',
  27. '纯欲',
  28. ];
  29. final Set<String> selectedTags = {};
  30. void _toggleTag(String tag) {
  31. setState(() {
  32. if (selectedTags.contains(tag)) {
  33. selectedTags.remove(tag);
  34. } else {
  35. selectedTags.add(tag);
  36. }
  37. });
  38. }
  39. void _goToNextStep() {
  40. print('Selected tags: $selectedTags');
  41. // Add navigation logic here
  42. }
  43. @override
  44. Widget build(BuildContext context) {
  45. return Scaffold(
  46. backgroundColor: const Color(0xFFF5F5F5),
  47. body: SafeArea(
  48. child: Column(
  49. children: [
  50. // Top image placeholder
  51. Padding(
  52. padding: const EdgeInsets.all(16.0),
  53. child: Container(
  54. height: 160,
  55. width: double.infinity,
  56. decoration: BoxDecoration(
  57. color: Colors.grey[300],
  58. borderRadius: BorderRadius.circular(16),
  59. ),
  60. child: const Center(
  61. child: Icon(Icons.image, size: 80, color: Colors.grey),
  62. ),
  63. ),
  64. ),
  65. const Text(
  66. '请选择您喜欢的外围类型(支持多选)',
  67. style: TextStyle(fontSize: 16),
  68. ),
  69. const SizedBox(height: 12),
  70. // Tags
  71. Padding(
  72. padding: const EdgeInsets.symmetric(horizontal: 16.0),
  73. child: Wrap(
  74. spacing: 12,
  75. runSpacing: 12,
  76. children: tags.map((tag) {
  77. final isSelected = selectedTags.contains(tag);
  78. return ChoiceChip(
  79. label: Text(
  80. tag,
  81. style: TextStyle(
  82. color: isSelected ? Colors.white : Colors.black,
  83. fontWeight: FontWeight.bold,
  84. ),
  85. ),
  86. selected: isSelected,
  87. onSelected: (_) => _toggleTag(tag),
  88. selectedColor: Colors.blue,
  89. backgroundColor: Colors.white,
  90. shape: RoundedRectangleBorder(
  91. borderRadius: BorderRadius.circular(8),
  92. side: BorderSide(color: Colors.grey.shade400),
  93. ),
  94. );
  95. }).toList(),
  96. ),
  97. ),
  98. const Spacer(),
  99. // Next button
  100. Padding(
  101. padding:
  102. const EdgeInsets.symmetric(horizontal: 32.0, vertical: 24.0),
  103. child: SizedBox(
  104. width: double.infinity,
  105. height: 56,
  106. child: ElevatedButton(
  107. onPressed: _goToNextStep,
  108. style: ElevatedButton.styleFrom(
  109. backgroundColor: Color(0xFF42A5F5),
  110. shape: RoundedRectangleBorder(
  111. borderRadius: BorderRadius.circular(8),
  112. ),
  113. ),
  114. child: const Text(
  115. '下一步',
  116. style: TextStyle(
  117. fontSize: 18,
  118. fontWeight: FontWeight.bold,
  119. color: Colors.white,
  120. ),
  121. ),
  122. ),
  123. ),
  124. ),
  125. ],
  126. ),
  127. ),
  128. );
  129. }
  130. }