mirror of
https://github.com/lichess-org/mobile.git
synced 2026-05-26 13:50:52 +00:00
replace generic analysisboard header (#3189)
This commit is contained in:
@@ -119,14 +119,19 @@ class _AnalysisScreenState extends ConsumerState<_AnalysisScreen>
|
||||
|
||||
switch (asyncState) {
|
||||
case AsyncData(:final value):
|
||||
Widget appBarTitle;
|
||||
if (value.archivedGame != null) {
|
||||
final title =
|
||||
'${value.archivedGame!.data.clockDisplay(context.l10n)} • ${value.archivedGame!.meta.speed.label} • ${value.archivedGame!.meta.rated ? context.l10n.rated : context.l10n.casual}';
|
||||
appBarTitle = VariantAppBarTitle(variant: value.variant, title: title);
|
||||
} else {
|
||||
appBarTitle = VariantAppBarTitle(variant: value.variant, title: context.l10n.analysis);
|
||||
}
|
||||
|
||||
return WakelockWidget(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
title: VariantAppBarTitle(variant: value.variant, title: context.l10n.analysis),
|
||||
actions: appBarActions,
|
||||
),
|
||||
appBar: AppBar(centerTitle: false, title: appBarTitle, actions: appBarActions),
|
||||
body: _Body(options: widget.options, controller: _tabController, tabs: tabs),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1484,7 +1484,7 @@ void main() {
|
||||
await tester.tap(find.text('Analysis board'));
|
||||
await tester.pumpAndSettle(); // wait for analysis screen to open
|
||||
expect(
|
||||
find.widgetWithText(AppBar, 'Analysis board'),
|
||||
find.descendant(of: find.byType(AppBar), matching: find.textContaining('Rated')),
|
||||
findsOneWidget,
|
||||
); // analysis screen is now open
|
||||
expect(find.byType(Chessboard), findsOneWidget);
|
||||
|
||||
Reference in New Issue
Block a user