GithubHelp home page GithubHelp logo

jack-beattie / url_preview_card Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scoutredeem/url_preview_card

0.0 0.0 0.0 1.67 MB

Url preview card package for flutter

Home Page: https://pub.dev/packages/url_preview_card

License: MIT License

Dart 100.00%

url_preview_card's Introduction

Show preview of urls, designed to show list of url previews with caching support.

Forked from flutter-simple-url-preview with different caching strategy for fast retrivel, and additional styling options.

In Action

Getting Started

Show single or list of URL previews

Currently only supports Open Graph Protocol

Please use latest version of the package.

How to use ?

Add url_preview_card to pubspec.yaml, and hit command 'flutter pub get'

dependencies:
  ...
  url_preview_card: ^0.1.1

1) Simple use:

SimpleUrlPreview(
  url: 'https://pub.dev/',
),

2) Override preview height, padding.(Default and minimum possible height is 130):

SimpleUrlPreview(
  url: 'https://pub.dev/',
  previewHeight: 200,
  previewContainerPadding: EdgeInsets.all(10),
),

3) Override title text style, description text style and site name text style

Default titleStyle = TextStyle(
      fontWeight: FontWeight.bold,
      fontSize: 16,
      color: Colors.black
    );
Default descriptionStyle = TextStyle(
      fontSize: 14,
      color: Colors.black
    );
Default siteNameStyle = TextStyle(
      fontSize: 14,
      color: Colors.black
    );
SimpleUrlPreview(
  url: 'https://pub.dev/',
  titleStyle: TextStyle(
  color: Colors.white,
  fontWeight: FontWeight.bold,
  fontSize: 16,
  fontFamily: 'Sansita Swashed'
  ),
  descriptionStyle: TextStyle(
    color: Colors.white
  ),
  siteNameStyle: TextStyle(
    color: Colors.white
  ),
),

4) Override image loader color and title and description lines:

Default and maximum title lines = 2 and description lines = 3.

SimpleUrlPreview(
  url: 'https://pub.dev/',
  titleLines: 1,
  descriptionLines: 2,
  imageLoaderColor: Colors.white,
),

6) Override onTap callback of the URL preview:

By Default, will open URL in default browser.

SimpleUrlPreview(
  url: 'https://pub.dev/',
  onTap: () => print('Hello Flutter URL Preview'),
),

Contribution:

Would ❤️ to see any contributions.

url_preview_card's People

Contributors

amitbhave avatar paurakhsharma avatar jackbeattie avatar jack-beattie avatar vinothvino42 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.