Files
sfm_app_final/lib/product/shared/shared_background.dart
2024-12-15 00:59:02 +07:00

45 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:sfm_app/product/constant/image/image_constants.dart';
class SharedBackground extends StatelessWidget {
final Widget child;
const SharedBackground({super.key, required this.child});
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Directionality(
textDirection: TextDirection.ltr,
child: Scaffold(
resizeToAvoidBottomInset: false,
body: SizedBox(
height: size.height,
width: double.infinity,
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Positioned(
top: 0,
left: 0,
child: Image.asset(
ImageConstants.instance.getImage("background_top"),
width: size.width * 0.3,
),
),
Positioned(
bottom: 0,
right: 0,
child: Image.asset(
ImageConstants.instance.getImage("background_bottom"),
width: size.width * 0.4,
),
),
SafeArea(child: child)
],
),
),
),
);
}
}