Giter Club home page Giter Club logo

flutter-simple-url-preview's Introduction

Hi there šŸ‘‹

  • šŸ”­ Iā€™m currently working as Senior Engineer @ Getir
  • šŸŒ± Iā€™m currently learning Flutter
  • šŸ‘Æ Iā€™m looking to collaborate on Flutter projects/ open source flutter libraries.
  • šŸ’¬ Ask me about Java, Spring boot
  • šŸ“« How to reach me: [email protected]

Visitors -

flutter-simple-url-preview's People

Contributors

abdulalikhan avatar amitbhave avatar coreagile avatar imshibl avatar paurakhsharma avatar vinothvino42 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

Watchers

 avatar  avatar  avatar

flutter-simple-url-preview's Issues

Make onTap configurable

Currently, the Link Preview Container opens the URL in the browser when tapped.

But it would be great if we could pass our own custom onTap method

Firebase Dynamic Link not previewing correctly

I have long url, say https://flutree.web.app/NWfLo and I shorten it, adding social metadata in app and it became https://flut.page.link/hcpa.

So, when tap the shorten link, it should redirect to the long link.

The problem is, this package returns a preview of the redirected link, not the Firebase Dynamic Link one.

My Code:

SimpleUrlPreview(
      url: 'https://flut.page.link/hcpa',
      bgColor: Colors.white,
),

Screenshot:
This package:
image

How I want it to look like:
image

Cache network requests

We need to show users a list of SimpleUrlPreview(), so, every time the user goes to this page
the app needs to reload all those SimpleUrlPreview().

So, I was thinking about caching the response from the URL so that it doesn't take a long time when the user goes to the page for the next time.

I am aware all the users of the package might not need to display the list of SimpleUrlPreview() so, you might not want to implement this in this package.

Please let me know if you are willing to add this feature in the package if so I will be happy to create a PR.
Else, I want to fork this package and add that functionality. I am thinking about using shared_preferences
for this. Please let me know if you have any better suggestions.

Thanks.

Make Container padding configurable

Currently, the Container has a hard-coded padding of const EdgeInsets.all(10),
But I need to display the list of URL previews, so I get unnecessary gap between the list elements.

It would be great if the padding was configurable

[bug] Overflow for long content

Hi,

Using the following incantation:

SimpleUrlPreview(
    previewContainerPadding:
        const EdgeInsets.only(top: 10, left: 46),
    bgColor: Colors.white,
    textColor: Colors.black,
    url: "https://giphy.com/gifs/crazy-the-simpsons-halloween-eaECZB7V6GACc")

I get the following error:

======== Exception caught by rendering library =====================================================
The following assertion was thrown during layout:
A RenderFlex overflowed by 6.0 pixels on the bottom.

The relevant error-causing widget was: 
  SimpleUrlPreview file:///Users/sstarkey/Synced/dev/dreamful-service/client/mobile/lib/facets/chat_facet.dart:324:27
The overflowing RenderFlex has an orientation of Axis.vertical.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.

Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size.
This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.

The specific RenderFlex in question is: RenderFlex#87db2 relayoutBoundary=up19 OVERFLOWING
...  parentData: offset=Offset(8.0, 8.0) (can use size)
...  constraints: BoxConstraints(w=192.5, 0.0<=h<=96.0)
...  size: Size(192.5, 96.0)
...  direction: vertical
...  mainAxisAlignment: spaceEvenly
...  mainAxisSize: max
...  crossAxisAlignment: start
...  textDirection: ltr
...  verticalDirection: down
ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤ā—¢ā—¤
====================================================================================================

Would much prefer the content not to wrap, but instead truncate. Can we make that a configuration option?

Support web

Would be great if this package worked on web

User showing url in place of site_name suggestion

Have been having a design where I was to show a link in place of the site_name, I had to make some changes so as to have that feature within the package.
Screenshot_20210826-194543
I added isShowLink: true which the default is isShowLink: false showing the site_name
`

simple_url_preview.dart error after updateing to a new flutter version

After updating to a new flutter version I got the error:
C:/Users/hayor/AppData/Local/Pub/Cache/hosted/pub.dev/simple_url_preview-3.0.1/lib/**simple_url_preview.dart:**174:54: Error: The getter 'accentColor' isn't defined for the class 'ThemeData'.

I am not expert in flutter but this site:
https://docs.flutter.dev/release/breaking-changes/theme-data-accent-properties#migration-guide
says:

Code before migration:
MaterialApp(
theme: ThemeData(accentColor: myColor),
// ...
);
Code after migration:

content_copy
final ThemeData theme = ThemeData();
MaterialApp(
theme: theme.copyWith(
colorScheme: theme.colorScheme.copyWith(secondary: myColor),
),
//...
)

It looks that 'accentColor' is not defined there anymore.

But maybe I am wrong - can you look into this problem?

Thanks,
zb

Remove textColor attribute

Remove textColor attribute, as separate titleStyle, descriptionStyle and siteNameStyle attributes have been given for the style configuration.

Adding elevation

Have been having a design where elevation is 0, I also made some changes adding an attribute to allow making changes to the card's elevation.

Screenshot_20210826-194448

I added elevation: 0, which the default is elevation: 5.

Does it has support for JavaScript-powered sites?

Hi there,

Precisely some weeks ago I was researching for a library intended to show a URL preview, but no one of the ones I tested did work.

So, I decided to develop my own URL preview component. However, I realised that, at the end, which was the problem was the URL I was using for tests. I was trying to preview a link to a tweet (Twitter).
The key here is that, when you gets the HTML content of a Twitter page, it returns a simple HTML telling you should enable JavaScript. So, without JavaScript, the factory can't find the Open Graph data.

So, is it supported?

Thanks,
Joan

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.