diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..151747ab3738f419bad95ce1f26c3f0e3e7e3c46 --- /dev/null +++ b/.gitignore @@ -0,0 +1,163 @@ +# Built application files +*.apk +*.aar +*.ap_ +*.aab + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ +# Uncomment the following line in case you need and you don't have the release build type files in your app +# release/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# IntelliJ +*.iml +.idea/workspace.xml +.idea/tasks.xml +.idea/gradle.xml +.idea/assetWizardSettings.xml +.idea/dictionaries +.idea/libraries +# Android Studio 3 in .gitignore file. +.idea/caches +.idea/modules.xml +# Comment next line if keeping position of elements in Navigation Editor is relevant for you +.idea/navEditor.xml + +# Keystore files +# Uncomment the following lines if you do not want to check your keystore files in. +#*.jks +#*.keystore + +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild +.cxx/ + +# Google Services (e.g. APIs or Firebase) +# google-services.json + +# Freeline +freeline.py +freeline/ +freeline_project_description.json + +# fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/readme.md + +# Version control +vcs.xml + +# lint +lint/intermediates/ +lint/generated/ +lint/outputs/ +lint/tmp/ +# lint/reports/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +**/generated_plugin_registrant.dart +.packages +.pub-cache/ +.pub/ +flutter_*.png +linked_*.ds +unlinked.ds +unlinked_spec.ds + +# packages file containing multi-root paths +.packages.generated + +# Visual Studio Code related +.classpath +.project +.settings/ +.vscode/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java +**/android/key.properties +*.jks + +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +.glci diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..291b7c0438f5450e8ef586add2cff6a533e20258 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,51 @@ +image: cirrusci/flutter:latest + +stages: + - test + - update + - build + - deploy + +tests: + stage: test + script: + - flutter test + interruptible: true + +update: + stage: update + script: + - flutter packages get + - flutter packages upgrade + interruptible: true + +android:build: + stage: build + script: + # Flutter local configuration + - echo flutter.sdk=$FLUTTER_PATH > android/local.properties + - echo sdk.dir=$ANDROID_SDK_PATH >> android/local.properties + - echo flutter.buildMode=release >> android/local.properties + # Android signing + - ANDROID_KEYSTORE_PATH=my.keystore + - echo $ANDROID_KEYSTORE_FILE | base64 -d > $ANDROID_KEYSTORE_PATH + - echo storePassword=$ANDROID_KEY_STORE_PASSWORD > android/key.properties + - echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties + - echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties + - echo storeFile=$ANDROID_KEYSTORE_PATH >> android/key.properties + # build flutter app + - flutter build apk + artifacts: + paths: + - build/app/outputs/apk/release/app-release.apk + expire_in: 1 week + interruptible: true + +android:deploy: + stage: deploy + only: + - master + dependencies: + - android:build + script: + - wget ${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN} diff --git a/.metadata b/.metadata new file mode 100644 index 0000000000000000000000000000000000000000..182cccafd96b59814f686d06695a1a60af003e8d --- /dev/null +++ b/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 78910062997c3a836feee883712c241a5fd22983 + channel: stable + +project_type: app diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..f288702d2fa16d3cdf0035b15a9fcbc552cd88e7 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<https://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<https://www.gnu.org/licenses/why-not-lgpl.html>. diff --git a/README.md b/README.md index a236266f157ce437ec70580fe6fb31404433876a..2033aa9471d1468f19c7ae762dc854aa06d61d68 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ -# hangman +Hangman +======== +[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" + alt="Get it on F-Droid" + height="80">](https://f-droid.org/packages/org.benoitharrault.hangman/) + +GNU General Public License (GPLv3). diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..decff11a5ed9b97360515443996c0d4f097e3682 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,9 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..ba06a2de4432b9b5615b0b62db465f30dcc07680 --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,54 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '6' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.5' +} + +apply plugin: 'com.android.application' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 29 + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "org.benoitharrault.hangman" + minSdkVersion 21 + targetSdkVersion 29 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..f51d31318aafd3d429a768e999b45f720a9bb53c --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="org.benoitharrault.hangman"> + <!-- Flutter needs it to communicate with the running application + to allow setting breakpoints, to provide hot reload, etc. + --> + <uses-permission android:name="android.permission.INTERNET"/> +</manifest> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..a68012e7b467604dd3a36fe3447b18866219dd26 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="org.benoitharrault.hangman"> + <!-- io.flutter.app.FlutterApplication is an android.app.Application that + calls FlutterMain.startInitialization(this); in its onCreate method. + In most cases you can leave this as-is, but you if you want to provide + additional functionality it is fine to subclass or reimplement + FlutterApplication and put your custom class here. --> + <uses-permission android:name="android.permission.INTERNET"/> + <application + android:label="Hangman" + android:icon="@mipmap/ic_launcher"> + <activity + android:name=".MainActivity" + android:launchMode="singleTop" + android:theme="@style/LaunchTheme" + android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" + android:hardwareAccelerated="true" + android:windowSoftInputMode="adjustResize"> + <!-- Specifies an Android theme to apply to this Activity as soon as + the Android process has started. This theme is visible to the user + while the Flutter UI initializes. After that, this theme continues + to determine the Window background behind the Flutter UI. --> + <meta-data + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" + /> + <!-- Displays an Android View that continues showing the launch screen + Drawable until Flutter paints its first frame, then this splash + screen fades out. A splash screen is useful to avoid any visual + gap between the end of Android's launch screen and the painting of + Flutter's first frame. --> + <meta-data + android:name="io.flutter.embedding.android.SplashScreenDrawable" + android:resource="@drawable/launch_background" + /> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + </activity> + <!-- Don't delete the meta-data below. + This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> + <meta-data + android:name="flutterEmbedding" + android:value="2" /> + </application> +</manifest> diff --git a/android/app/src/main/java/com/hangman/MainActivity.java b/android/app/src/main/java/com/hangman/MainActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..810c77b8f7faa2c515871c03ad94b8259a29ef68 --- /dev/null +++ b/android/app/src/main/java/com/hangman/MainActivity.java @@ -0,0 +1,6 @@ +package org.benoitharrault.hangman; + +import io.flutter.embedding.android.FlutterActivity; + +public class MainActivity extends FlutterActivity { +} diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..304732f8842013497e14bd02f67a55f2614fb8f7 --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Modify this file to customize your launch splash screen --> +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@android:color/white" /> + + <!-- You can insert your own image assets here --> + <!-- <item> + <bitmap + android:gravity="center" + android:src="@mipmap/launch_image" /> + </item> --> +</layer-list> diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..57942fbe807e89b845871f9e3087309a477799b1 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..06c00715d6fd339092fd1d298cfb740e8fc2a3d4 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..57942fbe807e89b845871f9e3087309a477799b1 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..6ed5b02ff7c28f80fa78f09a85b38570966084ed Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..f05f9f7dd17dbf0cfd58d5846fb0f53954ab0e62 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..6ed5b02ff7c28f80fa78f09a85b38570966084ed Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..944c67b1a16817a70459744c2a7e0ff3506d69f8 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..944c67b1a16817a70459744c2a7e0ff3506d69f8 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..944c67b1a16817a70459744c2a7e0ff3506d69f8 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..23329a94b1d843c2b944b29c5042f7f258889d44 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..e3aa0ec3e828e90b6b0041b54da771d2674577bc Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..23329a94b1d843c2b944b29c5042f7f258889d44 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..d7d204d09f9f55d58920bc5fa775efc9d2358eab Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000000000000000000000000000000000000..c2a46d7fb3ab5f9383f0c54deb3aeb6a968ab108 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..d7d204d09f9f55d58920bc5fa775efc9d2358eab Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000000000000000000000000000000000000..1f83a33fd4f2c45c5ffa5b6c1b729c431fd445fc --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Theme applied to the Android Window while the process is starting --> + <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> + <!-- Show a splash screen on the activity. Automatically removed when + Flutter draws its first frame --> + <item name="android:windowBackground">@drawable/launch_background</item> + </style> + <!-- Theme applied to the Android Window as soon as the process has started. + This theme determines the color of the Android Window while your + Flutter UI initializes, as well as behind your Flutter UI while its + running. + + This Theme is only used starting with V2 of Flutter's Android embedding. --> + <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> + <item name="android:windowBackground">@android:color/white</item> + </style> +</resources> diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..f51d31318aafd3d429a768e999b45f720a9bb53c --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="org.benoitharrault.hangman"> + <!-- Flutter needs it to communicate with the running application + to allow setting breakpoints, to provide hot reload, etc. + --> + <uses-permission android:name="android.permission.INTERNET"/> +</manifest> diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..089a64e8b356474b2b85a47fb62ba944f8a36df7 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,30 @@ +buildscript { + ext.kotlin_version = '1.3.72' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.1.2' + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..a6738207fd15542cba015ae6ddcb8789efd81397 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true +android.enableR8=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..039eda99de884b62037cb230e639b99bdc50c15e --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..44e62bcf06ae649ea809590f8a861059886502e8 --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/assets/audio/error.aac b/assets/audio/error.aac new file mode 100644 index 0000000000000000000000000000000000000000..5c6c2a6144029adb1a2de89486abe3cea77ca290 Binary files /dev/null and b/assets/audio/error.aac differ diff --git a/assets/audio/gameover.aac b/assets/audio/gameover.aac new file mode 100644 index 0000000000000000000000000000000000000000..a2b088a046ea83ba523d29896fdd9e772230e319 Binary files /dev/null and b/assets/audio/gameover.aac differ diff --git a/assets/audio/success.aac b/assets/audio/success.aac new file mode 100644 index 0000000000000000000000000000000000000000..532123dc1bb205f3044849578b6fd6c9715bf31f Binary files /dev/null and b/assets/audio/success.aac differ diff --git a/assets/audio/victory.aac b/assets/audio/victory.aac new file mode 100644 index 0000000000000000000000000000000000000000..a6eae02c2856deea2eb625d30065fdf8ccec1a27 Binary files /dev/null and b/assets/audio/victory.aac differ diff --git a/assets/files/word-list-fr.json b/assets/files/word-list-fr.json new file mode 100644 index 0000000000000000000000000000000000000000..6892b65ca48889cf8c0ffd276780cbbaa76eaf31 --- /dev/null +++ b/assets/files/word-list-fr.json @@ -0,0 +1,188 @@ +{ + "words-list": [ + { + "category": "ANIMAUX", + "clue": "Animal", + "words": [ + "ANACONDA", + "AUTRUCHE", + "BARRACUDA", + "BOUQUETIN", + "COCCINELLE", + "CROCODILE", + "DROMADAIRE", + "ELEPHANT", + "ESCARGOT", + "FOURMILIER", + "GRENOUILLE", + "HIPPOCAMPE", + "HIPPOPOTAME", + "KANGOUROU", + "LIBELLULE", + "PERROQUET", + "PIPISTRELLE", + "RHINOCEROS", + "SAUTERELLE", + "TARENTULE" + ] + }, + { + "category": "FRUITS", + "clue": "Fruit", + "words": [ + "AUBERGINE", + "BETTERAVE", + "CITROUILLE", + "CONCOMBRE", + "FRAMBOISE", + "GROSEILLE", + "MANDARINE", + "MIRABELLE", + "MYRTILLE", + "PAMPLEMOUSSE" + ] + }, + { + "category": "METIERS", + "clue": "Métier", + "words": [ + "AGRICULTEUR", + "ARCHEOLOGUE", + "ARCHITECTE", + "ASTRONAUTE", + "BIJOUTIER", + "BIOLOGISTE", + "CHARCUTIER", + "CHARPENTIER", + "CUISINIER", + "ELECTRICIEN", + "HORTICULTEUR", + "INFIRMIER", + "MECANICIEN", + "MENUISIER", + "METEOROLOGUE", + "PHOTOGRAPHE", + "PROFESSEUR", + "STANDARDISTE", + "VETERINAIRE", + "VOLCANOLOGUE" + ] + }, + { + "category": "GEOGRAPHIE", + "clue": "Géographie", + "words": [ + "ALLEMAGNE", + "ANTARCTIQUE", + "ARGENTINE", + "ATLANTIQUE", + "AUSTRALIE", + "EMBOUCHURE", + "HEMISPHERE", + "HYDROGRAPHIE", + "KILIMANDJARO", + "LUXEMBOURG", + "MADAGASCAR", + "MEDITERRANEE", + "MISSISSIPPI", + "NORMANDIE", + "PACIFIQUE", + "PLANISPHERE", + "STRASBOURG", + "SUPERFICIE", + "VENEZUELA", + "WASHINGTON" + ] + }, + { + "category": "COULEURS", + "clue": "Couleur", + "words": [ + "ROUGE", + "BLEU", + "VERT", + "JAUNE", + "VIOLET", + "ORANGE", + "MARRON", + "NOIR", + "BLANC", + "TURQUOISE", + "BEIGE", + "ROSE" + ] + }, + { + "category": "FLEURS", + "clue": "Fleur", + "words": [ + "ROSE", + "PIVOINE", + "TULIPE", + "JONQUILLE", + "CACTUS" + ] + }, + { + "category": "SPORTS", + "clue": "Sport ou jeu", + "words": [ + "GYMNASTIQUE", + "FOOTBALL", + "HANDBALL", + "COURSE", + "CYCLISME", + "RANDONNEE" + ] + }, + { + "category": "ALIMENTS", + "clue": "Aliment ou plat", + "words": [ + "FROMAGE", + "PIZZA", + "SAUCISSON", + "JAMBON", + "SALAMI", + "PAELLA", + "PATES", + "SALADE", + "SOUPE", + "CHOCOLAT", + "OEUF", + "CREME", + "LAIT", + "CORNICHON", + "FLAN", + "TARTE", + "PUREE", + "SAUMON", + "SANDWICH" + ] + }, + { + "category": "VEHICULE", + "clue": "Véhicule ou moyen de transport", + "words": [ + "VOITURE", + "MOTO", + "VELO", + "TRAIN", + "BATEAU", + "AVION", + "HELICOPTERE", + "AUTOBUS", + "CAR", + "TRAINEAU", + "FUSEE", + "VOILIER", + "PAQUEBOT", + "METRO", + "SOUS-MARIN", + "CAMION", + "TRACTEUR", + "KAYAK" + ] + } + ] +} diff --git a/assets/fonts/tiza.ttf b/assets/fonts/tiza.ttf new file mode 100644 index 0000000000000000000000000000000000000000..492514557e26943483120661760484e29b092c8d Binary files /dev/null and b/assets/fonts/tiza.ttf differ diff --git a/assets/images/gameover.png b/assets/images/gameover.png new file mode 100644 index 0000000000000000000000000000000000000000..97e98b39d94c4934e1a731d6b053b56bf7de0ed8 Binary files /dev/null and b/assets/images/gameover.png differ diff --git a/assets/images/icon128.png b/assets/images/icon128.png new file mode 100644 index 0000000000000000000000000000000000000000..34d4cd6178fe5c6e54a0a108a7dfea52583a7e94 Binary files /dev/null and b/assets/images/icon128.png differ diff --git a/assets/images/icon128.png.png b/assets/images/icon128.png.png new file mode 100644 index 0000000000000000000000000000000000000000..d717a1fee2af97525e23f7549fa3fd2c8cca5cbd Binary files /dev/null and b/assets/images/icon128.png.png differ diff --git a/assets/images/img1.png b/assets/images/img1.png new file mode 100644 index 0000000000000000000000000000000000000000..cf02d9bd0a49e9c5f7ab65bb763e14cb02da05e8 Binary files /dev/null and b/assets/images/img1.png differ diff --git a/assets/images/img2.png b/assets/images/img2.png new file mode 100644 index 0000000000000000000000000000000000000000..1017ccb260a995e1099335f8e3d737684200fa91 Binary files /dev/null and b/assets/images/img2.png differ diff --git a/assets/images/img3.png b/assets/images/img3.png new file mode 100644 index 0000000000000000000000000000000000000000..bd09508eb49a7ac5e099826804f458161284f43d Binary files /dev/null and b/assets/images/img3.png differ diff --git a/assets/images/img4.png b/assets/images/img4.png new file mode 100644 index 0000000000000000000000000000000000000000..4f9d5b119f47e5db3ddcfc4f3fa97bd7e6d3d9c6 Binary files /dev/null and b/assets/images/img4.png differ diff --git a/assets/images/img5.png b/assets/images/img5.png new file mode 100644 index 0000000000000000000000000000000000000000..ceadc43ae13aed5d45c7e65d8dff823753acb207 Binary files /dev/null and b/assets/images/img5.png differ diff --git a/assets/images/img6.png b/assets/images/img6.png new file mode 100644 index 0000000000000000000000000000000000000000..9b7b8db3a3cebba376ba7e7f1b40a7622eaee009 Binary files /dev/null and b/assets/images/img6.png differ diff --git a/assets/images/img7.png b/assets/images/img7.png new file mode 100644 index 0000000000000000000000000000000000000000..9d6ec80ac63304397349443881eb17fe319fab91 Binary files /dev/null and b/assets/images/img7.png differ diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt new file mode 100644 index 0000000000000000000000000000000000000000..fe91a9db34e6b6b64b226c84003d9b36032d941e --- /dev/null +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -0,0 +1 @@ +<p>Hangman game, simple and classic.</p> diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cde3798ae864958a4ba7c20b509de6f30c73f9dc Binary files /dev/null and b/fastlane/metadata/android/en-US/images/icon.png differ diff --git a/fastlane/metadata/android/en-US/short_description.txt b/fastlane/metadata/android/en-US/short_description.txt new file mode 100644 index 0000000000000000000000000000000000000000..3d399340855455e428118aef2417afd4a993181f --- /dev/null +++ b/fastlane/metadata/android/en-US/short_description.txt @@ -0,0 +1 @@ +Hangman game, simple and classic. diff --git a/fastlane/metadata/android/fr-FR/images/icon.png b/fastlane/metadata/android/fr-FR/images/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cde3798ae864958a4ba7c20b509de6f30c73f9dc Binary files /dev/null and b/fastlane/metadata/android/fr-FR/images/icon.png differ diff --git a/fastlane/metadata/android/fr/full_description.txt b/fastlane/metadata/android/fr/full_description.txt new file mode 100644 index 0000000000000000000000000000000000000000..9888a1207f5f01e323206230c1e3ebac17a04a15 --- /dev/null +++ b/fastlane/metadata/android/fr/full_description.txt @@ -0,0 +1 @@ +<p>Jeu du pendu, simple et classique.</p> diff --git a/fastlane/metadata/android/fr/short_description.txt b/fastlane/metadata/android/fr/short_description.txt new file mode 100644 index 0000000000000000000000000000000000000000..ba530a8013c5263dd4b646cb2bc89dbac83f2dae --- /dev/null +++ b/fastlane/metadata/android/fr/short_description.txt @@ -0,0 +1 @@ +Jeu du pendu, simple et classique. diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..442d9132ea32808ad980df4bd233b359f76341a7 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000000000000000000000000000000000000..4f906e0c811fc9e230eb44819f509cd0627f2600 --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000000000000000000000000000000000..ac1b06f93825db68fb0c0b5150917f340eaa5d02 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/icons/build_icons.sh b/icons/build_icons.sh new file mode 100755 index 0000000000000000000000000000000000000000..323f007b425de52990e09ad251e5bd777d1cf8fb --- /dev/null +++ b/icons/build_icons.sh @@ -0,0 +1,84 @@ +#! /bin/bash + +# Check dependencies +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}")" + +SOURCE="${CURRENT_DIR}/hangman.svg" +OPTIPNG_OPTIONS="-preserve -quiet -o7" + +# optimize svg +cp ${SOURCE} ${SOURCE}.tmp +scour \ + --remove-descriptive-elements \ + --enable-id-stripping \ + --enable-viewboxing \ + --enable-comment-stripping \ + --nindent=4 \ + -i ${SOURCE}.tmp \ + -o ${SOURCE} +rm ${SOURCE}.tmp + +# build icons +function build_icon() { + ICON_SIZE="$1" + TARGET="$2" + + TARGET_PNG="${TARGET}.png" + + inkscape \ + --export-width=${ICON_SIZE} \ + --export-height=${ICON_SIZE} \ + --export-filename=${TARGET_PNG} \ + ${SOURCE} + + optipng ${TARGET_PNG} ${TARGET_PNG} +} + +build_icon 324 ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground +build_icon 144 ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round +build_icon 144 ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher +build_icon 162 ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground +build_icon 72 ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher_round +build_icon 72 ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher +build_icon 432 ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground +build_icon 192 ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round +build_icon 192 ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher +build_icon 108 ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground +build_icon 48 ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher_round +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_foreground +build_icon 216 ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round +build_icon 216 ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher +build_icon 128 ${BASE_DIR}/assets/images/icon128.png +build_icon 192 ${BASE_DIR}/fastlane/metadata/android/en-US/images/icon +build_icon 192 ${BASE_DIR}/fastlane/metadata/android/fr-FR/images/icon + + +# convert to webp +function convert_to_webp() { + FILE="$1" + + convert ${FILE}.png ${FILE}.webp + rm ${FILE}.png +} +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher_round +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher_round +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round +convert_to_webp ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher diff --git a/icons/hangman.svg b/icons/hangman.svg new file mode 100644 index 0000000000000000000000000000000000000000..2c9629e830689f0efd5ab687eb0a32936f553aeb --- /dev/null +++ b/icons/hangman.svg @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg version="1.1" viewBox="0 0 28.747 28.747" xmlns="http://www.w3.org/2000/svg"> + <defs> + <filter id="filter6206-7" color-interpolation-filters="sRGB"> + <feGaussianBlur stdDeviation="0.658125"/> + </filter> + </defs> + <g transform="translate(0 -1093.8)"> + <path transform="matrix(1.0781 0 0 1.0641 -.093733 2.7509)" d="m4.4177 1028.2v1.6051h-1.6052v18.192h1.6052v2.1402h18.192v-2.1402h2.1402v-18.192h-2.1402v-1.6051z" fill="#3e2723" filter="url(#filter6206-7)" opacity=".2"/> + <rect x="2.9987" y="1096.8" width="22.749" height="22.749" rx="1.1973" ry="1.1974" fill="#795548"/> + <g transform="translate(-22.32 1056.5)"> + <path d="m0 0h51.2v51.2h-51.2z" fill="none" stroke-width="1.0667"/> + <g transform="matrix(.33601 0 0 .33601 1.5296 73.043)"> + <path d="m0 0h51.2v51.2h-51.2z" fill="none" stroke-width="1.0667"/> + </g> + <g transform="matrix(.37187 0 0 .37187 38.802 63.239)"> + <path d="m0 0h51.2v51.2h-51.2z" fill="none" stroke-width="1.0667"/> + <g transform="matrix(2.6891 0 0 2.6891 -82.906 -48.45)"> + <path d="m0 0h51.2v51.2h-51.2z" fill="none" stroke-width="1.0667"/> + </g> + </g> + </g> + <path d="m4.1958 1096.8c-0.66332 0-1.1979 0.5346-1.1979 1.1979v0.3334c0-0.6634 0.53459-1.1979 1.1979-1.1979h20.354c0.66332 0 1.1979 0.5345 1.1979 1.1979v-0.3334c0-0.6633-0.5346-1.1979-1.1979-1.1979z" fill="#fff" opacity=".2"/> + <rect x="128" y="546.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="128" y="631.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="128" y="674.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="128" y="589.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="128" y="717.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="213.33" y="546.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="213.33" y="631.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="213.33" y="674.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="213.33" y="589.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="213.33" y="717.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="298.67" y="546.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="298.67" y="631.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="298.67" y="674.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="298.67" y="589.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="298.67" y="717.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="170.67" y="546.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="170.67" y="631.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="170.67" y="674.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="170.67" y="589.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="170.67" y="717.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="256" y="546.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="256" y="631.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="256" y="674.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="256" y="589.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="256" y="717.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="128" y="759.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="213.33" y="759.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="298.67" y="759.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="170.67" y="759.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="256" y="759.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="341.33" y="589.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="341.33" y="631.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="341.33" y="717.19" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="341.33" y="546.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="341.33" y="674.52" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="341.33" y="759.85" width="42.667" height="42.667" fill="none" stroke-width="1.0667"/> + <rect x="160" y="578.52" width="192" height="192" fill="none" stroke-width="1.0667"/> + <g transform="matrix(.37344 0 0 .37344 4.7333 1097.4)"> + <path d="m0 0h51.2v51.2h-51.2z" fill="none" stroke-width="1.0667"/> + </g> + <g transform="matrix(.36471 0 0 .36471 5.1356 1097.4)"> + <path d="m0 0h51.2v51.2h-51.2z" fill="none" stroke-width="1.0667"/> + </g> + <g transform="matrix(.41585 0 0 .41585 84.325 1055.9)"> + <g transform="matrix(.062269 0 0 .062269 -28.238 185.29)"> + <g transform="matrix(38.618 0 0 38.618 14724 -13542)"> + <g transform="matrix(.71436 0 0 .71436 -400.52 188.34)"> + <path d="m1293.2-120.67c-181.75 0.2763-511.18 0.13525-699.05 0.13998-2.3216 10.413-3.593 21.251-3.593 32.384v114c207.65 0.73695 494.72 0.38136 706.23 0.3733v-114.37c0-11.18-1.2522-22.07-3.593-32.523zm-458.69 295.56c-78.385-4e-3 -158.85 0.17892-243.95 0.55995v138.63c286.34-0.39317 421.73-0.13827 706.23-0.32664v-137.75c-163.2-0.53005-311.22-1.1113-462.28-1.1199z" opacity="0" stroke-width="1.4932"/> + </g> + </g> + </g> + </g> + <path d="m24.549 1119.5c0.66325 0 1.1979-0.5346 1.1979-1.1979v-0.3333c0 0.6632-0.53461 1.1978-1.1979 1.1978h-20.354c-0.66325 0-1.1979-0.5346-1.1979-1.1978v0.3333c0 0.6633 0.53461 1.1979 1.1979 1.1979z" fill="#3e2723" opacity=".2"/> + </g> + <path d="m20.55 16.968-1.6934-1.6934v-1.877l1.6578 0.66328 0.33894-0.84875-1.6769-0.66968a1.8181 1.8181 0 0 0-0.31974-3.4092v-1.8921h-8.6794v13.247h-2.284v0.91362h5.9385v-0.91362h-2.7408v-9.8607l2.4732-2.4732h4.379v0.97848a1.8181 1.8181 0 0 0-0.31975 3.4092l-1.6751 0.66968 0.33894 0.84875 1.6559-0.66328v1.877l-1.6934 1.6934 0.64593 0.64593 1.5043-1.5043 1.5043 1.5043zm-9.4591-7.6319v-1.1813h1.1813zm6.3953 1.5595a0.91362 0.91362 0 1 1 0.91361 0.91361 0.91362 0.91362 0 0 1-0.91361-0.91361z" fill="#fff" stroke="#fff" stroke-width=".1"/> +</svg> diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e96ef602b8d172f7cd28ba656aac097f741c736d --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,32 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000000000000000000000000000000000000..6b4c0f78a7850094f62713858e533a2fc8eda617 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>$(DEVELOPMENT_LANGUAGE)</string> + <key>CFBundleExecutable</key> + <string>App</string> + <key>CFBundleIdentifier</key> + <string>io.flutter.flutter.app</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>App</string> + <key>CFBundlePackageType</key> + <string>FMWK</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1.0</string> + <key>MinimumOSVersion</key> + <string>8.0</string> +</dict> +</plist> diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000000000000000000000000000000000000..592ceee85b89bd111b779db6116b130509ab6d4b --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000000000000000000000000000000000000..592ceee85b89bd111b779db6116b130509ab6d4b --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000000000000000000000000000000000000..c36c44f71e85c2c8cd7845e583fd59a6587ab029 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,496 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; + 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = "<group>"; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, + ); + sourceTree = "<group>"; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = "<group>"; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + ); + path = Runner; + sourceTree = "<group>"; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 97C146F21CF9000F007C117D /* main.m */, + ); + name = "Supporting Files"; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, + 97C146F31CF9000F007C117D /* main.m in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = "<group>"; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = "<group>"; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.benoitharrault.hangman; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.benoitharrault.hangman; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.benoitharrault.hangman; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000000000000000000000000000000000..1d526a16ed0f1cd0c2409d848bf489b93fefa3b2 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Workspace + version = "1.0"> + <FileRef + location = "group:Runner.xcodeproj"> + </FileRef> +</Workspace> diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000000000000000000000000000000000..18d981003d68d0546c4804ac2ff47dd97c6e7921 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDEDidComputeMac32BitWarning</key> + <true/> +</dict> +</plist> diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000000000000000000000000000000000..f9b0d7c5ea15f194be85eb6ee8e6721a87ff4644 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>PreviewsEnabled</key> + <false/> +</dict> +</plist> diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000000000000000000000000000000000000..a28140cfdb3ff9b7a11a9497b84546d615db2afa --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "1020" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "97C146ED1CF9000F007C117D" + BuildableName = "Runner.app" + BlueprintName = "Runner" + ReferencedContainer = "container:Runner.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES"> + <Testables> + </Testables> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "97C146ED1CF9000F007C117D" + BuildableName = "Runner.app" + BlueprintName = "Runner" + ReferencedContainer = "container:Runner.xcodeproj"> + </BuildableReference> + </MacroExpansion> + <AdditionalOptions> + </AdditionalOptions> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "97C146ED1CF9000F007C117D" + BuildableName = "Runner.app" + BlueprintName = "Runner" + ReferencedContainer = "container:Runner.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + buildConfiguration = "Profile" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "97C146ED1CF9000F007C117D" + BuildableName = "Runner.app" + BlueprintName = "Runner" + ReferencedContainer = "container:Runner.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000000000000000000000000000000000..1d526a16ed0f1cd0c2409d848bf489b93fefa3b2 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Workspace + version = "1.0"> + <FileRef + location = "group:Runner.xcodeproj"> + </FileRef> +</Workspace> diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000000000000000000000000000000000..18d981003d68d0546c4804ac2ff47dd97c6e7921 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDEDidComputeMac32BitWarning</key> + <true/> +</dict> +</plist> diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000000000000000000000000000000000..f9b0d7c5ea15f194be85eb6ee8e6721a87ff4644 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>PreviewsEnabled</key> + <false/> +</dict> +</plist> diff --git a/ios/Runner/AppDelegate.h b/ios/Runner/AppDelegate.h new file mode 100644 index 0000000000000000000000000000000000000000..36e21bbf9cf407bfa7968f28d35675da72c6c6c0 --- /dev/null +++ b/ios/Runner/AppDelegate.h @@ -0,0 +1,6 @@ +#import <Flutter/Flutter.h> +#import <UIKit/UIKit.h> + +@interface AppDelegate : FlutterAppDelegate + +@end diff --git a/ios/Runner/AppDelegate.m b/ios/Runner/AppDelegate.m new file mode 100644 index 0000000000000000000000000000000000000000..70e83933db1448dac8faf17d88fb0ab2e256bb35 --- /dev/null +++ b/ios/Runner/AppDelegate.m @@ -0,0 +1,13 @@ +#import "AppDelegate.h" +#import "GeneratedPluginRegistrant.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [GeneratedPluginRegistrant registerWithRegistry:self]; + // Override point for customization after application launch. + return [super application:application didFinishLaunchingWithOptions:launchOptions]; +} + +@end diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..d36b1fab2d9dea668a4f83df94d525897d9e68dd --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..dc9ada4725e9b0ddb1deab583e5b5102493aa332 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..28c6bf03016f6c994b70f38d1b7346e5831b531f Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2ccbfd967d9697cd4b83225558af2911e9571c9b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..f091b6b0bca859a3f474b03065bef75ba58a9e4c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..4cde12118dda48d71e01fcb589a74d069c5d7cb5 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..d0ef06e7edb86cdfe0d15b4b0d98334a86163658 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..dcdc2306c28505ebc0b6c3a359c4d252bf626b9f Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..2ccbfd967d9697cd4b83225558af2911e9571c9b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..c8f9ed8f5cee1c98386d13b17e89f719e83555b2 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..a6d6b8609df07bf62e5100a53a01510388bd2b22 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..a6d6b8609df07bf62e5100a53a01510388bd2b22 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..75b2d164a5a98e212cca15ea7bf2ab5de5108680 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..c4df70d39da7941ef3f6dcb7f06a192d8dcb308d Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..6a84f41e14e27f4b11f16f9ee39279ac98f8d5ac Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..d0e1f58536026aebc4f1f70e481f6993c9ff088d Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..0bedcf2fd46788ae3a01a423467513ff59b5c120 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000000000000000000000000000000000000..89c2725b70f1882be97f5214fafe22d27a0ec01e --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000000000000000000000000000000000000..f2e259c7c9390ff69a6bbe1e0907e6dc366848e7 --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/> + </dependencies> + <scenes> + <!--View Controller--> + <scene sceneID="EHf-IW-A2E"> + <objects> + <viewController id="01J-lp-oVM" sceneMemberID="viewController"> + <layoutGuides> + <viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/> + <viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/> + </layoutGuides> + <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"> + </imageView> + </subviews> + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <constraints> + <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/> + <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/> + </constraints> + </view> + </viewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="53" y="375"/> + </scene> + </scenes> + <resources> + <image name="LaunchImage" width="168" height="185"/> + </resources> +</document> diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000000000000000000000000000000000000..f3c28516fb38e64d88cfcf5fb1791175df078f2f --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> + </dependencies> + <scenes> + <!--Flutter View Controller--> + <scene sceneID="tne-QT-ifu"> + <objects> + <viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController"> + <layoutGuides> + <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> + <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> + </layoutGuides> + <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> + <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> + </view> + </viewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> + </objects> + </scene> + </scenes> +</document> diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000000000000000000000000000000000000..e1152e4100fe3e9887fd266cfa90e178bd5f59ca --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>$(DEVELOPMENT_LANGUAGE)</string> + <key>CFBundleExecutable</key> + <string>$(EXECUTABLE_NAME)</string> + <key>CFBundleIdentifier</key> + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>hangman</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>$(FLUTTER_BUILD_NAME)</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>$(FLUTTER_BUILD_NUMBER)</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>UILaunchStoryboardName</key> + <string>LaunchScreen</string> + <key>UIMainStoryboardFile</key> + <string>Main</string> + <key>UISupportedInterfaceOrientations</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> + </array> + <key>UISupportedInterfaceOrientations~ipad</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> + </array> + <key>UIViewControllerBasedStatusBarAppearance</key> + <false/> +</dict> +</plist> diff --git a/ios/Runner/main.m b/ios/Runner/main.m new file mode 100644 index 0000000000000000000000000000000000000000..dff6597e4513dcf90c13b17495c78dd1069cdb20 --- /dev/null +++ b/ios/Runner/main.m @@ -0,0 +1,9 @@ +#import <Flutter/Flutter.h> +#import <UIKit/UIKit.h> +#import "AppDelegate.h" + +int main(int argc, char* argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000000000000000000000000000000000000..73b4b1dfa1b364faf21b3cb3364ecee71af33d9d --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; +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'; +import './utils/constants.dart'; +import 'package:hangman/utils/constants.dart'; + +void main() => runApp(Hangman()); + +class Hangman extends StatelessWidget { + @override + Widget build(BuildContext context) { + return ChangeNotifierProvider( + create: (BuildContext context) => Data(), + child: Consumer<Data>(builder: (context, data, child) { + return MaterialApp( + debugShowCheckedModeBanner: false, + theme: ThemeData( + primaryColor: Color(darkGreen), + visualDensity: VisualDensity.adaptivePlatformDensity, + ), + home: Home(), + routes: { + Home.id: (context) => Home(), + Game.id: (context) => Game(), + Settings.id: (context) => Settings(), + Scores.id: (context) => Scores(), + Info.id: (context) => Info(), + }, + ); + }), + ); + } +} diff --git a/lib/provider/data.dart b/lib/provider/data.dart new file mode 100644 index 0000000000000000000000000000000000000000..ae86605450410692f83748e97cde4acad9d3034f --- /dev/null +++ b/lib/provider/data.dart @@ -0,0 +1,185 @@ +import 'package:flutter/foundation.dart'; +import '../utils/shared_prefs.dart'; +import '../utils/package_info.dart'; +import '../utils/constants.dart'; + +class Data extends ChangeNotifier { + // settings + final SharedPrefs _sharedPrefs = SharedPrefs(); + + // screen settings + bool _soundValue = true; + bool _gameModeValue = false; + String _levelValue = defaultLevel; + + // randomization + String _secretWord; + bool _searching = false; + String _clue = ''; + List<String> _hiddenWord = []; + List<String> _usedLetters = []; + + bool get searching => _searching; + + set searching(bool value) { + _searching = value; + notifyListeners(); + } + + // scores + int _errors = 0; + 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); + _levelValue = onlineGameMode[_gameModeValue].contains(_sharedPrefs.level) + ? _sharedPrefs.level + : onlineGameMode[_gameModeValue].first; + _victoryCount = _sharedPrefs.victoryCount ?? 0; + _defeatCount = _sharedPrefs.defeatCount ?? 0; + 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(); + } + + set setPrefLevel(String prefLevel) { + _sharedPrefs.level = prefLevel; + notifyListeners(); + } + + bool get soundValue => _soundValue; + + set updateSound(bool value) { + _soundValue = value; + notifyListeners(); + } + + bool get gameModeValue => _gameModeValue; + + set updateGameMode(bool value) { + _gameModeValue = value; + _levelValue = onlineGameMode[value].first; + notifyListeners(); + } + + String get levelValue => _levelValue; + + set updateLevel(String value) { + _levelValue = value; + notifyListeners(); + } + + String get secretWord => _secretWord; + + set updateSecretWord(String value) { + _secretWord = value; + _hiddenWord = List<String>.generate(value.length, (i) => '_'); + notifyListeners(); + } + + String get clue => _clue; + + set updateClue(String value) { + _clue = value; + notifyListeners(); + } + + String get hiddenWord => _hiddenWord.join(); + + void updateHiddenWord(int index, String letra) { + _hiddenWord[index] = letra; + notifyListeners(); + } + + List<String> get usedLetters => _usedLetters; + + void updateUsedLetters(String key) { + _usedLetters.add(key); + notifyListeners(); + } + + void resetUsedLetters() { + _usedLetters.clear(); + notifyListeners(); + } + + int get errors => _errors; + + void addError() { + _errors++; + notifyListeners(); + } + + void resetSuccessAndErrors() { + _errors = 0; + notifyListeners(); + } + + int get victoryCount => _victoryCount; + int get defeatCount => _defeatCount; + + void addVictory() { + _victoryCount++; + _sharedPrefs.victoryCount = _victoryCount; + notifyListeners(); + } + + void addDefeat() { + _defeatCount++; + _sharedPrefs.defeatCount = _defeatCount; + notifyListeners(); + } + + void resetScores() { + _victoryCount = 0; + _defeatCount = 0; + notifyListeners(); + } + + void resetGame() { + _errors = 0; + _secretWord = null; + _clue = ''; + _hiddenWord = []; + _usedLetters = []; + _usedLetters.clear(); + notifyListeners(); + } +} diff --git a/lib/screens/game.dart b/lib/screens/game.dart new file mode 100644 index 0000000000000000000000000000000000000000..417bde7f250f877681f3d5f7efbfc614dc0cb618 --- /dev/null +++ b/lib/screens/game.dart @@ -0,0 +1,147 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../provider/data.dart'; +import '../utils/constants.dart'; +import '../utils/random_pick.dart'; +import '../widgets/letters.dart'; + +class Game extends StatelessWidget { + static const String id = 'game'; + + Future<void> pickWord(BuildContext context, Data myProvider) async { + myProvider.searching = true; + RandomPick randompick; + int attempts = 0; + do { + randompick = RandomPick(myProvider.levelPref); + await randompick.init(); + if (randompick.word != null) { + myProvider.updateSecretWord = randompick.word; + myProvider.resetSuccessAndErrors(); + myProvider.resetUsedLetters(); + if (myProvider.levelPref == defaultLevel) { + myProvider.updateClue = randompick.clue; + } + myProvider.searching = false; + break; + } + attempts++; + } while (attempts < 3); + } + + @override + Widget build(BuildContext context) { + Orientation orientation = MediaQuery.of(context).orientation; + Data _myProvider = Provider.of<Data>(context); + + return Scaffold( + backgroundColor: Color(board), + floatingActionButton: _myProvider.levelPref == defaultLevel + ? FloatingActionButton( + foregroundColor: Colors.white, + backgroundColor: Colors.transparent, + elevation: 0.0, + onPressed: () { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text('Indice'), + content: Text(_myProvider.clue), + actions: <Widget>[ + FlatButton( + child: Text('Revenir au jeu'), + onPressed: () => Navigator.of(context).pop(), + ) + ], + ); + }, + ); + }, + child: Icon(Icons.help_outline), + ) + : null, + floatingActionButtonLocation: orientation == Orientation.portrait + ? FloatingActionButtonLocation.endTop + : FloatingActionButtonLocation.centerTop, + body: orientation == Orientation.portrait + ? Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + child: Padding( + padding: EdgeInsets.only(top: 60.0, left: 30.0, right: 30.0, bottom: 10.0), + child: const ImgGallow(), + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 30.0), + child: const HiddenWord(), + ), + const LetterButtons(), + ], + ) + : Row( + children: [ + Expanded( + flex: 2, + child: Column( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.only(top: 40.0), + child: ImgGallow(), + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 20.0), + child: const HiddenWord(), + ), + ], + ), + ), + Expanded(child: LetterButtons()), + ], + ), + ); + } +} + +class ImgGallow extends StatelessWidget { + const ImgGallow({Key key}) : super(key: key); + @override + Widget build(BuildContext context) { + Data _myProvider = Provider.of<Data>(context); + return Stack( + children: [ + for (int error = 0; error < 7; error++) + AnimatedOpacity( + opacity: _myProvider.errors >= error ? 1.0 : 0.0, + duration: Duration(milliseconds: _myProvider.errors >= error ? 800 : 0), + child: Image.asset('assets/images/img${error + 1}.png'), + ) + ], + ); + } +} + +class HiddenWord extends StatelessWidget { + const HiddenWord({Key key}) : super(key: key); + @override + Widget build(BuildContext context) { + Data _myProvider = Provider.of<Data>(context); + return FittedBox( + child: Text( + (_myProvider.hiddenWord.isEmpty || _myProvider.hiddenWord == null) + ? 'UNEXPECTED ERROR' + : _myProvider.hiddenWord, + style: TextStyle( + fontFamily: 'Tiza', + color: Colors.white, + fontSize: 34.0, + letterSpacing: 10.0, + ), + ), + ); + } +} diff --git a/lib/screens/home.dart b/lib/screens/home.dart new file mode 100644 index 0000000000000000000000000000000000000000..b908bdb9ad2428367cea8b78d00e4487cadad875 --- /dev/null +++ b/lib/screens/home.dart @@ -0,0 +1,174 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../provider/data.dart'; +import 'game.dart'; +import '../widgets/my_app_bar.dart'; +import '../widgets/dialog_fetch_error.dart'; +import '../utils/constants.dart'; + +class Home extends StatelessWidget { + static const String id = 'home'; + + @override + Widget build(BuildContext context) { + 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, + builder: (_) => AlertDialog( + title: Text('Erreur inattendue'), + content: Text('Erreur inattendue à la récupération d\'un mot aléatoire.\n' + 'Installer une nouvelle version de l\'application pourrait corriger cette anomalie.'), + actions: <Widget>[ + FlatButton( + child: Text('Fermer'), + onPressed: () => Navigator.of(context).pop(), + ) + ], + ), + ); + } + + return Scaffold( + appBar: MyAppBar(appBar: AppBar()), + body: Builder( + builder: (context) => Center( + child: _myProvider.searching == true + ? WillPopScope( + onWillPop: () async => false, + child: Center( + child: CircularProgressIndicator(), + /*child: Text( + 'Generando una palabra,\nespera un momento por favor...', + textAlign: TextAlign.center, + ),*/ + ), + ) + : Container( + child: SingleChildScrollView( + child: SizedBox( + height: MediaQuery.of(context).size.height / 1.25, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: FittedBox( + fit: BoxFit.fitWidth, + child: Text( + 'LE PENDU', + style: TextStyle( + fontFamily: 'Tiza', + fontSize: 28.0, + color: Colors.grey[700], + ), + ), + ), + ), + 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))), + color: Color(board), + textColor: Colors.white, + padding: EdgeInsets.all(10.0), + onPressed: () async { + Scaffold.of(context).removeCurrentSnackBar(); + _myProvider.resetGame(); + _myProvider.searching = true; + bool control = true; + await Game().pickWord(context, _myProvider); + if (_myProvider.secretWord == null || + _myProvider.secretWord == '' || + _myProvider.hiddenWord == null || + (_myProvider.hiddenWord?.isEmpty ?? true)) { + control = false; + var response = await Navigator.push( + context, + MaterialPageRoute(builder: (context) => DialogFetchError()), + ); + if (response == false) { + _myProvider.searching = false; + _myProvider.resetGame(); + } else { + _myProvider.setPrefGameMode = false; + _myProvider.setPrefLevel = defaultLevel; + await Game().pickWord(context, _myProvider); + control = true; + } + } + + if (_myProvider.secretWord == 'UNEXPECTED ERROR') { + control = false; + _myProvider.resetGame(); + _errorWord(context); + } + + if (control) { + Navigator.pushNamed(context, Game.id) + .then((value) => _myProvider.searching = false); + } + }, + icon: Icon( + Icons.check_box, + color: Colors.white, + size: 60.0, + ), + label: Column( + children: [ + Text( + 'JOUER', + style: TextStyle( + fontSize: 22.0, + letterSpacing: 2.0, + ), + ), + Text( + 'Mode de jeu: ${_myProvider.levelPref}', + style: TextStyle( + fontSize: 10.0, + fontWeight: FontWeight.w300, + ), + ), + ], + ), + ), + ], + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/info.dart b/lib/screens/info.dart new file mode 100644 index 0000000000000000000000000000000000000000..d31812904fc0e91555d791265a8ff1b3c98fde93 --- /dev/null +++ b/lib/screens/info.dart @@ -0,0 +1,75 @@ +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 +'''; diff --git a/lib/screens/scores.dart b/lib/screens/scores.dart new file mode 100644 index 0000000000000000000000000000000000000000..9f77ae552f07d43863c7dde7bc42673e303dfb80 --- /dev/null +++ b/lib/screens/scores.dart @@ -0,0 +1,120 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../provider/data.dart'; +import '../utils/constants.dart'; + +class Scores extends StatelessWidget { + static const String id = 'scores'; + + @override + Widget build(BuildContext context) { + Data _myProvider = Provider.of<Data>(context); + return Scaffold( + backgroundColor: Color(board), + appBar: AppBar( + title: Text('Scores'), + actions: [ + IconButton( + icon: Icon(Icons.delete_forever), + onPressed: () => _myProvider.resetScores(), + ), + ], + ), + body: SafeArea( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Flexible( + child: FractionallySizedBox(heightFactor: 0.6), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.0), + child: FittedBox( + fit: BoxFit.fitWidth, + child: Text( + 'SCORES', + style: TextStyle( + fontFamily: 'Tiza', + fontSize: 28.0, + color: Colors.grey[300], + ), + ), + ), + ), + Flexible(child: FractionallySizedBox(heightFactor: 0.2)), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CardBox( + Icon( + Icons.emoji_events, + color: Colors.grey[200], + size: 60.0, + ), + '${_myProvider.victoryCount}', + ), + CardBox( + ImageIcon( + AssetImage('assets/images/gameover.png'), + color: Colors.grey[200], + size: 60.0, + ), + '${_myProvider.defeatCount}', + ), + ], + ), + ], + ), + ), + ); + } +} + +class CardBox extends StatelessWidget { + final Widget imagen; + final String text; + + CardBox(this.imagen, this.text); + + @override + Widget build(BuildContext context) { + return Flexible( + child: Card( + elevation: 10.0, + margin: EdgeInsets.symmetric(horizontal: 10.0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + color: Color(darkGreen), + child: Column( + children: [ + Container( + padding: EdgeInsets.all(10.0), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 0.5, + ), + ), + ), + child: Padding( + padding: const EdgeInsets.all(10.0), + child: imagen, + ), + ), + Container( + padding: EdgeInsets.all(20.0), + child: Text( + text, + style: TextStyle( + fontFamily: 'Tiza', + fontSize: 20.0, + color: Colors.grey[300], + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart new file mode 100644 index 0000000000000000000000000000000000000000..5b7d8101b8e190d03520f4630a978d06a360a72f --- /dev/null +++ b/lib/screens/settings.dart @@ -0,0 +1,91 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../provider/data.dart'; +import '../utils/constants.dart'; + +class Settings extends StatelessWidget { + static const String id = 'settings'; + + @override + Widget build(BuildContext context) { + Data _myProvider = Provider.of<Data>(context); + return Scaffold( + appBar: AppBar(title: Text('Réglages')), + body: SingleChildScrollView( + child: Padding( + 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: [ + Text('Mode en ligne'), + Switch( + value: _myProvider.gameModeValue, + onChanged: (bool value) => _myProvider.updateGameMode = value, + activeTrackColor: Color(board), + activeColor: Colors.greenAccent[400], + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Niveau'), + DropdownButton<String>( + value: _myProvider.levelValue ?? onlineGameMode[_myProvider.gameModeValue].first, + items: onlineGameMode[_myProvider.gameModeValue] + .map<DropdownMenuItem<String>>((String value) { + return DropdownMenuItem<String>( + value: value, + child: Text(value), + ); + }).toList(), + onChanged: (String value) => _myProvider.updateLevel = value, + ), + ], + ), + Divider(color: Colors.grey), + Padding( + padding: const EdgeInsets.only(top: 20.0), + child: RaisedButton.icon( + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))), + 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); + }, + icon: Icon(Icons.save, color: Colors.white), + label: Text( + 'Enregistrer', + style: TextStyle( + color: Colors.white, + fontSize: 18.0, + ), + ), + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart new file mode 100644 index 0000000000000000000000000000000000000000..7b9aa37d491974c46cd3917a7cf1449a96aeb3f5 --- /dev/null +++ b/lib/utils/constants.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; + +const String letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + +const Map<bool, List<String>> onlineGameMode = { + false: ['Thèmes', 'Expert'], + true: ['Junior', 'Avancé'], +}; + +const String defaultLevel = 'Thèmes'; + +//colores +const int darkGreen = 0xff013220; +const int board = 0xff004D00; +const int accent = 0xffD81B60; +/* +<color name="colorPrimary">#008577</color> +<color name="colorPrimaryDark">#00574B</color> +<color name="colorAccent">#D81B60</color> +<color name="pizarra">#004D00</color> +*/ + +// GameOver +enum GameOver { VICTORY, DEFEAT } + +extension GameOverExtension on GameOver { + static const titles = { + GameOver.VICTORY: 'Victoire !', + GameOver.DEFEAT: 'Pendu !', + }; + + String get title => titles[this]; + + static const icons = { + GameOver.VICTORY: Icons.military_tech, + GameOver.DEFEAT: Icons.gavel, + }; + + IconData get icon => icons[this]; +} + +const victory = GameOver.VICTORY; +const defeat = GameOver.DEFEAT; diff --git a/lib/utils/package_info.dart b/lib/utils/package_info.dart new file mode 100644 index 0000000000000000000000000000000000000000..5f7da5a50161d5a0856823284d59ba054071a69e --- /dev/null +++ b/lib/utils/package_info.dart @@ -0,0 +1,16 @@ +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; +} diff --git a/lib/utils/random_pick.dart b/lib/utils/random_pick.dart new file mode 100644 index 0000000000000000000000000000000000000000..754ec3899d14f6ac17a776a531696502d45a99ad --- /dev/null +++ b/lib/utils/random_pick.dart @@ -0,0 +1,110 @@ +import 'dart:async'; +import 'package:html/parser.dart'; +import 'package:html/dom.dart'; +import 'package:http/http.dart' as http; +import 'dart:convert'; +import 'package:flutter/services.dart'; +import 'dart:math' show Random; +import 'package:diacritic/diacritic.dart'; +import 'package:list_french_words/list_french_words.dart'; + +class RandomPick { + final String level; + RandomPick(this.level); + + String _url; + String _word; + String _clue; + final random = Random(); + + init() async { + switch (level) { + case 'Thèmes': + await wordFromLocal(); + break; + case 'Avancé': + _url = 'https://www.palabrasaleatorias.com/mots-aleatoires.php?fs=1&fs2=0&Submit=Nouveau+mot'; + await wordFromWeb(_url); + break; + case 'Junior': + _url = 'https://www.palabrasaleatorias.com/mots-aleatoires.php?fs=1&fs2=1&Submit=Nouveau+mot'; + await wordFromWeb(_url); + break; + case 'Expert': + await wordFromPackage(); + break; + default: + await wordFromLocal(); + } + } + + Future<void> wordFromWeb(String url) async { + try { + var response = await http.Client().get(Uri.parse(url)); + if (response.statusCode == 200) { + var html = parse(utf8.decode(response.bodyBytes)); + Element element = html.getElementsByTagName('div').last; + String word = _validate(element.text); + if (word == null) { + throw Exception(); + } + _word = word; + } else { + throw Exception(); + } + } catch (e) { + _word = null; + } + } + + String _validate(String word) { + String wordToValidate = word.trim(); + if (wordToValidate.contains(' ')) { + return null; + } + wordToValidate = removeDiacritics(wordToValidate); + wordToValidate = wordToValidate.toUpperCase(); + wordToValidate = wordToValidate.replaceAll(RegExp('[0-9]'), ''); + wordToValidate = wordToValidate.replaceAll(RegExp('[^A-Z]'), ''); + if (wordToValidate.length < 3 || wordToValidate.length > 12) { + return null; + } + return wordToValidate; + } + + Future _waitList() => Future(() { + final completer = Completer(); + int indexRandom = random.nextInt(630000); + completer.complete(list_french_words.sublist(indexRandom, indexRandom + 1).join('\n')); + return completer.future; + }); + + wordFromPackage() async { + var wordList = await _waitList(); + var word = _validate(wordList); + _word = word; + } + + Future<void> wordFromLocal() async { + String jsonString; + try { + jsonString = await rootBundle.loadString('assets/files/word-list-fr.json'); + final jsonResponse = await json.decode(jsonString); + var wordList = jsonResponse[jsonResponse.keys.toList().join()]; + int randomCategoryIndex = random.nextInt(wordList.length); + _clue = wordList[randomCategoryIndex]['clue']; + List<String> words = []; + for (var word in wordList[randomCategoryIndex]['words']) { + words.add(word); + } + String word = words[random.nextInt(words.length)]; + _word = word ?? 'UNEXPECTED ERROR'; + } catch (e) { + _word = 'UNEXPECTED ERROR'; + } + } + + String get word => _word; + + String get clue => _clue; +} diff --git a/lib/utils/shared_prefs.dart b/lib/utils/shared_prefs.dart new file mode 100644 index 0000000000000000000000000000000000000000..9291b99dcf3db0c4f10382ac42e570160ef89530 --- /dev/null +++ b/lib/utils/shared_prefs.dart @@ -0,0 +1,36 @@ +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'; + static const String _prefsDefeatCount = 'defeatCount'; + + init() async { + if (_sharedPrefs == null) { + _sharedPrefs = await SharedPreferences.getInstance(); + } + } + + 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); + + String get level => _sharedPrefs?.getString(_prefsLevel); + + set level(String value) => _sharedPrefs.setString(_prefsLevel, value); + + int get victoryCount => _sharedPrefs?.getInt(_prefsVictoryCount); + + set victoryCount(int value) => _sharedPrefs?.setInt(_prefsVictoryCount, value); + + int get defeatCount => _sharedPrefs?.getInt(_prefsDefeatCount); + + set defeatCount(int value) => _sharedPrefs?.setInt(_prefsDefeatCount, value); +} diff --git a/lib/utils/sound.dart b/lib/utils/sound.dart new file mode 100644 index 0000000000000000000000000000000000000000..75f98581370e4f8b82fdd55b53f172bc827fc3e3 --- /dev/null +++ b/lib/utils/sound.dart @@ -0,0 +1,26 @@ +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(); +} diff --git a/lib/widgets/dialog_fetch_error.dart b/lib/widgets/dialog_fetch_error.dart new file mode 100644 index 0000000000000000000000000000000000000000..fad566546938220cacae00ee385a2b56000809cb --- /dev/null +++ b/lib/widgets/dialog_fetch_error.dart @@ -0,0 +1,32 @@ +import 'package:hangman/utils/constants.dart'; +import 'package:flutter/material.dart'; + +class DialogFetchError extends StatelessWidget { + const DialogFetchError({Key key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Color(board), + body: WillPopScope( + onWillPop: () async => false, + child: AlertDialog( + title: Text('Connexion impossible'), + content: Text('Impossible de récupérer un mot aléatoire. ' + 'La connexion internet est peut-être inaccessible.\n' + 'Changer vers un mode de jeu hors-ligne ?'), + actions: [ + FlatButton( + child: const Text('REVENIR'), + onPressed: () => Navigator.pop(context, false), + ), + FlatButton( + child: const Text('ACCEPTER'), + onPressed: () => Navigator.pop(context, true), + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/dialog_gameover.dart b/lib/widgets/dialog_gameover.dart new file mode 100644 index 0000000000000000000000000000000000000000..05f1bf97dd33cfd72205cd51332473079f306d36 --- /dev/null +++ b/lib/widgets/dialog_gameover.dart @@ -0,0 +1,65 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +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); + + @override + Widget build(BuildContext context) { + Data _myProvider = Provider.of<Data>(context); + return Scaffold( + backgroundColor: Colors.transparent, + body: _myProvider.searching == true + ? Center(child: CircularProgressIndicator()) + : WillPopScope( + onWillPop: () async => false, + child: AlertDialog( + title: Row( + children: [ + Icon(gameOver.icon), + SizedBox(width: 10.0), + Text(gameOver.title), + ], + ), + content: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (gameOver == GameOver.DEFEAT) + Text('Le mot secret était ${_myProvider.secretWord}'), + Text('Rejouer ?'), + ], + ), + ), + actions: [ + FlatButton( + child: const Text('QUITTER'), + onPressed: () { + if (_myProvider.soundValue == true) { + sound.stop(); + } + Navigator.pushNamed(context, Home.id); + }, + ), + FlatButton( + child: const Text('REJOUER'), + onPressed: () async { + _myProvider.resetSuccessAndErrors(); + await Game().pickWord(context, _myProvider); + Navigator.of(context).pop(); + }, + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/letters.dart b/lib/widgets/letters.dart new file mode 100644 index 0000000000000000000000000000000000000000..7b4bf276e837822f1a2d048da9ce227e6f2a2dd1 --- /dev/null +++ b/lib/widgets/letters.dart @@ -0,0 +1,104 @@ +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 { + const LetterButtons({Key key}) : super(key: key); + + @override + 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 = []; + lettersList.forEach((key) { + keys.add( + Padding( + padding: const EdgeInsets.all(2.0), + child: RaisedButton( + disabledColor: Colors.grey, + disabledTextColor: Colors.white, + splashColor: Color(accent), + onPressed: _myProvider.usedLetters.contains(key) + ? null + : () async { + _myProvider.updateUsedLetters(key); + if (_myProvider.secretWord.contains(key)) { + for (int index = 0; index < _myProvider.secretWord.length; index++) { + if (key == _myProvider.secretWord[index]) { + _myProvider.updateHiddenWord(index, key); + } + } + + if (_myProvider.hiddenWord == _myProvider.secretWord) { + _myProvider.addVictory(); + if (_myProvider.soundValue == true) { + sound.play(Archive.victory.file); + } + showDialog( + context: context, + builder: (context) => DialogGameOver(victory, sound), + ); + } else { + if (_myProvider.soundValue == true) { + sound.play(Archive.success.file); + } + } + } else { + _myProvider.addError(); + if (_myProvider.errors == 6) { + 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), + ); + } else { + if (_myProvider.soundValue == true) { + sound.play(Archive.error.file); + } + } + } + }, + child: Text( + key, + textAlign: TextAlign.center, + ), + color: Colors.grey[200], + ), + ), + ); + }); + return Container( + alignment: orientation == Orientation.portrait ? Alignment.bottomCenter : Alignment.center, + color: Color(darkGreen), + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(top: orientation == Orientation.portrait ? 0.0 : paddingTop), + child: GridView.count( + padding: EdgeInsets.zero, + shrinkWrap: true, + crossAxisCount: orientation == Orientation.portrait ? 9 : 3, + childAspectRatio: orientation == Orientation.portrait ? 1 / 1 : (itemWidth / itemHeight), + children: keys, + ), + ); + } +} diff --git a/lib/widgets/my_app_bar.dart b/lib/widgets/my_app_bar.dart new file mode 100644 index 0000000000000000000000000000000000000000..e7160c25b614286d75799367b55ca28e04ba0289 --- /dev/null +++ b/lib/widgets/my_app_bar.dart @@ -0,0 +1,61 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show SystemNavigator; +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; + const MyAppBar({Key key, this.appBar}) : super(key: key); + + @override + Size get preferredSize => Size.fromHeight(appBar.preferredSize.height); + + @override + Widget build(BuildContext context) { + Data _myProvider = Provider.of<Data>(context); + + return AppBar( + title: Text('Hangman'), + automaticallyImplyLeading: false, + actions: [ + IconButton( + icon: Icon(Icons.settings), + onPressed: () { + _myProvider.resetValues(); + Scaffold.of(context).removeCurrentSnackBar(); + Navigator.pushNamed(context, Settings.id); + }, + ), + PopupMenuButton<String>( + onSelected: (String value) { + switch (value) { + case 'Quitter': + SystemNavigator.pop(); + break; + case 'Scores': + 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 PopupMenuItem<String>( + value: choice, + child: Text(choice), + ); + }).toList(); + }, + ), + ], + ); + } +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000000000000000000000000000000000000..cc0ded11ae7ec9168c72ad96d343d6f5bb40b96b --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,404 @@ +# 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.14" + assets_audio_player_web: + dependency: transitive + description: + name: assets_audio_player_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.14" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + 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: + name: csslib + 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.2" + diacritic: + dependency: "direct main" + description: + name: diacritic + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + html: + dependency: "direct main" + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+4" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + list_french_words: + dependency: "direct main" + description: + name: list_french_words + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0+1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + nested: + dependency: transitive + description: + name: nested + 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: + name: path + 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.27" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + 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: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.5" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" + provider: + dependency: "direct main" + description: + name: provider + 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: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.12+4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2+4" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+11" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2+7" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2+3" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19" + typed_data: + dependency: transitive + description: + name: typed_data + 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: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.20.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4320af8c1f5b57266187a95aecf045bfbea1b31c --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,41 @@ +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.0.0 + +environment: + sdk: ">=2.7.0 <3.0.0" + +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: + - asset: assets/fonts/tiza.ttf diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000000000000000000000000000000000000..6dc53c329f67440536cb8b3bc85c5cfb0e014c12 --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:hangman/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + await tester.pumpWidget(Hangman()); + }); +}