new_member_without_channel.dart 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import 'package:flutter/material.dart';
  2. class NewMemberWithoutChannel extends StatefulWidget {
  3. @override
  4. _NewMemberWithoutChannelState createState() =>
  5. _NewMemberWithoutChannelState();
  6. }
  7. class _NewMemberWithoutChannelState extends State<NewMemberWithoutChannel> {
  8. final TextEditingController _channelController = TextEditingController();
  9. void _enterApp() {
  10. String channelName = _channelController.text.trim();
  11. // Handle validation or navigation here
  12. print('Entered channel: $channelName');
  13. }
  14. @override
  15. Widget build(BuildContext context) {
  16. return Scaffold(
  17. backgroundColor: const Color(0xFFF5F5F5),
  18. body: Center(
  19. child: Padding(
  20. padding: const EdgeInsets.symmetric(horizontal: 32.0),
  21. child: Column(
  22. mainAxisAlignment: MainAxisAlignment.center,
  23. children: [
  24. // Input box
  25. Container(
  26. padding: const EdgeInsets.symmetric(horizontal: 12.0),
  27. decoration: BoxDecoration(
  28. border: Border.all(color: Colors.grey),
  29. color: Colors.white,
  30. ),
  31. child: TextField(
  32. controller: _channelController,
  33. decoration: const InputDecoration(
  34. hintText: '请输入渠道名称(请前往下载网站获取)',
  35. border: InputBorder.none,
  36. ),
  37. ),
  38. ),
  39. const SizedBox(height: 32.0),
  40. // Button
  41. SizedBox(
  42. width: double.infinity,
  43. height: 56,
  44. child: ElevatedButton(
  45. onPressed: _enterApp,
  46. style: ElevatedButton.styleFrom(
  47. backgroundColor: Color(0xFF42A5F5), // Blue color
  48. shape: RoundedRectangleBorder(
  49. borderRadius: BorderRadius.circular(8),
  50. ),
  51. ),
  52. child: const Text(
  53. '进入APP',
  54. style: TextStyle(
  55. fontSize: 18,
  56. fontWeight: FontWeight.bold,
  57. color: Colors.white,
  58. ),
  59. ),
  60. ),
  61. ),
  62. ],
  63. ),
  64. ),
  65. ),
  66. );
  67. }
  68. }