Skip to content

Commit

Permalink
remove names from stats screen to avoid cut off
Browse files Browse the repository at this point in the history
  • Loading branch information
HaonRekcef committed Mar 27, 2024
1 parent c7765f6 commit bd09eba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 44 deletions.
49 changes: 17 additions & 32 deletions lib/src/view/puzzle/storm_dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,58 +11,43 @@ import 'package:lichess_mobile/src/utils/l10n_context.dart';
import 'package:lichess_mobile/src/widgets/list.dart';
import 'package:lichess_mobile/src/widgets/shimmer.dart';
import 'package:lichess_mobile/src/widgets/stat_card.dart';
import 'package:lichess_mobile/src/widgets/user_full_name.dart';

class StormDashboardModal extends StatelessWidget {
const StormDashboardModal({super.key, required this.user});

final LightUser user;

@override
Widget build(BuildContext context) {
return Theme.of(context).platform == TargetPlatform.iOS
? CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: _Title(user: user),
middle: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(LichessIcons.storm, size: 20),
const SizedBox(width: 8.0),
Text(context.l10n.stormHighscores),
],
),
),
child: _Body(user: user),
)
: Scaffold(
body: _Body(user: user),
appBar: AppBar(
titleSpacing: 0,
title: _Title(user: user),
title: Row(
children: [
const Icon(LichessIcons.storm, size: 20),
const SizedBox(width: 8.0),
Text(context.l10n.stormHighscores),
],
),
),
body: _Body(user: user),
);
}
}

class _Title extends StatelessWidget {
const _Title({required this.user});

final LightUser user;

@override
Widget build(BuildContext context) {
return Row(
children: [
Flexible(
child: UserFullNameWidget(user: user),
),
Flexible(
child: Row(
children: [
const SizedBox(width: 8.0),
const Icon(LichessIcons.storm, size: 20),
const SizedBox(width: 8.0),
Text(context.l10n.stormHighscores),
],
),
),
],
);
}
}

class _Body extends ConsumerWidget {
const _Body({required this.user});

Expand Down
19 changes: 7 additions & 12 deletions lib/src/view/user/perf_stats_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class PerfStatsScreen extends StatelessWidget {
return Scaffold(
appBar: AppBar(
titleSpacing: 0,
title: _Title(user: user, perf: perf),
title: _Title(perf: perf),
),
body: _Body(user: user, perf: perf),
);
Expand All @@ -65,31 +65,26 @@ class PerfStatsScreen extends StatelessWidget {
Widget _iosBuilder(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: _Title(user: user, perf: perf),
middle: _Title(perf: perf),
),
child: _Body(user: user, perf: perf),
);
}
}

class _Title extends StatelessWidget {
const _Title({required this.user, required this.perf});
const _Title({required this.perf});

final User user;
final Perf perf;

@override
Widget build(BuildContext context) {
return Row(
children: [
Flexible(
child: UserFullNameWidget(user: user.lightUser),
),
Flexible(
child: Text(
' ${context.l10n.perfStatPerfStats(perf.title)}',
overflow: TextOverflow.ellipsis,
),
Icon(perf.icon),
Text(
' ${context.l10n.perfStatPerfStats(perf.title)}',
overflow: TextOverflow.ellipsis,
),
],
);
Expand Down

0 comments on commit bd09eba

Please sign in to comment.