v1.5.6
flutter_link_preview
यह एक URL प्रीव्यू प्लगइन है जो URL के सामग्री का प्रीव्यू करता है।
76लाइक 14730-दिन डाउनलोड40Pub अंक
प्लेटफ़ॉर्म डेटा नहीं
यह एक फ्लटर URL प्रीव्यू प्लगइन है जो URL के सामग्री का प्रीव्यू प्रदान करता है
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
This is a URL preview plugin that previews the content of a URL
FlutterLinkPreview(
url: "https://github.com",
titleStyle: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.bold,
),
)
Result:
Widget _buildCustomLinkPreview(BuildContext context) {
return FlutterLinkPreview(
key: ValueKey("${_controller.value.text}211"),
url: _controller.value.text,
builder: (info) {
if (info == null) return const SizedBox();
if (info is WebImageInfo) {
return CachedNetworkImage(
imageUrl: info.image,
fit: BoxFit.contain,
);
}
final WebInfo webInfo = info;
if (!WebAnalyzer.isNotEmpty(webInfo.title)) return const SizedBox();
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: const Color(0xFFF0F1F2),
),
padding: const EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
CachedNetworkImage(
imageUrl: webInfo.icon ?? "",
imageBuilder: (context, imageProvider) {
return Image(
image: imageProvider,
fit: BoxFit.contain,
width: 30,
height: 30,
errorBuilder: (context, error, stackTrace) {
return const Icon(Icons.link);
},
);
},
),
const SizedBox(width: 8),
Expanded(
child: Text(
webInfo.title,
overflow: TextOverflow.ellipsis,
),
),
],
),
if (WebAnalyzer.isNotEmpty(webInfo.description)) ...[
const SizedBox(height: 8),
Text(
webInfo.description,
maxLines: 5,
overflow: TextOverflow.ellipsis,
),
],
if (WebAnalyzer.isNotEmpty(webInfo.image)) ...[
const SizedBox(height: 8),
CachedNetworkImage(
imageUrl: webInfo.image,
fit: BoxFit.contain,
),
]
],
),
);
},
);
}
उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗