Created
March 5, 2021 13:21
-
-
Save matuella/1bbee4f8570b9320dee4b182af65cdb4 to your computer and use it in GitHub Desktop.
StackOverflow Q: "Removing helperText padding from InputDecoration with OutlineInputBorder"
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', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: MyHomePage(), | |
); | |
} | |
} | |
class MyHomePage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Center( | |
child: TextField( | |
decoration: InputDecoration( | |
// This indeed updates `helperText`, but also changes the label padding | |
// contentPadding: EdgeInsets.zero, | |
border: const OutlineInputBorder(), | |
labelText: 'My Label Text', | |
helperText: 'My Helper Text', | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment