Created
September 29, 2018 15:40
-
-
Save figengungor/53c53cee0128a0ab9056946cca9cb2c3 to your computer and use it in GitHub Desktop.
Alignment Issue when labelText and prefixIcon used in TextField
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
routes: { | |
'/': (context) => HomePage(), | |
}, | |
); | |
} | |
} | |
class HomePage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('hintText and prefixIcon Issue'), | |
), | |
body: Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: Column( | |
children: <Widget>[ | |
TextField( | |
decoration: InputDecoration( | |
isDense: true, | |
prefixIcon: Icon( | |
Icons.lock, | |
), | |
hintText: "Password", | |
), | |
obscureText: true, | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment