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

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

custom_navigator

एक फ्लटर पैकेज जो विजेट ट्री में कहीं भी अपना नेविगेटर बनाने में आसानी प्रदान करता है।

30-दिन डाउनलोड
107
लाइक
51
Pub अंक
40

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

flutter pub add custom_navigator

पैकेज अवलोकन

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

एक फ्लटर पैकेज जो किसी भी हिस्से में कस्टम नेविगेटर बनाने को सरल बनाता है। यह डेवलपर्स को ऐप के मुख्य नेविगेटर से अलग नेविगेशन लॉजिक को परिभाषित और प्रबंधित करने की अनुमति देता है, जिससे मॉड्यूलर और पुन: उपयोगी नेविगेशन कंपोनेंट्स का निर्माण होता है। जटिल UI के लिए उपयुक्त जिसमें नेस्टेड या डायनामिक नेविगेशन फ्लो होते हैं, यह चिंता के अलगाव को बढ़ावा देता है और परीक्षण को आसान बनाता है। पैकेज हल्का है और लचीलापन के लिए डिज़ाइन किया गया है, बिना ऐप के मुख्य संरचना में गहरी एकीकरण के आवश्यकता के बिना।

उपयोग

  • बड़े एप्लिकेशन में मॉड्यूलर नेविगेशन बनाना
  • विजेट्स के भीतर नेस्टेड नेविगेशन बनाना
  • डायनामिक रूट प्रबंधन का कार्यान्वयन
  • पुनर्उपयोगी नेविगेशन घटक सक्षम करना
  • अलगाव में नेविगेशन तर्क का परीक्षण

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

  • किसी भी स्थान पर सरल एकीकरण विजेट वृक्ष में
  • कस्टम रूट परिभाषाओं का समर्थन करता है
  • पुन: उपयोगी नेविगेशन तर्क को बढ़ावा देता है
  • न्यूनतम बॉयलरप्लेट
  • मुख्य नेविगेटर से स्वतंत्र रूप से काम करता है

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

  • जटिल नेविगेशन पैटर्न बनाने वाले डेवलपर्स
  • मॉड्यूलर UI आर्किटेक्चर की आवश्यकता वाली टीमें
  • डायनामिक या नेस्टेड नेविगेशन वाले ऐप्स
  • परीक्षण-आधारित विकास कार्यप्रवाह
  • आंतरिक नेविगेशन की आवश्यकता वाले कस्टम UI घटक

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

  • MaterialApp.router के प्रतिस्थापन के रूप में नहीं बनाया गया है
  • कई संदर्भों में उपयोग किए जाने पर सावधानीपूर्वक राज्य प्रबंधन की आवश्यकता होती है
  • सरल ऐप में अत्यधिक उपयोग करने पर जटिलता बढ़ सकती है
  • बिल्ट-इन नेविगेटर्स की तुलना में सीमित प्लेटफॉर्म-विशिष्ट विशेषताएं

मूल README

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

Custom navigator

A flutter package that makes it easy to create your own navigator anywhere in the widget tree.

A common use for such widget is when you need to implement an "Always presenting bottom navigation bar"

Getting Started

First you need to add the package to your pubspec.yaml file.

Custom scaffold

CustomScaffold is a stateful widget that uses the CustomNavigator to to handle item transition of [BottomNavigationBar] with nested navigation while keeping the [BottomNavigationBar] visible!

Usage
// Here's the custom scaffold widget
// It takes a normal scaffold with mandatory bottom navigation bar
// and children who are your pages
CustomScaffold(
      scaffold: Scaffold(
        bottomNavigationBar: BottomNavigationBar(
          items: _items,
        ),
      ),

      // Children are the pages that will be shown by every click
      // They should placed in order such as
      // `page 0` will be presented when `item 0` in the [BottomNavigationBar] clicked.
      children: <Widget>[
        Page('0'),
        Page('1'),
        Page('2'),
      ],

      // Called when one of the [items] is tapped.
      onItemTap: (index) {},
    );

See the custom_scaffold_example for more details


Custom navigator

The CustomNavigator is fairly easy to use

Usage

CustomNavigator(
        home: YourChildWidget(),
        //Specify your page route [PageRoutes.materialPageRoute] or [PageRoutes.cupertinoPageRoute]
        pageRoute: PageRoutes.materialPageRoute,
      );

Then you can call it using the same old Navigator.of(context)

Options
  • you can specify Named routes exactly like in MaterialApp.

if you want to use the default [Navigator] you need to specify a [GlobalKey] to your [MaterialApp] and use it navigatorKey.currentState

See the example for more details.

श्रेणियाँ

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

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