flutter_inputbox 0.0.1
flutter_inputbox: ^0.0.1 copied to clipboard
A customizable input box widget with support for colors, icons, validation, and more.
InputBox Widget #
A fully customizable Flutter InputBox widget designed for building dynamic and stylish input fields with ease.
Features #
- Customizable Design: Adjust field colors, borders, labels, and hint styles.
- Icons Support: Add prefix and suffix icons with custom actions.
- Validation: Includes built-in support for validation with custom logic.
- Text Customization: Configure text behavior with
TextEditingController,TextInputFormatter, andTextCapitalization. - Responsive Design: Built with
flutter_screenutilfor consistent scaling across devices. - Event Handling: Callbacks for
onTap,onChanged, andonEditingCompleteevents. - New Feature: Added
colorproperty to allow custom colors for text, cursor, borders, and icons.
Installation #
Add the following to your pubspec.yaml:
dependencies:
your_package_name: ^0.0.1
#Usage
import 'package:flutter/material.dart';
import 'input_box.dart';
class MyForm extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('InputBox Example')),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: InputBox(
hintText: "Enter your name",
labelText: "Name",
maxLength: 50,
keyboardType: TextInputType.text,
prefixIcon: Icons.person,
suffixIcon: Icons.clear,
color: Colors.blue,
onSuffixIconPressed: () {
print("Suffix icon pressed");
},
validator: (value) {
if (value == null || value.isEmpty) {
return "Please enter a name";
}
return null;
},
),
),
);
}
}