pub package Awesome

This Flutter plugin aims to achive drop cap in text capitalization.

Usage

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

dependencies:
  drop_cap_text: ^1.0.1
import 'package:drop_cap_text/drop_cap_text.dart';
DropCapText(
    loremIpsumText,
    style: TextStyle(fontStyle: FontStyle.italic),
),

ex1

Properties

NameTypeDefaultDescription
dataStringnull
modeDropCapModeDropCapMode.inside
textAlignTextAlignnull
indentationOffsetOffset.zero
dropCapCharsint1
dropCapPaddingEdgeInsetsEdgeInsets.zero
dropCapDropCap [Widget]null
styleTextStylenull
dropCapStyleTextStyle( ... height: 0.8 ... )

Customization

Custom DropCap Widget: Image

ex3

DropCapText(
    loremIpsumText,
    dropCap: DropCap(
    width: 100,
    height: 100,
    child: Image.network(
    	'https://www.codemate.com/wp-content/uploads/2017/09/flutter-logo.png')
    ),
),

2 characters + indentation

ex2

DropCapText(
    loremIpsumText,
    style: TextStyle(
        height: 1.3,
        fontFamily: 'times',
    ),
    dropCapChars: 2,
    indentation: Offset(25, 10),
),

Upward drop cap

ex5

DropCapText(
    loremIpsumText,
    mode: DropCapMode.upwards,
    dropCapStyle: TextStyle(
        color: Colors.red,
        fontWeight: FontWeight.bold,
        fontSize: 120,
        fontFamily: 'times',
    ),
),

Left drop cap

ex6

DropCapText(
    loremIpsumText,
    style: TextStyle(
        fontWeight: FontWeight.bold,
        height: 1.2,
    ),
    mode: DropCapMode.left,
),

Libraries

drop_cap_text