textfields 0.0.3
textfields: ^0.0.3 copied to clipboard
A custom textField Which can save your time.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:textfields/textfields.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 MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
String selectedCountryCode = "+91";
String selectedCountryName = "India";
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: Padding(
padding: const EdgeInsets.all(28.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const BorderTextFieldWithIcon(
hintText: "email",
prefixIcon: Icon(
Icons.people,
// color: Colors.white,
),
suffixIcon: Icon(
Icons.email,
// color: Colors.white,
),
),
const SizedBox(
height: 20,
),
const SimpleTextFieldWithBorder(
label: "label",
bordercolor: Colors.red,
),
const SizedBox(
height: 20,
),
TextFieldWithCountryMobileNo(
selectedCountryCode: selectedCountryCode,
onChangedDropDown: (String? value) {
print(value);
selectedCountryCode = value!;
setState(() {});
},
onChanged: (String? text) {
print(text);
},
),
const SizedBox(
height: 20,
),
TextFieldWithCountryName(
selectedCountryCode: selectedCountryName,
onChangedDropDown: (String? value) {
print(value);
selectedCountryName = value!;
setState(() {});
},
onChanged: (String? text) {
print(text);
},
),
const SizedBox(
height: 20,
),
const MultiLineTextField(
maxLines: 10,
bordercolor: Colors.red,
)
],
),
),
),
);
}
}