Code Monkey home page Code Monkey logo

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 better_player installation site

Video/GIF Tweets don't work on iOS simulators (video_player ios instructions)

finally, create a TweetView from a JSON:

API V1.1

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

API V2

TweetView.fromTweetV2(
    TweetV2Response.fromRawJson(
        jsonFromTwitterAPI
        // {"data": ["created_at": "2020-09-18T18:36:15.000Z", "id": "1061967001177018368", ...
        // or
        // {"data": {"created_at": "2020-09-18T18:36:15.000Z", "id": "1061967001177018368", ...
    )
);

or a CompactTweetView,

API V1.1

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

API V2

CompactTweetView.fromTweetV2(
    TweetV2Response.fromRawJson(
        jsonFromTwitterAPI
        // {"data": ["created_at": "2020-09-18T18:36:15.000Z", "id": "1061967001177018368", ...
        // or
        // {"data": {"created_at": "2020-09-18T18:36:15.000Z", "id": "1061967001177018368", ...
    )
);

or a EmbeddedTweetView.

API V1.1

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

API V2

EmbeddedTweetView.fromTweetV2(
    TweetV2Response.fromRawJson(
      jsonFromTwitterAPI
      // {"data": ["created_at": "2020-09-18T18:36:15.000Z", "id": "1061967001177018368", ...
      // or
      // {"data": {"created_at": "2020-09-18T18:36:15.000Z", "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.

Twitter API V2 know problems

In current version of twitter API (V2 as of 14.02.2022) it is not possible to get video url in tweet response. See the following links for more info:

All other video fields (like size or duration) are available in the response. This means that videos will not work for now.

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 ercadev avatar erickok avatar escamoteur avatar ivanjpg avatar jamesblasco avatar kawa89 avatar ndahlquist avatar nicktt19 avatar robertmrobo avatar tristan-vrt avatar wszeborowskimateusz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tweet_ui's Issues

Running the example

I tried running the included example and I got this error here:

/Users/admin/flutter/.pub-cache/hosted/pub.dartlang.org/visibility_detector-0.2.0/lib/src/visibility_detector_layer.dart:276:21: Error: Too many positional arguments: 1 allowed, but 2 found.
Try removing the extra positional arguments.
super.addToScene(builder, layerOffset);

Anyone seeing similar error?

type 'Null' is not a subtype of type 'double'

Describe the bug
When I try to read a tweet I get type 'Null' is not a subtype of type 'double' error

To Reproduce

    TwitterApi twitterApi = TwitterApi(
      client: TwitterClient(
        consumerKey: dotenv.env["twitterApiKey"]!,
        consumerSecret: dotenv.env["twitterApiKeySecret"]!,
        token: dotenv.env["twitterAccessToken"]!,
        secret: dotenv.env["twitterAccessTokenSecret"]!,
      ),
    );
    final tweet = await twitterApi.tweetService.show(id: "some id");
    json = tweet.toJson();
....
return TweetView.fromTweetV1(
      TweetV1Response.fromJson(json!),
    );

Expected behavior
I expected the tweet widget to be displayed

Screenshots

Smartphone (please complete the following information):

  • Device: Android emulator
  • OS: Android 10
  • Version: 4.0.1

Additional context
When I look at json comes from dart_tweeter_api package, there was no id element. Instead there were only id_str element. Is that the root cause of the problem?

Should be fixed deprecated method

  • 'canLaunch' is deprecated and shouldn't be used. Use canLaunchUrl instead.
  • 'launch' is deprecated and shouldn't be used. Use launchUrl instead.

TweetVM does not take `favorited` from `Tweet`

Describe the bug
TweetVM does not take favorited from tweet

To Reproduce
Use this version

tweet_ui: ^2.2.0+3

Expected behavior
TweetVM be able to hold favorited in bool datatype. Then EmbeddedTweetView can be change the Icons.favorite_border to Icons.favorite

Screenshots
image

Smartphone (please complete the following information):

  • Device: Android Emulator
  • OS: Android 10
  • Version: API 30

EmbeddedTweetView text size is too big

Describe the bug
EmbeddedTweetView does not wrap text properly

To Reproduce

import 'package:flutter/material.dart';
import 'package:tweet_ui/models/api/tweet.dart';
import 'package:tweet_ui/models/api/user.dart';
import 'package:tweet_ui/tweet_ui.dart';

class TweetWidget extends StatefulWidget {
  @override
  _TweetWidgetState createState() => _TweetWidgetState();
}

class _TweetWidgetState extends State<TweetWidget> {
  @override
  Widget build(BuildContext context) {
    final user = User(
        id: 121,
        name: "Marshal Sarit",
        screenName: "King Prayed",
        verified: true,
        profileImageUrlHttps:
            "https://d1ab2zufs7bob.cloudfront.net/media/avatars/avatar_GlDoZ0w.jpg");
    final tweet = Tweet(
      createdAt: "Wed Oct 10 20:19:24 +0000 2018",
      id: 1050118621198921728,
      idStr: "1050118621198921728",
      text:
          "To make room for more expression, we will now count all emojis as equalโ€”including those with genderโ€โ€โ€ โ€โ€and skin tโ€ฆ https://t.co/MkGjXf9aXm",
      favoriteCount: 22,
      user: user,
    );
    return Column(children: [
      TweetView.fromTweet(tweet),
      CompactTweetView.fromTweet(tweet),
      EmbeddedTweetView.fromTweet(tweet),
    ]);
  }
}

Expected behavior
Time of 3rd TweetView must be wrapped in the single screen NOT too big like this

Screenshots
Screenshot_1598721370

Smartphone (please complete the following information):

  • Device: Emulator Nexus 6 API 3 0,
  • OS: Android 10.0+
  • Version tweet_ui: ^2.2.0+3

Additional context
OSX: 10.15.6

Why full tweet not showing.

In App In Web
drawing drawing

Sorry my mistake. Not getting full text from API. solved by adding this in options. 'tweet_mode': 'extended'

The data field is an array, but only one TweetView is generated

Hi amazing developers,

I tried this library with twitter_api_v2, but it did not work as expected. As the title says, I passed JSON to the constructor in a format where data is an array, but it seems that only one TweetView was generated and the rest were ignored.

My expectation was that a TweetView would be generated like a ListView for the number of items in the JSON passed to the constructor, but am I using this library incorrectly to begin with?

Cached images

I was looking through the documentation, but had trouble seeing some any references to cached image urls. I know it is a dependency, so it is in the package, however, is it just used by default? Do i need to enable it?

Autoplay videos

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
A way to be able to play the videos automatically, through a configuration parameter, maybe autoplayVideos: true|false. Also, it'd be great if the video autoplays when visible on the screen. Something like this

Tweets not formatting correctly

The tweet view has missing text, mainly the RT's. The "full_text" json field is not null. Sometimes the whole text is missing, sometimes some parts.

I think this is related with #14.

An example JSON and a screenshot are below.

Thank you.

imagen

{
   "created_at":"Sun Mar 15 11:20:07 +0000 2020",
   "id":1239149373881106434,
   "id_str":"1239149373881106434",
   "full_text":" RT @artnet: An Ohio couple's $100 million gift of art to the Cleveland Museum is the institution's largest donation in more than 60 Years.โ€ฆ",
   "truncated":false,
   "display_text_range":[
      0,
      139
   ],
   "entities":{
      "hashtags":[

      ],
      "symbols":[

      ],
      "user_mentions":[
         {
            "screen_name":"artnet",
            "name":"Artnet",
            "id":20622594,
            "id_str":20622594,
            "indices":[
               3,
               10
            ]
         }
      ],
      "urls":[

      ]
   },
   "source":"<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
   "in_reply_to_status_id":null,
   "in_reply_to_status_id_str":null,
   "in_reply_to_user_id":null,
   "in_reply_to_user_id_str":null,
   "in_reply_to_screen_name":null,
   "user":{
      "id":1207068980239835136,
      "id_str":1207068980239835136,
      "name":"IvanJPG",
      "screen_name":"ivan_jpg",
      "location":null,
      "description":null,
      "url":null,
      "entities":{
         "description":{
            "urls":[

            ]
         }
      },
      "protected":false,
      "followers_count":3,
      "friends_count":20,
      "listed_count":0,
      "created_at":"Tue Dec 17 22:46:27 +0000 2019",
      "favourites_count":22,
      "utc_offset":null,
      "time_zone":null,
      "geo_enabled":false,
      "verified":false,
      "statuses_count":21,
      "lang":null,
      "contributors_enabled":false,
      "is_translator":false,
      "is_translation_enabled":false,
      "profile_background_color":"F5F8FA",
      "profile_background_image_url":null,
      "profile_background_image_url_https":null,
      "profile_background_tile":false,
      "profile_image_url":"http://pbs.twimg.com/profile_images/1207158782033137665/ZQ7DpHyi_normal.jpg, profile_image_url_https: https://pbs.twimg.com/profile_images/1207158782033137665/ZQ7DpHyi_normal.jpg",
      "profile_banner_url":"https://pbs.twimg.com/profile_banners/1207068980239835136/1576644547",
      "profile_link_color":"1DA1F2",
      "profile_sidebar_border_color":"C0DEED",
      "profile_sidebar_fill_color":"DDEEF6",
      "profile_text_color":"333333",
      "profile_use_background_image":true,
      "has_extended_profile":false,
      "default_profile":true,
      "default_profile_image":false,
      "following":true,
      "follow_request_sent":false,
      "notifications":true,
      "translator_type":"none"
   },
   "geo":null,
   "coordinates":null,
   "place":null,
   "contributors":null,
   "retweeted_status":{
      "created_at":"Sun Mar 15 02:45:03 +0000 2020",
      "id":1239019752980348934,
      "id_str":"1239019752980348934",
      "full_text":"An Ohio couple's $100 million gift of art to the Cleveland Museum is the institution's largest donation in more than 60 Years. https://t.co/lj37YEj84D https://t.co/QwPcIO0eMO",
      "truncated":false,
      "display_text_range":[
         0,
         150
      ],
      "entities":{
         "hashtags":[

         ],
         "symbols":[

         ],
         "user_mentions":[

         ],
         "urls":[
            {
               "url":"https://t.co/lj37YEj84D",
               "expanded_url":"http://bit.ly/33d1SM1",
               "display_url":"bit.ly/33d1SM1",
               "indices":[
                  127,
                  150
               ]
            }
         ],
         "media":[
            {
               "id":1239019751155863552,
               "id_str":"1239019751155863552",
               "indices":[
                  151,
                  174
               ],
               "media_url":"http://pbs.twimg.com/media/ETHh5ilWkAAW3AI.jpg",
               "media_url_https":"https://pbs.twimg.com/media/ETHh5ilWkAAW3AI.jpg",
               "url":"https://t.co/QwPcIO0eMO",
               "display_url":"pic.twitter.com/QwPcIO0eMO",
               "expanded_url":"https://twitter.com/artnet/status/1239019752980348934/photo/1",
               "type":"photo",
               "sizes":{
                  "thumb":{
                     "w":150,
                     "h":150,
                     "resize":"crop"
                  },
                  "large":{
                     "w":1024,
                     "h":847,
                     "resize":"fit"
                  },
                  "small":{
                     "w":680,
                     "h":562,
                     "resize":"fit"
                  },
                  "medium":{
                     "w":1024,
                     "h":847,
                     "resize":"fit"
                  }
               }
            }
         ]
      },
      "extended_entities":{
         "media":[
            {
               "id":1239019751155863552,
               "id_str":"1239019751155863552",
               "indices":[
                  151,
                  174
               ],
               "media_url":"http://pbs.twimg.com/media/ETHh5ilWkAAW3AI.jpg",
               "media_url_https":"https://pbs.twimg.com/media/ETHh5ilWkAAW3AI.jpg",
               "url":"https://t.co/QwPcIO0eMO",
               "display_url":"pic.twitter.com/QwPcIO0eMO",
               "expanded_url":"https://twitter.com/artnet/status/1239019752980348934/photo/1",
               "type":"photo",
               "sizes":{
                  "thumb":{
                     "w":150,
                     "h":150,
                     "resize":"crop"
                  },
                  "large":{
                     "w":1024,
                     "h":847,
                     "resize":"fit"
                  },
                  "small":{
                     "w":680,
                     "h":562,
                     "resize":"fit"
                  },
                  "medium":{
                     "w":1024,
                     "h":847,
                     "resize":"fit"
                  }
               }
            }
         ]
      },
      "source":"<a href=\"https://buffer.com\" rel=\"nofollow\">Buffer</a>",
      "in_reply_to_status_id":null,
      "in_reply_to_status_id_str":null,
      "in_reply_to_user_id":null,
      "in_reply_to_user_id_str":null,
      "in_reply_to_screen_name":null,
      "user":{
         "id":20622594,
         "id_str":"20622594",
         "name":"Artnet",
         "screen_name":"artnet",
         "location":"New York, N.Y.",
         "description":"The art world online.",
         "url":"http://t.co/Bp5pApQP9z",
         "entities":{
            "url":{
               "urls":[
                  {
                     "url":"http://t.co/Bp5pApQP9z",
                     "expanded_url":"http://www.artnet.com",
                     "display_url":"artnet.com",
                     "indices":[
                        0,
                        22
                     ]
                  }
               ]
            },
            "description":{
               "urls":[

               ]
            }
         },
         "protected":false,
         "followers_count":1943812,
         "friends_count":9304,
         "listed_count":10501,
         "created_at":"Wed Feb 11 20:13:22 +0000 2009",
         "favourites_count":2674,
         "utc_offset":null,
         "time_zone":null,
         "geo_enabled":true,
         "verified":true,
         "statuses_count":50223,
         "lang":null,
         "contributors_enabled":false,
         "is_translator":false,
         "is_translation_enabled":false,
         "profile_background_color":"FCF7FC",
         "profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png",
         "profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png",
         "profile_background_tile":false,
         "profile_image_url":"http://pbs.twimg.com/profile_images/525022505140899840/SqjK4CPu_normal.png",
         "profile_image_url_https":"https://pbs.twimg.com/profile_images/525022505140899840/SqjK4CPu_normal.png",
         "profile_banner_url":"https://pbs.twimg.com/profile_banners/20622594/1539102791",
         "profile_link_color":"FF6F35",
         "profile_sidebar_border_color":"FFFFFF",
         "profile_sidebar_fill_color":"F0F0F0",
         "profile_text_color":"333333",
         "profile_use_background_image":false,
         "has_extended_profile":false,
         "default_profile":false,
         "default_profile_image":false,
         "following":false,
         "follow_request_sent":false,
         "notifications":false,
         "translator_type":"none"
      },
      "geo":null,
      "coordinates":null,
      "place":null,
      "contributors":null,
      "is_quote_status":false,
      "retweet_count":8,
      "favorite_count":48,
      "favorited":false,
      "retweeted":false,
      "possibly_sensitive":false,
      "lang":"en"
   },
   "is_quote_status":false,
   "retweet_count":8,
   "favorite_count":0,
   "favorited":false,
   "retweeted":false,
   "lang":"en"
}

Displaying a list of tweets using JSON

Hi, I'm not sure if this would be the right place to ask this here, but since I'm utilizing this library and the question coincides with using the library I guess I'll post here. I am a bit new to Flutter development and right now I am attempting to fetch a list of tweets using Flutter's HTTP library and Twitter's API endpoint, and then display the list of tweets onto a ListView widget using the tweet_ui library. I was able to get the fetching of a list of tweets working correctly and I get back a JSON response. However, I am currently attempting to decode the JSON response.body and save it onto a List to later encode once I pass it to the tweet_ui method I am using. Using the code I've shown below I continue get this red error screen with the error saying "Expected a value of type 'String', but got one of type '_Future < dynamic >'". I've tried multiple times playing around with the different types that are being passed around from function to function and that does not seem to work. I've also attempted to wrap the widget around a future builder, and that did not seem to work as well. Any idea what I could possibly be doing wrong? Am I approaching this logic completely wrong? Should I be using a List instead of List, I thought since .fromRawJson() requires a String best would be for it to be saved to a list. I'd appreciate any help, thank you!

Future getTweetJson() async {
Map<String, String> params = {
  'exclude': 'retweets',
  'expansions':
      'attachments.poll_ids,attachments.media_keys,author_id,entities.mentions.username,geo.place_id,in_reply_to_user_id,referenced_tweets.id,referenced_tweets.id.author_id',
  'tweet.fields':
      'attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,possibly_sensitive,public_metrics,reply_settings,source,text',
  'user.fields':
      'created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified',
  'place.fields':
      'contained_within,country,country_code,full_name,geo,id,name,place_type',
  'media.fields':
      'duration_ms,height,media_key,preview_image_url,type,url,width,public_metrics,non_public_metrics,organic_metrics,promoted_metrics'
};

var response = await http.get(
    Uri.https('api.twitter.com', '2/users/IDnumber/tweets', params),
    headers: {
      "Authorization":
          "Bearer bearerToken"
    });

String jsonData = response.body;   

return jsonData;
}

Function used to fetch tweets using HTTP library from Twitter API

List getListOfTweets(var jsonData) {
List<dynamic> tweets = [];

tweets = convert.jsonDecode(jsonData);

return tweets;
}

Function used to hopefully convert each tweet fetched in the Json to be added to the list.

List<dynamic> tweets = handler.getListOfTweets(handler.getTweetJson());

@override
Widget build(BuildContext context) {
return Scaffold(
  appBar: AppBar(title: Text("Tweets")),
  body: Column(children: <Widget>[
    Expanded(
      child: ListView.builder(
          itemCount: tweets.length,
          itemBuilder: (context, index) {
            return Container(
                child: Column(
              children: [
                EmbeddedTweetView.fromTweet(
                  Tweet.fromRawJson(
                    convert.jsonEncode(tweets[index]),
                  ),
                )
              ],
            ));
          }),
    ),
  ]),
);
}

Widget using ListView

var tweetJson = handler.getTweetJson();

@override
Widget build(BuildContext context) {
return Scaffold(
  appBar: AppBar(title: Text("Tweets")),
  body: Container(
    child: Card(
      child: FutureBuilder(
        future: tweetJson,
        builder: (context, AsyncSnapshot snapshot) {
          if (snapshot.data == null) {
            return Container(
              child: const Center(
                child: Text('Loading. . .'),
              ),
            );
          } else {
            var tweets =
                List<String>.from(convert.jsonDecode(snapshot.data));
            return ListView.builder(
                itemCount: tweets.length,
                itemBuilder: (context, index) {
                  return Container(
                      child: Column(
                    children: [
                      EmbeddedTweetView.fromTweet(
                        Tweet.fromRawJson(
                          convert.jsonEncode(tweets[index]),
                        ),
                      )
                    ],
                  ));
                });
          }
        },
      ),
    ),
  ),
);
}

Alternative Widget using Future Builder

video not work in iOS

in example code and in other projects video not works in iOS

Smartphone:

  • Device: [e.g. iPhone11]
  • OS: [e.g. iOS14]

EmbeddedTweetView with scrollable_positioned_list plugin

Describe the bug
When using twitter_ui EmbeddedTweetView or TweetView in conjunction with scrollable_positioned_list plugin the scrolling function works badly (erratically)
This happens in flutter 1.22.x not in 1.20.x.

To Reproduce
Steps to reproduce the behavior:

  1. Get a list of tweets in json format
  2. pass those the tweets to the EmbeddedTweetView inside the scrollable_positioned_list builder
  3. use the scrollTo function in order to move programatically from one tweet to the next
  4. See that the scrolling goes to the wrong position inside the list.

Expected behavior
Scroll to the correct position
This works fine if instead of TweetViews i use other things like a Card

Smartphone (please complete the following information):

  • Device: Any Android, Any iPhone
  • OS: Android / iOS
  • Version API 21+ / 10.3+

Additional context
Also opened an issue with the scrollable_positioned_list plugin

Example code

scrollable_list_audioservice_v2.zip

Add the option to show the 'reply_count' on a tweet widget.

Next to the likes/favourites count, I would like to show also how many replies does a tweet have.

I added the functionality on my local fork and it is ready for submission as a PR if this feature can be a welcomed addition.

The option to show the replies count is optional.

Update photo_view dependency to 0.14.0

Describe the bug
Flutter 3.10.6 assumes photo_view 0.14.0. tweet_ui requires 0.13.0, but this has an incompatible API.

Specifically, when you try to compile with 0.13.0 the error :

../../../../.pub-cache/hosted/pub.dev/photo_view-0.13.0/lib/src/core/photo_view_gesture_detector.dart:89:38: Error: No named parameter with the name 'kind'.
  }) : super(debugOwner: debugOwner, kind: kind);
                                     ^^^^

is thrown.

Can we update the photo_view dependency to 0.14.0?

BetterPlayer colliding with textToSpeech plugin as text is being read

Is your feature request related to a problem? Please describe.
I cannot use it embedded better_player in TweetView because of an AudioFocus issue i still cannot work out. It seems like BetterPlayer is colliding with the ongoing textToSpeech being read.

Thanks

Describe the solution you'd like
Something to avoid giving focus to better_player before the video is tapped

Describe alternatives you've considered
Some EmbeddedTweetView option to not autoload or autoplay
Or an onTapVideo option to process video myself outside the tweet

Additional context
useVideoPlayer: false could be an option but in iOS the video displays in full screen without possibility to dismiss and cannot return to my aplication.

Tweets are not displayed correctly in EmbededTweetView

Thank you so much for developing a great library. I am always grateful.
I'm still a low-level developer, so let me report here.

Describe the bug
The following issues occur when using EmbededTweetVied.fromTweet on certain tweets
(1) Characters are garbled and the character string after the character is not read.
(2) RangeError is raised (see the following image)

To Reproduce
(1) https://twitter.com/maruyamahodaka/status/1253607143837556736
(2) http://twitter.com/swallowspr/status/1252794458636083201

EmbeddedTweetView.fromTweet(
      Tweet.fromRawJson(
        tweetJson,
      ),
      createdDateDisplayFormat: DateFormat("EEE, MMM d, ''yy"),
    );

Expected behavior
The tweets must be displayed correctly.

Screenshots

(1)

ใ‚นใ‚ฏใƒชใƒผใƒณใ‚ทใƒงใƒƒใƒˆ 2020-04-25 17 48 40

(2)

ใ‚นใ‚ฏใƒชใƒผใƒณใ‚ทใƒงใƒƒใƒˆ 2020-04-25 17 49 01

Smartphone (please complete the following information):

  • Device: iPhone SE 2nd (Simulator)
  • OS: iOS 13.4

Additional context

% flutter doctor                                                                          
Doctor summary (to see all details, run flutter doctor -v):
[โœ“] Flutter (Channel master, v1.18.0-9.0.pre.1, on Mac OS X 10.15.3 19D76, locale ja-JP)

[โœ“] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[โœ“] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[โœ“] Android Studio (version 3.6)
[โœ“] VS Code (version 1.44.2)
[โœ“] Connected device (3 available)

I would like to ask a question that is not relevant to this case.
Q1: Is it possible to customize the TextStyle of EmbededTweetView? (I want to change the font size.)
Q2: I can't go back to the previous screen when I tap on an attached image in a tweet, is that a specification?

Redesign widgets to look like the native embedded on website ones

Is your feature request related to a problem? Please describe.
I want the tweets to look more natural. Showing a tweet should look like the result you get from the "embed a tweet on your website" (example picture in additional context)

Describe the solution you'd like
I could redesign the Widgets to look as close to the embedded version as possible

Describe alternatives you've considered
Add widgets like TweetEmbedded() to this package. Or I would fork this repo and rewrite all widgets and use it on my own, but if more than I want this feature adding widgets to this package would be beter.

Additional context
Skaฬˆrmavbild 2020-03-16 kl  16 44 19

Add support for videos in V2 api

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
There is a way to extract videos from V2 api for quite some time now. They are available under (an example): includes/media/0/variants/0/url.

{
    "includes": {
        "media": [
            {
                "duration_ms": 24854,
                "width": 640,
                "height": 640,
                "variants": [
                    {
                        "bit_rate": 832000,
                        "content_type": "video/mp4",
                        "url": "https://video.twimg.com/amplify_video/1587454126853529602/vid/540x540/xj3M5rCNdkkUGP6x.mp4?tag=14"
                    },
                    {
                        "bit_rate": 1280000,
                        "content_type": "video/mp4",
                        "url": "https://video.twimg.com/amplify_video/1587454126853529602/vid/640x640/pdl6VUCYiN8w98eE.mp4?tag=14"
                    },
                    {
                        "bit_rate": 432000,
                        "content_type": "video/mp4",
                        "url": "https://video.twimg.com/amplify_video/1587454126853529602/vid/320x320/pht7hzEG1BN9o-Bp.mp4?tag=14"
                    },
                    {
                        "content_type": "application/x-mpegURL",
                        "url": "https://video.twimg.com/amplify_video/1587454126853529602/pl/ad4D_5NaCG3_dxV0.m3u8?tag=14&container=fmp4"
                    }
                ],
                "preview_image_url": "https://pbs.twimg.com/amplify_video_thumb/1587454126853529602/img/IaajgbNdWOFo7Igy.jpg",
                "public_metrics": {
                    "view_count": 1141132
                },
                "type": "video",
                "media_key": "13_1587454126853529602"
            }
        ],
    }
}

It would be lovely to be able to play videos on tweet views based on api V2.

Finding tweets that are not being rendered correctly

This tweet is not rendered correctly. I am seeing many others like this.

{
"created_at": "Mon Jan 20 00:45:29 +0000 2020",
"id": 1219058331102347264,
"id_str": "1219058331102347264",
"full_text": "so me & 4 girls at work are taking a weekend trip to Chicago this June & one of them today said \u201chold on ashlyn, I meant to ask you beforehand....are you gonna do anything to get the police called on us?\u201d \ud83d\ude02\ud83d\ude02\ud83d\ude02\ud83d\ude02\ud83d\ude02\ud83d\ude02",
"truncated": false,
"display_text_range": [0, 219],
"entities": {
"hashtags": [],
"symbols": [],
"user_mentions": [],
"urls": []
},
"metadata": {
"iso_language_code": "en",
"result_type": "recent"
},
"source": "\u003ca href="http://twitter.com/download/iphone" rel="nofollow"\u003eTwitter for iPhone\u003c/a\u003e",
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 46506347,
"id_str": "46506347",
"name": "ash",
"screen_name": "ashlynluckett11",
"location": "",
"description": "University of Kentucky alumna",
"url": "https://t.co/fI37XghgnK",
"entities": {
"url": {
"urls": [{
"url": "https://t.co/fI37XghgnK",
"expanded_url": "http://www.ovinternational.org/donate",
"display_url": "ovinternational.org/donate",
"indices": [0, 23]
}]
},
"description": {
"urls": []
}
},
"protected": false,
"followers_count": 866,
"friends_count": 368,
"listed_count": 1,
"created_at": "Thu Jun 11 22:13:51 +0000 2009",
"favourites_count": 16649,
"utc_offset": null,
"time_zone": null,
"geo_enabled": true,
"verified": false,
"statuses_count": 39968,
"lang": null,
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "C0DEED",
"profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
"profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
"profile_background_tile": true,
"profile_image_url": "http://pbs.twimg.com/profile_images/1214380088604733440/F_2CxJA5_normal.jpg",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1214380088604733440/F_2CxJA5_normal.jpg",
"profile_banner_url": "https://pbs.twimg.com/profile_banners/46506347/1577842418",
"profile_link_color": "0084B4",
"profile_sidebar_border_color": "C0DEED",
"profile_sidebar_fill_color": "DDEEF6",
"profile_text_color": "333333",
"profile_use_background_image": true,
"has_extended_profile": false,
"default_profile": false,
"default_profile_image": false,
"following": false,
"follow_request_sent": false,
"notifications": false,
"translator_type": "none"
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"retweet_count": 0,
"favorite_count": 0,
"favorited": false,
"retweeted": false,
"lang": "en"
}

TWEET_UI renders it like this

image

TWITTER renders it like this
image

Retweet image display

The retweets are not fully or correctly displayed.

I leave you here two screenshots, the first one shows the tweet_ui display and the second one the tweeter embeded version. After screenshots the paste of the JSON is present.

Thanks a lot for all the good work!

ss01
ss02

{
   "created_at":"Wed Apr 22 11:00:20 +0000 2020",
   "id":1252915134965493760,
   "id_str":"1252915134965493760",
   "text":"RT @artnet: We will need new ways to interact with art after lockdown. \n\nI believe virtual reality is the answer: https:\/\/t.co\/hHp6E2R382 h\u2026",
   "truncated":false,
   "entities":{
      "hashtags":[

      ],
      "symbols":[

      ],
      "user_mentions":[
         {
            "screen_name":"artnet",
            "name":"Artnet",
            "id":20622594,
            "id_str":"20622594",
            "indices":[
               3,
               10
            ]
         }
      ],
      "urls":[
         {
            "url":"https:\/\/t.co\/hHp6E2R382",
            "expanded_url":"https:\/\/bit.ly\/34TFdFn",
            "display_url":"bit.ly\/34TFdFn",
            "indices":[
               114,
               137
            ]
         }
      ]
   },
   "source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e",
   "in_reply_to_status_id":null,
   "in_reply_to_status_id_str":null,
   "in_reply_to_user_id":null,
   "in_reply_to_user_id_str":null,
   "in_reply_to_screen_name":null,
   "user":{
      "id":1207068980239835136,
      "id_str":"1207068980239835136",
      "name":"AppArtista",
      "screen_name":"AppArtista",
      "location":"",
      "description":"",
      "url":null,
      "entities":{
         "description":{
            "urls":[

            ]
         }
      },
      "protected":false,
      "followers_count":3,
      "friends_count":20,
      "listed_count":0,
      "created_at":"Tue Dec 17 22:46:27 +0000 2019",
      "favourites_count":23,
      "utc_offset":null,
      "time_zone":null,
      "geo_enabled":false,
      "verified":false,
      "statuses_count":30,
      "lang":null,
      "contributors_enabled":false,
      "is_translator":false,
      "is_translation_enabled":false,
      "profile_background_color":"F5F8FA",
      "profile_background_image_url":null,
      "profile_background_image_url_https":null,
      "profile_background_tile":false,
      "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/1207158782033137665\/ZQ7DpHyi_normal.jpg",
      "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/1207158782033137665\/ZQ7DpHyi_normal.jpg",
      "profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/1207068980239835136\/1576644547",
      "profile_link_color":"1DA1F2",
      "profile_sidebar_border_color":"C0DEED",
      "profile_sidebar_fill_color":"DDEEF6",
      "profile_text_color":"333333",
      "profile_use_background_image":true,
      "has_extended_profile":false,
      "default_profile":true,
      "default_profile_image":false,
      "following":true,
      "follow_request_sent":false,
      "notifications":true,
      "translator_type":"none"
   },
   "geo":null,
   "coordinates":null,
   "place":null,
   "contributors":null,
   "retweeted_status":{
      "created_at":"Tue Apr 21 17:39:04 +0000 2020",
      "id":1252653088692895746,
      "id_str":"1252653088692895746",
      "text":"We will need new ways to interact with art after lockdown. \n\nI believe virtual reality is the answer:\u2026 https:\/\/t.co\/iRKDQuB4ne",
      "truncated":true,
      "entities":{
         "hashtags":[

         ],
         "symbols":[

         ],
         "user_mentions":[

         ],
         "urls":[
            {
               "url":"https:\/\/t.co\/iRKDQuB4ne",
               "expanded_url":"https:\/\/twitter.com\/i\/web\/status\/1252653088692895746",
               "display_url":"twitter.com\/i\/web\/status\/1\u2026",
               "indices":[
                  103,
                  126
               ]
            }
         ]
      },
      "source":"\u003ca href=\"https:\/\/buffer.com\" rel=\"nofollow\"\u003eBuffer\u003c\/a\u003e",
      "in_reply_to_status_id":null,
      "in_reply_to_status_id_str":null,
      "in_reply_to_user_id":null,
      "in_reply_to_user_id_str":null,
      "in_reply_to_screen_name":null,
      "user":{
         "id":20622594,
         "id_str":"20622594",
         "name":"Artnet",
         "screen_name":"artnet",
         "location":"New York, N.Y.",
         "description":"The art world online.",
         "url":"http:\/\/t.co\/Bp5pApQP9z",
         "entities":{
            "url":{
               "urls":[
                  {
                     "url":"http:\/\/t.co\/Bp5pApQP9z",
                     "expanded_url":"http:\/\/www.artnet.com",
                     "display_url":"artnet.com",
                     "indices":[
                        0,
                        22
                     ]
                  }
               ]
            },
            "description":{
               "urls":[

               ]
            }
         },
         "protected":false,
         "followers_count":1944411,
         "friends_count":9296,
         "listed_count":10520,
         "created_at":"Wed Feb 11 20:13:22 +0000 2009",
         "favourites_count":2750,
         "utc_offset":null,
         "time_zone":null,
         "geo_enabled":true,
         "verified":true,
         "statuses_count":50498,
         "lang":null,
         "contributors_enabled":false,
         "is_translator":false,
         "is_translation_enabled":false,
         "profile_background_color":"FCF7FC",
         "profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
         "profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
         "profile_background_tile":false,
         "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/525022505140899840\/SqjK4CPu_normal.png",
         "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/525022505140899840\/SqjK4CPu_normal.png",
         "profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/20622594\/1539102791",
         "profile_link_color":"FF6F35",
         "profile_sidebar_border_color":"FFFFFF",
         "profile_sidebar_fill_color":"F0F0F0",
         "profile_text_color":"333333",
         "profile_use_background_image":false,
         "has_extended_profile":false,
         "default_profile":false,
         "default_profile_image":false,
         "following":false,
         "follow_request_sent":false,
         "notifications":false,
         "translator_type":"none"
      },
      "geo":null,
      "coordinates":null,
      "place":null,
      "contributors":null,
      "is_quote_status":false,
      "retweet_count":14,
      "favorite_count":19,
      "favorited":false,
      "retweeted":false,
      "possibly_sensitive":false,
      "lang":"en"
   },
   "is_quote_status":false,
   "retweet_count":14,
   "favorite_count":0,
   "favorited":false,
   "retweeted":false,
   "possibly_sensitive":false,
   "lang":"en"
}

Duplicate classes when compiling

Describe the bug
When I import tweet_ui in pubspec.yaml and do 'flutter run', I see this error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.google.android.exoplayer2.ui.package-info found in modules jetified-exoplayer-common-2.14.1-runtime.jar (com.google.android.exoplayer:exoplayer-common:2.14.1) and jetified-exoplayer-ui-2.13.3-runtime.jar (com.google.android.exoplayer:exoplayer-ui:2.13.3)

  Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.     


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 16s
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        17.4s
Exception: Gradle task assembleDebug failed with exit code 1

To Reproduce
Steps to reproduce the behavior:

  1. Checkout v2 branch at https://github.com/dasmikko/knocky/tree/v2
  2. Do 'flutter run' in checked out repo

Expected behavior
App compiles and runs

Smartphone (please complete the following information):

  • Device: OnePlus 7T Pro
  • OS: Android
  • Version 11.0.1.1.HD01BA

Additional context
Looks like this is a matter of the Android version or even just the phone. Any pointers on what's wrong would be great, I'm assuming we're colliding with another library but it's hard for me to see which.

Showing an error of Unable to load asset : {JSON OBject}

How can I resolve it? I'm fetching the API data online and trying to show the Tweet.
The endpoint I'm trying to reach: "statuses/show.json
I want to display any tweet by its id without saving the JSON object in assets Folder.
WhatsApp Image 2020-07-10 at 1 09 56 AM

Video Tweets with initial volume

The tweets with video embedded are hardcoded to start with a 0.0 volume, I found in this file:

lib/src/tweet_video.dart

Is there a possibility to add an option to set a default initial volume?

I think it would be possible by adding to TweetView class a new double property, then passing it to MediaContainer and finally to TweetVideo. At least it looks so much straight forward than add a way to access the Chewie controller.

Thank you so much! (again)

I think this could be done in this dirty way:

diff --git a/lib/src/media_container.dart b/lib/src/media_container.dart
index f4876d5..fc17564 100644
--- a/lib/src/media_container.dart
+++ b/lib/src/media_container.dart
@@ -19,12 +19,14 @@ class MediaContainer extends StatefulWidget {
     this.viewMode, {
     Key key,
     this.useVideoPlayer = true,
+    this.videoPlayerInitialVolume = 0.0,
     this.onTapImage,
   }) : super(key: key);

   final TweetVM tweetVM;
   final ViewMode viewMode;
   final bool useVideoPlayer;
+  final double videoPlayerInitialVolume;

   @override
   _MediaContainerState createState() => _MediaContainerState();
@@ -47,7 +49,10 @@ class _MediaContainerState extends State<MediaContainer>
     Widget child;
     if (widget.tweetVM.getDisplayTweet().hasSupportedVideo) {
       if (widget.useVideoPlayer) {
-        child = TweetVideo(widget.tweetVM.getDisplayTweet());
+        child = TweetVideo(
+          widget.tweetVM.getDisplayTweet(),
+          initialVolume: widget.videoPlayerInitialVolume
+        );
       } else {
         child = Stack(
           children: <Widget>[
diff --git a/lib/src/tweet_video.dart b/lib/src/tweet_video.dart
index b7ace27..a85ae36 100644
--- a/lib/src/tweet_video.dart
+++ b/lib/src/tweet_video.dart
@@ -9,9 +9,11 @@ class TweetVideo extends StatefulWidget {
   TweetVideo(
     this.tweetVM, {
     Key key,
+    this.initialVolume = 0.0
   }) : super(key: key);

   final TweetVM tweetVM;
+  final double initialVolume;

   @override
   _TweetVideoState createState() => _TweetVideoState();
@@ -27,7 +29,7 @@ class _TweetVideoState extends State<TweetVideo>
     super.initState();
     _controller = VideoPlayerController.network(
         widget.tweetVM.getDisplayTweet().videoUrl);
-    _controller.setVolume(0.0);
+    _controller.setVolume(widget.initialVolume);

     _chewieController = ChewieController(
       videoPlayerController: _controller,
diff --git a/lib/tweet_view.dart b/lib/tweet_view.dart
index 660b3bc..4b32fa3 100644
--- a/lib/tweet_view.dart
+++ b/lib/tweet_view.dart
@@ -58,6 +58,9 @@ class TweetView extends StatelessWidget {
   /// If set to false a image placeholder will he shown and a video will be played in a new page.
   final bool useVideoPlayer;

+  /// If the Tweet contains a video then an initial volume can be specified with a value between 0.0 and 1.0.
+  final double videoPlayerInitialVolume;
+
   /// Function used when you want a custom image tapped callback
   final OnTapImage onTapImage;

@@ -79,6 +82,7 @@ class TweetView extends StatelessWidget {
     this.quoteBackgroundColor,
     this.backgroundColor,
     this.useVideoPlayer,
+    this.videoPlayerInitialVolume,
     this.onTapImage,
     this.createdDateDisplayFormat,
   }); //  TweetView(this.tweetVM);
@@ -97,6 +101,7 @@ class TweetView extends StatelessWidget {
       this.quoteBackgroundColor = Colors.white,
       this.backgroundColor = Colors.white,
       this.useVideoPlayer = true,
+      this.videoPlayerInitialVolume = 0.0,
       this.onTapImage,
       this.createdDateDisplayFormat})
       : _tweetVM = TweetVM.fromApiModel(tweet, createdDateDisplayFormat);
@@ -111,6 +116,7 @@ class TweetView extends StatelessWidget {
             _tweetVM,
             ViewMode.standard,
             useVideoPlayer: useVideoPlayer,
+            videoPlayerInitialVolume: videoPlayerInitialVolume,
             onTapImage: onTapImage,
           ),
           GestureDetector(

Enable more platforms

  1. Check what is blocking the support
  2. Remove blocking packages and add support for new ones.
  3. Try to enable support for:
    • Web
    • Mac
    • Windows

Tweet with video doesn't show the video

Describe the bug
Hi

I'm using tweet_video.json from the example folder. The tweet renders fine but the video is not displayed even with a clean project. This occurs with both versions 3.0.1 and 4.0.0-dev-1 but the behavior is a little different.
3.0.1 After load video, CircularProgressIndicator is removed you can press play and other actions, the video is playing but the screen remains in black.

4.0.0-dev.1 Same as 3.0.1 but the CircularProgressIndicator is not removed.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project
  2. Install tweet_ui
  3. Use a tweet with video
  4. See error

Expected behavior
The video is displayed correctly

Screenshots
Simulator Screen Shot - iPhone 13 - 2022-04-01 at 15 41 50

Smartphone (please complete the following information):

  • Device: iPhone 13 iOS 15.2 (Simulator)
  • OS: MacOs
  • Version: 12.3.1

Date Time Format bug

The following FormatException was thrown building:
Trying to read EEE from 2021-01-29T20:23:55.000Z at position 0

DateFormat df = new DateFormat("yyyy-MM-ddTHH:mm:ss.mmmuuuZ");
return TweetUI.CompactTweetView.fromTweet(aTweet, createdDateDisplayFormat: df,);

And tried without a df, same thing. In your examples you are looking for:
"created_at": "Mon Nov 12 13:00:38 +0000 2018"
but the twitter API is returning for me:
"created_at": "2021-01-29T20:23:55.000Z"

Override image tap

Would it possible to have a way of overriding the image tap method?

I have my own image viewer screen, it would like to use.

It would be even more awesome if when tapping on an image, I could get an list of all the tweet images, if there are multiple images. :)

Can't display a single tweet

I'm trying to display a tweet obtained with Tweets Lookup

 EmbeddedTweetView.fromTweetV2(
   TweetV2Response.fromRawJson(jsonEncode(tweet)),
 ),

but an error is thrown:
type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>' in type cast

The error it's clear, but how to display correctly a tweet obtained from that endpoint? The data field of tweet response isn't a List

Question regarding actions when clicking text

Hello, first of all congratulations, its a great plugin.
In my project i need to trigger an action (call a method, like onTap does for cards) other than opening the twitter app or web when the text is clicked. Is there anyway i can tune that behavior using your plugin?
Thanks!
Martin.

Incompatible with Flutter v2.5.0

Describe the bug

Flutter v2.5.0 was recently released to the stable channel. This library has some compatibility issues (looks like largely from transitive dependencies).

To Reproduce

When importing this library:

Launching lib/main.dart on Pixel 4a in debug mode...
Running Gradle task 'assembleDebug'...
../../sdks/flutter/.pub-cache/hosted/pub.dartlang.org/photo_view-0.11.1/lib/src/core/photo_view_gesture_detector.dart:106:29: Error: The argument type 'PointerEvent' can't be assigned to the parameter type 'PointerDownEvent'.
 - 'PointerEvent' is from 'package:flutter/src/gestures/events.dart' ('../../sdks/flutter/packages/flutter/lib/src/gestures/events.dart').
 - 'PointerDownEvent' is from 'package:flutter/src/gestures/events.dart' ('../../sdks/flutter/packages/flutter/lib/src/gestures/events.dart').
    super.addAllowedPointer(event);

When attempting to build the example app:

Running "flutter pub get" in example...
Launching lib/main.dart on Pixel 4a in debug mode...
Running Gradle task 'assembleDebug'...
../../../sdks/flutter/.pub-cache/hosted/pub.dartlang.org/photo_view-0.11.1/lib/src/core/photo_view_gesture_detector.dart:106:29: Error: The argument type 'PointerEvent' can't be assigned to the parameter type 'PointerDownEvent'.
 - 'PointerEvent' is from 'package:flutter/src/gestures/events.dart' ('../../../sdks/flutter/packages/flutter/lib/src/gestures/events.dart').
 - 'PointerDownEvent' is from 'package:flutter/src/gestures/events.dart' ('../../../sdks/flutter/packages/flutter/lib/src/gestures/events.dart').
    super.addAllowedPointer(event);
                            ^
../../../sdks/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.2.0/lib/messages.dart:100:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
 - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('../../../sdks/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
        channel.setMockMessageHandler(null);
                ^^^^^^^^^^^^^^^^^^^^^
../../../sdks/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.2.0/lib/messages.dart:102:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
 - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('../../../sdks/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
        channel.setMockMessageHandler((dynamic message) async {
                ^^^^^^^^^^^^^^^^^^^^^
../../../sdks/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.2.0/lib/messages.dart:114:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
 - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('../../../sdks/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
        channel.setMockMessageHandler(null);
                ^^^^^^^^^^^^^^^^^^^^^
../../../sdks/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.2.0/lib/messages.dart:116:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
 - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('../../../sdks/flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
        channel.setMockMessageHandler((dynamic message) async {
                ^^^^^^^^^^^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script '/Users/nic/sdks/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1005

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/nic/sdks/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 46s
Exception: Gradle task assembleDebug failed with exit code 1

Expected behavior
The library should be compatible with the latest stable channel.

Additional context
I will try to update the transitive dependencies and see if that resolves the issues (if so, will make a PR).

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.