Skip to content
On this page

NumberInput

An editable numeric field with parsing and formatting.

NumberInput in FluttyUINumberInput in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

NumberInput

const NumberInput({
  super.key,
  this.size,
  required this.value,
  this.onChanged,
  this.onSubmitted,
  this.format = const NumberInputFormat.decimal(),
  this.step = 1,
  this.min,
  this.max,
  this.enabled = true,
  this.readOnly = false,
  this.isInvalid = false,
  this.showControls = true,
  this.autofocus = false,
  this.focusNode,
  this.placeholder,
  this.semanticLabel = 'Number',
  this.increaseLabel = 'Increase',
  this.decreaseLabel = 'Decrease',
  this.textInputAction = TextInputAction.done,
  this.backgroundColor,
  this.foregroundColor,
  this.focusedBorderColor,
  this.borderRadius,
  this.height,
  this.fontSize,
});
ParameterTypeRequiredDefault
keyKey?Nonull
sizeComponentSize?Nonull
valuedouble?Yes—
onChangedValueChanged<double?>?Nonull
onSubmittedValueChanged<double?>?Nonull
formatNumberInputFormatNoconst NumberInputFormat.decimal()
stepdoubleNo1
mindouble?Nonull
maxdouble?Nonull
enabledboolNotrue
readOnlyboolNofalse
isInvalidboolNofalse
showControlsboolNotrue
autofocusboolNofalse
focusNodeFocusNode?Nonull
placeholderString?Nonull
semanticLabelStringNo'Number'
increaseLabelStringNo'Increase'
decreaseLabelStringNo'Decrease'
textInputActionTextInputActionNoTextInputAction.done
backgroundColorColor?Nonull
foregroundColorColor?Nonull
focusedBorderColorColor?Nonull
borderRadiusdouble?Nonull
heightdouble?Nonull
fontSizedouble?Nonull

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/forms/number_input/number_input.dart

This reference is generated from the NumberInput declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI