class VitalWidget extends StatelessWidget {
VitalWidget({
this.vitalType,
this.unit,
this.initialValue,
Key key,
}) : super(key: key);
final String vitalType;
final String unit;
final String initialValue;
@override
Widget build(BuildContext context) {
return Column(
children: [
Row(
children: [
Padding(
padding: const EdgeInsets.only(left: 40),
child: Text(
vitalType,
style: TextStyle(fontSize: 15),
),
),
Row(
children: [
SizedBox(
width: 90,
child: Align(
alignment: Alignment.centerRight,
child: TextFormField(
initialValue: initialValue,
textAlign: TextAlign.center,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
decoration: const InputDecoration(),
),
),
),
Text(unit),
],
),
],
),
],
);
}
}
I know this is not a like hard thing to do but ive been stuck on it for a while now. Is there a way to make the textformfield and the text(unit) on the right side of the screen? i tried using padding but they werent in line with each other and on different screens it would look so weird.Its so simple but i cant figure it out