Container(
padding: const EdgeInsets.symmetric(horizontal: 8),
margin: const EdgeInsets.only(bottom: 16),
height: 60,
decoration: BoxDecoration(
color: AppColors.boxColor, borderRadius: BorderRadius.circular(8)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
category.name,
style: const TextStyle(fontSize: 18),
),
isSelected
? Container(
width: 130,
height: 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey),
),
// alignment: Alignment.centerRight,
child: ConstrainedBox(
constraints: const BoxConstraints.expand(),
child: TextField(
controller: _controller.textController,
maxLines: 1,
textDirection: TextDirection.rtl,
textAlignVertical: TextAlignVertical.bottom,
focusNode: _controller.focusNode,
autofocus: isSelected,
keyboardType: const TextInputType.numberWithOptions(
decimal: true),
style: const TextStyle(fontSize: 18),
decoration: const InputDecoration(
contentPadding: EdgeInsets.symmetric(horizontal: 5),
hintTextDirection: TextDirection.rtl,
border: InputBorder.none,
),
),
),
)
Text is jump out side the box of container and not what I expected to align it at vertical center of the container. I have try many way of wrapping TextField with Align widget or using Alignment.center ... but does not work. please help me with that. Image for more detail