v2.0.0
slugify
Converts a string into a slug. Useful for URLs, filenames, IDs, and more.
50Likes 70.3K30-day downloads135Pub points
AndroidiOSWebmacOSWindowsLinux
Converts a string to a slug, useful for URLs, filenames, IDs, and more
^1.16.4^1.0.0English project snapshot. Visit GitHub for the latest content.
Converts any String to a slug. Useful for URLs, filenames, IDs, and more.
import 'package:slugify/slugify.dart';
// Use with default options.
var slug = slugify('Hello, World! Foo Bar');
print(slug); // hello-world-foo-bar
// Use with custom options.
var slug2 = slugify('Hello, World! Foo Bar', lowercase: false, delimiter: '🙂');
print(slug2) // Hello🙂World🙂Foo🙂Bar
| Name | Type | Default | Description |
|---|---|---|---|
delimiter |
String |
"-" |
Separator between words |
lowercase |
bool |
true |
Convert text to lowercase |