flutter_initials 1.0.1 copy "flutter_initials: ^1.0.1" to clipboard
flutter_initials: ^1.0.1 copied to clipboard

A Package for generating initials from names.

Here's a clean and professional README.md file for your flutter_initials package:


# flutter_initials

A lightweight Dart utility for extracting initials from a full name, designed for use in Flutter apps. Perfect for generating avatars, short representations of names, or tags.

## Features

- Extracts the first letter of each word in a name
- Converts to uppercase
- Preserves numbers if found in words
- Trims special characters
- Limits output to 4 characters max

## Installation

Add the following to your `pubspec.yaml`:

```yaml
dependencies:
  flutter_initials: ^1.0.0
```

Then run:

flutter pub get

Usage #

Import the package:

import 'package:flutter_initials/flutter_initials.dart';

Use the utility:

String initials = FlutterInitials.getInitials("John Doe");
print(initials); // Output: JD

Examples #

Input Output Explanation
"John Doe" JD First letters of first and last name
"Mary-Kate Olsen" MK Hyphen removed, initials from both words
"Élodie Yung" EY Special characters removed
"Agent 47" A47 Numbers preserved
"Albus Percival Wulfric Brian Dumbledore" APWB Max 4 initials
" jack o'neill " JO Extra spaces and special characters cleaned

Contributing #

Feel free to open issues or submit pull requests for improvements or new features.

License #

MIT License


---

Let me know if you'd like help publishing to pub.dev or adding additional badges (e.g. build status, version, likes).
3
likes
0
points
20
downloads

Publisher

unverified uploader

Weekly Downloads

A Package for generating initials from names.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on flutter_initials