Image is not showing as I wrap the container with positioned Widget and give top any value as removed the value it is showing up. Why is that.
======================================================================================================================================================================================================================================================================================================================================================================================================== Here is the Code
import 'package:flutter/material.dart';
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: Column(
children: [
SizedBox(
height: MediaQuery.of(context).size.height * 2,
child: Stack(
children: [
Positioned(
top: 1,
child: Container(
// height: 30,
// color: Colors.red,
height: MediaQuery.of(context).size.height * 1 - 17,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('home/h_intro-s1-l1.jpg'),
fit: BoxFit.fill,
),
),
),
),
],
),
),
],
),
),
);
}
}