Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save HansMuller/15ae9ee53653ae6790570b755ecdc8a3 to your computer and use it in GitHub Desktop.
Save HansMuller/15ae9ee53653ae6790570b755ecdc8a3 to your computer and use it in GitHub Desktop.
// Adding an icon to a TextFormField misaligns label when field is selected
// https://github.com/flutter/flutter/issues/18111
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(),
body: new Container(
padding: const EdgeInsets.all(16.0),
alignment: Alignment.center,
child: new TextField(
decoration: new InputDecoration(
labelText: 'primaryLink',
hintText: 'Primary link to story',
icon: const Icon(Icons.insert_link),
border: OutlineInputBorder()
),
),
),
);
}
}
void main() {
runApp(new MaterialApp(home: new HomePage()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment