Skip to content

Commit

Permalink
v6.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Jan 16, 2025
1 parent de840ec commit 70fffdc
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [6.16.0] - 2025-01-16

* Add `Field.capitalizeSentences` and `Field.capitalizeWords`

## [6.15.0] - 2025-01-12

* Make `updatePageState` public
Expand Down
72 changes: 72 additions & 0 deletions lib/widgets/ny_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,78 @@ class Field {
}
}

/// Field.capitalizeWords is a constructor that helps in managing capitalizeWords fields
Field.capitalizeWords(
this.key, {
this.value,
this.validate,
this.autofocus = false,
this.dummyData,
this.header,
this.footer,
this.titleStyle,
this.style,
this.metaData = const {},
this.hidden = false,
Widget? prefixIcon,
bool clearable = false,
Widget? clearIcon,
}) : cast = FormCast.capitalizeWords(
prefixIcon: prefixIcon,
clearable: clearable,
clearIcon: clearIcon,
) {
if (style == null) return;

metaData = {};
if (style is String) {
style = style;
return;
}
if (style is Map) {
style as Map<String, dynamic>;
metaData!["decoration_style"] =
(style as Map<String, dynamic>).entries.first.value;
style = (style as Map<String, dynamic>).entries.first.key;
}
}

/// Field.capitalizeSentences is a constructor that helps in managing capitalizeSentences fields
Field.capitalizeSentences(
this.key, {
this.value,
this.validate,
this.autofocus = false,
this.dummyData,
this.header,
this.footer,
this.titleStyle,
this.style,
this.metaData = const {},
this.hidden = false,
Widget? prefixIcon,
bool clearable = false,
Widget? clearIcon,
}) : cast = FormCast.capitalizeSentences(
prefixIcon: prefixIcon,
clearable: clearable,
clearIcon: clearIcon,
) {
if (style == null) return;

metaData = {};
if (style is String) {
style = style;
return;
}
if (style is Map) {
style as Map<String, dynamic>;
metaData!["decoration_style"] =
(style as Map<String, dynamic>).entries.first.value;
style = (style as Map<String, dynamic>).entries.first.key;
}
}

/// Field.picker is a constructor that helps in managing picker fields
Field.picker(
this.key, {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: nylo_support
description: Support library for the Nylo framework. This library supports routing, widgets, localization, cli, storage and more.
version: 6.15.0
version: 6.16.0
homepage: https://nylo.dev
repository: https://github.com/nylo-core/support/tree/6.x
issue_tracker: https://github.com/nylo-core/support/issues
Expand Down

0 comments on commit 70fffdc

Please sign in to comment.