responsive_image
tzvc/responsive_image open-source repository details.
- Stars
- 5
- Forks
- 4
- Last push (UTC)
- Nov 9, 2019
- Project status
- Active
Original README
English project snapshot. Visit GitHub for the latest content.
responsive_image
A Flutter library that bring responsive capabilities to images.
Given a set of source URLs, the widget select the approriate source depending on the rendering size of the child widget, the pixel density of the device and a user defined scaling preference.
Features
- Automatic image source selection based on size and device pixel density
- Adjustable scaling preference
- Extendability and customization with builder
Example
Basic usage:
ResponsiveImage(
srcSet: {
64: "https://via.placeholder.com/64",
128: "https://via.placeholder.com/128",
256: "https://via.placeholder.com/256",
512: "https://via.placeholder.com/512",
},
scalePreference: ScalePreference.Upper,
);
Usage with builder for further customization of the displayed image:
ResponsiveImage(
srcSet: {
256: "https://via.placeholder.com/256",
512: "https://via.placeholder.com/512",
1024: "https://via.placeholder.com/1024",
},
builder: (BuildContext context, String url) {
return CachedNetworkImage(
imageUrl: url,
placeholder: (context, url) => CircularProgressIndicator(),
errorWidget: (context, url, error) => Icon(Icons.error),
);
},
);
LanguagesDartSwiftKotlinObjective-C
Dependencies used
Dependency list 2 items
- flutter
{"sdk":"flutter"} - flutter_testDevelopment
{"sdk":"flutter"}
How do I choose a repository?
Start with your use case, compare repository activity, and check the original project before adopting it.
- Search by repository name, owner or description, then narrow the results by topic.
- Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
- Read the README, license and issues on GitHub before using a project.
Sources and maintenance
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗
- tzvc/responsive_image · GitHub ↗
- GitHub Docs — Saving repositories with stars ↗
- Directory maintained by Ducafecat ↗
