-1

i have a problem in my flutter project, as you can see on the picture, I am not able to see my text, placing this text above png pictures does not help. I am able to see my text for a second, before my png photos are uploaded. It is like those photos where always "on top" of my screen, how to place them belowe? Size of a pictures is ofcourse not a problem, the only problem is why i can't see my text.

Scaffold(
      body: SizedBox.expand(
        child: Container(
          color: Colors.red,
          //padding: EdgeInsets.only(left: 10),
          child: FittedBox(
              fit: BoxFit.fitWidth,
              child: Stack(children: [
                Image.asset('assets/images/bigWoman.png'),
                Image.asset('assets/images/bigWomanBlueblueWorld.png'),
                Container(
                  child: Text("my text"),
                ),
              ])),
        ),
      ),
      backgroundColor: Theme.of(context).backgroundColor,
    );

this is what i have: enter image description here

this is what i want: enter image description here

my thin picture, when i am not using BoxFit.fitWidth, and this shuld be a problem: enter image description here

Maciek
  • 181
  • 3
  • 12

1 Answers1

1

Try below code hope its help to you.

Refer Stack class here

Refer Positioned class here

 return Scaffold(
  appBar: AppBar(
    title: Text('Your Title'),
  ),
  body: Stack(
    children: [
      Container(
        decoration: BoxDecoration(
          image: DecorationImage(
            fit: BoxFit.fill,
            image: AssetImage(
              'assets/images/6.png',
            ),
          ),
        ),
      ),
      Positioned(
        left: 20,
        bottom: -5,
        child: Container(
          padding: EdgeInsets.all(8),
          child: Text(
            'Put Your Text Here',
            style: TextStyle(
              fontSize: 15,
              color: Colors.white,
              fontWeight: FontWeight.bold,
            ),
          ),
        ),
      ),
    ],
  ),
);

Your result screen-> enter image description here

Ravindra S. Patil
  • 11,757
  • 3
  • 13
  • 40