flutter_text_styled 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 68

flutter_text_styled #

A Flutter helper class to add tag-styled text into your widgets.

Features #

  • [X] [b][/b] bold text
  • [X] [i][/i] italics text
  • [X] [u][/u] underline text
  • [X] [color=NAME_OF_COLOR_OR_VALUE] [/color] Colored text
  • [ ] Hyperlinks
  • [ ] Text size

In current version [b][/b], [i][/i], [u][/u], [color=NAME_OF_COLOR_OR_VALUE] [/color] tags are allowed for bold, italic, underline and colored text style.

getStyledTextWidgets returns List<Text> widgets.

Color could be defined as name from colors.dart from material package or using int to parse by this class. See example.

List of supported colors:

  • "amber":
  • "amberAccent"
  • "black"
  • "black12"
  • "black26"
  • "black38"
  • "black45"
  • "black54"
  • "black87"
  • "blue"
  • "blueAccent"
  • "blueGrey"
  • "brown"
  • "cyan"
  • "cyanAccent"
  • "deepOrangeAccent"
  • "deepPurple"
  • "deepPurpleAccent"
  • "green"
  • "greenAccent";
  • "grey"
  • "indigo"
  • "indigoAccent"
  • "lightBlue"
  • "lightBlueAccent"
  • "lightGreen"
  • "lightGreenAccent"
  • "lime"
  • "limeAccent"
  • "orange"
  • "orangeAccent"
  • "pink"
  • "pinkAccent"
  • "purple"
  • "purpleAccent"
  • "pink"
  • "red"
  • "redAccent"
  • "teal"
  • "tealAccent"
  • "transparent"
  • "white"
  • "yellow"
  • "yellowAccent"

Questions or Feedback? #

Feel free to open an issue.

[0.2.0] - 11.03.2020 #

  • Added functionality [color=NAME_OF_COLOR_OR_VALUE] [/color] tags

[0.1.0] - 18.02.2020 #

  • Added functionality for [u][/u] and [i][/i] tags

[0.0.2] - 12.02.2020 #

  • Added example of usage

[0.0.1] - 12.02.2020 Initial release #

  • Added basic functionality for [b][/b] tags

example/Example.dart

import 'package:flutter/material.dart';
import 'package:flutter_text_styled/flutter_text_styled.dart';

class StyledPage extends StatefulWidget {
  @override
  _StyledPageState createState() => _StyledPageState();
}

class _StyledPageState extends State<StyledPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Title"),
      ),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: SingleChildScrollView(
          child: Wrap(
            children: TextStyled().getStyledTextWidgets(
                "This is normal text [color=blue]blue text[/color] with [b]bold text[/b] [i]italic text[/i] [u]underlined text[/u] and [color=0xFFFFD600][b][i][u]mixed styled[/b][/i][/u][/color]"),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_text_styled: ^0.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_text_styled/flutter_text_styled.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
36
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
68
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health issues and suggestions

Document public APIs. (-1 points)

19 out of 19 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

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 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test