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

패키지 상세v1.0.0+9

number_text_input_formatter

Flutter용 숫자 텍스트 입력 포맷터

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
3
좋아요
32
Pub 점수
130

패키지 설치

flutter pub add number_text_input_formatter

패키지 개요

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

텍스트 입력을 숫자 형식으로 자동으로 포맷하는 플러터 패키지로, 소수점, 천단위 구분 기호 및 음수 부호를 자동으로 처리합니다. 사용자 입력이 숫자 규칙을 준수하도록 보장하면서 텍스트 필드에서 깔끔하고 가독성 있는 형식을 유지합니다. 가격, 수량 또는 측정값과 같은 숫자 데이터 입력이 필요한 폼에 이상적입니다. 이 포맷터는 Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼에서 작동하며 장치에 관계없이 일관된 동작을 제공합니다. 소수 정밀도 및 지역별 포맷팅의 커스터마이징을 지원합니다.

사용 사례

  • 가격용 폼 입력
  • 포맷이 적용된 수량 입력
  • 측정 데이터 수집
  • 금융 응용 프로그램
  • 사용자 친화적인 숫자 입력
  • 실시간 검증을 갖춘 데이터 입력

주요 기능

  • 숫자의 자동 형식 지정
  • 소수 및 음수 지원
  • 천 단위 구분 기호 지원
  • 사용자 정의 가능한 소수 자릿수
  • 크로스 플랫폼 일관성
  • 로케일 인식 형식 지정

적합한 대상

  • 금융 앱을 개발하는 개발자
  • 숫자 입력이 필요한 폼
  • 실시간 입력 피드백이 필요한 애플리케이션
  • 다중 플랫폼 Flutter 프로젝트
  • 서식이 지정된 숫자 입력을 선호하는 사용자

고려 사항

  • 경계 사례에 대한 추가 검증이 필요할 수 있습니다
  • 올바르게 구성되지 않은 경우 키보드 탐색에 영향을 줄 수 있습니다
  • 숫자 형식화만 가능
  • 기본적으로 숫자가 아닌 문자를 처리하지 않습니다
  • 고주기 업데이트에 대한 성능 영향

원본 README

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

Number Text Input Formatter

Number Text Input Formatter for Flutter.

Installation

dependencies:
  number_text_input_formatter: ^1.0.0

Usage

NumberTextInputFormatter

General-purpose formatter for numeric input fields.

TextField(
  inputFormatters: [
    NumberTextInputFormatter(
      integerDigits: 10,
      decimalDigits: 2,
      maxValue: '1000000000.00',
      decimalSeparator: '.',
      groupDigits: 3,
      groupSeparator: ',',
      allowNegative: false,
      overrideDecimalPoint: true,
      insertDecimalPoint: false,
      insertDecimalDigits: true,
    ),
  ],
  keyboardType: TextInputType.number,
),
Parameters
Parameter Type Default Description
integerDigits int? null Maximum number of integer digits. Must be > 0 if provided.
decimalDigits int? null Maximum number of decimal digits. Must be >= 0 if provided.
maxValue String? null Maximum allowed value (e.g. '9999.99'). Infers integerDigits and decimalDigits if not set.
decimalSeparator String '.' Character used as the decimal point. Must be a single character.
groupDigits int? null Group integer digits every N digits (e.g. 3 for thousands). Must be > 1 if provided.
groupSeparator String ',' Character used as the grouping separator. Must be a single character, different from decimalSeparator.
allowNegative bool false Whether to allow negative numbers.
fixNumber bool true Inserts 0 before a leading decimal point, and 0 after a trailing decimal point.
insertDecimalPoint bool false Automatically inserts the decimal point as the user types (e.g. 123 → 1.23). Requires decimalDigits to be set.
insertDecimalDigits bool false Always appends decimal digits with zeros (e.g. 5 → 5.00). Requires decimalDigits to be set.
overrideDecimalPoint bool false When a second decimal point is typed, moves the decimal point to the new position instead of ignoring it.
prefix String? null String prepended to the formatted value (e.g. '\$ ').
suffix String? null String appended to the formatted value (e.g. ' USD').

CurrencyTextInputFormatter

Pre-configured formatter for currency input. Defaults: 2 decimal digits, grouping every 3 digits, decimal point auto-inserted.

TextField(
  inputFormatters: [
    CurrencyTextInputFormatter(
      prefix: '\$ ',
    ),
  ],
  keyboardType: TextInputType.number,
),
Parameters

Same as NumberTextInputFormatter with these defaults:

Parameter Default
decimalDigits 2
groupDigits 3
insertDecimalPoint true

PercentageTextInputFormatter

Pre-configured formatter for percentage input. Defaults: max 100, 0 decimal digits, decimal digits always inserted.

TextField(
  inputFormatters: [
    PercentageTextInputFormatter(
      suffix: '%',
    ),
  ],
  keyboardType: TextInputType.number,
),
Parameters

Same as NumberTextInputFormatter with these defaults:

Parameter Default
integerDigits 3 (minimum 3)
decimalDigits 0
insertDecimalDigits true

The maxValue is automatically computed from integerDigits and decimalDigits (e.g. integerDigits: 3 → max 100).

카테고리

소스 저장소

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

아직 데이터가 없습니다.