From c82e8bbb0c91929c3581b2c0dde1f17ba95cf601 Mon Sep 17 00:00:00 2001 From: Tien Do Nam <38380847+Tienisto@users.noreply.github.com> Date: Fri, 1 Mar 2024 22:03:09 +0100 Subject: [PATCH] Add CaseStyle.upperSnakeCase Adds the "upper snake case" (commonly known as `CONSTANT_CASE` or `SCREAMING_SNAKE_CASE` in Rust). It is commonly used within the JVM ecosystem. --- packages/dart_mappable/lib/src/case_style.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/dart_mappable/lib/src/case_style.dart b/packages/dart_mappable/lib/src/case_style.dart index 02079b44..4a395296 100644 --- a/packages/dart_mappable/lib/src/case_style.dart +++ b/packages/dart_mappable/lib/src/case_style.dart @@ -89,6 +89,9 @@ class CaseStyle { /// Transforms to 'FIELDNAME' static const upperCase = CaseStyle(tail: TextTransform.upperCase); + + /// Transforms to 'FIELD_NAME' + static const upperSnakeCase = CaseStyle(tail: TextTransform.upperCase, separator: '_'); } extension CaseStyleTransform on CaseStyle? {