Skip to content

This light-weight library provides images with letter/text like the Gmail app or like android contact apps for Flutter. It is a widget and can be used anywhere. Also included is a fluent interface for creating the widget and a customizable Color Generator.

License

Notifications You must be signed in to change notification settings

pranayairan/TextDrawableWidget

Repository files navigation

text_drawable_widget

This light-weight library provides images with letter/text like the Gmail or Android contact apps

Pub Package Can Be Found At

Pub Package

Usage

Text Drawable Widget support 2 types of mode, 1 is the default mode and other is more customizable advance mode.

Default Mode

To use default mode, import the text drawable widget file in your project and add following line

 TextDrawableWidget(data, ColorGenerator.materialColors, (bool selected) {
                  // on tap callback
                }),

This will add the text drawable widget, with default size, colors and fonts. Default size is 60 * 60 with a text style of size 28 and color white.

Customizable Mode

You can customize everything in text drawable widget. From fonts to size of the widget. Here are options that you can customized.

  • Width and height of widget.
  • If widget is tapable or not. With this option you can disable the tap behavior.
  • Shape of widget, currently we support Circle and rounded corner Square.
  • Text Style, you can customized the text style with any color, fonts, size of your choice.

Example with full customization :

TextDrawableWidget(data, ColorGenerator.materialColors, (bool selected) {
                  // on tap callback
                  print("on tap callback");
                }, true, 60.0, 60.0, BoxShape.rectangle,TextStyle(color: Colors.black, fontSize: 28.0))

Built in Color generator

By default this library ships with 2 sets of colors, material color and default color. But you can customize the color list and give any colors of your choice. To give a different color, use the following code ColorGenerator.create(colorList). It takes List

You can mix and match the default and customizable mode, check the example project.

About

This light-weight library provides images with letter/text like the Gmail app or like android contact apps for Flutter. It is a widget and can be used anywhere. Also included is a fluent interface for creating the widget and a customizable Color Generator.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published