A flutter plugin to get the initial letters of full name.


This plugin returns initial letters of the full name with customizable background, so it can be useful while creating contacts or chat application.

How to use

To use this plugin, add sp_initials as a dependency in your pubspec.yaml file.

# add this line in your dependencies
sp_initials: ^0.0.1
// import this package in your dart file
import 'package:sp_initials/sp_initials.dart';


Text(SpInitials.getInitials('Shankar Pariyar')),
child: SpInitials.getInitialsWithShape(context: context, fullName: 'Shankar Pariyar'),
contextPass context of ancestor widget (required)required
fullNameString, full name to get initial letters(required)required
radiusradius of bakground shape (when font size is changed, radius of background shape is changed accordingly)30.0
isCircleif true, creates circle shapefalse
borderRadiusfor rectangle with rounded border (isCircle must be false)null
borderWidthshape outline/border (when borderColor is set, default borderWidth = 1.0)null
borderColorshape outline/border color (when borderWidth is set, default borderColor = primaryColor)null
backgroundColorshape background colorprimaryColor
fontSizeinitial letters' font size (when font size is changed, radius of background shape is changed accordingly)14.0
fontWeightto change the font weightnormal
fontColorto change the font colorblack
fontFamilyto change the font familyandroid: Roboto, iOS: San Francisco
letterSpacingto provide space between initial letters (+ve value to increase space, -ve value to decrease space)0.0

Preview Images