सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Shimmer एक Flutter पैकेज है जो UI कंपोनेंट्स में शिमर लोडिंग प्रभाव जोड़ने को सरल बनाता है, एक चिकनी, एनिमेटेड प्लेसहोल्डर दिखावट बनाता है। यह सूचियों, कार्डों या छवियों में सामग्री लोडिंग स्थितियों को नकल करने के लिए आदर्श है, डेटा लोड करते समय उपयोगकर्ता अनुभव को बढ़ावा देता है। इस पैकेज को सभी प्रमुख प्लेटफॉर्म जैसे Android, iOS, Web, macOS, Windows और Linux के लिए समर्थन मिलता है, जिससे उपकरणों के बीच संगत व्यवहार सुनिश्चित होता है। कम सेटअप के साथ, विकासकर्ता जटिल एनिमेशन लिखे बिना दृश्य रूप से आकर्षक लोडिंग संकेतक त्वरित रूप से लागू कर सकते हैं।
उपयोग
सूचियों में लोडिंग स्थानापन्न
एनिमेटेड कार्ड स्थान भरने वाले
इमेज लोडिंग स्केलेटन
डेटा फ़ेच के दौरान उपयोगकर्ता अनुभव में सुधार
डायनामिक कंटेंट प्रीव्यू
मुख्य विशेषताएँ
सरल API एकीकरण
प्लेटफॉर्म के अनुकूल समर्थन
कस्टमाइज़ किए गए शिमर रंग
चिकन एनिमेशन प्रभाव
हल्का और कार्यक्षम
इनके लिए उपयुक्त
दृश्य चमक की तलाश में UI डिज़ाइनर
गतिशील सामग्री स्क्रीन बना रहे विकासकर्ता
अक्सर डेटा लोड करने वाले ऐप्स
इंटरैक्टिव इंटरफेस के प्रोटोटाइपिंग
संवेदनशील प्रदर्शन में सुधार
विचार योग्य बातें
स्थिर सामग्री के लिए उपयुक्त नहीं
विजेट ट्री में सही स्थान पर रखने की आवश्यकता है
अगर अधिक उपयोग किया जाए, तो प्रदर्शन पर प्रभाव पड़ सकता है
मूल शैली के अलावा सीमित कस्टमाइज़ेशन
सबसे अच्छा लाभ ट्रांसपेरेंट बैकग्राउंड के साथ होता है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Shimmer
A lightweight Flutter widget that paints a moving highlight over placeholder
UI. Typical uses are skeleton screens while data loads, and a sliding highlight
on a call to action.
Install
dependencies:shimmer:^4.0.0material_ui:^1.0.1
shimmer 4.0 uses Flutter's standalone material_ui package (Flutter 3.44+). Apps that still import package:flutter/material.dart can wrap those subtrees in MaterialUiCompatibilityBridge.
Shimmer.fromColors is the usual constructor. Build the child from solid
shapes (Container, Row, Column). The gradient replaces those colors;
transparent pixels stay transparent.
*Required on Shimmer(...). Shimmer.fromColors takes baseColor and
highlightColor instead.
Performance
Wrap a list of placeholders in one Shimmer, not one Shimmer per row.
Keep child simple and static. Fancy widgets (images, text with decoration,
elevation) often look wrong because the shader replaces their colors.
Toggle enabled to false when loading finishes so the ticker stops.
Example
The example/ app shows a loading list and a “slide to unlock” highlight.
From the repository root:
cd example && flutter run
How it works
Shimmer drives an AnimationController and paints a ShaderMaskLayer over
the child (BlendMode.srcIn). The highlight rectangle is three times the
child size so the band can travel fully across the widget.