Giter Club home page Giter Club logo

eli-me / tweet_ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from schibsted/tweet_ui

0.0 0.0 0.0 48.76 MB

Flutter package to show Tweets from a Twitter API JSON on Android and iOS. Support for Tweets with 1-4 photos, Video, GIFs, hashtags, mentions, symbols, urls, quoted Tweets and retweets.

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

License: MIT License

Kotlin 0.09% Ruby 0.96% Swift 0.28% Objective-C 0.03% Dart 80.29% CMake 5.83% C++ 12.00% C 0.52%

tweet_ui's Introduction

tweet_ui

Flutter Tweet UI - Flutter package that is inspired by twitter-kit-android. Works on iOS and Android.

Getting Started

To use this package add it to the pubspec.yaml file:

tweet_ui: <latest_version>

import it:

import 'package:tweet_ui/tweet_ui.dart';

If you want to show tweets with videos: check the video_player installation site.

finally, create a TweetView from a JSON:

TweetView.fromTweet(
    Tweet.fromRawJson(
        jsonFromTwitterAPI
        // {"created_at": "Mon Nov 12 13:00:38 +0000 2018", "id": 1061967001177018368, ...
    )
);

or a CompactTweetView,

CompactTweetView.fromTweet(
    Tweet.fromRawJson(
        jsonFromTwitterAPI
        // {"created_at": "Mon Nov 12 13:00:38 +0000 2018", "id": 1061967001177018368, ...
    )
);

or a EmbeddedTweetView.

EmbeddedTweetView.fromTweet(
    Tweet.fromRawJson(
        jsonFromTwitterAPI
        // {"created_at": "Mon Nov 12 13:00:38 +0000 2018", "id": 1061967001177018368, ...
    )
  darkMode: true,
)

There is also a special QuoteTweetView that is embedded in a TweetView or a CompactTweetView or a EmbeddedTweetView. This depends if a Tweet has a quoted_status value in the JSON.

What tweet view should I create?

TweetView and CompactTweetView are more customisable, but EmbeddedTweetView looks more modern. Check the screenshots below.

Need more information? Check our wiki pages!

Colors & styling

Custom callbacks

Custom date format

Video player options

Example of supported view and media types:

Standard tweet views

Media type TweetView CompactTweetView EmbeddedTweetView
1 photo img img img
2 photos img img img
3 photos img img img
4 photos img img img
video img img img
GIF img img img

Quoted tweet views

Media type TweetView CompactTweetView EmbeddedTweetView
1 photo img img img
2 photos img img img
3 photos img img img
4 photos img img img
video img img img
GIF img img img

Sample tweets use real-life tweet ids but for example purposes, their content was changed.


tweet_ui's People

Contributors

dasmikko avatar ellie-me avatar ercadev avatar erickok avatar escamoteur avatar ivanjpg avatar jamesblasco avatar kawa89 avatar ndahlquist avatar tristan-vrt 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.