feedback changes done

This commit is contained in:
priyanka
2024-04-12 04:29:26 -07:00
parent de46155aa2
commit de96235fb0

View File

@@ -25,6 +25,7 @@ class _FeedBackState extends State<FeedBack> {
RxBool active = false.obs;
RxBool active1 = false.obs;
final TextEditingController _textarea = TextEditingController();
@override
void initState() {
@@ -33,6 +34,7 @@ class _FeedBackState extends State<FeedBack> {
if (getFeedback!.result != null && getFeedback!.result!.isNotEmpty) {
int lastIndex = getFeedback!.result!.length - 1;
reaction = getFeedback!.result![lastIndex].reaction;
message = getFeedback!.result![lastIndex].message;
if (reaction == 0) {
active.value = true;
@@ -42,6 +44,7 @@ class _FeedBackState extends State<FeedBack> {
active1.value = true;
}
}
_textarea.text = message!;
super.initState();
}
@@ -57,10 +60,11 @@ class _FeedBackState extends State<FeedBack> {
// RxBool feedActive = true.obs;
GlobalKey<FormState> _formkey = GlobalKey<FormState>();
final TextEditingController _textarea = TextEditingController();
// RxString getapidata = ''.obs;
// RxString getapidata2 = ''.obs;
_feedbackbutton() async {
// FocusScope.of(context).unfocus();
if (!active.value && !active1.value) {
print("Please select a smile container before submitting.");
Flushbar(
@@ -88,6 +92,7 @@ class _FeedBackState extends State<FeedBack> {
final resp = await FeedbackServices().feedbackApi(updata);
if (resp.status == ResponseStatus.SUCCESS) {
// btnController.reset();
Get.to(() => Home());
print('data---$data');
Flushbar(
@@ -193,9 +198,7 @@ class _FeedBackState extends State<FeedBack> {
maxLines: 12,
decoration: InputDecoration(
fillColor: const Color(0xff212121),
hintText: getFeedback!.result!.isNotEmpty
? message
: "Type your feedback...",
hintText: "Type your feedback...",
contentPadding: const EdgeInsets.only(
top: 20,
bottom: 20,
@@ -278,7 +281,8 @@ class _FeedBackState extends State<FeedBack> {
),
// const Spacer(),
InkWell(
onTap: () {
onTap: () async {
FocusScope.of(context).unfocus();
_feedbackbutton();
},
child: Container(