Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 17-improve-and-complete-offline-words-list-and-tips
  • 42-improve-app-metadata
  • 6-allow-translate-application
  • 9-improve-documentation
  • master
  • Release_1.1.10_10
  • Release_1.1.8_8
  • Release_1.1.9_9
  • Release_1.10.0_44
  • Release_1.10.1_45
  • Release_1.2.0_11
  • Release_1.2.10_21
  • Release_1.2.11_22
  • Release_1.2.12_23
  • Release_1.2.13_24
  • Release_1.2.14_25
  • Release_1.2.15_26
  • Release_1.2.16_27
  • Release_1.2.17_28
  • Release_1.2.18_29
  • Release_1.2.1_12
  • Release_1.2.2_13
  • Release_1.2.3_14
  • Release_1.2.4_15
  • Release_1.2.5_16
  • Release_1.2.6_17
  • Release_1.2.7_18
  • Release_1.2.8_19
  • Release_1.2.9_20
  • Release_1.3.0_30
  • Release_1.3.1_31
  • Release_1.3.2_32
  • Release_1.4.0_33
  • Release_1.4.1_34
  • Release_1.5.0_35
  • Release_1.5.1_36
  • Release_1.5.2_37
  • Release_1.6.0_38
  • Release_1.7.0_39
  • Release_1.8.0_40
  • Release_1.9.0_41
  • Release_1.9.1_42
  • Release_1.9.2_43
43 results

Target

Select target project
  • android/hangman
1 result
Select Git revision
  • 17-improve-and-complete-offline-words-list-and-tips
  • 42-improve-app-metadata
  • 6-allow-translate-application
  • 9-improve-documentation
  • master
  • Release_1.1.10_10
  • Release_1.1.8_8
  • Release_1.1.9_9
  • Release_1.10.0_44
  • Release_1.10.1_45
  • Release_1.2.0_11
  • Release_1.2.10_21
  • Release_1.2.11_22
  • Release_1.2.12_23
  • Release_1.2.13_24
  • Release_1.2.14_25
  • Release_1.2.15_26
  • Release_1.2.16_27
  • Release_1.2.17_28
  • Release_1.2.18_29
  • Release_1.2.1_12
  • Release_1.2.2_13
  • Release_1.2.3_14
  • Release_1.2.4_15
  • Release_1.2.5_16
  • Release_1.2.6_17
  • Release_1.2.7_18
  • Release_1.2.8_19
  • Release_1.2.9_20
  • Release_1.3.0_30
  • Release_1.3.1_31
  • Release_1.3.2_32
  • Release_1.4.0_33
  • Release_1.4.1_34
  • Release_1.5.0_35
  • Release_1.5.1_36
  • Release_1.5.2_37
  • Release_1.6.0_38
  • Release_1.7.0_39
  • Release_1.8.0_40
  • Release_1.9.0_41
  • Release_1.9.1_42
  • Release_1.9.2_43
43 results
Show changes

Commits on Source 2

Showing
with 9 additions and 321 deletions
......@@ -2,5 +2,5 @@ org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
app.versionName=1.1.10
app.versionCode=10
app.versionName=1.2.0
app.versionCode=11
File deleted
File deleted
File deleted
File deleted
assets/images/icon128.png

3.07 KiB

......@@ -4,7 +4,6 @@
command -v inkscape >/dev/null 2>&1 || { echo >&2 "I require inkscape but it's not installed. Aborting."; exit 1; }
command -v scour >/dev/null 2>&1 || { echo >&2 "I require scour but it's not installed. Aborting."; exit 1; }
command -v optipng >/dev/null 2>&1 || { echo >&2 "I require optipng but it's not installed. Aborting."; exit 1; }
command -v convert >/dev/null 2>&1 || { echo >&2 "I require convert (imagemagick) but it's not installed. Aborting."; exit 1; }
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BASE_DIR="$(dirname "${CURRENT_DIR}")"
......@@ -47,6 +46,5 @@ build_icon 72 ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher
build_icon 192 ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher
build_icon 48 ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher
build_icon 216 ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher
build_icon 128 ${BASE_DIR}/assets/images/icon128
build_icon 192 ${BASE_DIR}/fastlane/metadata/android/en-US/images/icon
build_icon 192 ${BASE_DIR}/fastlane/metadata/android/fr-FR/images/icon
......@@ -3,7 +3,6 @@ import 'package:provider/provider.dart';
import 'provider/data.dart';
import 'screens/home.dart';
import 'screens/info.dart';
import 'screens/settings.dart';
import 'screens/game.dart';
import 'screens/scores.dart';
......@@ -30,7 +29,6 @@ class Hangman extends StatelessWidget {
Game.id: (context) => Game(),
Settings.id: (context) => Settings(),
Scores.id: (context) => Scores(),
Info.id: (context) => Info(),
},
);
}),
......
import 'package:flutter/foundation.dart';
import '../utils/shared_prefs.dart';
import '../utils/package_info.dart';
import '../utils/constants.dart';
class Data extends ChangeNotifier {
......@@ -8,7 +7,6 @@ class Data extends ChangeNotifier {
final SharedPrefs _sharedPrefs = SharedPrefs();
// screen settings
bool _soundValue = true;
bool _gameModeValue = false;
String _levelValue = defaultLevel;
......@@ -31,27 +29,12 @@ class Data extends ChangeNotifier {
int _victoryCount = 0;
int _defeatCount = 0;
// pack info
String _version = 'Non disponible';
var _packInfo = PackInfo();
Data() {
_readVersion();
_getPrefs();
}
void _readVersion() async {
await _packInfo.init();
String versionInfo = _packInfo.version;
_version = versionInfo;
notifyListeners();
}
String get version => _version;
void _getPrefs() async {
await _sharedPrefs.init();
_soundValue = _sharedPrefs.sound ?? true;
_gameModeValue = _sharedPrefs.gameMode ??
onlineGameMode.keys
.firstWhere((k) => onlineGameMode[k].contains(_sharedPrefs.level), orElse: () => false);
......@@ -63,17 +46,11 @@ class Data extends ChangeNotifier {
notifyListeners();
}
bool get soundPref => _sharedPrefs.sound ?? true;
bool get gameModePref => _sharedPrefs.gameMode ?? false;
String get levelPref => _sharedPrefs.level ?? onlineGameMode[gameModePref].first;
void resetValues() => _getPrefs();
set setPrefSound(bool prefSound) {
_sharedPrefs.sound = prefSound;
notifyListeners();
}
set setPrefGameMode(bool prefGameMode) {
_sharedPrefs.gameMode = prefGameMode;
notifyListeners();
......@@ -84,13 +61,6 @@ class Data extends ChangeNotifier {
notifyListeners();
}
bool get soundValue => _soundValue;
set updateSound(bool value) {
_soundValue = value;
notifyListeners();
}
bool get gameModeValue => _gameModeValue;
set updateGameMode(bool value) {
......
......@@ -15,24 +15,6 @@ class Home extends StatelessWidget {
Orientation orientation = MediaQuery.of(context).orientation;
Data _myProvider = Provider.of<Data>(context);
List<Widget> _listWidgets() {
return [
Image.asset(
'assets/images/icon128.png',
scale: orientation == Orientation.portrait ? 1 : 1.5,
),
Padding(
padding: orientation == Orientation.portrait
? EdgeInsets.only(top: 10.0)
: EdgeInsets.only(left: 10.0),
child: Text(
'Version: ${_myProvider.version}',
textAlign: orientation == Orientation.portrait ? TextAlign.center : TextAlign.left,
),
),
];
}
void _errorWord(context) {
showDialog(
context: context,
......@@ -59,10 +41,6 @@ class Home extends StatelessWidget {
onWillPop: () async => false,
child: Center(
child: CircularProgressIndicator(),
/*child: Text(
'Generando una palabra,\nespera un momento por favor...',
textAlign: TextAlign.center,
),*/
),
)
: Container(
......@@ -86,15 +64,6 @@ class Home extends StatelessWidget {
),
),
),
Container(
child: orientation == Orientation.portrait
? Column(children: _listWidgets())
: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: _listWidgets(),
),
),
RaisedButton.icon(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0))),
......
import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show Clipboard, ClipboardData;
class Info extends StatelessWidget {
static const String id = 'info';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Informations'),
actions: [ButtonCoffee()],
),
body: SingleChildScrollView(
padding: EdgeInsets.all(10.0),
child: Text(
textoInfo,
style: TextStyle(fontSize: 18.0),
),
),
);
}
}
class ButtonCoffee extends StatelessWidget {
const ButtonCoffee({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return IconButton(
icon: Icon(Icons.free_breakfast),
onPressed: () {
showDialog(
context: context,
builder: (BuildContext context) => Scaffold(
backgroundColor: Colors.transparent,
body: Builder(
builder: (context) => DialogInfo(),
),
),
);
},
);
}
}
class DialogInfo extends StatelessWidget {
const DialogInfo({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text('Informations sur cette application'),
content: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Le jeu du pendu est un logiciel libre, sans publicité.'),
],
),
),
actions: [
FlatButton(
child: Text('Fermer'),
onPressed: () => Navigator.of(context).pop(),
)
],
);
}
}
const String textoInfo = '''
LE JEU DU PENDU
''';
......@@ -16,19 +16,6 @@ class Settings extends StatelessWidget {
padding: const EdgeInsets.only(top: 30.0, left: 30.0, right: 30.0),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Son'),
Switch(
value: _myProvider.soundValue,
onChanged: (bool value) => _myProvider.updateSound = value,
activeTrackColor: Color(board),
activeColor: Colors.greenAccent[400],
),
],
),
Divider(color: Colors.grey),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
......@@ -67,7 +54,6 @@ class Settings extends StatelessWidget {
color: Color(board),
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
onPressed: () {
_myProvider.setPrefSound = _myProvider.soundValue;
_myProvider.setPrefGameMode = _myProvider.gameModeValue;
_myProvider.setPrefLevel = _myProvider.levelValue;
Navigator.pop(context);
......
import 'package:package_info/package_info.dart';
class PackInfo {
static PackageInfo _packageInfo;
static String _version = 'Not available';
init() async {
if (_packageInfo == null) {
_packageInfo = await PackageInfo.fromPlatform();
_version = _packageInfo.version;
}
}
String get version => _version;
}
......@@ -2,7 +2,6 @@ import 'package:shared_preferences/shared_preferences.dart';
class SharedPrefs {
static SharedPreferences _sharedPrefs;
static const String _prefsSound = 'sound';
static const String _prefsGameMode = 'gameMode';
static const String _prefsLevel = 'level';
static const String _prefsVictoryCount = 'victoryCount';
......@@ -14,10 +13,6 @@ class SharedPrefs {
}
}
bool get sound => _sharedPrefs?.getBool(_prefsSound);
set sound(bool value) => _sharedPrefs.setBool(_prefsSound, value);
bool get gameMode => _sharedPrefs?.getBool(_prefsGameMode);
set gameMode(bool value) => _sharedPrefs.setBool(_prefsGameMode, value);
......
import 'package:assets_audio_player/assets_audio_player.dart';
enum Archive { success, error, defeat, victory }
extension ArchiveExtension on Archive {
static const files = {
Archive.success: 'assets/audio/success.aac',
Archive.error: 'assets/audio/error.aac',
Archive.defeat: 'assets/audio/gameover.aac',
Archive.victory: 'assets/audio/victory.aac',
};
String get file => files[this];
}
class Sound {
AssetsAudioPlayer assetsAudioPlayer;
Sound() {
assetsAudioPlayer = AssetsAudioPlayer();
}
Future<void> play(String archive) async => await assetsAudioPlayer.open(Audio(archive));
Future<void> stop() async => await assetsAudioPlayer.stop();
}
......@@ -4,12 +4,10 @@ import '../screens/home.dart';
import '../screens/game.dart';
import '../provider/data.dart';
import '../utils/constants.dart';
import '../utils/sound.dart';
class DialogGameOver extends StatelessWidget {
final GameOver gameOver;
final Sound sound;
const DialogGameOver(this.gameOver, this.sound);
const DialogGameOver(this.gameOver);
@override
Widget build(BuildContext context) {
......@@ -43,9 +41,6 @@ class DialogGameOver extends StatelessWidget {
FlatButton(
child: const Text('QUITTER'),
onPressed: () {
if (_myProvider.soundValue == true) {
sound.stop();
}
Navigator.pushNamed(context, Home.id);
},
),
......
......@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../provider/data.dart';
import '../utils/constants.dart';
import '../utils/sound.dart';
import '../widgets/dialog_gameover.dart';
class LetterButtons extends StatelessWidget {
......@@ -12,15 +11,11 @@ class LetterButtons extends StatelessWidget {
Widget build(BuildContext context) {
Orientation orientation = MediaQuery.of(context).orientation;
var size = MediaQuery.of(context).size;
/*24 is for notification bar on Android*/
//final double itemHeight = (size.height - kToolbarHeight - 24) / 2;
//final double itemWidth = size.width / 2;
final double paddingTop = MediaQuery.of(context).padding.top;
final double itemHeight = (size.height - paddingTop) / 2;
final double itemWidth = size.width / 2;
Data _myProvider = Provider.of<Data>(context);
Sound sound = Sound();
List<String> lettersList = letters.split('');
List<Widget> keys = [];
......@@ -45,36 +40,20 @@ class LetterButtons extends StatelessWidget {
if (_myProvider.hiddenWord == _myProvider.secretWord) {
_myProvider.addVictory();
if (_myProvider.soundValue == true) {
sound.play(Archive.victory.file);
}
showDialog(
context: context,
builder: (context) => DialogGameOver(victory, sound),
builder: (context) => DialogGameOver(victory),
);
} else {
if (_myProvider.soundValue == true) {
sound.play(Archive.success.file);
}
}
} else {
_myProvider.addError();
if (_myProvider.errors == 8) {
if (_myProvider.soundValue == true) {
await sound.play(Archive.error.file);
await Future.delayed(Duration(seconds: 1));
await sound.play(Archive.defeat.file);
}
await Future.delayed(Duration(milliseconds: 900)); //????
_myProvider.addDefeat();
showDialog(
context: context,
builder: (context) => DialogGameOver(defeat, sound),
builder: (context) => DialogGameOver(defeat),
);
} else {
if (_myProvider.soundValue == true) {
sound.play(Archive.error.file);
}
}
}
},
......
......@@ -5,7 +5,6 @@ import 'package:provider/provider.dart';
import '../provider/data.dart';
import '../screens/settings.dart';
import '../screens/scores.dart';
import '../screens/info.dart';
class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
final AppBar appBar;
......@@ -40,14 +39,10 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
Scaffold.of(context).removeCurrentSnackBar();
Navigator.pushNamed(context, Scores.id);
break;
case 'Informations':
Scaffold.of(context).removeCurrentSnackBar();
Navigator.pushNamed(context, Info.id);
break;
}
},
itemBuilder: (BuildContext context) {
return {'Scores', 'Informations', 'Quitter'}.map((String choice) {
return {'Scores', 'Quitter'}.map((String choice) {
return PopupMenuItem<String>(
value: choice,
child: Text(choice),
......
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
assets_audio_player:
dependency: "direct main"
description:
name: assets_audio_player
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.15"
assets_audio_player_web:
dependency: transitive
description:
name: assets_audio_player_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.15"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
version: "2.7.0"
boolean_selector:
dependency: transitive
description:
......@@ -57,20 +43,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.5"
csslib:
dependency: transitive
description:
......@@ -78,13 +50,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.2"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
diacritic:
dependency: "direct main"
description:
......@@ -176,7 +141,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.4.0"
nested:
dependency: transitive
description:
......@@ -184,13 +149,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
package_info:
dependency: "direct main"
description:
name: package_info
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3+4"
path:
dependency: transitive
description:
......@@ -198,13 +156,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
path_provider:
dependency: transitive
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.28"
path_provider_linux:
dependency: transitive
description:
......@@ -212,13 +163,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+2"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+8"
path_provider_platform_interface:
dependency: transitive
description:
......@@ -268,13 +212,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.3.3"
rxdart:
dependency: transitive
description:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.25.0"
shared_preferences:
dependency: "direct main"
description:
......@@ -363,7 +300,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
version: "0.4.0"
typed_data:
dependency: transitive
description:
......@@ -371,13 +308,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
uuid:
dependency: transitive
description:
name: uuid
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.2"
vector_math:
dependency: transitive
description:
......
name: hangman
description: Hangman game, have fun with words and letters!
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.1.3+1
environment:
......@@ -11,30 +9,22 @@ environment:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
provider: ^4.3.2+3
package_info: ^0.4.3+2
shared_preferences: ^0.5.12+4
html: ^0.14.0+4
http: ^0.12.2
diacritic: ^0.1.1
assets_audio_player: ^2.0.13+1
list_french_words: ^0.1.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- assets/images/
- assets/files/
- assets/audio/
fonts:
- family: Tiza
fonts:
......