stack_wallet/lib/widgets/desktop/desktop_scaffold.dart

66 lines
1.4 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import 'package:stackwallet/utilities/cfcolors.dart';
2022-09-21 00:46:07 +00:00
import 'package:stackwallet/utilities/theme/stack_theme.dart';
class DesktopScaffold extends StatelessWidget {
const DesktopScaffold({
Key? key,
this.background = CFColors.background,
this.appBar,
this.body,
}) : super(key: key);
final Color background;
final Widget? appBar;
final Widget? body;
@override
Widget build(BuildContext context) {
return Material(
color: background,
child: Column(
2022-09-18 16:51:42 +00:00
// crossAxisAlignment: CrossAxisAlignment.stretch,
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,
this.background = CFColors.background,
}) : super(key: key);
final bool isDesktop;
final Widget appBar;
final Widget body;
final Color background;
@override
Widget build(BuildContext context) {
if (isDesktop) {
return DesktopScaffold(
background: background,
appBar: appBar,
body: body,
);
} else {
return Scaffold(
backgroundColor: background,
appBar: appBar as PreferredSizeWidget?,
body: body,
);
}
}
}