Skip to content

Commit

Permalink
Fix game not saving after end of level and trying to close the game. …
Browse files Browse the repository at this point in the history
…Adding credits
  • Loading branch information
eagskunst committed Feb 12, 2020
1 parent ec94873 commit 2b390cc
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 1 deletion.
1 change: 1 addition & 0 deletions android/settings_aar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':app'
13 changes: 13 additions & 0 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
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.
1 change: 1 addition & 0 deletions ios/Runner/Runner-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#import "GeneratedPluginRegistrant.h"
9 changes: 8 additions & 1 deletion lib/ui/game/game_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class _GameViewState extends State<GameView> {
isScrollControlled: true,
builder: (context) => WordsBottomSheet(words: wordsBloc.createSoupWordsWidget()),
),
() => wordsBloc.unlockWordEnable ? unlockWord() : SnackBarUtil.createErrorSnack(context, 'You have already unlocked a word')
() => wordsBloc.unlockWordEnable ? unlockWord() : SnackBarUtil.createErrorSnack(context, 'Ya desbloqueaste una palabra')
],
wordsBloc.unlockWordEnable
)
Expand Down Expand Up @@ -157,6 +157,13 @@ class _GameViewState extends State<GameView> {
void createLevelCompletedDialog() async {
final goNextLevel = await LevelCompleteDialog.showLevelCompleteDialog(context, wordsBloc.userName, widget.level);
if(goNextLevel) wordsBloc.triggerLevelComplete();
else {
wordsBloc.triggerLevelComplete();
Future.delayed(Duration(milliseconds: 500))
.then((_) => wordsBloc.saveGameBoardData(widget.level)
.then((_) => Navigator.pop(context))
);
}
}

void createGameCompleteDialog() async {
Expand Down
11 changes: 11 additions & 0 deletions lib/ui/initial_screen/initial_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class _InitialScreenState extends State<InitialScreen> with WidgetsBindingObserv
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
SizedBox(
height: shortestSide < 500 ? 150 : 190,
Expand Down Expand Up @@ -86,6 +87,16 @@ class _InitialScreenState extends State<InitialScreen> with WidgetsBindingObserv
text: 'Borrar partida'.toUpperCase(),
onTap: _gameboardState == null ? null : () => deleteGameBoard(),
),
Padding(
padding: const EdgeInsets.only(top: 25.0),
child: Text(
'Hecho por: Emmanuel Guerra y Carlos Rosales',
style: TextStyle(
fontSize: 14,
color: Colors.grey.withOpacity(0.7)
),
),
)
],
);
}
Expand Down
10 changes: 10 additions & 0 deletions web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>word_soup</title>
</head>
<body>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>

0 comments on commit 2b390cc

Please sign in to comment.