url_text 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 68

url_text #

Url Test. Identify web links in text and make them clickable.

What is looks like? #

Screenshot

Getting Started #

UrlText(
    text: 'This https://www.google.com is jump to Google.',
    urlStyle: TextStyle(color: Colors.green),
    style: TextStyle(color: Colors.pink),
),

Publish to Pub.dev #

flutter format .
flutter pub publish --dry-run
flutter pub publish

[1.0.1] - 2019-12-15 #

  • Add Example Project

[1.0.0] - 2019-12-15 #

  • Initial release.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: SafeArea(
        child: Container(
          padding: EdgeInsets.all(8.0),
          child: Column(
            children: <Widget>[
              UrlText(
                text:
                    'This is the demo image of Url_text, Which you can click https://www.google.com to jump to Google.',
              ),
              SizedBox(
                height: 20,
              ),
              UrlText(
                text:
                    'You can change the TextStyle for Url. It looks like this: https://www.google.com .',
                urlStyle: TextStyle(color: Colors.red, fontSize: 20.0),
              ),
              SizedBox(
                height: 20,
              ),
              UrlText(
                text:
                    'Or you can change the TextStyle for normal text. It looks like this: https://www.google.com .',
                style: TextStyle(
                  color: Colors.green,
                ),
              ),
              SizedBox(
                height: 20,
              ),
              UrlText(
                text:
                    'Sure, Of course you can change all of them. Looks like this: https://www.google.com .',
                urlStyle: TextStyle(
                    color: Colors.purple,
                    fontStyle: FontStyle.italic,
                    fontWeight: FontWeight.w800),
                style: TextStyle(color: Colors.pink),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  url_text: ^1.0.1

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:url_text/url_text.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
37
Health:
Code health derived from static analysis. [more]
100
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 Jun 5, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev
  • Flutter: 1.17.1

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
url_launcher ^5.4.1 5.4.10
Transitive dependencies
collection 1.14.12
flutter_web_plugins 0.0.0
meta 1.1.8
platform_detect 1.4.0
plugin_platform_interface 1.0.2
pub_semver 1.4.4
sky_engine 0.0.99
typed_data 1.1.6
url_launcher_macos 0.0.1+7
url_launcher_platform_interface 1.0.7
url_launcher_web 0.1.1+6
vector_math 2.0.8
Dev dependencies
flutter_test