refactor app bar

This commit is contained in:
sneurlax 2024-01-24 12:00:38 -06:00
parent 0f8d3eb122
commit ec9cec5d21

View file

@ -85,43 +85,7 @@ class _NewWalletRecoveryPhraseWarningViewState
return MasterScaffold( return MasterScaffold(
isDesktop: isDesktop, isDesktop: isDesktop,
appBar: isDesktop appBar: _buildAppBar(context),
? const DesktopAppBar(
isCompactHeight: false,
leading: AppBarBackButton(),
trailing: ExitToMyStackButton(),
)
: AppBar(
leading: const AppBarBackButton(),
actions: [
Padding(
padding: const EdgeInsets.only(
top: 10,
bottom: 10,
right: 10,
),
child: AppBarIconButton(
semanticsLabel:
"Question Button. Opens A Dialog For Recovery Phrase Explanation.",
icon: SvgPicture.asset(
Assets.svg.circleQuestion,
width: 20,
height: 20,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
onPressed: () async {
await showDialog<void>(
context: context,
builder: (context) =>
const RecoveryPhraseExplanationDialog(),
);
},
),
)
],
),
body: ConditionalParent( body: ConditionalParent(
condition: !isDesktop, condition: !isDesktop,
builder: (child) => LayoutBuilder( builder: (child) => LayoutBuilder(
@ -653,4 +617,44 @@ class _NewWalletRecoveryPhraseWarningViewState
), ),
); );
} }
Widget _buildAppBar(BuildContext context) {
return isDesktop
? const DesktopAppBar(
isCompactHeight: false,
leading: AppBarBackButton(),
trailing: ExitToMyStackButton(),
)
: AppBar(
leading: const AppBarBackButton(),
actions: [
Padding(
padding: const EdgeInsets.only(
top: 10,
bottom: 10,
right: 10,
),
child: AppBarIconButton(
semanticsLabel:
"Question Button. Opens A Dialog For Recovery Phrase Explanation.",
icon: SvgPicture.asset(
Assets.svg.circleQuestion,
width: 20,
height: 20,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
onPressed: () async {
await showDialog<void>(
context: context,
builder: (context) =>
const RecoveryPhraseExplanationDialog(),
);
},
),
)
],
);
}
} }