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.

Libraries

color_generator
i18n
text_drawable_widget

Dart

dart:ui
Built-in types and core primitives for a Flutter application. [...]

Core

dart:async
Support for asynchronous programming, with classes such as Future and Stream. [...]
dart:collection
Classes and utilities that supplement the collection support in dart:core. [...]
dart:convert
Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
dart:core
Built-in types, collections, and other core functionality for every Dart program. [...]
dart:developer
Interact with developer tools such as the debugger and inspector. [...]
dart:math
Mathematical constants and functions, plus a random number generator. [...]
dart:typed_data
Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]

VM

dart:io
File, socket, HTTP, and other I/O support for non-web applications. [...]
dart:isolate
Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]