पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv0.1.0

flutter_lazy_indexed_stack

एक Flutter पैकेज जो एक `IndexedStack` को लेटीली लोड करने की अनुमति देता है।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
6.7 हज़ार
लाइक
80
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add flutter_lazy_indexed_stack

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक फ्लटर पैकेज जो बिल्ट-इन IndexedStack को उनके बच्चों के लेट लोडिंग का समर्थन करने के लिए विस्तारित करता है। यह सुनिश्चित करता है कि केवल वर्तमान में दृश्यमान विजेट को बनाया और रेंडर किया जाता है, जिससे बड़े स्टैक में महंगे विजेट के साथ प्रदर्शन में सुधार होता है। यह स्थितियों के लिए आदर्श है जहां मेमोरी दक्षता और आवश्यकता के अनुसार रेंडरिंग महत्वपूर्ण है। पैकेज IndexedStack के समान API बनाए रखता है लेकिन लेट इनिशियलाइजेशन जोड़ता है, जिससे इसे मौजूदा प्रोजेक्ट में बिना किसी दिक्कत के एकीकृत किया जा सकता है।

उपयोग

  • बड़े टैब वाले इंटरफेस
  • स्मृति-कुशल नेविगेशन
  • डायनामिक कंटेंट स्विचिंग
  • आवश्यकता पर विजेट रेंडरिंग
  • भारी घटकों के साथ जटिल UI

मुख्य विशेषताएँ

  • स्टैक बच्चों का लेटी लोडिंग
  • IndexedStack के समान API
  • सुधारित प्रदर्शन
  • कम मेमोरी उपयोग
  • निरंतर एकीकरण

इनके लिए उपयुक्त

  • विकासकर्ता उपयोगकर्ता इंटरफेस प्रदर्शन को अनुकूलित कर रहे हैं
  • बहुत सारे टैब या स्क्रीन वाले ऐप्स
  • भारी विजेट्स के साथ IndexedStack का उपयोग करने वाले प्रोजेक्ट्स
  • पेजिंग-भारी एप्लिकेशन
  • अत्यधिक इंटरैक्टिव डैशबोर्ड

विचार योग्य बातें

  • तुरंत बच्चे के निर्माण की आवश्यकता के लिए उपयुक्त नहीं
  • स्टैक-आधारित लेआउट पर सीमित
  • ध्यान से राज्य प्रबंधन की आवश्यकता हो सकती है
  • स्थिर इंडेक्स मानों के साथ सबसे अच्छा उपयोग किया जाता है
  • डिफ़ॉल्ट रूप से एनीमेटेड ट्रांज़िशन का समर्थन नहीं करता है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Lazy Indexed Stack 😴🥞

pub ci License: MIT style: very good analysis

A Flutter package that exposes an IndexedStack that can be lazily loaded.

IndexedStack is a widget that shows its children one at a time, preserving the state of all the children. But it renders all the children at once.

With LazyIndexedStack, you can load the children lazily, and only when they are needed. This comes in handy if you have a lot of children, and you don't want to load them all at once or if you have a child that loads content asynchronously.

Usage

The LazyIndexedStack API is the same as IndexedStack. A basic implementation requires two parameters:

  • A List<Widget> of children that are going to be lazy loaded under the hood.
  • An int index that indicates which child is going to be shown.

Example

class HomePage extends StatefulWidget {
  const HomePage({super.key, required this.title});

  final String title;

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  int index = 0;

  void changeIndex(int newIndex) => setState(() => index = newIndex);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        children: [
          Expanded(
            child: LazyIndexedStack(
              index: index,
              children: List.generate(3, (i) => Text('$i')),
            ),
          ),
          BottomNavigationBar(
            currentIndex: index,
            onTap: changeIndex,
            items: const [
              BottomNavigationBarItem(
                icon: Icon(Icons.filter_1),
                label: '1',
              ),
              BottomNavigationBarItem(
                icon: Icon(Icons.filter_2),
                label: '2',
              ),
              BottomNavigationBarItem(
                icon: Icon(Icons.filter_3),
                label: '3',
              ),
            ],
          ),
        ],
      ),
    );
  }
}

Refer to the example to see the usage of LazyIndexedStack.

श्रेणियाँ

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट