mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-10 20:54:33 +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 kDesktopAppBarHeightCompact = 82.0;
|
||||
|
||||
class DesktopAppBar extends StatefulWidget {
|
||||
class DesktopAppBar extends StatelessWidget {
|
||||
const DesktopAppBar({
|
||||
Key? key,
|
||||
this.leading,
|
||||
|
@ -22,46 +22,33 @@ class DesktopAppBar extends StatefulWidget {
|
|||
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!);
|
||||
Widget build(BuildContext context) {
|
||||
final List<Widget> items = [];
|
||||
if (leading != null) {
|
||||
items.add(leading!);
|
||||
}
|
||||
|
||||
if (widget.useSpacers) {
|
||||
if (useSpacers) {
|
||||
items.add(const Spacer());
|
||||
}
|
||||
|
||||
if (widget.center != null) {
|
||||
items.add(widget.center!);
|
||||
if (widget.useSpacers) {
|
||||
if (center != null) {
|
||||
items.add(center!);
|
||||
if (useSpacers) {
|
||||
items.add(const Spacer());
|
||||
}
|
||||
}
|
||||
|
||||
if (widget.trailing != null) {
|
||||
items.add(widget.trailing!);
|
||||
if (trailing != null) {
|
||||
items.add(trailing!);
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: widget.background,
|
||||
color: background,
|
||||
),
|
||||
height: widget.isCompactHeight
|
||||
? kDesktopAppBarHeightCompact
|
||||
: kDesktopAppBarHeight,
|
||||
height:
|
||||
isCompactHeight ? kDesktopAppBarHeightCompact : kDesktopAppBarHeight,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
|
Loading…
Reference in a new issue