mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-22 01:56:47 +08:00
opt ui
Closes #1050 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
29
lib/common/widgets/view_safe_area.dart
Normal file
29
lib/common/widgets/view_safe_area.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ViewSafeArea extends StatelessWidget {
|
||||
const ViewSafeArea({
|
||||
super.key,
|
||||
this.top = false,
|
||||
this.left = true,
|
||||
this.right = true,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
final bool top;
|
||||
final bool left;
|
||||
final bool right;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
EdgeInsets padding = MediaQuery.viewPaddingOf(context);
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: top ? padding.top : 0.0,
|
||||
left: left ? padding.left : 0.0,
|
||||
right: right ? padding.right : 0.0,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user