signup.dart 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import 'package:flutter/material.dart';
  2. import 'package:namer_app/footer.dart';
  3. import 'package:namer_app/header.dart';
  4. import 'package:namer_app/service/signup_serv.dart';
  5. class SignupPage extends StatelessWidget {
  6. const SignupPage({super.key});
  7. @override
  8. Widget build(BuildContext context) {
  9. var usernameController = TextEditingController();
  10. final nameController = TextEditingController();
  11. final passwordController = TextEditingController();
  12. return Scaffold(
  13. appBar: CustomAppbar(),
  14. backgroundColor: Colors.white,
  15. body: Form(
  16. child: Column(
  17. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  18. children: [
  19. Center(
  20. child: Row(
  21. mainAxisAlignment: MainAxisAlignment.center,
  22. children: [
  23. Text(
  24. 'SIGN UP',
  25. style: TextStyle(color: Colors.black, fontSize: 48),
  26. ),
  27. ],
  28. )),
  29. Column(
  30. children: [
  31. Padding(
  32. padding: const EdgeInsets.all(8.0),
  33. child: SizedBox(
  34. width: 396,
  35. child: TextFormField(
  36. decoration: InputDecoration(
  37. border: OutlineInputBorder(),
  38. focusedBorder: OutlineInputBorder(
  39. borderRadius: BorderRadius.all(Radius.circular(12)),
  40. borderSide: BorderSide(color: Colors.black)),
  41. enabledBorder: OutlineInputBorder(
  42. borderRadius: BorderRadius.all(Radius.circular(12)),
  43. borderSide: BorderSide(color: Colors.black)),
  44. labelText: 'Enter Username',
  45. labelStyle: TextStyle(color: Colors.black),
  46. filled: true,
  47. fillColor: Colors.white.withOpacity(0.25)),
  48. cursorColor: Colors.black,
  49. style: TextStyle(color: Colors.black),
  50. controller: usernameController,
  51. ),
  52. ),
  53. ),
  54. Padding(
  55. padding: const EdgeInsets.all(8.0),
  56. child: SizedBox(
  57. width: 396,
  58. child: TextFormField(
  59. decoration: InputDecoration(
  60. border: OutlineInputBorder(),
  61. focusedBorder: OutlineInputBorder(
  62. borderRadius: BorderRadius.all(Radius.circular(12)),
  63. borderSide: BorderSide(color: Colors.black)),
  64. enabledBorder: OutlineInputBorder(
  65. borderRadius: BorderRadius.all(Radius.circular(12)),
  66. borderSide: BorderSide(color: Colors.black)),
  67. labelText: 'Enter Name',
  68. labelStyle: TextStyle(color: Colors.black),
  69. filled: true,
  70. fillColor: Colors.white.withOpacity(0.25)),
  71. cursorColor: Colors.black,
  72. style: TextStyle(color: Colors.black),
  73. controller: nameController,
  74. ),
  75. ),
  76. ),
  77. SizedBox(
  78. width: 396,
  79. child: TextFormField(
  80. obscureText: true,
  81. decoration: InputDecoration(
  82. border: OutlineInputBorder(),
  83. focusedBorder: OutlineInputBorder(
  84. borderRadius: BorderRadius.all(Radius.circular(12)),
  85. borderSide: BorderSide(color: Colors.black)),
  86. enabledBorder: OutlineInputBorder(
  87. borderRadius: BorderRadius.all(Radius.circular(12)),
  88. borderSide: BorderSide(color: Colors.black)),
  89. labelText: 'Enter Password',
  90. labelStyle: TextStyle(color: Colors.black),
  91. filled: true,
  92. fillColor: Colors.white.withOpacity(0.25)),
  93. cursorColor: Colors.black,
  94. style: TextStyle(color: Colors.black),
  95. controller: passwordController,
  96. ),
  97. ),
  98. Padding(
  99. padding: const EdgeInsets.all(20.0),
  100. child: SizedBox(
  101. width: 396,
  102. height: 61,
  103. child: ElevatedButton(
  104. onPressed: () => signup(context,
  105. // formData
  106. usernameController.text,
  107. passwordController.text,
  108. nameController.text
  109. ),
  110. style: ElevatedButton.styleFrom(//todo putih lage
  111. backgroundColor: Colors.black,
  112. side: BorderSide(color: Colors.white),
  113. shape: RoundedRectangleBorder(
  114. borderRadius: BorderRadius.circular(12.0),
  115. ),
  116. ),
  117. child: Text(
  118. 'Save',
  119. style: TextStyle(color: Colors.white),
  120. ),
  121. ),
  122. ),
  123. ),
  124. ],
  125. ),
  126. ],
  127. ),
  128. ),
  129. bottomNavigationBar: Footer(),
  130. );
  131. }
  132. }