Search packages, repositories and app categories

Package detailsv4.1.0

recase

Changes the case of the input text to the desire case convention.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
2.7M
Likes
370
Pub points
150

Install package

flutter pub add recase

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

ReCase is a Dart package that transforms text into various case conventions such as camelCase, PascalCase, snake_case, kebab-case, and more. It provides simple methods to convert strings between different naming formats, making it ideal for formatting identifiers, file names, or API responses. The package supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, ensuring consistent behavior across environments. With minimal setup via `flutter pub add recase`, developers can easily integrate case conversion utilities into their projects.

Use cases

  • Formatting API response keys
  • Generating file names from user input
  • Converting between naming conventions in code
  • Standardizing string formats in UI components
  • Creating dynamic variable names
  • Preparing data for serialization

Key features

  • Supports multiple case formats
  • Simple and intuitive API
  • Cross-platform compatibility
  • Extensible for custom cases
  • Lightweight and fast
  • No external dependencies

Suitable for

  • Flutter developers needing string formatting
  • Backend integrations with varied naming styles
  • Code generation tools
  • Data transformation pipelines
  • Projects requiring consistent naming conventions

Considerations

  • Does not handle complex linguistic rules
  • Limited to basic case transformations
  • May require additional validation for edge cases
  • Not suitable for full natural language processing
  • Assumes input is valid text
  • No built-in support for locale-specific casing

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

ReCase

Changes the case of the input text to the desire case convention.

import 'package:recase/recase.dart';

void main() {
  ReCase rc = new ReCase('Just_someSample-text');

  print(rc.camelCase); // Prints 'justSomeSampleText'
  print(rc.constantCase); // Prints 'JUST_SOME_SAMPLE_TEXT'
}

String extensions are also available.

import 'package:recase/recase.dart';

void main() {
  String sample = 'Just_someSample-text';

  print(sample.camelCase); // Prints 'justSomeSampleText'
  print(sample.constantCase); // Prints 'JUST_SOME_SAMPLE_TEXT'
}

This feature is available in version 3.0.0, and requires at least Dart 2.6

Supports:

  • snake_case
  • dot.case
  • path/case
  • param-case
  • PascalCase
  • Header-Case
  • Title Case
  • camelCase
  • Sentence case
  • CONSTANT_CASE

Categories

Source repository

Projects using this package