smart_text 0.0.1+3

Smart Text #

Text to render emoji well by decreasing its height, and draw hyperlink as well (Inspired by Flutter Linkify)

Note: This plugin is still under development, and some Components might not be available yet or still has so many bugs.

  • We are using URL Launcher library too to support this Text to launch URL right away

Installation #

First, add smart_text as a dependency in your pubspec.yaml file.

smart_text: ^0.0.1+3

Example #

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    String content =
        "The Avengers are a fictional team of superheroes appearing in American comic books published by Marvel Comics. The team made its debut in The Avengers #1 (cover-dated Sept. 1963), created by writer-editor Stan Lee and artist/co-plotter Jack Kirby. The Avengers is Lee and Kirby's renovation of a previous superhero team, All-Winners Squad, who appeared in comic books series published by Marvel Comics' predecessor Timely Comics.\n\nLabeled \"Earth's Mightiest Heroes\", the Avengers originally consisted of Ant-Man, the Hulk, Iron Man, Thor, and the Wasp. Ant-Man had become Giant-Man by issue #2. The original Captain America was discovered trapped in ice in issue #4, and joined the group after they revived him. A rotating roster became a hallmark of the series, although one theme remained consistent: the Avengers fight \"the foes no single superhero can withstand.\" The team, famous for its battle cry of \"Avengers Assemble!\", has featured humans, mutants, Inhumans, androids, aliens, supernatural beings, and even former villains. 💫🤩🌟\n\n\nSource: https://en.wikipedia.org/wiki/Avengers_(comics)";

    return MaterialApp(
      theme: ThemeData(brightness: Brightness.light, primaryColorBrightness: Brightness.light),
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Smart Text Demo'),
          ),
          body: SingleChildScrollView(
            child: SmartText(content, maxLines: 5),
          )),
    );
  }
}

0.0.1+3 #

  • Swift error fixed

0.0.1+2 #

  • Release const from SmartTextConfig

0.0.1+1 #

  • Bug Fix

0.0.1 #

  • Initial Release

example/README.md

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

import 'package:flutter/services.dart';
import 'package:smart_text/smart_text.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    String content =
        "The Avengers are a fictional team of superheroes appearing in American comic books published by Marvel Comics. The team made its debut in The Avengers #1 (cover-dated Sept. 1963), created by writer-editor Stan Lee and artist/co-plotter Jack Kirby. The Avengers is Lee and Kirby's renovation of a previous superhero team, All-Winners Squad, who appeared in comic books series published by Marvel Comics' predecessor Timely Comics.\n\nLabeled \"Earth's Mightiest Heroes\", the Avengers originally consisted of Ant-Man, the Hulk, Iron Man, Thor, and the Wasp. Ant-Man had become Giant-Man by issue #2. The original Captain America was discovered trapped in ice in issue #4, and joined the group after they revived him. A rotating roster became a hallmark of the series, although one theme remained consistent: the Avengers fight \"the foes no single superhero can withstand.\" The team, famous for its battle cry of \"Avengers Assemble!\", has featured humans, mutants, Inhumans, androids, aliens, supernatural beings, and even former villains. 💫🤩🌟\n\n\nSource: https://en.wikipedia.org/wiki/Avengers_(comics)";

    return MaterialApp(
      theme: ThemeData(brightness: Brightness.light, primaryColorBrightness: Brightness.light),
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Smart Text Demo'),
          ),
          body: SingleChildScrollView(
            child: SmartText(content, maxLines: 5),
          )),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  smart_text: ^0.0.1+3

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:smart_text/smart_text.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
44
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/smart_text.dart.

Run flutter format to format lib/smart_text.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
url_launcher ^5.0.2 5.1.2
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8