2023-05-26 21:21:16 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-09-18 16:14:27 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2024-05-23 00:37:06 +00:00
|
|
|
import '../../themes/stack_colors.dart';
|
|
|
|
import '../background.dart';
|
2022-09-18 16:14:27 +00:00
|
|
|
|
|
|
|
class DesktopScaffold extends StatelessWidget {
|
|
|
|
const DesktopScaffold({
|
2024-05-27 23:56:22 +00:00
|
|
|
super.key,
|
2022-09-21 21:59:52 +00:00
|
|
|
this.background,
|
2022-09-18 16:14:27 +00:00
|
|
|
this.appBar,
|
|
|
|
this.body,
|
2024-05-27 23:56:22 +00:00
|
|
|
});
|
2022-09-18 16:14:27 +00:00
|
|
|
|
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-22 23:48:50 +00:00
|
|
|
color:
|
|
|
|
background ?? Theme.of(context).extension<StackColors>()!.background,
|
2022-11-25 19:24:01 +00:00
|
|
|
child: Background(
|
|
|
|
child: Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
children: [
|
|
|
|
if (appBar != null) appBar!,
|
|
|
|
if (body != null)
|
|
|
|
Expanded(
|
|
|
|
child: body!,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2022-09-18 16:14:27 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2022-09-18 17:27:38 +00:00
|
|
|
|
|
|
|
class MasterScaffold extends StatelessWidget {
|
|
|
|
const MasterScaffold({
|
2024-05-27 23:56:22 +00:00
|
|
|
super.key,
|
2022-09-18 17:27:38 +00:00
|
|
|
required this.isDesktop,
|
|
|
|
required this.appBar,
|
|
|
|
required this.body,
|
2022-09-21 21:59:52 +00:00
|
|
|
this.background,
|
2024-05-27 23:56:22 +00:00
|
|
|
});
|
2022-09-18 17:27:38 +00:00
|
|
|
|
|
|
|
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-11-25 19:24:01 +00:00
|
|
|
background: background,
|
2022-09-18 17:27:38 +00:00
|
|
|
appBar: appBar,
|
|
|
|
body: body,
|
|
|
|
);
|
|
|
|
} else {
|
2022-11-25 19:24:01 +00:00
|
|
|
return Background(
|
|
|
|
child: Scaffold(
|
|
|
|
backgroundColor: background ??
|
|
|
|
Theme.of(context).extension<StackColors>()!.background,
|
|
|
|
appBar: appBar as PreferredSizeWidget?,
|
|
|
|
body: body,
|
|
|
|
),
|
2022-09-18 17:27:38 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|