denomination 0.0.2
denomination: ^0.0.2 copied to clipboard
A Flutter widget for formatting and displaying currency denominations. It provides a convenient way to display monetary amounts with appropriate currency symbols and formatting rules.
Denomination Widget #
A Flutter widget for formatting and displaying currency denominations. It provides a convenient way to display monetary amounts with appropriate currency symbols and formatting rules.
Features #
- Supports multiple coin and bill denominations.
- Customizable formatting rules for displaying amounts.
Getting started #
To use this package, add denomination as a dependency in your pubspec.yaml file.
from the package authors, and more.
Example usage #
''' // Create a new instance of the Denomination widget. Denomination( // Auto-focus on the widget when it is rendered. autoFocus: false, // Set the label of the primary button. primaryButtonLabel: 'Proceed', // Set the title of the widget. title: Text( 'Transfer funds to cashier', // Apply the 'Inter' font to the title. style: GoogleFonts.inter( color: Colors.black, fontSize: 20, fontWeight: FontWeight.bold), ), // Define the callback function to execute when the form is submitted. onSubmit: (Denominations values) { setState(() { // Convert the form values to a JSON object. denominations = values.toJson(); }); // Perform additional actions when the form is submitted. handleOnTransferFunds(); }, // Set the initial value of the amount field. amount: double.tryParse( amountController.text.replaceAll(',', '')) ?? 0, // Define the child widgets to be displayed within the widget. child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ const Gap(20), // Display the get notified of activity text. Text( 'Get notified of activity', style: GoogleFonts.inter( fontSize: 14, color: const Color(0XFF6B7280)), ), Gap(10.h),
const Gap(10),
// Display the amount label text.
Text(
'Amount',
style: labelTextStyle,
),
const Gap(10),
// Display the amount text field.
SizedBox(
width: 580,
height: 59,
child: TextFormField(
focusNode: amountFocusNode,
// Execute the onFieldSubmitted function when the field is submitted.
onFieldSubmitted: (value) {
remarksfocusNode.requestFocus();
},
// Execute the onChanged function when the field value changes.
onChanged: (value) {
setState(() {});
},
// Apply the CurrencyInputFormatter to the field.
inputFormatters: [
CurrencyInputFormatter(
mantissaLength: 2, useSymbolPadding: true)
],
controller: amountController,
style: fieldTextStyle,
decoration: inputDecoration,
)),
const Gap(10),
// Display the remarks label text.
Text(
'Remarks',
style: labelTextStyle,
),
const Gap(10),
// Display the remarks text field.
SizedBox(
width: 580,
height: 50,
child: TextFormField(
onFieldSubmitted: (value) {
setState(() {
denominationFocus = true;
});
},
focusNode: remarksfocusNode,
style: fieldTextStyle,
decoration: inputDecoration,
),
),
const Gap(20),
],
),
),'''