dart_casing 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 66

dart_casing #

pub package

Dart library for changing String case style to the desired convention.

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  dart_casing: <latest version>

Usage #

import 'package:dart_casing/dart_casing.dart';

main()
{
  var text = "Lorem-ipsum_dolor\\SIT amet";

  print(Casing.camelCase(text));                   // loremIpsumDolorSitAmet
  print(Casing.pascalCase(text));                  // LoremIpsumDolorSitAmet
  print(Casing.titleCase(text));                   // Lorem Ipsum Dolor Sit Amet
  print(Casing.titleCase(text, separator: "_"));   // Lorem_Ipsum_Dolor_Sit_Amet
  print(Casing.snakeCase(text));                   // lorem_ipsum_dolor_sit_amet
  print(Casing.paramCase(text));                   // lorem-ipsum-dolor-sit-amet
  print(Casing.constantCase(text));                // LOREM_IPSUM_DOLOR_SIT_AMET
  print(Casing.lowerCase(text, separator: " "));   // lorem ipsum dolor sit amet
  print(Casing.upperCase(text, separator: " "));   // LOREM IPSUM DOLOR SIT AMET
}

Issues #

Please file any issues, bugs or feature request here.

License #

This project is licensed under the MIT License

Author #

This Dart package is developed by Florin Bratan. You can contact me at florin@leadcode.dev

1.0.0 #

  • Initial release

example/dart_casing_example.dart

import 'package:dart_casing/dart_casing.dart';

main()
{
  var text = "Lorem-ipsum_dolor\\SIT amet";

  print(Casing.camelCase(text));                  // loremIpsumDolorSitAmet
  print(Casing.pascalCase(text));                 // LoremIpsumDolorSitAmet
  print(Casing.titleCase(text));                  // Lorem Ipsum Dolor Sit Amet
  print(Casing.titleCase(text, separator: "_"));  // Lorem_Ipsum_Dolor_Sit_Amet
  print(Casing.snakeCase(text));                  // lorem_ipsum_dolor_sit_amet
  print(Casing.paramCase(text));                  // lorem-ipsum-dolor-sit-amet
  print(Casing.constantCase(text));               // LOREM_IPSUM_DOLOR_SIT_AMET
  print(Casing.lowerCase(text, separator: " "));  // lorem ipsum dolor sit amet
  print(Casing.upperCase(text, separator: " "));  // LOREM IPSUM DOLOR SIT AMET
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_casing: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_casing/dart_casing.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
40
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
66
Learn more about scoring.

We analyzed this package on Feb 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health issues and suggestions

Document public APIs. (-1 points)

17 out of 17 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/dart_casing.dart.

Run dartfmt to format lib/dart_casing.dart.

Format lib/input_processor.dart.

Run dartfmt to format lib/input_processor.dart.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://leadcode.dev was unreachable.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0