Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Flutter: How to not change textfield postion when increasing height of container in row

I am trying to create this, but when i increase the height of container by textfield changes it position to top.

enter image description here

here is my code:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel


 Padding(
      padding: const EdgeInsets.all(8.0),
      child: Row(
        children: [
          Expanded(
            child: CustomTextfield(
              isPrefixIcon: false,
              bgColor: AppColors.whiteColor,
              borderColor: AppColors.blueColor,
              hintColor: AppColors.blackColor,
              isBorder: true,
              hintText: AppStrings.typeMessage,
              suffixIcon: Image.asset(AssetPaths.sendIcon,scale: 1.5,),
            ),
          ),
          sizedboxWidth5(),
          Container(
            height: 120.h,width: 40.w,
            decoration: BoxDecoration(color: AppColors.blueColor,borderRadius: BorderRadius.circular(30)),)
          
        ]
      ),
    );

here is my code output

enter image description here

>Solution :

In Row widget theres a properties mainAxisAlignment and crossAxisAlignment

mainAxisAlignment in Row widget means the horizontally

crossAxisAlignment in Row widget means the vertically.

On your issue, try to change the crossAxisAlignment value. Check the code below:

Row(
  crossAxisAlignment: CrossAxisAlignment.end, /// add this
  children: [
   /// ....
  ],
),
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading