custom_edittext 0.0.4 custom_edittext: ^0.0.4 copied to clipboard
A new Flutter package with a highly customizable edittext, can able to set margins without wrapping it in a container and more.
import 'package:custom_edittext/custom_edittext.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Custom Edittext',
home: MyHomePage(title: 'Custom Edittext Demo Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final textEditingController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: CustomEditText(
marginLeft: 10,
marginRight: 10,
marginTop: 10,
cornerRadius: 10,
hintText: "please enter the value",
borderColor: Colors.red,
borderWidth: 2,
isBackgroundFilled: false,
textAlign: TextAlign.left,
textStyle: GoogleFonts.lato(fontSize: 18, fontStyle: FontStyle.italic),
textInputType: TextInputType.name,
backgroundColor: Colors.blue,
textEditController: textEditingController,
maxLines: null,
)),
);
}
}