velvet_support 0.0.1-dev.6 velvet_support: ^0.0.1-dev.6 copied to clipboard
Provide support classes for the everyday work. Porting of some Laravel utilities to Dart.
Velvel Support - Example #
Str #
import 'package:velvet_support/velvet_support.dart';
void main() {
// Example of using the Str::camel method
print(Str.camel('hello_world')); // Output: helloWorld
// Example of using the Str::kebab method
print(Str.kebab('helloWorld')); // Output: hello-world
// Example of using the Str::snake method
print(Str.snake('helloWorld')); // Output: hello_world
// Example of using the Str::studly method
print(Str.studly('hello_world')); // Output: HelloWorld
// Example of using the Str::upper method
print(Str.upper('helloWorld')); // Output: HELLOWORLD
// Example of using the Str::lower method
print(Str.lower('helloWorld')); // Output: helloworld
}
Stringable #
import 'package:velvet_support/velvet_support.dart';
void main() {
var phrase = 'My name is: Daniele.';
var name = Str.of(phrase)
.after('My name is: ')
.before('.')
.toString(); // Output: Daniele
}