Skip to content

Commit

Permalink
Merge pull request #246 from CosmicRaptor/main
Browse files Browse the repository at this point in the history
fixed bug report screen image not clearing
  • Loading branch information
CosmicRaptor authored Jul 28, 2024
2 parents d02e924 + f206534 commit 07334bd
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/new_ui/screens/bug_report_screen/bug_report_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class _BugReportScreenState extends ConsumerState<BugReportScreen> {

@override
Widget build(BuildContext context) {
bool iseEnabled = false;
return Scaffold(
appBar: AppBar(shadowColor: Colors.transparent,
backgroundColor: Colors.transparent,
Expand Down Expand Up @@ -59,7 +60,8 @@ class _BugReportScreenState extends ConsumerState<BugReportScreen> {
const SizedBox(height: 20),
// Add the form here
TextFormField(
//maxLines: 3,
maxLines: 1,
readOnly: iseEnabled,
minLines: 1,
decoration: const InputDecoration(
hintText: 'Bug title',
Expand All @@ -80,6 +82,7 @@ class _BugReportScreenState extends ConsumerState<BugReportScreen> {
),
const SizedBox(height: 20),
TextFormField(
readOnly: iseEnabled,
maxLines: null,
minLines: 1,
decoration: const InputDecoration(
Expand Down Expand Up @@ -141,10 +144,14 @@ class _BugReportScreenState extends ConsumerState<BugReportScreen> {
}
else {
showSnackBar(context, 'Submitting...');
await ref.read(bugreportNotifierProvider.notifier).addBugreport(titleController.text, descriptionController.text, images, ref.read(firebaseAuthProvider).currentUser!.uid);
titleController.clear();
descriptionController.clear();
images.clear();
setState(() {
iseEnabled = true;
images.clear();

});
await ref.read(bugreportNotifierProvider.notifier).addBugreport(titleController.text, descriptionController.text, images, ref.read(firebaseAuthProvider).currentUser!.uid);
showSnackBar(context, 'Submitted successfully'); }
}, color: Colors.green, child: Text('Submit'),),
],
Expand Down

0 comments on commit 07334bd

Please sign in to comment.