addmember.dart 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. import 'package:flutter/material.dart';
  2. import 'package:namer_app/footer.dart';
  3. import 'package:namer_app/header.dart';
  4. import '../service/addmember_serv.dart';
  5. class AddMemberPage extends StatelessWidget {
  6. final int projId;
  7. const AddMemberPage({super.key, required this.projId});
  8. @override
  9. Widget build(BuildContext context) {
  10. // var projId = TextEditingController();
  11. var userId = TextEditingController();
  12. var role = TextEditingController();
  13. return Scaffold(
  14. appBar: CustomAppbar(),
  15. backgroundColor: Colors.white,
  16. body: Column(
  17. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  18. children: [
  19. Center(
  20. child: Row(
  21. mainAxisAlignment: MainAxisAlignment.center,
  22. children: [
  23. Text(
  24. 'ADD MEMBER',
  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: TextField(
  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 Project ID', //todo get data
  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: projId,
  51. // ),
  52. // ),
  53. // ),
  54. Padding(
  55. padding: const EdgeInsets.all(8.0),
  56. child: SizedBox(
  57. width: 396,
  58. child: TextField(
  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 User ID', //todo get data
  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: userId,
  74. ),
  75. ),
  76. ),
  77. Padding(
  78. padding: const EdgeInsets.all(8.0),
  79. child: SizedBox(
  80. width: 396,
  81. child: TextField(
  82. decoration: InputDecoration(
  83. border: OutlineInputBorder(),
  84. focusedBorder: OutlineInputBorder(
  85. borderRadius: BorderRadius.all(Radius.circular(12)),
  86. borderSide: BorderSide(color: Colors.black)),
  87. enabledBorder: OutlineInputBorder(
  88. borderRadius: BorderRadius.all(Radius.circular(12)),
  89. borderSide: BorderSide(color: Colors.black)),
  90. labelText: 'Enter Role', //todo get data
  91. labelStyle: TextStyle(color: Colors.black),
  92. filled: true,
  93. fillColor: Colors.white.withOpacity(0.25)),
  94. cursorColor: Colors.black,
  95. style: TextStyle(color: Colors.black),
  96. controller: role,
  97. ),
  98. ),
  99. ),
  100. Padding(
  101. padding: const EdgeInsets.all(20.0),
  102. child: SizedBox(
  103. width: 396,
  104. height: 61,
  105. child: ElevatedButton(
  106. onPressed: () => addmember(context, projId, int.parse(userId.text), role.text),
  107. style: ElevatedButton.styleFrom(
  108. backgroundColor: Colors.black, //todo putih lage
  109. side: BorderSide(color: Colors.white),
  110. shape: RoundedRectangleBorder(
  111. borderRadius: BorderRadius.circular(12.0),
  112. ),
  113. ),
  114. child: Text(
  115. 'Save',
  116. style: TextStyle(color: Colors.white),
  117. ),
  118. ),
  119. ),
  120. ),
  121. ],
  122. ),
  123. ],
  124. ),
  125. bottomNavigationBar: Footer(),
  126. );
  127. }
  128. }