2023-11-06 17:57:03 +01:00
|
|
|
// SPDX-FileCopyrightText: 2022 Iconica
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class Background extends StatelessWidget {
|
|
|
|
const Background({
|
|
|
|
required this.child,
|
2023-11-29 11:54:25 +01:00
|
|
|
this.background,
|
|
|
|
super.key,
|
|
|
|
});
|
2023-11-06 17:57:03 +01:00
|
|
|
|
|
|
|
final BoxDecoration? background;
|
|
|
|
final Widget child;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
var theme = Theme.of(context);
|
|
|
|
var background = this.background ??
|
|
|
|
BoxDecoration(
|
|
|
|
color: theme.colorScheme.background,
|
|
|
|
);
|
|
|
|
var size = MediaQuery.of(context).size;
|
|
|
|
return Container(
|
|
|
|
width: size.width,
|
|
|
|
height: size.height,
|
|
|
|
decoration: background,
|
|
|
|
child: child,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|