window enhancement with full screen param
This commit is contained in:
@@ -6,8 +6,10 @@ class MIHWindow extends StatefulWidget {
|
|||||||
final List<Widget> windowBody;
|
final List<Widget> windowBody;
|
||||||
final List<Widget> windowTools;
|
final List<Widget> windowTools;
|
||||||
final void Function() onWindowTapClose;
|
final void Function() onWindowTapClose;
|
||||||
|
final bool fullscreen;
|
||||||
const MIHWindow({
|
const MIHWindow({
|
||||||
super.key,
|
super.key,
|
||||||
|
required this.fullscreen,
|
||||||
required this.windowTitle,
|
required this.windowTitle,
|
||||||
required this.windowBody,
|
required this.windowBody,
|
||||||
required this.windowTools,
|
required this.windowTools,
|
||||||
@@ -76,16 +78,18 @@ class _MIHWindowState extends State<MIHWindow> {
|
|||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
widget.windowTitle,
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
widget.windowTitle,
|
||||||
overflow: TextOverflow.ellipsis,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
overflow: TextOverflow.ellipsis,
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
style: TextStyle(
|
||||||
fontSize: windowTitleSize,
|
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
fontWeight: FontWeight.bold,
|
fontSize: windowTitleSize,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -109,14 +113,23 @@ class _MIHWindowState extends State<MIHWindow> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget getWidnowBody() {
|
Widget getWidnowBody() {
|
||||||
return Padding(
|
if (widget.fullscreen) {
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
return Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: widget.windowBody,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: widget.windowBody,
|
children: widget.windowBody,
|
||||||
),
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget createWindow(Widget header, Widget body) {
|
Widget createWindow(Widget header, Widget body) {
|
||||||
|
|||||||
Reference in New Issue
Block a user