TextField in Flutter

This Article is posted by seven.srikanth at 14-08-2019 12:47:57

In this example, I have shown how to achieve few common queries with TextField.
How to get a number keyboard when TextField is selected in Flutter?
How to show an Icon inside the TextField in Flutter?
How to show a Placeholder Text inside the TextField in Flutter?
How to color a TextField in Flutter?
How to decorate TextField in Flutter?
You can simply copy this code to your main.dart file and run it to see this example. 
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Keyboard Type Example'),
),
body: Center(
child:
Container(
margin: EdgeInsets.all(20.0),
child: TextField(
keyboardType: TextInputType.number,
decoration: InputDecoration(
prefixIcon: Icon(Icons.text_fields),
filled: true,
fillColor: Colors.grey[400],
hintText: 'Select this TextBox'
),
),
),
),
),
);
}
}
Hope this is helpful.
Thanks,
Srikanth

Tags: TextField; Keyboard type; Number Keyboard; Icon; Placeholder Text; HintText; Hint; Color;



0 Comments
Login to comment.
Recent Comments

Be the first to Comment. You can ask a Query or Share your toughts or Just say thanks.



Recent Articles


How to add Assets Images and Network images in flutter?

Posted by bloggeraatit on 20 Sep 2019 Article


How to use inkwell class for responding images in flutter?

Posted by bloggeraatit on 20 Sep 2019 Article


Flutter Web Live on Server

Posted by nikhilchaudhary12155 on 18 Sep 2019 Article


How to specify stops in a gradient?

Posted by seven.srikanth on 20 Sep 2019 Article



© 2018 - Fluttercentral | Email to me - Seven.srikanth@gmail.com