Created
December 11, 2019 22:56
-
-
Save vovahost/3f9149a1c8f5eec352c796e7585e233c to your computer and use it in GitHub Desktop.
Example of a TextField without any padding.
This file contains hidden or 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: 'TextField without padding', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData(primarySwatch: Colors.blue), | |
home: Material( | |
child: Center( | |
child: Container( | |
width: 150.0, | |
color: Colors.lightGreenAccent, | |
child: TextField( | |
decoration: InputDecoration( | |
contentPadding: EdgeInsets.all(0.0), | |
isDense: true, | |
border: InputBorder.none, | |
hintText: "Type a message", | |
hintStyle: TextStyle( | |
color: Colors.grey, | |
fontSize: 14.0, | |
), | |
), | |
minLines: 1, | |
maxLines: 1, | |
), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment