import 'package:flutter/material.dart'; class Background extends StatelessWidget { final Widget child; const Background({ Key? key, required this.child, this.topImage = "assets/images/head.jpg", this.bottomImage = "assets/images/login_bottom.png", }) : super(key: key); final String topImage, bottomImage; @override Widget build(BuildContext context) { return Scaffold( resizeToAvoidBottomInset: false, body: Container( width: double.infinity, height: MediaQuery.of(context).size.height, child: Stack( alignment: Alignment.center, children: [ Positioned( top: 0, left: 0, child: Image.asset( topImage, width: 120, ), ), // Positioned( // bottom: 0, // right: 0, // child: Image.asset(bottomImage, width: 120), // ), SafeArea(child: child), ], ), ), ); } }