패키지, 저장소 및 앱 카테고리 검색

currency_textfield 표지
패키지 상세v5.0.0+1

currency_textfield

통화 텍스트 입력을 위한 컨트롤러를 구현하는 플러터 패키지입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
395
좋아요
53
Pub 점수
160

패키지 설치

flutter pub add currency_textfield

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

통화 텍스트 입력을 처리하기 위한 전용 컨트롤러를 제공하는 플러터 패키지로, 자동 형식 지정, 마스킹 및 검증 기능을 갖추고 있습니다. 사용자가 일관된 형식으로 금액을 입력할 수 있도록 하며, 소수점과 통화 기호를 자동으로 삽입하면서 유효하지 않은 문자를 방지합니다. 정확한 재무 데이터 입력이 필요한 양식에 적합하며, 모바일, 웹, 데스크톱 등 다양한 플랫폼을 지원합니다. 이 패키지는 입력 오류를 줄이고 통화 값의 가독성을 향상시켜 사용자 경험을 개선합니다.

사용 사례

  • 재무 양식 입력
  • 전자상거래 체크아웃 필드
  • 예산 관리 앱
  • 청구서 및 결제 양식
  • 실시간 통화 표시

주요 기능

  • 자동 소수 형식
  • 통화 기호 삽입
  • 입력 검증
  • 크로스 플랫폼 지원
  • 사용자 정의 소수 자릿수
  • 실시간 피드백

적합한 대상

  • 금융 앱을 개발하는 개발자
  • 정확한 금액 입력이 필요한 앱
  • 엄격한 데이터 형식이 필요한 양식
  • 다중 플랫폼 금융 도구
  • 사용성과 정확성에 중점을 둔 UI

고려 사항

  • 사용자 지정 외관을 위해 추가 스타일링이 필요할 수 있습니다
  • 숫자 및 통화 고유의 동작에 제한됨
  • 통화 변환을 처리하지 않습니다
  • TextEditingController의 올바른 초기화에 의존합니다
  • 적절히 관리되지 않으면 다른 포맷터와의 잠재적인 충돌이 발생할 수 있음

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

currency_textfield

Build Status pub package

A Controller for currency text input

Demo

sample

Install

Follow this guide

Usage

Import the library

import 'package:currency_textfield/currency_textfield.dart';

Create the Controller

CurrencyTextFieldController controller = CurrencyTextFieldController()

Parameters and getters

Currency Symbol, Decimal and Thousand separator

It's possible to customize currencySymbol, decimalSymbol and thousandSymbol:

var controller = CurrencyTextFieldController(currencySymbol: "RR", decimalSymbol: ".", thousandSymbol: ",");
Get double value, get int value and get number in string format

To get the number value from controller, you can use both the doubleValue or the intValue properties:

//Double value:
final double val = controller.doubleValue;
//Int value:
final int val = controller.intValue;
//String number:
final int val = controller.textWithoutCurrencySymbol;
Initial value

You can initialize the controller using a int or a double, but not both at the same time. To make this, just use initDoubleValue or initIntValue:

final CurrencyTextFieldController controller2 = CurrencyTextFieldController(initDoubleValue: 10);
final CurrencyTextFieldController controller3 = CurrencyTextFieldController(initIntValue: 1000);

// this will raise an error!
final CurrencyTextFieldController controller4 = CurrencyTextFieldController(initIntValue: 1000,initDoubleValue: 10);
Position of the symbol and separator

You can decide if the symbol will be before or after the number. To make this, just use currencyOnLeft:

// default with the currency before the number
final CurrencyTextFieldController controller = CurrencyTextFieldController();

// currency after the number
final CurrencyTextFieldController controller2 = CurrencyTextFieldController(currencyOnLeft: false);

And also define the separator between the symbol and the value with currencySeparator:

// the default value is a single space
final CurrencyTextFieldController controller = CurrencyTextFieldController(currencySeparator: ' -> ');
Block the user from setting negative numbers

Just set enableNegative to false

Force a value from outside the TextField
final CurrencyTextFieldController controller = CurrencyTextFieldController();
// using a double
controller.forceValue(initDoubleValue: 300.5);

// using an int
controller.forceValue(initIntValue: 10000);
Change the currency symbol of the controller
final CurrencyTextFieldController controller = CurrencyTextFieldController();
// keeping the current value:
controller.replaceCurrencySymbol('EUR');

// reseting the current value:
controller.replaceCurrencySymbol('EUR', resetValue: true);

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.