Search packages, repositories and app categories

Package detailsv2.0.0

slugify

Converts a string into a slug. Useful for URLs, filenames, IDs, and more.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
85.8K
Likes
50
Pub points
135

Install package

flutter pub add slugify

Package Overview

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

A Dart package that converts strings into URL-friendly slugs by removing special characters, spaces, and accents, then normalizing the result. Ideal for generating clean identifiers for URLs, filenames, database IDs, and other use cases requiring standardized text. The package supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, ensuring consistent behavior across environments. It is lightweight and easy to integrate via Flutter's pub package manager.

Use cases

  • Generating SEO-friendly URLs
  • Creating file names from titles
  • Producing unique IDs
  • Normalizing user input
  • Building navigation paths
  • Simplifying data storage keys

Key features

  • Removes special characters and accents
  • Converts spaces to hyphens
  • Supports international characters
  • Case normalization
  • Extensible customization options
  • Cross-platform compatibility

Suitable for

  • Web and mobile app developers
  • Content management systems
  • Static site generators
  • API backend services
  • User-facing form inputs
  • Data processing pipelines

Considerations

  • May require manual handling of duplicates
  • Does not guarantee uniqueness on its own
  • Limited to string transformation
  • No built-in sanitization beyond slugification
  • Depends on external library for advanced features
  • Not suitable for cryptographic hashing

Original README

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

slugify

Converts any String to a slug. Useful for URLs, filenames, IDs, and more.

Features

  • Multi-language support
  • Removes unfriendly characters
  • Approximates replacements for characters not in the Latin alphabet
  • Configurable options
  • Null safe with Dart 2.12

Usage

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
Options
Name Type Default Description
delimiter String "-" Separator between words
lowercase bool true Convert text to lowercase

Categories

Source repository

Projects using this package