Skip to content

Commit

Permalink
fix: chaning onChange in DurationInMonthsWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
LynxLynxx committed Jan 29, 2025
1 parent bcd38d1 commit c0c595a
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DurationInMonthsWidget extends StatefulWidget {
final DocumentValueProperty<int> property;
final DocumentDurationInMonthsSchema schema;
final bool isEditMode;
final ValueChanged<DocumentChange> onChanged;
final ValueChanged<List<DocumentChange>> onChanged;

const DurationInMonthsWidget({
super.key,
Expand Down Expand Up @@ -70,10 +70,7 @@ class _DurationInMonthsWidgetState extends State<DurationInMonthsWidget> {
if (_title.isNotEmpty) ...[
Text(
_title,
style: Theme
.of(context)
.textTheme
.titleSmall,
style: Theme.of(context).textTheme.titleSmall,
),
const SizedBox(height: 8),
SingleSelectDropdown(
Expand Down Expand Up @@ -105,10 +102,12 @@ class _DurationInMonthsWidgetState extends State<DurationInMonthsWidget> {

void _notifyChangeListener(int? value) {
widget.onChanged(
DocumentValueChange(
nodeId: widget.schema.nodeId,
value: value,
),
[
DocumentValueChange(
nodeId: widget.schema.nodeId,
value: value,
),
],
);
}

Expand Down

0 comments on commit c0c595a

Please sign in to comment.