background.dart 746 B

1234567891011121314151617181920212223242526272829
  1. import 'package:flutter/material.dart';
  2. class SignInBackground extends StatelessWidget {
  3. final Widget child;
  4. const SignInBackground({
  5. Key? key,
  6. required this.child,
  7. }) : super(key: key);
  8. @override
  9. Widget build(BuildContext context) {
  10. var size = MediaQuery.of(context).size;
  11. return SizedBox(
  12. height: size.height,
  13. width: double.infinity,
  14. child: Stack(
  15. alignment: Alignment.center,
  16. children: [
  17. Image(
  18. fit: BoxFit.cover,
  19. width: size.width,
  20. height: size.height,
  21. image: const AssetImage(
  22. 'assets/images/appflowy_launch_splash.jpg')),
  23. child,
  24. ],
  25. ));
  26. }
  27. }