Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/larryaasen/tweet_webview
A Flutter widget to display a Twitter tweet in a WebView widget using webview_flutter.
https://github.com/larryaasen/tweet_webview
dart flutter twitter
Last synced: 17 days ago
JSON representation
A Flutter widget to display a Twitter tweet in a WebView widget using webview_flutter.
- Host: GitHub
- URL: https://github.com/larryaasen/tweet_webview
- Owner: larryaasen
- License: mit
- Created: 2018-12-01T01:45:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-31T15:17:24.000Z (almost 5 years ago)
- Last Synced: 2024-10-03T15:14:34.207Z (about 1 month ago)
- Topics: dart, flutter, twitter
- Language: Dart
- Size: 2.43 MB
- Stars: 7
- Watchers: 4
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# TweetWebView for Flutter
[![Build Status](https://travis-ci.org/larryaasen/tweet_webview.svg?branch=master)](https://travis-ci.org/larryaasen/tweet_webview) [![codecov](https://codecov.io/gh/larryaasen/tweet_webview/branch/master/graph/badge.svg)](https://codecov.io/gh/larryaasen/tweet_webview) [![pub package](https://img.shields.io/pub/v/tweet_webview.svg)](https://pub.dartlang.org/packages/tweet_webview)
TweetWebView is a Flutter widget to easily display a Twitter tweet in a WebView widget using [webview_flutter](https://pub.dartlang.org/packages/webview_flutter).
## Example 1
Display a single tweet in a TweetWebView widget using the tweet URL.```dart
class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Tweet WebView Example 1'),
),
body: TweetWebView.tweetUrl("https://twitter.com/Interior/status/463440424141459456"),
);
}
}
```[](screenshots/example1.png)
## Example 2
Display a single tweet in a TweetWebView widget using the tweet ID.```dart
class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Tweet WebView Example 2'),
),
body: TweetWebView.tweetID('463440424141459456'),
);
}
}
```[](screenshots/example2.png)
## Example 3
Display a list of tweets in TweetWebView widgets using the tweet IDs.```dart
class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Tweet WebView Example 3'),
),
body: _buildBody(),
);
}Widget _buildBody() {
final tweets = ['1065424382292566017', '1068219397293125633', '1068551446029832192', '1065362290512293888'];final list = ListView.builder(
scrollDirection: Axis.vertical,
padding: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
itemCount: tweets.length,
itemBuilder: (context, index) {
var tweetID = tweets[index];
return Card(
child: TweetWebView.tweetID(tweetID),
);
},
);final container = Container(
color: Colors.black26,
child: Center(child: list)
);return container;
}
}
```[](screenshots/example3.png)
## Contributing
All [comments](https://github.com/larryaasen/tweet_webview/issues) and [pull requests](https://github.com/larryaasen/tweet_webview/pulls) are welcome.