mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-26 20:26:02 +00:00
fix theme updating desktop appbar children
This commit is contained in:
parent
4593f7a0dc
commit
820efa4d8b
1 changed files with 14 additions and 27 deletions
|
@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||||
const double kDesktopAppBarHeight = 96.0;
|
const double kDesktopAppBarHeight = 96.0;
|
||||||
const double kDesktopAppBarHeightCompact = 82.0;
|
const double kDesktopAppBarHeightCompact = 82.0;
|
||||||
|
|
||||||
class DesktopAppBar extends StatefulWidget {
|
class DesktopAppBar extends StatelessWidget {
|
||||||
const DesktopAppBar({
|
const DesktopAppBar({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.leading,
|
this.leading,
|
||||||
|
@ -21,47 +21,34 @@ class DesktopAppBar extends StatefulWidget {
|
||||||
final bool isCompactHeight;
|
final bool isCompactHeight;
|
||||||
final bool useSpacers;
|
final bool useSpacers;
|
||||||
|
|
||||||
@override
|
|
||||||
State<DesktopAppBar> createState() => _DesktopAppBarState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DesktopAppBarState extends State<DesktopAppBar> {
|
|
||||||
late final List<Widget> items;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
items = [];
|
|
||||||
if (widget.leading != null) {
|
|
||||||
items.add(widget.leading!);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (widget.useSpacers) {
|
|
||||||
items.add(const Spacer());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (widget.center != null) {
|
|
||||||
items.add(widget.center!);
|
|
||||||
if (widget.useSpacers) {
|
|
||||||
items.add(const Spacer());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (widget.trailing != null) {
|
|
||||||
items.add(widget.trailing!);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final List<Widget> items = [];
|
||||||
|
if (leading != null) {
|
||||||
|
items.add(leading!);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (useSpacers) {
|
||||||
|
items.add(const Spacer());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (center != null) {
|
||||||
|
items.add(center!);
|
||||||
|
if (useSpacers) {
|
||||||
|
items.add(const Spacer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trailing != null) {
|
||||||
|
items.add(trailing!);
|
||||||
|
}
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: widget.background,
|
color: background,
|
||||||
),
|
),
|
||||||
height: widget.isCompactHeight
|
height:
|
||||||
? kDesktopAppBarHeightCompact
|
isCompactHeight ? kDesktopAppBarHeightCompact : kDesktopAppBarHeight,
|
||||||
: kDesktopAppBarHeight,
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
|
Loading…
Reference in a new issue