TextField in Flutter

This Article is posted by seven.srikanth at 8/14/2019 12:47:57 PM



<p>In this example, I have shown how to achieve few common queries with TextField. font-size: 1rem;]( 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?</p> <p>![](https://fluttercentral.com/Uploads/0d97f871-cfcf-49d7-95e6-736ef59de001.PNGwidth="50%height="auto](</p> <p>You can simply copy this code to your main.dart file and run it to see this example.</p> <p>color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre-wrap;](color: #569cd6;](import color: #ce9178;]('package:flutter/material.dart'; color: #569cd6;](void main() => runApp(MyApp()); color: #569cd6;](class MyApp color: #569cd6;](extends StatelessWidget { color: #569cd6;](@override Widget build(BuildContext context) { color: #569cd6;](return MaterialApp( home: Scaffold( appBar: AppBar( title: Text(color: #ce9178;]('Keyboard Type Example'), ), body: Center( child: Container( margin: EdgeInsets.all(color: #b5cea8;](20.0), child: TextField( keyboardType: TextInputType.number, decoration: InputDecoration( prefixIcon: Icon(Icons.text_fields), filled: color: #569cd6;](true, fillColor: Colors.grey[color: #b5cea8;](400], hintText: color: #ce9178;]('Select this TextBox' ), ), ), ), ), ); }}</p> <p>Hope this is helpful. Thanks,Srikanth</p>


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








0 Comments
Login to comment.
Recent Comments