Skip to content

Commit

Permalink
feat: [DX-983] Update OptimusDateTimeField signature
Browse files Browse the repository at this point in the history
  • Loading branch information
witwash committed Jan 16, 2024
1 parent 0ac87c8 commit 337f17c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions optimus/lib/src/date_time_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class OptimusDateTimeField extends StatefulWidget {
required this.formatDateTime,
this.isClearEnabled = false,
this.placeholder,
this.isEnabled = true,
});

final DateTime? value;
Expand All @@ -27,6 +28,7 @@ class OptimusDateTimeField extends StatefulWidget {
final String? error;
final bool isClearEnabled;
final String? placeholder;
final bool isEnabled;

@override
State<OptimusDateTimeField> createState() => _OptimusDateTimeFieldState();
Expand Down Expand Up @@ -93,6 +95,7 @@ class _OptimusDateTimeFieldState extends State<OptimusDateTimeField>
error: widget.error,
label: widget.label,
isClearEnabled: _isClearVisible,
isEnabled: widget.isEnabled,
trailing: GestureDetector(
onTap: _handleTap,
child: Icon(
Expand Down
1 change: 1 addition & 0 deletions storybook/lib/stories/date_time_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class _ContentState extends State<_Content> {
label: widget.k.text(label: 'Label', initial: 'Date'),
error: widget.k.text(label: 'Error', initial: ''),
placeholder: widget.k.text(label: 'Placeholder', initial: ''),
isEnabled: widget.k.boolean(label: 'Enabled', initial: true),
formatDateTime: (d) {
final am = d.hour < 12 ? 'AM' : 'PM';
final hours = d.hour % 12;
Expand Down

0 comments on commit 337f17c

Please sign in to comment.