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

पैकेज विवरणv1.0.4

power_state

डिपेंडेंस इंजेक्शन के साथ एक Flutter राज्य प्रबंधन समाधान। आप अपने राज्य को आसानी से प्रबंधित कर सकते हैं

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
102
लाइक
14
Pub अंक
150

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

flutter pub add power_state

पैकेज अवलोकन

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

PowerState एक Flutter स्थिति प्रबंधन समाधान है जो डेपेंडेंसी इंजेक्शन को एकीकृत करता है ताकि स्थिति के प्रबंधन को सरल बनाया जा सके। यह विकासकर्ताओं को अनुप्रयोग स्थिति को कुशलता से प्रबंधित करने में सक्षम बनाता है और साफ, स्केलेबल कोड को बढ़ावा देता है। आंतरिक डेपेंडेंसी इंजेक्शन के साथ, यह बॉइलरप्लेट को कम करता है और परीक्षण क्षमता को बढ़ाता है। यह पैकेज सभी प्रमुख प्लेटफॉर्म का समर्थन करता है, जिससे यह क्रॉस-प्लेटफॉर्म एप्लिकेशन के लिए आदर्श बन जाता है। इसका सरल एपीआई छोटे उपकरणों में स्थिति अपडेट को आसानी से सेटअप और बिना किसी रुकावट के अपडेट करने की अनुमति देता है।

उपयोग

  • क्रॉस-प्लेटफॉर्म ऐप स्टेट मैनेजमेंट
  • Flutter ऐप्स में निर्भरता निवेश
  • जटिल राज्य तर्क को सरल बनाना
  • राज्य वाले घटकों का परीक्षण
  • स्केलेबल UI आर्किटेक्चर बनाना
  • राज्य संभाल में बॉयलरप्लेट को कम करना

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

  • निर्मित निर्भरता इंजेक्शन
  • क्रॉस-प्लेटफ़ॉर्म समर्थन
  • न्यूनतम बॉयलरप्लेट
  • आसान राज्य अपडेट
  • स्केलेबल आर्किटेक्चर
  • परीक्षण-अनुकूल डिज़ाइन

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

  • एकीकृत DI और अवस्था प्रबंधन की तलाश में विकासकर्ता
  • बड़े पैमाने पर Flutter एप्लिकेशन बनाने वाली टीमें
  • रखरखाव योग्य राज्य तर्क की आवश्यकता वाले प्रोजेक्ट्स
  • Flutter के शुरुआती लोग अवस्था प्रबंधन सीख रहे हैं
  • बहुप्लेटफॉर्म लक्षित ऐप्स

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

  • उपलब्ध दस्तावेज़ सीमित हैं
  • लोकप्रिय विकल्पों की तुलना में छोटा समुदाय
  • नए उपयोगकर्ताओं के लिए सीखने का वक्र आवश्यक हो सकता है
  • उत्पादन में अभी तक व्यापक रूप से अपनाया नहीं गया है
  • सीमित तृतीय पक्ष प्लगइन सुविधा के लिए संभावना

मूल README

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

Power State is a lightweight and flexible state management library for Flutter apps. It provides a simple and easy-to-use API that helps you manage the state of your app in a clean and efficient way. With Power State, you can easily manage your app's state and update your UI in real-time.

Usage

Step:1 Create a PowerController

Create a controller class that extends PowerController. This controller class will hold your application's state and provide methods to manipulate it.

Here's an example CounterController class:

import 'package:power_state/power_state.dart';

class CounterController extends PowerController {
  int count = 1;

  increment() {
    count++;
    notifyListeners();
  }
}

Step:2 Store controller

Instantiate your controller class using PowerVault.put() method:

final CounterController controller = PowerVault.put(CounterController());

Step:3 Use PowerBuilder and PowerSelector to access your state

Use PowerBuilder to listen for changes to your state and rebuild your UI. Use PowerSelector to select a specific value from your state and rebuild only when that value changes.:

PowerBuilder<CounterController>(
  builder: (countController) {
    return Text(countController.count.toString());
  },
),

PowerSelector<CounterController>(
  selector: () => controller.selectorValue,
  builder: (countController) {
    return Text(countController.selectorValue.toString());
  },
),

Step:4 Update your state

Update your state by calling methods on your controller and calling notifyListeners() to rebuild your UI.

controller.increment();
controller.update();

You can find a Controller that is being used by another page and redirect you to it.

final CounterController countController = PowerVault.find();

Deleting a controller

If you no longer need a controller, you can delete it from PowerVault using the PowerVault.delete() method. Here's an example of deleting the CounterController:

PowerVault.delete<CounterController>();

Deleting all controller

If you no longer need controllerr, you can delete it from PowerVault using the PowerVault.clear() method. Here's an example of clear controllers:

PowerVault.clear();

Check out the example app to see Power State in action.

श्रेणियाँ

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

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

अभी कोई डेटा उपलब्ध नहीं है।