mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 01:37:54 +00:00
81 lines
1.8 KiB
Dart
81 lines
1.8 KiB
Dart
/*
|
|
* This file is part of Stack Wallet.
|
|
*
|
|
* Copyright (c) 2023 Cypher Stack
|
|
* All Rights Reserved.
|
|
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
|
* Generated by Cypher Stack on 2023-05-26
|
|
*
|
|
*/
|
|
|
|
import 'package:flutter/material.dart';
|
|
import '../../themes/stack_colors.dart';
|
|
import '../background.dart';
|
|
|
|
class DesktopScaffold extends StatelessWidget {
|
|
const DesktopScaffold({
|
|
super.key,
|
|
this.background,
|
|
this.appBar,
|
|
this.body,
|
|
});
|
|
|
|
final Color? background;
|
|
final Widget? appBar;
|
|
final Widget? body;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Material(
|
|
color:
|
|
background ?? Theme.of(context).extension<StackColors>()!.background,
|
|
child: Background(
|
|
child: Column(
|
|
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
if (appBar != null) appBar!,
|
|
if (body != null)
|
|
Expanded(
|
|
child: body!,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class MasterScaffold extends StatelessWidget {
|
|
const MasterScaffold({
|
|
super.key,
|
|
required this.isDesktop,
|
|
required this.appBar,
|
|
required this.body,
|
|
this.background,
|
|
});
|
|
|
|
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 Background(
|
|
child: Scaffold(
|
|
backgroundColor: background ??
|
|
Theme.of(context).extension<StackColors>()!.background,
|
|
appBar: appBar as PreferredSizeWidget?,
|
|
body: body,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
}
|