This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d06ef3
commit 93e61d8
Showing
20 changed files
with
583 additions
and
26 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export 'view/view.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import 'package:app_ui/app_ui.dart'; | ||
import 'package:dash_run/game/game.dart'; | ||
import 'package:dash_run/gen/assets.gen.dart'; | ||
import 'package:dash_run/l10n/l10n.dart'; | ||
import 'package:dash_run/settings/settings.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class GameIntroPage extends StatelessWidget { | ||
const GameIntroPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final l10n = context.l10n; | ||
final theme = Theme.of(context); | ||
return Scaffold( | ||
body: Stack( | ||
children: [ | ||
Positioned.fill( | ||
child: Assets.images.introBackground.image( | ||
fit: BoxFit.fill, | ||
), | ||
), | ||
Column( | ||
children: [ | ||
const Spacer(), | ||
Assets.images.gameLogo.image(), | ||
const Spacer(flex: 4), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16), | ||
child: Text( | ||
l10n.gameIntroPageHeadline, | ||
textAlign: TextAlign.center, | ||
style: theme.textTheme.titleMedium?.copyWith( | ||
color: Colors.white, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
), | ||
const SizedBox(height: 32), | ||
GameElevatedButton( | ||
label: l10n.gameIntroPagePlayButtonText, | ||
onPressed: () => Navigator.of(context).push(GameView.route()), | ||
), | ||
const Spacer(), | ||
const _Actions(), | ||
const SizedBox(height: 32), | ||
], | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} | ||
|
||
class _Actions extends StatelessWidget { | ||
const _Actions(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final settingsController = context.watch<SettingsController>(); | ||
return Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
children: [ | ||
ValueListenableBuilder<bool>( | ||
valueListenable: settingsController.soundsOn, | ||
builder: (context, soundsOn, child) => GameIconButton( | ||
icon: soundsOn ? Icons.volume_up : Icons.volume_off, | ||
onPressed: soundsOn | ||
? settingsController.toggleMuted | ||
: settingsController.toggleMusicOn, | ||
), | ||
), | ||
GameIconButton( | ||
icon: Icons.leaderboard, | ||
onPressed: () {}, | ||
), | ||
GameIconButton( | ||
onPressed: () {}, | ||
icon: Icons.info, | ||
), | ||
GameIconButton( | ||
onPressed: () {}, | ||
icon: Icons.help, | ||
), | ||
], | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export 'game_intro_page.dart'; |
Oops, something went wrong.