Reputation: 5141
So I want the text inside TextField
to the very bottom.
import 'package:flutter/material.dart';
void main() => runApp(const Home());
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: TextField(
textAlignVertical: TextAlignVertical(y: -0.0),
decoration: InputDecoration(filled: true)
),
),
),
);
}
}
I tried using textAlignVertical
but it doesn't work.
Upvotes: 1
Views: 569
Reputation: 835
Try adding a contentPadding
:
import 'package:flutter/material.dart';
void main() => runApp(const Home());
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: TextField(
textAlignVertical: TextAlignVertical(y: -0.0),
decoration: InputDecoration(
filled: true,
contentPadding: EdgeInsets.only(bottom: 0.0), //here
),
),
),
),
);
}
}
Upvotes: 2