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

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

flutter_laravel_form_validation

एक सरलीकृत डार्ट एक्सटेंशन आधारित फ्लटर फॉर्म वैधता। लारावेल वैधता से प्रेरित।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
224
लाइक
24
Pub अंक
160

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

flutter pub add flutter_laravel_form_validation

पैकेज अवलोकन

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

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

उपयोग

  • उपयोगकर्ता पंजीकरण फॉर्म की प्रमाणित करना
  • रियल-टाइम इनपुट सत्यापन का कार्यान्वयन
  • पुनर्उपयोगी नियमों के लिए मानकीकरण बनाएं
  • जटिल फॉर्म तर्क का प्रबंधन
  • त्रुटि संदेश को सरल बनाना
  • मौजूदा Flutter फॉर्म के साथ एकीकरण

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

  • लैरावेल-प्रेरित वैधता सिंटैक्स
  • चेनेबल वैधता नियम
  • कस्टमाइज़ किए गए त्रुटि संदेश
  • बहुपлатफॉर्म समर्थन
  • Flutter विजेट्स के साथ आसान एकीकरण
  • वास्तविक समय वैधता प्रतिक्रिया

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

  • Laravel के परिचय वाले Flutter विकासकर्ता
  • स्थिर वैधता पैटर्न की खोज कर रहे टीमें
  • ठीक से फॉर्म वैलिडेशन की आवश्यकता वाले प्रोजेक्ट्स
  • संक्षिप्त प्रामाणिकता कोड चाहने वाले विकासकर्ता
  • जटिल फॉर्म आवश्यकताओं वाले ऐप्स

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

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

मूल README

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

Flutter Laravel Form Validation

A simplified dart extension based flutter form validation . Inspired by Laravel Validation.

🎖 Installing

dependencies:
  flutter_laravel_form_validation : ^1.0.4
⚡️ Import
import 'package:flutter_laravel_form_validation/flutter_laravel_form_validation.dart';

🎮 How To Use

Validation rules in a list, short form without label or custom messages

    TextFormField(
        validator : ['required','max:10','uppercase'].v,
    ),

Validation rules in a list using the FLValidator class, short form without label or custom messages

    TextFormField(
        validator : [FLValidator.required,FLValidator.max(10),FLValidator.uppercase].v,
    ),

Custom validation in a list

    TextFormField(
        validator : [FLValidator.required,customValidation].v,
    ),

    String? customValidation(String? value) {
    if (value == "flutterdev") {
        return "Value cannot be flutterdev";
    }
    return null;
    }

Validation rules in a string, short form without label or custom messages

    TextFormField(
        validator : "required|max:10|uppercase".v,
    ),

Validation rules in a list with label or custom messages

 TextFormField(
        validator : ['required','max:10','uppercase',].validate(attribute: 'Username',
        customMessages: {
            'required': "You must input your username",
            'max': "The length must be 10",
             'uppercase': "Only uppercase is allowed"
            },
    ),

Validation rules in a list with label or custom messages

 TextFormField(
        validator : "required|max:10|uppercase".validate(attribute: 'Username',
        customMessages: {
            'required': "You must input your username",
            'max': "The length must be 10",
             'uppercase': "Only uppercase is allowed"
            },
    ),

Rules

Class property String Description Example
FLValidator.required required For making sure a form field value is required ['required'] or 'required' or [FLValidator.required]
FLValidator.numeric numeric For making sure a form field value is numeric ['numeric'] or 'numeric' or [FLValidator.numeric]
FLValidator.integer interger For making sure a form field value is an interger ['interger'] or 'interger' or [FLValidator.interger]
FLValidator.double double For making sure a form field value is a double ['double'] or 'double' or [FLValidator.double]
FLValidator.between(min,max) between(min,max) For making sure a form field value is between the of min and max ['between:2,8'] or 'between(2,8)' or [FLValidator.between(2,8)]
FLValidator.max(length) max:length For making sure a form field value length is limited to the max length ['max:5'] or 'max:5' or [FLValidator.max(5)
FLValidator.min(length) min:length For making sure a form field value length is limited to the min length ['min:5'] or 'min:5' or [FLValidator.min(5)]
FLValidator.gt(number) gt:number For making sure a form field value is greater than the number specified ['gt:10'] or 'gt:10' or [FLValidator.gt(10)]
FLValidator.lt(number) lt:number For making sure a form field value is less than the number specified ['lt:10'] or 'lt:10' or [FLValidator.lt(10)]
FLValidator.gte(number) gte:number For making sure a form field value is greater than or equal to the number specified ['gte:10'] or 'gte:10' or [FLValidator.gte(10)]
FLValidator.lte(number) lte:number For making sure a form field value is less than or equal to the number specified ['lte:10'] or 'lte:10' or [FLValidator.lte(10)]
FLValidator.uppercase uppercase For making sure a form field value is uppercase ['uppercase'] or 'uppercase' or [FLValidator.uppercase]
FLValidator.lowercase lowercase For making sure a form field value is lowercase ['lowercase'] or 'lowercase' or [FLValidator.lowercase]
FLValidator.startsWith(value) starts_with:value For making sure a form field value starts with the specified value ['starts_with:man'] or 'starts_with:man' or [FLValidator.startsWith(man)]
FLValidator.endsWith(value) ends_with:value For making sure a form field value ends with the specified value ['ends_with:man'] or 'ends_with:man' or [FLValidator.endsWith(man)]
FLValidator.same(other) same:other For making sure a form field value is same as other ['same:other'] or 'same:other' or [FLValidator.same(other)]
FLValidator.alphaNum alpha_num For making sure a form field value is alpha numeric ['alpha_num'] or 'alpha_num' or [FLValidator.alphaNum]
FLValidator.inItems(List items) in: For making sure a form field value exist in a list ['in:he,she,it'] or 'in:he,she,it' or [FLValidator.inItems([he,she,it])]
FLValidator.notInItems(List items) not_in: For making sure a form field value does exist in a list ['not_in:he,she,it'] or 'not_in:he,she,it' or [FLValidator.notInItems([he,she,it])]
FLValidator.regEx(pattern) regex:pattern For making sure a form field value match the specified regular expression pattern ['regex:pattern'] or 'regex:pattern' or [FLValidator.regEx(pattern)]
FLValidator.email email For making sure a form field value is an email ['email'] or 'email' or [FLValidator.email]
FLValidator.ip ip For making sure a form field value is an ip address ['ip'].v or 'ip'.v or [FLValidator.ip].v
FLValidator.url url For making sure a form field value is a url ['url'].v or 'url'.v or [FLValidator.url].v

Also, localization is a work in progress

🐛 Bugs/Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github and I'll look into it. Pull request are also welcome.

श्रेणियाँ

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

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

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