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 {
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Keyboard Type Example'),
body: Center(
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.

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

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

Open-Source News App built with Flutter

Posted by nishantkotatech on 26 Feb 2020 Article

Meme Generator with Flutter

Posted by theindianappguy on 25 Feb 2020 Tutorials

Flutter Scaffold Widget

Posted by themaaz32 on 05 Feb 2020 Tutorials

Flutter Tensorflow Tutorial

Posted by theindianappguy on 28 Jan 2020 Tutorials

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