Why is my Stack clipping the right-hand side of images?

Eind997

I want to put some text over an image and I thought of using a ClipRRect with a Stack as a child. That way I could stack the images and text on top of each other. When I do this though, the image gets cut off on the right-hand side. Can anyone point out the problem?

Link here as I cannot embed images yet

return ClipRRect(
  borderRadius: BorderRadius.circular(8.0),
  child: Stack(
    children:<Widget>[
      Image.network(
        listItem.imageUrl,
        height: 200.0,
        //width: 100.0,
        fit: BoxFit.cover
      ),
    ]
  ),
);
Uni

The reason why the right side of the image is clipped out is that you are placing a rounding the border of the Stack instead of the Image. This is how you can achieve what you've wanted to do:

return Stack(
    children:<Widget>[
      ClipRRect(
        borderRadius: BorderRadius.circular(8.0),
        child: Image.network(
        listItem.imageUrl,
         height: 200.0,
         fit: BoxFit.cover
        ),
       ),
       Align(alignment:Alignment.bottomCenter,child:Text("Hello World")),
    ]
);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Why are there spaces on the left and right hand side of my seekbar?

Can't get my sidebar on the right-hand side

Why Diamond operator was not missed from Right hand side in Java 7?

Why >> duplicates right-hand side operand in haskell

Sympy right hand side of inequality

show the content on the right hand side

How can I put my label on the right hand side of my chart in Chartjs

Why does my cube bounce at the left side but not at the right side?

How to add an unbroken line in bash starting from end of my left hand PS1 text to the right hand side

Why can I use initializer lists on the right-hand side of operator += but not operator+?

Why does the right-hand-side of clause not agree with function result type?

Why wont 'justify-content: space-between' make the navbar go to the right hand side?

Why does irb echo the right hand side of an assignment instead of the return value in the case of a setter method?

VUEJS - Why do I get: Uncaught TypeError: Right-hand side of 'instanceof'?

why does python pep526 accept literals as the right hand side argument?

How to show the right hand side layout/margin?

islice from right-hand side

Get right-hand side of equation

Nullish coalescing operator (??) with right hand side 'undefined'

Is 'or' used on the right-hand-side of an assignment pythonic?

Use "at variable" ($@) on the right hand side of a rule in makefile

Verilog changing the size of right hand side

Enclose right hand side of expression in Swift language

Erlang: no match of right hand side value

Should null be checked on the left or right hand side

Slice Qstring from right hand side

Right-hand side of instanceof is not callable

Right hand side position of substring MySQL

Rewrite sympy equations to 0 right hand side