Skip to content

Commit

Permalink
Simplify clock screen
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Apr 11, 2024
1 parent aa23a66 commit 186e5ba
Showing 1 changed file with 19 additions and 37 deletions.
56 changes: 19 additions & 37 deletions lib/src/view/clock/clock_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:lichess_mobile/src/model/clock/clock_controller.dart';
import 'package:lichess_mobile/src/utils/immersive_mode.dart';
import 'package:lichess_mobile/src/view/clock/clock_settings.dart';
import 'package:lichess_mobile/src/view/clock/clock_tile.dart';
import 'package:lichess_mobile/src/widgets/platform.dart';

class ClockScreen extends StatefulWidget {
const ClockScreen({super.key});
Expand All @@ -17,27 +16,8 @@ class ClockScreen extends StatefulWidget {
class _ClockScreenState extends State<ClockScreen> {
@override
Widget build(BuildContext context) {
return ImmersiveModeWidget(
child: PlatformWidget(
androidBuilder: _androidBuilder,
iosBuilder: _iosBuilder,
),
);
}

Widget _androidBuilder(BuildContext context) {
return const SafeArea(
child: Scaffold(
body: _Body(),
),
);
}

Widget _iosBuilder(BuildContext context) {
return const SafeArea(
child: CupertinoPageScaffold(
child: _Body(),
),
return const ImmersiveModeWidget(
child: _Body(),
);
}
}
Expand All @@ -49,23 +29,25 @@ class _Body extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final state = ref.watch(clockControllerProvider);

return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: ClockTile(
playerType: ClockPlayerType.top,
clockState: state,
return SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: ClockTile(
playerType: ClockPlayerType.top,
clockState: state,
),
),
),
const ClockSettings(),
Expanded(
child: ClockTile(
playerType: ClockPlayerType.bottom,
clockState: state,
const ClockSettings(),
Expanded(
child: ClockTile(
playerType: ClockPlayerType.bottom,
clockState: state,
),
),
),
],
],
),
);
}
}

0 comments on commit 186e5ba

Please sign in to comment.