Ticket change over - #117
Conversation
# Conflicts: # lib/l10n/app_en.arb # lib/l10n/app_fr.arb # lib/l10n/app_localizations.dart # lib/l10n/app_localizations_en.dart # lib/l10n/app_localizations_fr.dart
fa032a1 to
1053640
Compare
| // ── Edit Questions Section ────────────────────────────────────────────────── | ||
| void _updateTicketEventState(WidgetRef ref, TicketEvent updated) { | ||
| ref.read(ticketEventByIdProvider(updated.id).notifier).setEvent(updated); | ||
| ref.read(selectedTicketEventProvider.notifier).state = updated; |
There was a problem hiding this comment.
ticketEventByIdProvider(id) — cached event data for the edit screen
selectedTicketEventProvider — “which event did the user pick?”
After an edit (session/category/question change, etc.), onEventUpdated calls this helper to keep both copies aligned
There was a problem hiding this comment.
OK, but why updating the state instead of having a dedicated function
| final dateFormatter = DateFormat('dd/MM/yyyy HH:mm', locale.toString()); | ||
| final editNotifier = ref.read(ticketEventEditProvider.notifier); | ||
|
|
||
| final titleController = TextEditingController(text: event.name); |
There was a problem hiding this comment.
Use useTextEditingController to auto dispose
There was a problem hiding this comment.
No — not in that spot. useTextEditingController only works inside a HookWidget’s build method (or a custom hook called from there). Lines 388–389 sit in _showGeneralInfoEditDialog, a top-level async function, so hooks aren’t valid there.
There was a problem hiding this comment.
Why is this widget not a hookwidget then ?
| ), | ||
| ); | ||
| }), | ||
| OutlinedButton.icon( |
| final editNotifier = ref.read(ticketEventEditProvider.notifier); | ||
|
|
||
| final textController = TextEditingController(text: question.question); | ||
| final priceController = TextEditingController( |
| body: body != null ? jsonEncode(body) : null, | ||
| ); | ||
| if (response.statusCode == 204) { | ||
| if (response.statusCode == 204 || response.statusCode == 200) { |
There was a problem hiding this comment.
Hm, for which endpoint, should be a back change imo
Description
Summary
...
Issues/PR dependencies
Issues to be resolved
Required PRs
Changes Made
Additional Notes
Classification
Type of Change
Impact & Scope
Testing
Documentation
//Comments