TextField in Flutter

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



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.


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