Skip to content

Commit 70fffdc

Browse files
committed
v6.16.0
1 parent de840ec commit 70fffdc

File tree

3 files changed

+77
-1
lines changed

3 files changed

+77
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [6.16.0] - 2025-01-16
2+
3+
* Add `Field.capitalizeSentences` and `Field.capitalizeWords`
4+
15
## [6.15.0] - 2025-01-12
26

37
* Make `updatePageState` public

lib/widgets/ny_form.dart

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,78 @@ class Field {
431431
}
432432
}
433433

434+
/// Field.capitalizeWords is a constructor that helps in managing capitalizeWords fields
435+
Field.capitalizeWords(
436+
this.key, {
437+
this.value,
438+
this.validate,
439+
this.autofocus = false,
440+
this.dummyData,
441+
this.header,
442+
this.footer,
443+
this.titleStyle,
444+
this.style,
445+
this.metaData = const {},
446+
this.hidden = false,
447+
Widget? prefixIcon,
448+
bool clearable = false,
449+
Widget? clearIcon,
450+
}) : cast = FormCast.capitalizeWords(
451+
prefixIcon: prefixIcon,
452+
clearable: clearable,
453+
clearIcon: clearIcon,
454+
) {
455+
if (style == null) return;
456+
457+
metaData = {};
458+
if (style is String) {
459+
style = style;
460+
return;
461+
}
462+
if (style is Map) {
463+
style as Map<String, dynamic>;
464+
metaData!["decoration_style"] =
465+
(style as Map<String, dynamic>).entries.first.value;
466+
style = (style as Map<String, dynamic>).entries.first.key;
467+
}
468+
}
469+
470+
/// Field.capitalizeSentences is a constructor that helps in managing capitalizeSentences fields
471+
Field.capitalizeSentences(
472+
this.key, {
473+
this.value,
474+
this.validate,
475+
this.autofocus = false,
476+
this.dummyData,
477+
this.header,
478+
this.footer,
479+
this.titleStyle,
480+
this.style,
481+
this.metaData = const {},
482+
this.hidden = false,
483+
Widget? prefixIcon,
484+
bool clearable = false,
485+
Widget? clearIcon,
486+
}) : cast = FormCast.capitalizeSentences(
487+
prefixIcon: prefixIcon,
488+
clearable: clearable,
489+
clearIcon: clearIcon,
490+
) {
491+
if (style == null) return;
492+
493+
metaData = {};
494+
if (style is String) {
495+
style = style;
496+
return;
497+
}
498+
if (style is Map) {
499+
style as Map<String, dynamic>;
500+
metaData!["decoration_style"] =
501+
(style as Map<String, dynamic>).entries.first.value;
502+
style = (style as Map<String, dynamic>).entries.first.key;
503+
}
504+
}
505+
434506
/// Field.picker is a constructor that helps in managing picker fields
435507
Field.picker(
436508
this.key, {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nylo_support
22
description: Support library for the Nylo framework. This library supports routing, widgets, localization, cli, storage and more.
3-
version: 6.15.0
3+
version: 6.16.0
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/support/tree/6.x
66
issue_tracker: https://github.com/nylo-core/support/issues

0 commit comments

Comments
 (0)