block_input 1.1.0 copy "block_input: ^1.1.0" to clipboard
block_input: ^1.1.0 copied to clipboard

outdated

Simple character blocked input that usually used for redeem code or validation code input.

Block Input #

build pub package

Simple character blocked input that usually used for redeem code or validation code input.

Example #

Full example

import 'package:block_input/block_input.dart';
BlockInput(
  blockInputController: blockInputController,
  blockInputKeyboardType: BlockInputKeyboardType.number, // Number or Text
  axisAlignment: MainAxisAlignment.spaceBetween, // Same as Row/Column MainAxisAlignment
  blockInputStyle: BlockInputStyle(
    backgroundColor: Colors.black12, // Color
    border: OutlineInputBorder( // Same as InputDecoration border
         borderRadius: BorderRadius.all(Radius.circular(10)),
         borderSide: BorderSide(color: Colors.deepOrange, width: 1)
    ),
    focusedBorder: OutlineInputBorder( // Same as InputDecoration border
         borderRadius: BorderRadius.all(Radius.circular(10)),
         borderSide: BorderSide(color: Colors.blueAccent, width: 2)
    )
  )
)

Controller and Listener #

Controller is almost same as classic TextEditingController :D

// Initializing controller
int inputSize = 6; // input size is required for controller
BlockInputController blockInputController = BlockInputController(inputSize);

// Attaching listener
blockInputController.addListener(() {
  print(blockInputController.text);
});

// Getting and Setting value
String getValue = blockInputController.text; // get
blockInputController.text = 'maaraa'; // set + 
// + throws exception when text length was exceeded from input size

blockInputController.clear(); // clear

// Disposing
blockInputController.dispose();

Attributes #

BlockInput #

Attribute Type
blockInputKeyboardType BlockInputController
blockInputKeyboardType BlockInputKeyboardType
blockInputStyle BlockInputStyle
errorMessage String
errorMessageStyle TextStyle
axisAlignment MainAxisAlignment

BlockInputStyle #

Attribute Type
backgroundColor Color
border OutlineInputBorder
focusedBorder OutlineInputBorder
padding EdgeInsets
width double
textStyle TextStyle

Licence #

Apache License version 2.0

Enkh-Amar.G // vonqo

4
likes
0
pub points
51%
popularity

Publisher

verified publisherwiser.studio

Simple character blocked input that usually used for redeem code or validation code input.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on block_input