Skip to content

Commit 8ea795c

Browse files
committed
fix(analytics): allow null unit in MixpanelSegmentationRequest
- Make unit parameter optional in MixpanelSegmentationRequest class - Update props getter to handle nullable unit - Adjust toJson method to accommodate nullable unit value
1 parent 12c9a99 commit 8ea795c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/models/analytics/mixpanel_request.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MixpanelSegmentationRequest extends Equatable {
2929
required this.event,
3030
required this.fromDate,
3131
required this.toDate,
32-
this.unit = MixpanelTimeUnit.day,
32+
this.unit,
3333
});
3434

3535
/// Creates a [MixpanelSegmentationRequest] from a JSON object.
@@ -49,13 +49,13 @@ class MixpanelSegmentationRequest extends Equatable {
4949
final String toDate;
5050

5151
/// The time unit for segmentation (e.g., 'day', 'week').
52-
final MixpanelTimeUnit unit;
52+
final MixpanelTimeUnit? unit;
5353

5454
/// Converts this instance to a JSON map for query parameters.
5555
Map<String, dynamic> toJson() => _$MixpanelSegmentationRequestToJson(this);
5656

5757
@override
58-
List<Object> get props => [projectId, event, fromDate, toDate, unit];
58+
List<Object?> get props => [projectId, event, fromDate, toDate, unit];
5959
}
6060

6161
/// {@template mixpanel_top_events_request}

0 commit comments

Comments
 (0)