-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Add this widget to lib to customize target window size in the full screen mode
class SafeResizedWidget extends StatelessWidget {
final Widget _child;
final double _targetWidth;
final double _targetHeight;
final double _opacity;
///
const SafeResizedWidget({
super.key,
required Widget child,
required double targetWidth,
required double targetHeight,
double opacity = 0.5,
}) :
_child = child,
_targetWidth = targetWidth,
_targetHeight = targetHeight,
_opacity = opacity;
///
@override
Widget build(BuildContext context) {
final dw = (MediaQuery.of(context).size.width - _targetWidth) / 2;
final dh = (MediaQuery.of(context).size.height - _targetHeight) / 2;
return Container(
color: Theme.of(context).colorScheme.background.withOpacity(_opacity),
child: SafeArea(
minimum: EdgeInsets.symmetric(
horizontal: dw,
vertical: dh,
),
child: _child,
),
);
}
}
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
🟠 Priority 2