drop_cap_text 1.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • new51

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,
),

[0.0.1] TODO

  • fix text junction with textStyle: justify

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  drop_cap_text: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:drop_cap_text/drop_cap_text.dart';
  
Version Uploaded Documentation Archive
1.0.1 Mar 2, 2019 Go to the documentation of drop_cap_text 1.0.1 Download drop_cap_text 1.0.1 archive
1.0.0 Mar 2, 2019 Go to the documentation of drop_cap_text 1.0.0 Download drop_cap_text 1.0.0 archive
0.0.1 Mar 2, 2019 Go to the documentation of drop_cap_text 0.0.1 Download drop_cap_text 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
7
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
51
Learn more about scoring.

We analyzed this package on Mar 6, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.3.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/drop_cap_text.dart. (-1.49 points)

Analysis of lib/drop_cap_text.dart reported 3 hints:

line 31 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: DropCapText.dropCapChars

line 130 col 11: The value of the local variable 'totMillis' isn't used.

line 179 col 3: The method '_buildBaseline' isn't used.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and drop_cap_text.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test