skip to Main Content

How to move the image to the right?

 Stack(
  alignment: Alignment.centerRight,
  children: [
    Container(
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(15),
        gradient: LinearGradient(
          begin: Alignment.topLeft,
          end: Alignment.topRight,
          colors: [
            Colors.red,
            Colors.green.shade200,
          ],
        ),
      ),
      width: MediaQuery.of(context).size.width,
      height: 80,
    ),
    Positioned(
      right: 0,
      left: 0,
      child: Column(children: [
        Text('checkItOut'.tr()),
        Text(
          'owner'.tr(),
          style:
              const TextStyle(fontWeight: FontWeight.bold, fontSize: 25),
        ),
      ]),
    ),
    Positioned(
      child: SizedBox(
        height: 150,
        child: Assets.images.tenancy.image(),
      ),
    )
  ],
),

enter image description here

2

Answers


  1. You can include left on Positioned to move it right,

    Positioned(
      left: 12,
      child: SizedBox(
        height: 150,
        child: Assets.images.tenancy.image(),
      ),
    )
    
    Login or Signup to reply.
  2. Left silin onun yerine right:0 yazın düzelecektir

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search