6/15/1
This commit is contained in:
64
lib/views/home/profile/complaint_page.dart
Normal file
64
lib/views/home/profile/complaint_page.dart
Normal file
@@ -0,0 +1,64 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../controller/home/profile/feed_back_controller.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
|
||||
class ComplaintPage extends StatelessWidget {
|
||||
// Rename class
|
||||
ComplaintPage({super.key});
|
||||
ComplaintController complaintController =
|
||||
Get.put(ComplaintController()); // Update controller instance
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Complaint'.tr,
|
||||
body: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(26),
|
||||
child: Form(
|
||||
key: complaintController.formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: complaintController.complaintController,
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
hintText: 'Enter your complaint here'.tr,
|
||||
labelText: 'Complaint', // Update label
|
||||
),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Please enter your complaint.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
complaintController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: MyElevatedButton(
|
||||
onPressed: () {
|
||||
if (complaintController.formKey.currentState!
|
||||
.validate()) {
|
||||
complaintController
|
||||
.addComplaint(); // Update method name
|
||||
|
||||
// Clear the complaint form
|
||||
complaintController.formKey.currentState!.reset();
|
||||
}
|
||||
},
|
||||
title: 'Submit '.tr,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user