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

पैकेज विवरणv2.0.0

the_validator

फ्लटर के लिए एक सरल और आसान वैधता पैकेज जिसका उपयोग फॉर्म फील्ड्स और स्ट्रिंग्स और मानों को वैध करने के लिए किया जा सकता है

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
183
लाइक
25
Pub अंक
130

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

flutter pub add the_validator

पैकेज अवलोकन

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

वैलिडेटर एक हल्का Flutter पैकेज है जो सरल और कुशल फॉर्म फील्ड, स्ट्रिंग और मान वैलिडेशन के लिए डिज़ाइन किया गया है। इसमें ईमेल, पासवर्ड और कस्टम शर्तों जैसे इनपुट को वैलिडेट करने के लिए एक स्पष्ट और सहज API है। जटिल सेटअप के बिना त्वरित एकीकरण की तलाश करने वाले डेवलपर्स के लिए आदर्श है, यह Android, iOS, Web, macOS, Windows और Linux जैसे कई प्लेटफॉर्म का समर्थन करता है। यह पैकेज फॉर्म इनपुट के दौरान रियल-टाइम प्रतिक्रिया के माध्यम से उपयोगकर्ता अनुभव को बढ़ाता है। इसकी न्यूनतम दृष्टिकोण इसे किसी भी फ्लटर प्रोजेक्ट में बेहद आसानी से अपनाने योग्य बनाता है जिसमें मूल या उन्नत वैलिडेशन तर्क की आवश्यकता हो।

उपयोग

  • फॉर्म इनपुट सत्यापन
  • ईमेल और पासवर्ड जांच
  • कस्टम वैधता नियम
  • रियल-टाइम उपयोगकर्ता प्रतिक्रिया
  • उपयोगकर्ता फॉर्म में डेटा अखंडता
  • क्रॉस-प्लेटफ़ॉर्म सत्यापन

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

  • सरल API
  • कई प्रकार के सत्यापन का समर्थन करता है
  • वास्तविक समय में प्रमाणीकरण
  • क्रॉस-प्लेटफॉर्म संगतता
  • विस्तारयोग्य नियमों की जाँच
  • हल्का और तेज़

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

  • शुरुआती Flutter विकासकर्ता
  • त्वरित प्रमाणीकरण की आवश्यकता वाले प्रोजेक्ट
  • मोबाइल और वेब एप्लिकेशन
  • फॉर्म-भारी एप्लिकेशन
  • कठोर डेटा एंट्री आवश्यकताओं वाले ऐप
  • न्यूनतम निर्भरता के प्रति प्राथमिकता देने वाले विकासकर्मी

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

  • मूलभूत सत्यापन की आवश्यकता तक सीमित
  • कोई निर्मित अंतर्राष्ट्रीयकरण नहीं
  • त्रुटि संदेश को हाथ से संभालने की आवश्यकता है
  • अत्यधिक जटिल वैधता कार्यप्रवाह के लिए उपयुक्त नहीं
  • बाह्य GitHub भंडार पर निर्भर करता है
  • मूल उदाहरणों के अतिरिक्त न्यूनतम दस्तावेज़ीकरण

मूल README

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

The Validator

A simple & lightweight form and data validation package for flutter

How to use

The Validator can be used directly on a TextFormField validator parameter TextFormField(validator: FieldValidator.email())

The Validator can also be used as a stand alone validator Validatror.isPassword('SecretPass', shouldContainCapitalLetter: true)

Sample Usage (FieldValidator)

TextFormField( 
    controller: _emailController,
    validator: FieldValidator.email(),
    decoration: InputDecoration(labelText: "Email"),
    ),
                
 TextFormField( 
    controller: _passwordController,
        validator: FieldValidator.password(
        minLength: 8,
        shouldContainNumber: true,
        shouldContainCapitalLetter: true,
        shouldContainSmallLetter: true,
        shouldContainSpecialChars: true,
        errorMessage: "Password must match the required format",
        isNumberNotPresent: () { return "Password must contain number"; },
        isSpecialCharsNotPresent: () { return "Password must contain special characters"; },
        isCapitalLetterNotPresent: () { return "Password must contain capital letters"; }
        ),
        decoration: InputDecoration(labelText: "Email"),
    ),

To validate confirm password field

  // To validate confirm password field
  TextFormField(
      controller: _confirmPasswordController,
      obscureText: true,
      validator: FieldValidator.equalTo(_passwordController, message: "Password Mismatch"),
      decoration: InputDecoration(labelText: "Confirm Password"),
  )

Then make a call to formState .validate() to perform the validations on the textfields


RaisedButton(
  onPressed: () {
    // validate() inputed data
    if (_formKey.currentState.validate()) {

          _scaffoldKey.currentState
          .showSnackBar(SnackBar(content: Text("Yay! we got it right!")));
                      
    }
  },
  child: Text("Submit"),                  
)

Sample Usage 2 (Validator)

var password = 'Secret'
var confirmPassword = 'secret'
if (Validator.isPassword(password, shouldContainCapitalLetter: true)) {
  if (Validator.isEqualTo(password, confirmPassword)) {
    print("Go ahead & grant access")
  } else {
    print("Password mis match")
  }
}

Error messages

By default The Validator will give you a nice default error based on the the type of validation you specify for field or an input. But you can also override the default message

Default Error Messages

FieldValidator.alphaNumeric() will output Field must contain both alphabets and numbers

User Defined Error Message

FieldValidator.alphaNumeric(message: 'Your username must contain both numbers & alphabets')

श्रेणियाँ

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

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

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