addcomment.dart 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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/addcomment_serv.dart';
  5. class AddCommentPage extends StatelessWidget {
  6. final int bugId;
  7. const AddCommentPage({super.key, required this.bugId});
  8. @override
  9. Widget build(BuildContext context) {
  10. // var bugId = TextEditingController();
  11. var content = TextEditingController();
  12. return Scaffold(
  13. appBar: CustomAppbar(),
  14. backgroundColor: Colors.white,
  15. body: Stack(children: [
  16. SingleChildScrollView(
  17. child: Column(
  18. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  19. children: [
  20. Center(
  21. child: Row(
  22. mainAxisAlignment: MainAxisAlignment.center,
  23. children: [
  24. Text(
  25. 'ADD COMMENT',
  26. style: TextStyle(color: Colors.black, fontSize: 48),
  27. ),
  28. ],
  29. )),
  30. Column(
  31. children: [
  32. // Padding(
  33. // padding: const EdgeInsets.all(8.0),
  34. // child: SizedBox(
  35. // width: 396,
  36. // child: TextField(
  37. // decoration: InputDecoration(
  38. // border: OutlineInputBorder(),
  39. // focusedBorder: OutlineInputBorder(
  40. // borderRadius:
  41. // BorderRadius.all(Radius.circular(12)),
  42. // borderSide: BorderSide(color: Colors.black)),
  43. // enabledBorder: OutlineInputBorder(
  44. // borderRadius:
  45. // BorderRadius.all(Radius.circular(12)),
  46. // borderSide: BorderSide(color: Colors.black)),
  47. // labelText: 'Enter Description',
  48. // labelStyle: TextStyle(color: Colors.black),
  49. // filled: true,
  50. // fillColor: Colors.white.withOpacity(0.25)),
  51. // cursorColor: Colors.black,
  52. // style: TextStyle(color: Colors.black),
  53. // controller: bugId,
  54. // ),
  55. // ),
  56. // ),
  57. Padding(
  58. padding: const EdgeInsets.all(8.0),
  59. child: SizedBox(
  60. width: 396,
  61. child: TextField(
  62. decoration: InputDecoration(
  63. border: OutlineInputBorder(),
  64. focusedBorder: OutlineInputBorder(
  65. borderRadius:
  66. BorderRadius.all(Radius.circular(12)),
  67. borderSide: BorderSide(color: Colors.black)),
  68. enabledBorder: OutlineInputBorder(
  69. borderRadius:
  70. BorderRadius.all(Radius.circular(12)),
  71. borderSide: BorderSide(color: Colors.black)),
  72. labelText: 'Enter Content', //todo get data
  73. labelStyle: TextStyle(color: Colors.black),
  74. filled: true,
  75. fillColor: Colors.white.withOpacity(0.25)),
  76. cursorColor: Colors.black,
  77. style: TextStyle(color: Colors.black),
  78. controller: content,
  79. ),
  80. ),
  81. ),
  82. Padding(
  83. padding: const EdgeInsets.all(20.0),
  84. child: SizedBox(
  85. width: 396,
  86. height: 61,
  87. child: ElevatedButton(
  88. onPressed: () => addcomment(context, bugId, content.text), //todo save edit
  89. style: ElevatedButton.styleFrom(
  90. backgroundColor: Colors.black,
  91. side: BorderSide(color: Colors.white),
  92. shape: RoundedRectangleBorder(
  93. borderRadius: BorderRadius.circular(12.0),
  94. ),
  95. ),
  96. child: Text(
  97. 'Save',
  98. style: TextStyle(color: Colors.white),
  99. ),
  100. ),
  101. ),
  102. ),
  103. ],
  104. ),
  105. ],
  106. ),
  107. ),
  108. ]),
  109. bottomNavigationBar: Footer(),
  110. );
  111. }
  112. }