2022-09-18 16:14:27 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-09-21 00:46:07 +00:00
|
|
|
import 'package:stackwallet/utilities/theme/stack_theme.dart';
|
2022-09-18 16:14:27 +00:00
|
|
|
|
|
|
|
class DesktopScaffold extends StatelessWidget {
|
|
|
|
const DesktopScaffold({
|
|
|
|
Key? key,
|
2022-09-21 21:59:52 +00:00
|
|
|
this.background,
|
2022-09-18 16:14:27 +00:00
|
|
|
this.appBar,
|
|
|
|
this.body,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
2022-09-21 21:59:52 +00:00
|
|
|
final Color? background;
|
2022-09-18 16:14:27 +00:00
|
|
|
final Widget? appBar;
|
|
|
|
final Widget? body;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Material(
|
2022-09-21 21:59:52 +00:00
|
|
|
color: background ?? StackTheme.instance.color.background,
|
2022-09-18 16:14:27 +00:00
|
|
|
child: Column(
|
2022-09-18 16:51:42 +00:00
|
|
|
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
2022-09-18 16:14:27 +00:00
|
|
|
children: [
|
|
|
|
if (appBar != null) appBar!,
|
|
|
|
if (body != null)
|
|
|
|
Expanded(
|
|
|
|
child: body!,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2022-09-18 17:27:38 +00:00
|
|
|
|
|
|
|
class MasterScaffold extends StatelessWidget {
|
|
|
|
const MasterScaffold({
|
|
|
|
Key? key,
|
|
|
|
required this.isDesktop,
|
|
|
|
required this.appBar,
|
|
|
|
required this.body,
|
2022-09-21 21:59:52 +00:00
|
|
|
this.background,
|
2022-09-18 17:27:38 +00:00
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
final bool isDesktop;
|
|
|
|
final Widget appBar;
|
|
|
|
final Widget body;
|
2022-09-21 21:59:52 +00:00
|
|
|
final Color? background;
|
2022-09-18 17:27:38 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
if (isDesktop) {
|
|
|
|
return DesktopScaffold(
|
2022-09-21 21:59:52 +00:00
|
|
|
background: background ?? StackTheme.instance.color.background,
|
2022-09-18 17:27:38 +00:00
|
|
|
appBar: appBar,
|
|
|
|
body: body,
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Scaffold(
|
2022-09-21 21:59:52 +00:00
|
|
|
backgroundColor: background ?? StackTheme.instance.color.background,
|
2022-09-18 17:27:38 +00:00
|
|
|
appBar: appBar as PreferredSizeWidget?,
|
|
|
|
body: body,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|