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

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

currency_text_input_formatter

Flutter के लिए मुद्रा पाठ इनपुट स्वरूपकर्ता। अपने Flutter ऐप में इसका आसान और सरल उपयोग करें।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
1.2 लाख
लाइक
293
Pub अंक
160

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

flutter pub add currency_text_input_formatter

पैकेज अवलोकन

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

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

उपयोग

  • वित्तीय ऐप फॉर्म इनपुट
  • ई-कॉमर्स मूल्य दर्ज करें
  • व्यय ट्रैकिंग एप्लिकेशन
  • इन्वॉइस और बिलिंग प्रणाली
  • उपयोगकर्ता प्रोफ़ाइल वित्तीय विवरण
  • भुगतान गेटवे एकीकरण

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

  • रियल-टाइम मुद्रा प्रारूपण
  • कस्टम मुद्रा प्रतीक समर्थित करता है
  • स्वचालित दशमलव और हजार के अलगाव
  • क्रॉस-प्लेटफॉर्म संगतता
  • TextFields के साथ सरल एकीकरण
  • निर्धारित दशमलव स्थान

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

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

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

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

मूल README

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

Currency Text Input Formatter

pub package

Currency Text Input Formatter for Flutter. https://pub.dev/packages/currency_text_input_formatter

Installation

Solving Intl package conflict

Add this code end of pubspec.yaml.

dependency_overrides:
  intl: your intl package version

Usage

Basic
import 'package:currency_text_input_formatter/currency_text_input_formatter.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Welcome to Flutter'),
        ),
        body: Center(
          child: TextField(
            inputFormatters: [CurrencyTextInputFormatter.currency()],
            // inputFormatters: [CurrencyTextInputFormatter.simpleCurrency()], < for simple
            // inputFormatters: [CurrencyTextInputFormatter()], < for basic
            keyboardType: TextInputType.number,
          ),
        ),
      ),
    );
  }
}
With initialValue
import 'package:currency_text_input_formatter/currency_text_input_formatter.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Welcome to Flutter'),
        ),
        body: Center(
          child: MyFormField(),
        ),
      ),
    );
  }
}

class MyFormField extends StatefulWidget {
  const MyFormField({ super.key });

  @override
  State<MyFormField> createState() => _MyFormFieldState();
}

class _MyFormFieldState extends State<MyFormField> {
  final CurrencyTextInputFormatter _formatter = CurrencyTextInputFormatter.currency();

  @override
  Widget build(BuildContext context) {
    return TextFormField(
      initialValue: _formatter.formatString('2000'),
      inputFormatters: <TextInputFormatter>[_formatter],
      keyboardType: TextInputType.number,
    );
  }
}
Custom Options
import 'package:currency_text_input_formatter/currency_text_input_formatter.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Welcome to Flutter'),
        ),
        body: Center(
          child: TextField(
            inputFormatters: <TextInputFormatter>[
              CurrencyTextInputFormatter.currency(
                locale: 'ko',
                decimalDigits: 0,
                symbol: 'KRW(원) ',
              ),
            ],
            keyboardType: TextInputType.number,
          ),
        ),
      ),
    );
  }
}
With built-in methods
import 'package:currency_text_input_formatter/currency_text_input_formatter.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Welcome to Flutter'),
        ),
        body: Center(
          child: MyFormField(),
        ),
      ),
    );
  }
}

class MyFormField extends StatefulWidget {
  const MyFormField({ super.key });

  @override
  State<MyFormField> createState() => _MyFormFieldState();
}

class _MyFormFieldState extends State<MyFormField> {
  final CurrencyTextInputFormatter _formatter = CurrencyTextInputFormatter.currency();

  @override
  Widget build(BuildContext context) {
    // Built-in Methods
    print(_formatter.getFormattedValue()); // $ 2,000
    print(_formatter.getUnformattedValue()); // 2000.00
    print(_formatter.formatString('2000')); // $ 2,000
    print(_formatter.formatDouble(20.00)); // $ 20

    return TextFormField(
      inputFormatters: <TextInputFormatter>[_formatter],
      keyboardType: TextInputType.number,
    );
  }
}

Recommend Libraries

Maintainer

License

MIT

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 1 आइटम

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

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