diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e6365a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,63 @@ +# 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 + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + +# Android API keys go here +/android/app/src/main/res/values/secrets.xml + +# Personal development screenshots go here +/screenshots + +# iOS API Keys go here +/ios/Flutter/Secrets.xcconfig + +# Ignore the Firebase files +/android/app/google-services.json +/ios/Runner/GoogleService-Info.plist + +# Ignore images related to release +/assets/Release/* +/web/icons/ diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..c1ee81b --- /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: 1d9032c7e1d867f071f2277eb1673e8f9b0274e3 + channel: stable + +project_type: app diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..398da61 --- /dev/null +++ b/COPYING @@ -0,0 +1,681 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. + + +As additional permission under section 7, you are allowed to distribute the +software through an app store, even if that store has restrictive terms and +conditions that are incompatible with the GPL, provided that the source is +also available under the GPL with or without this permission through a +channel without those restrictive terms and conditions. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4566412 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# AntNupTracker + +![AntNupTracker basic features](assets/feature_graphic/feature_graphic.png) + +Client app for AntNupTracker for iOS and Android™, developed using the Flutter™ framework in Dart™. + +Copyright (C) 2020-2022 Abouheif Lab + +Welcome to the repository for the `AntNupTracker` app. A contribution guide is coming shortly. The code is designed to try to follow Dart and Flutter style. + +This app is a tool for browsing records of [ant nuptial flights](https://www.antnuptialflights.com/about/) and reporting new flights from the field. Visit our website at https://www.antnuptialflights.com for more details. For the server-side application that manages the database of ant nuptial flights, please go to [this repository](https://github.com/bzrudski/antnuptracker-server/). + +Our app is licensed under the GNU GPLv3 with App Store Exception (see `COPYING`). Therefore, the app is open source, but the binary can still be distributed through Apple's App Store and Google Play without violating their terms. (All source files say GPL, but the App Store Exception is applied to all files in this project in order to not defeat the purpose of this project.) + +In order to build, clone this repository and open it in an IDE. You may need to tweak a few settings. If you would like to test your modifications against a custom version of the backend, make sure that you change the `base` argument value in `url_manager.dart`. + +IOS is a trademark or registered trademark of Cisco in the U.S. and other countries. + +App Store and Xcode are trademarks of Apple Inc., registered in the U.S. and other countries. + +Android™ and Google Play are registered trademarks of Google LLC. + +Dart and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC. + +Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC. \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..b12d74b --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,2 @@ +#include: package:lints/recommended.yaml +include: package:flutter_lints/flutter.yaml \ No newline at end of file diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..0a741cb --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,11 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/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 0000000..e8dfa93 --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,77 @@ +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 GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply plugin: 'com.google.gms.google-services' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file("key.properties") +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + +android { + compileSdkVersion 31 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.bzrudski.ant_nup_tracker" + minSdkVersion 21 + targetSdkVersion 31 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] + } + } + + buildTypes { + release { + // Signing with the debug keys for now, so `flutter run --release` works. +// signingConfig signingConfigs.debug + signingConfig signingConfigs.release + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation platform('com.google.firebase:firebase-bom:28.3.1') + implementation 'androidx.core:core-splashscreen:1.0.0-alpha02' +} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..36879fa --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/android/app/src/debug/ic_launcher_dev-playstore.png b/android/app/src/debug/ic_launcher_dev-playstore.png new file mode 100644 index 0000000..be29506 Binary files /dev/null and b/android/app/src/debug/ic_launcher_dev-playstore.png differ diff --git a/android/app/src/debug/res/drawable-v24/ic_launcher_dev_background.xml b/android/app/src/debug/res/drawable-v24/ic_launcher_dev_background.xml new file mode 100644 index 0000000..6550213 --- /dev/null +++ b/android/app/src/debug/res/drawable-v24/ic_launcher_dev_background.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/debug/res/drawable-v24/ic_launcher_dev_foreground.xml b/android/app/src/debug/res/drawable-v24/ic_launcher_dev_foreground.xml new file mode 100644 index 0000000..1b912ce --- /dev/null +++ b/android/app/src/debug/res/drawable-v24/ic_launcher_dev_foreground.xml @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..327748d --- /dev/null +++ b/android/app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..327748d --- /dev/null +++ b/android/app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/debug/res/mipmap-hdpi/ic_launcher.png b/android/app/src/debug/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..4b31015 Binary files /dev/null and b/android/app/src/debug/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..5b7c692 Binary files /dev/null and b/android/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/debug/res/mipmap-mdpi/ic_launcher.png b/android/app/src/debug/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..0cca726 Binary files /dev/null and b/android/app/src/debug/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..219efef Binary files /dev/null and b/android/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..313c768 Binary files /dev/null and b/android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..2bb1b09 Binary files /dev/null and b/android/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..15f497e Binary files /dev/null and b/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..e8fd718 Binary files /dev/null and b/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..03a7c51 Binary files /dev/null and b/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..21d35cb Binary files /dev/null and b/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/debug/res/values/strings.xml b/android/app/src/debug/res/values/strings.xml new file mode 100644 index 0000000..5dcc3b1 --- /dev/null +++ b/android/app/src/debug/res/values/strings.xml @@ -0,0 +1,4 @@ + + + AntNupDev + \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..73666ac --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/ic_launcher_dev-playstore.png b/android/app/src/main/ic_launcher_dev-playstore.png new file mode 100644 index 0000000..3aa17f8 Binary files /dev/null and b/android/app/src/main/ic_launcher_dev-playstore.png differ diff --git a/android/app/src/main/ic_launcher_release-playstore.png b/android/app/src/main/ic_launcher_release-playstore.png new file mode 100644 index 0000000..f4f34bc Binary files /dev/null and b/android/app/src/main/ic_launcher_release-playstore.png differ diff --git a/android/app/src/main/kotlin/com/bzrudski/ant_nup_tracker/MainActivity.kt b/android/app/src/main/kotlin/com/bzrudski/ant_nup_tracker/MainActivity.kt new file mode 100644 index 0000000..e670ce1 --- /dev/null +++ b/android/app/src/main/kotlin/com/bzrudski/ant_nup_tracker/MainActivity.kt @@ -0,0 +1,6 @@ +package com.bzrudski.ant_nup_tracker + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/android/app/src/main/res/drawable-anydpi-v24/ic_notification_icon.xml b/android/app/src/main/res/drawable-anydpi-v24/ic_notification_icon.xml new file mode 100644 index 0000000..eae7d8a --- /dev/null +++ b/android/app/src/main/res/drawable-anydpi-v24/ic_notification_icon.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable-hdpi/ic_notification_icon.png b/android/app/src/main/res/drawable-hdpi/ic_notification_icon.png new file mode 100644 index 0000000..78c5a45 Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/ic_notification_icon.png differ diff --git a/android/app/src/main/res/drawable-mdpi/ic_notification_icon.png b/android/app/src/main/res/drawable-mdpi/ic_notification_icon.png new file mode 100644 index 0000000..3145ec2 Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/ic_notification_icon.png differ diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable-v24/ic_launcher_release_background.xml b/android/app/src/main/res/drawable-v24/ic_launcher_release_background.xml new file mode 100644 index 0000000..6d61bc8 --- /dev/null +++ b/android/app/src/main/res/drawable-v24/ic_launcher_release_background.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable-v24/ic_launcher_release_foreground.xml b/android/app/src/main/res/drawable-v24/ic_launcher_release_foreground.xml new file mode 100644 index 0000000..1b912ce --- /dev/null +++ b/android/app/src/main/res/drawable-v24/ic_launcher_release_foreground.xml @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable-xhdpi/ic_notification_icon.png b/android/app/src/main/res/drawable-xhdpi/ic_notification_icon.png new file mode 100644 index 0000000..764058e Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/ic_notification_icon.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_notification_icon.png b/android/app/src/main/res/drawable-xxhdpi/ic_notification_icon.png new file mode 100644 index 0000000..bb52abd Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/ic_notification_icon.png differ diff --git a/android/app/src/main/res/drawable/ic_ant_gradient.xml b/android/app/src/main/res/drawable/ic_ant_gradient.xml new file mode 100644 index 0000000..b245035 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_ant_gradient.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/ic_cartoon_ant.xml b/android/app/src/main/res/drawable/ic_cartoon_ant.xml new file mode 100644 index 0000000..e8bf37f --- /dev/null +++ b/android/app/src/main/res/drawable/ic_cartoon_ant.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/ic_cartoon_ant2.xml b/android/app/src/main/res/drawable/ic_cartoon_ant2.xml new file mode 100644 index 0000000..9e8b9a5 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_cartoon_ant2.xml @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/ic_splash_bg.xml b/android/app/src/main/res/drawable/ic_splash_bg.xml new file mode 100644 index 0000000..f8e84c4 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_splash_bg.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file 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 0000000..8cdf281 --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..ff8d7ca --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..ff8d7ca --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..84de40f Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..5cc6f2a Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..133778a Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..4d94e46 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..b4f947c Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..1a9e9e2 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..1f235ab Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..f52ed51 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..00ce2f0 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..ed83993 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..449a9f9 --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..d704408 --- /dev/null +++ b/android/app/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..60a4201 --- /dev/null +++ b/android/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + AntNupTracker + \ No newline at end of file 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 0000000..2089c28 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..e445b44 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..34c818f --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,32 @@ +buildscript { + ext.kotlin_version = '1.6.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.1.3' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.google.gms:google-services:4.3.10' + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +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 0000000..94adc3a --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..595fb86 --- /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-7.2-all.zip diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..44e62bc --- /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/android/settings_aar.gradle b/android/settings_aar.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/android/settings_aar.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/assets/android_icon/background_dev.svg b/assets/android_icon/background_dev.svg new file mode 100644 index 0000000..efb8b6a --- /dev/null +++ b/assets/android_icon/background_dev.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/assets/android_icon/background_release.svg b/assets/android_icon/background_release.svg new file mode 100644 index 0000000..6be1474 --- /dev/null +++ b/assets/android_icon/background_release.svg @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/assets/android_icon/full_ant.svg b/assets/android_icon/full_ant.svg new file mode 100644 index 0000000..5313e96 --- /dev/null +++ b/assets/android_icon/full_ant.svg @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/android_icon/full_ant_small.svg b/assets/android_icon/full_ant_small.svg new file mode 100644 index 0000000..2bbcfaa --- /dev/null +++ b/assets/android_icon/full_ant_small.svg @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/ant_circles/2x/green_ant.png b/assets/ant_circles/2x/green_ant.png new file mode 100644 index 0000000..c316c0e Binary files /dev/null and b/assets/ant_circles/2x/green_ant.png differ diff --git a/assets/ant_circles/2x/red_ant.png b/assets/ant_circles/2x/red_ant.png new file mode 100644 index 0000000..491391e Binary files /dev/null and b/assets/ant_circles/2x/red_ant.png differ diff --git a/assets/ant_circles/2x/white_ant.png b/assets/ant_circles/2x/white_ant.png new file mode 100644 index 0000000..fef5b57 Binary files /dev/null and b/assets/ant_circles/2x/white_ant.png differ diff --git a/assets/ant_circles/3x/green_ant.png b/assets/ant_circles/3x/green_ant.png new file mode 100644 index 0000000..4ab20bd Binary files /dev/null and b/assets/ant_circles/3x/green_ant.png differ diff --git a/assets/ant_circles/3x/red_ant.png b/assets/ant_circles/3x/red_ant.png new file mode 100644 index 0000000..fb8247d Binary files /dev/null and b/assets/ant_circles/3x/red_ant.png differ diff --git a/assets/ant_circles/3x/white_ant.png b/assets/ant_circles/3x/white_ant.png new file mode 100644 index 0000000..7679ebb Binary files /dev/null and b/assets/ant_circles/3x/white_ant.png differ diff --git a/assets/ant_circles/green_ant.png b/assets/ant_circles/green_ant.png new file mode 100644 index 0000000..f588d0b Binary files /dev/null and b/assets/ant_circles/green_ant.png differ diff --git a/assets/ant_circles/green_ant.svg b/assets/ant_circles/green_ant.svg new file mode 100644 index 0000000..a5f67f5 --- /dev/null +++ b/assets/ant_circles/green_ant.svg @@ -0,0 +1,137 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/ant_circles/red_ant.png b/assets/ant_circles/red_ant.png new file mode 100644 index 0000000..1418b7c Binary files /dev/null and b/assets/ant_circles/red_ant.png differ diff --git a/assets/ant_circles/red_ant.svg b/assets/ant_circles/red_ant.svg new file mode 100644 index 0000000..b1f40ef --- /dev/null +++ b/assets/ant_circles/red_ant.svg @@ -0,0 +1,142 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/ant_circles/white_ant.png b/assets/ant_circles/white_ant.png new file mode 100644 index 0000000..08eb720 Binary files /dev/null and b/assets/ant_circles/white_ant.png differ diff --git a/assets/ant_circles/white_ant.svg b/assets/ant_circles/white_ant.svg new file mode 100644 index 0000000..4840d06 --- /dev/null +++ b/assets/ant_circles/white_ant.svg @@ -0,0 +1,96 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/app_icon/Alternatives/icon3.png b/assets/app_icon/Alternatives/icon3.png new file mode 100644 index 0000000..3dad51e Binary files /dev/null and b/assets/app_icon/Alternatives/icon3.png differ diff --git a/assets/app_icon/Alternatives/icon4.png b/assets/app_icon/Alternatives/icon4.png new file mode 100644 index 0000000..3f1d578 Binary files /dev/null and b/assets/app_icon/Alternatives/icon4.png differ diff --git a/assets/app_icon/Alternatives/icon5.png b/assets/app_icon/Alternatives/icon5.png new file mode 100644 index 0000000..7ee776d Binary files /dev/null and b/assets/app_icon/Alternatives/icon5.png differ diff --git a/assets/app_icon/Alternatives/icon6.png b/assets/app_icon/Alternatives/icon6.png new file mode 100644 index 0000000..39c4ca9 Binary files /dev/null and b/assets/app_icon/Alternatives/icon6.png differ diff --git a/assets/app_icon/Alternatives/icon7.png b/assets/app_icon/Alternatives/icon7.png new file mode 100644 index 0000000..2b22167 Binary files /dev/null and b/assets/app_icon/Alternatives/icon7.png differ diff --git a/assets/app_icon/gradient-images1/icon-grad1024.png b/assets/app_icon/gradient-images1/icon-grad1024.png new file mode 100644 index 0000000..ae1e656 Binary files /dev/null and b/assets/app_icon/gradient-images1/icon-grad1024.png differ diff --git a/assets/app_icon/gradient-images1/icon-grad120.png b/assets/app_icon/gradient-images1/icon-grad120.png new file mode 100644 index 0000000..8760950 Binary files /dev/null and b/assets/app_icon/gradient-images1/icon-grad120.png differ diff --git a/assets/app_icon/gradient-images1/icon-grad152.png b/assets/app_icon/gradient-images1/icon-grad152.png new file mode 100644 index 0000000..4a3d2a6 Binary files /dev/null and b/assets/app_icon/gradient-images1/icon-grad152.png differ diff --git a/assets/app_icon/gradient-images1/icon-grad167.png b/assets/app_icon/gradient-images1/icon-grad167.png new file mode 100644 index 0000000..ce08fcd Binary files /dev/null and b/assets/app_icon/gradient-images1/icon-grad167.png differ diff --git a/assets/app_icon/gradient-images1/icon-grad180.png b/assets/app_icon/gradient-images1/icon-grad180.png new file mode 100644 index 0000000..191bec0 Binary files /dev/null and b/assets/app_icon/gradient-images1/icon-grad180.png differ diff --git a/assets/app_icon/gradient-images1/icon-grad40.png b/assets/app_icon/gradient-images1/icon-grad40.png new file mode 100644 index 0000000..e018fc4 Binary files /dev/null and b/assets/app_icon/gradient-images1/icon-grad40.png differ diff --git a/assets/app_icon/gradient-images1/icon-grad58.png b/assets/app_icon/gradient-images1/icon-grad58.png new file mode 100644 index 0000000..e37105b Binary files /dev/null and b/assets/app_icon/gradient-images1/icon-grad58.png differ diff --git a/assets/app_icon/gradient-images1/icon-grad60.png b/assets/app_icon/gradient-images1/icon-grad60.png new file mode 100644 index 0000000..d0fac5e Binary files /dev/null and b/assets/app_icon/gradient-images1/icon-grad60.png differ diff --git a/assets/app_icon/gradient-images1/icon-grad80.png b/assets/app_icon/gradient-images1/icon-grad80.png new file mode 100644 index 0000000..59f172e Binary files /dev/null and b/assets/app_icon/gradient-images1/icon-grad80.png differ diff --git a/assets/app_icon/gradient-images1/icon-grad87.png b/assets/app_icon/gradient-images1/icon-grad87.png new file mode 100644 index 0000000..d92394d Binary files /dev/null and b/assets/app_icon/gradient-images1/icon-grad87.png differ diff --git a/assets/app_icon/gradient2_icon/AntIconNewShortBlue1024.png b/assets/app_icon/gradient2_icon/AntIconNewShortBlue1024.png new file mode 100644 index 0000000..586c150 Binary files /dev/null and b/assets/app_icon/gradient2_icon/AntIconNewShortBlue1024.png differ diff --git a/assets/app_icon/gradient2_icon/AntIconNewShortBlue120.png b/assets/app_icon/gradient2_icon/AntIconNewShortBlue120.png new file mode 100644 index 0000000..03e48c5 Binary files /dev/null and b/assets/app_icon/gradient2_icon/AntIconNewShortBlue120.png differ diff --git a/assets/app_icon/gradient2_icon/AntIconNewShortBlue152.png b/assets/app_icon/gradient2_icon/AntIconNewShortBlue152.png new file mode 100644 index 0000000..e077073 Binary files /dev/null and b/assets/app_icon/gradient2_icon/AntIconNewShortBlue152.png differ diff --git a/assets/app_icon/gradient2_icon/AntIconNewShortBlue167.png b/assets/app_icon/gradient2_icon/AntIconNewShortBlue167.png new file mode 100644 index 0000000..2c50cc0 Binary files /dev/null and b/assets/app_icon/gradient2_icon/AntIconNewShortBlue167.png differ diff --git a/assets/app_icon/gradient2_icon/AntIconNewShortBlue180.png b/assets/app_icon/gradient2_icon/AntIconNewShortBlue180.png new file mode 100644 index 0000000..5cecf70 Binary files /dev/null and b/assets/app_icon/gradient2_icon/AntIconNewShortBlue180.png differ diff --git a/assets/app_icon/gradient2_icon/AntIconNewShortBlue40.png b/assets/app_icon/gradient2_icon/AntIconNewShortBlue40.png new file mode 100644 index 0000000..8e75527 Binary files /dev/null and b/assets/app_icon/gradient2_icon/AntIconNewShortBlue40.png differ diff --git a/assets/app_icon/gradient2_icon/AntIconNewShortBlue58.png b/assets/app_icon/gradient2_icon/AntIconNewShortBlue58.png new file mode 100644 index 0000000..49e73a9 Binary files /dev/null and b/assets/app_icon/gradient2_icon/AntIconNewShortBlue58.png differ diff --git a/assets/app_icon/gradient2_icon/AntIconNewShortBlue60.png b/assets/app_icon/gradient2_icon/AntIconNewShortBlue60.png new file mode 100644 index 0000000..cdc2827 Binary files /dev/null and b/assets/app_icon/gradient2_icon/AntIconNewShortBlue60.png differ diff --git a/assets/app_icon/gradient2_icon/AntIconNewShortBlue80.png b/assets/app_icon/gradient2_icon/AntIconNewShortBlue80.png new file mode 100644 index 0000000..5a71fd5 Binary files /dev/null and b/assets/app_icon/gradient2_icon/AntIconNewShortBlue80.png differ diff --git a/assets/app_icon/gradient2_icon/AntIconNewShortBlue87.png b/assets/app_icon/gradient2_icon/AntIconNewShortBlue87.png new file mode 100644 index 0000000..a780118 Binary files /dev/null and b/assets/app_icon/gradient2_icon/AntIconNewShortBlue87.png differ diff --git a/assets/app_icon/gradient7/AntIconNewShortBlue1024.png b/assets/app_icon/gradient7/AntIconNewShortBlue1024.png new file mode 100644 index 0000000..03fdd69 Binary files /dev/null and b/assets/app_icon/gradient7/AntIconNewShortBlue1024.png differ diff --git a/assets/app_icon/gradient7/AntIconNewShortBlue120.png b/assets/app_icon/gradient7/AntIconNewShortBlue120.png new file mode 100644 index 0000000..e71cfde Binary files /dev/null and b/assets/app_icon/gradient7/AntIconNewShortBlue120.png differ diff --git a/assets/app_icon/gradient7/AntIconNewShortBlue152.png b/assets/app_icon/gradient7/AntIconNewShortBlue152.png new file mode 100644 index 0000000..9b01895 Binary files /dev/null and b/assets/app_icon/gradient7/AntIconNewShortBlue152.png differ diff --git a/assets/app_icon/gradient7/AntIconNewShortBlue167.png b/assets/app_icon/gradient7/AntIconNewShortBlue167.png new file mode 100644 index 0000000..1e42c69 Binary files /dev/null and b/assets/app_icon/gradient7/AntIconNewShortBlue167.png differ diff --git a/assets/app_icon/gradient7/AntIconNewShortBlue180.png b/assets/app_icon/gradient7/AntIconNewShortBlue180.png new file mode 100644 index 0000000..424bce2 Binary files /dev/null and b/assets/app_icon/gradient7/AntIconNewShortBlue180.png differ diff --git a/assets/app_icon/gradient7/AntIconNewShortBlue40.png b/assets/app_icon/gradient7/AntIconNewShortBlue40.png new file mode 100644 index 0000000..8cf1b06 Binary files /dev/null and b/assets/app_icon/gradient7/AntIconNewShortBlue40.png differ diff --git a/assets/app_icon/gradient7/AntIconNewShortBlue58.png b/assets/app_icon/gradient7/AntIconNewShortBlue58.png new file mode 100644 index 0000000..59e13d9 Binary files /dev/null and b/assets/app_icon/gradient7/AntIconNewShortBlue58.png differ diff --git a/assets/app_icon/gradient7/AntIconNewShortBlue60.png b/assets/app_icon/gradient7/AntIconNewShortBlue60.png new file mode 100644 index 0000000..66c752c Binary files /dev/null and b/assets/app_icon/gradient7/AntIconNewShortBlue60.png differ diff --git a/assets/app_icon/gradient7/AntIconNewShortBlue80.png b/assets/app_icon/gradient7/AntIconNewShortBlue80.png new file mode 100644 index 0000000..8cd6a80 Binary files /dev/null and b/assets/app_icon/gradient7/AntIconNewShortBlue80.png differ diff --git a/assets/app_icon/gradient7/AntIconNewShortBlue87.png b/assets/app_icon/gradient7/AntIconNewShortBlue87.png new file mode 100644 index 0000000..aea13cb Binary files /dev/null and b/assets/app_icon/gradient7/AntIconNewShortBlue87.png differ diff --git a/assets/app_icon/icon-gradient.svg b/assets/app_icon/icon-gradient.svg new file mode 100644 index 0000000..97b65a5 --- /dev/null +++ b/assets/app_icon/icon-gradient.svg @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/app_icon/icon-gradient2.svg b/assets/app_icon/icon-gradient2.svg new file mode 100644 index 0000000..3bac186 --- /dev/null +++ b/assets/app_icon/icon-gradient2.svg @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/app_icon/icon-gradient3.svg b/assets/app_icon/icon-gradient3.svg new file mode 100644 index 0000000..12eb128 --- /dev/null +++ b/assets/app_icon/icon-gradient3.svg @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/app_icon/icon-gradient3.svg.2021_12_28_15_24_43.0.svg b/assets/app_icon/icon-gradient3.svg.2021_12_28_15_24_43.0.svg new file mode 100644 index 0000000..f0fb17c --- /dev/null +++ b/assets/app_icon/icon-gradient3.svg.2021_12_28_15_24_43.0.svg @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/app_icon/icon-gradient4.svg b/assets/app_icon/icon-gradient4.svg new file mode 100644 index 0000000..9cb93f5 --- /dev/null +++ b/assets/app_icon/icon-gradient4.svg @@ -0,0 +1,439 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/app_icon/icon-gradient6.svg b/assets/app_icon/icon-gradient6.svg new file mode 100644 index 0000000..b385ff6 --- /dev/null +++ b/assets/app_icon/icon-gradient6.svg @@ -0,0 +1,484 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/app_icon/icon-gradient7-dev.svg b/assets/app_icon/icon-gradient7-dev.svg new file mode 100644 index 0000000..4fdd3cd --- /dev/null +++ b/assets/app_icon/icon-gradient7-dev.svg @@ -0,0 +1,484 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/app_icon/icon-gradient7.svg b/assets/app_icon/icon-gradient7.svg new file mode 100644 index 0000000..82c2faf --- /dev/null +++ b/assets/app_icon/icon-gradient7.svg @@ -0,0 +1,484 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/app_icon/icon.svg b/assets/app_icon/icon.svg new file mode 100644 index 0000000..6bf7947 --- /dev/null +++ b/assets/app_icon/icon.svg @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/app_icon/newdevicon_icon/newdevicon1024.png b/assets/app_icon/newdevicon_icon/newdevicon1024.png new file mode 100644 index 0000000..62d9f2b Binary files /dev/null and b/assets/app_icon/newdevicon_icon/newdevicon1024.png differ diff --git a/assets/app_icon/newdevicon_icon/newdevicon120.png b/assets/app_icon/newdevicon_icon/newdevicon120.png new file mode 100644 index 0000000..9cf9f0d Binary files /dev/null and b/assets/app_icon/newdevicon_icon/newdevicon120.png differ diff --git a/assets/app_icon/newdevicon_icon/newdevicon152.png b/assets/app_icon/newdevicon_icon/newdevicon152.png new file mode 100644 index 0000000..edad583 Binary files /dev/null and b/assets/app_icon/newdevicon_icon/newdevicon152.png differ diff --git a/assets/app_icon/newdevicon_icon/newdevicon167.png b/assets/app_icon/newdevicon_icon/newdevicon167.png new file mode 100644 index 0000000..e111db6 Binary files /dev/null and b/assets/app_icon/newdevicon_icon/newdevicon167.png differ diff --git a/assets/app_icon/newdevicon_icon/newdevicon180.png b/assets/app_icon/newdevicon_icon/newdevicon180.png new file mode 100644 index 0000000..83b71bd Binary files /dev/null and b/assets/app_icon/newdevicon_icon/newdevicon180.png differ diff --git a/assets/app_icon/newdevicon_icon/newdevicon40.png b/assets/app_icon/newdevicon_icon/newdevicon40.png new file mode 100644 index 0000000..1b7089e Binary files /dev/null and b/assets/app_icon/newdevicon_icon/newdevicon40.png differ diff --git a/assets/app_icon/newdevicon_icon/newdevicon58.png b/assets/app_icon/newdevicon_icon/newdevicon58.png new file mode 100644 index 0000000..c91c937 Binary files /dev/null and b/assets/app_icon/newdevicon_icon/newdevicon58.png differ diff --git a/assets/app_icon/newdevicon_icon/newdevicon60.png b/assets/app_icon/newdevicon_icon/newdevicon60.png new file mode 100644 index 0000000..bff799c Binary files /dev/null and b/assets/app_icon/newdevicon_icon/newdevicon60.png differ diff --git a/assets/app_icon/newdevicon_icon/newdevicon80.png b/assets/app_icon/newdevicon_icon/newdevicon80.png new file mode 100644 index 0000000..60ab79c Binary files /dev/null and b/assets/app_icon/newdevicon_icon/newdevicon80.png differ diff --git a/assets/app_icon/newdevicon_icon/newdevicon87.png b/assets/app_icon/newdevicon_icon/newdevicon87.png new file mode 100644 index 0000000..e19e67c Binary files /dev/null and b/assets/app_icon/newdevicon_icon/newdevicon87.png differ diff --git a/assets/cartoon_ant/2x/cartoon_ant.png b/assets/cartoon_ant/2x/cartoon_ant.png new file mode 100644 index 0000000..5564e1a Binary files /dev/null and b/assets/cartoon_ant/2x/cartoon_ant.png differ diff --git a/assets/cartoon_ant/3x/cartoon_ant.png b/assets/cartoon_ant/3x/cartoon_ant.png new file mode 100644 index 0000000..43aa782 Binary files /dev/null and b/assets/cartoon_ant/3x/cartoon_ant.png differ diff --git a/assets/cartoon_ant/cartoon_ant.png b/assets/cartoon_ant/cartoon_ant.png new file mode 100644 index 0000000..2e845c3 Binary files /dev/null and b/assets/cartoon_ant/cartoon_ant.png differ diff --git a/assets/cartoon_ant/cartoon_ant.svg b/assets/cartoon_ant/cartoon_ant.svg new file mode 100644 index 0000000..4125adf --- /dev/null +++ b/assets/cartoon_ant/cartoon_ant.svg @@ -0,0 +1,453 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/cartoon_ant/cartoon_ant_cleaned.svg b/assets/cartoon_ant/cartoon_ant_cleaned.svg new file mode 100644 index 0000000..4125adf --- /dev/null +++ b/assets/cartoon_ant/cartoon_ant_cleaned.svg @@ -0,0 +1,453 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/cartoon_ant/dark/2x/cartoon_ant.png b/assets/cartoon_ant/dark/2x/cartoon_ant.png new file mode 100644 index 0000000..3770338 Binary files /dev/null and b/assets/cartoon_ant/dark/2x/cartoon_ant.png differ diff --git a/assets/cartoon_ant/dark/2x/cartoon_ant_darker.png b/assets/cartoon_ant/dark/2x/cartoon_ant_darker.png new file mode 100644 index 0000000..5deec74 Binary files /dev/null and b/assets/cartoon_ant/dark/2x/cartoon_ant_darker.png differ diff --git a/assets/cartoon_ant/dark/3x/cartoon_ant.png b/assets/cartoon_ant/dark/3x/cartoon_ant.png new file mode 100644 index 0000000..d700ecf Binary files /dev/null and b/assets/cartoon_ant/dark/3x/cartoon_ant.png differ diff --git a/assets/cartoon_ant/dark/3x/cartoon_ant_darker.png b/assets/cartoon_ant/dark/3x/cartoon_ant_darker.png new file mode 100644 index 0000000..7908077 Binary files /dev/null and b/assets/cartoon_ant/dark/3x/cartoon_ant_darker.png differ diff --git a/assets/cartoon_ant/dark/cartoon_ant.png b/assets/cartoon_ant/dark/cartoon_ant.png new file mode 100644 index 0000000..e15f2bf Binary files /dev/null and b/assets/cartoon_ant/dark/cartoon_ant.png differ diff --git a/assets/cartoon_ant/dark/cartoon_ant.svg b/assets/cartoon_ant/dark/cartoon_ant.svg new file mode 100644 index 0000000..6cb5c7e --- /dev/null +++ b/assets/cartoon_ant/dark/cartoon_ant.svg @@ -0,0 +1,400 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/cartoon_ant/dark/cartoon_ant_darker.png b/assets/cartoon_ant/dark/cartoon_ant_darker.png new file mode 100644 index 0000000..9e757a6 Binary files /dev/null and b/assets/cartoon_ant/dark/cartoon_ant_darker.png differ diff --git a/assets/cartoon_ant/dark/cartoon_ant_darker.svg b/assets/cartoon_ant/dark/cartoon_ant_darker.svg new file mode 100644 index 0000000..c32a948 --- /dev/null +++ b/assets/cartoon_ant/dark/cartoon_ant_darker.svg @@ -0,0 +1,400 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/cartoon_ant_old/2x/cartoon_ant.png b/assets/cartoon_ant_old/2x/cartoon_ant.png new file mode 100644 index 0000000..c3ce660 Binary files /dev/null and b/assets/cartoon_ant_old/2x/cartoon_ant.png differ diff --git a/assets/cartoon_ant_old/3x/cartoon_ant.png b/assets/cartoon_ant_old/3x/cartoon_ant.png new file mode 100644 index 0000000..e78a177 Binary files /dev/null and b/assets/cartoon_ant_old/3x/cartoon_ant.png differ diff --git a/assets/cartoon_ant_old/cartoon_ant.png b/assets/cartoon_ant_old/cartoon_ant.png new file mode 100644 index 0000000..b4b4cd6 Binary files /dev/null and b/assets/cartoon_ant_old/cartoon_ant.png differ diff --git a/assets/cartoon_ant_old/cartoon_ant.svg b/assets/cartoon_ant_old/cartoon_ant.svg new file mode 100644 index 0000000..c778798 --- /dev/null +++ b/assets/cartoon_ant_old/cartoon_ant.svg @@ -0,0 +1,160 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/createiosicons.sh b/assets/createiosicons.sh new file mode 100755 index 0000000..480a9c9 --- /dev/null +++ b/assets/createiosicons.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +#inkscape=/Applications/Inkscape.app/Contents/MacOS/inkscape +inputSVG=$1 +exportName=$2 +resolutions="40 58 60 80 87 120 152 167 180 1024" +dirName=${exportName}_icon + +mkdir $dirName + +for res in $resolutions +do + inkscape $inputSVG -o $dirName/$exportName$res.png -w $res -h $res +done diff --git a/assets/feature_graphic/feature_graphic.png b/assets/feature_graphic/feature_graphic.png new file mode 100644 index 0000000..976f760 Binary files /dev/null and b/assets/feature_graphic/feature_graphic.png differ diff --git a/fonts/Dosis/Dosis-VariableFont_wght.ttf b/fonts/Dosis/Dosis-VariableFont_wght.ttf new file mode 100644 index 0000000..e2c9959 Binary files /dev/null and b/fonts/Dosis/Dosis-VariableFont_wght.ttf differ diff --git a/fonts/Dosis/OFL.txt b/fonts/Dosis/OFL.txt new file mode 100644 index 0000000..73b1b36 --- /dev/null +++ b/fonts/Dosis/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2011 The Dosis Project Authors (https://github.com/googlefonts/dosis-vf) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/fonts/Dosis/README.txt b/fonts/Dosis/README.txt new file mode 100644 index 0000000..e12383b --- /dev/null +++ b/fonts/Dosis/README.txt @@ -0,0 +1,69 @@ +Dosis Variable Font +=================== + +This download contains Dosis as both a variable font and static fonts. + +Dosis is a variable font with this axis: + wght + +This means all the styles are contained in a single file: + Dosis-VariableFont_wght.ttf + +If your app fully supports variable fonts, you can now pick intermediate styles +that aren’t available as static fonts. Not all apps support variable fonts, and +in those cases you can use the static font files for Dosis: + static/Dosis-ExtraLight.ttf + static/Dosis-Light.ttf + static/Dosis-Regular.ttf + static/Dosis-Medium.ttf + static/Dosis-SemiBold.ttf + static/Dosis-Bold.ttf + static/Dosis-ExtraBold.ttf + +Get started +----------- + +1. Install the font files you want to use + +2. Use your app's font picker to view the font family and all the +available styles + +Learn more about variable fonts +------------------------------- + + https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts + https://variablefonts.typenetwork.com + https://medium.com/variable-fonts + +In desktop apps + + https://theblog.adobe.com/can-variable-fonts-illustrator-cc + https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts + +Online + + https://developers.google.com/fonts/docs/getting_started + https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide + https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts + +Installing fonts + + MacOS: https://support.apple.com/en-us/HT201749 + Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux + Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows + +Android Apps + + https://developers.google.com/fonts/docs/android + https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts + +License +------- +Please read the full license text (OFL.txt) to understand the permissions, +restrictions and requirements for usage, redistribution, and modification. + +You can use them in your products & projects - print or digital, +commercial or otherwise. + +This isn't legal advice, please consider consulting a lawyer and see the full +license for all details. diff --git a/fonts/Dosis/static/Dosis-Bold.ttf b/fonts/Dosis/static/Dosis-Bold.ttf new file mode 100644 index 0000000..2e21748 Binary files /dev/null and b/fonts/Dosis/static/Dosis-Bold.ttf differ diff --git a/fonts/Dosis/static/Dosis-ExtraBold.ttf b/fonts/Dosis/static/Dosis-ExtraBold.ttf new file mode 100644 index 0000000..6ea1ff0 Binary files /dev/null and b/fonts/Dosis/static/Dosis-ExtraBold.ttf differ diff --git a/fonts/Dosis/static/Dosis-ExtraLight.ttf b/fonts/Dosis/static/Dosis-ExtraLight.ttf new file mode 100644 index 0000000..9de198c Binary files /dev/null and b/fonts/Dosis/static/Dosis-ExtraLight.ttf differ diff --git a/fonts/Dosis/static/Dosis-Light.ttf b/fonts/Dosis/static/Dosis-Light.ttf new file mode 100644 index 0000000..bbd12bb Binary files /dev/null and b/fonts/Dosis/static/Dosis-Light.ttf differ diff --git a/fonts/Dosis/static/Dosis-Medium.ttf b/fonts/Dosis/static/Dosis-Medium.ttf new file mode 100644 index 0000000..9a73543 Binary files /dev/null and b/fonts/Dosis/static/Dosis-Medium.ttf differ diff --git a/fonts/Dosis/static/Dosis-Regular.ttf b/fonts/Dosis/static/Dosis-Regular.ttf new file mode 100644 index 0000000..1057d24 Binary files /dev/null and b/fonts/Dosis/static/Dosis-Regular.ttf differ diff --git a/fonts/Dosis/static/Dosis-SemiBold.ttf b/fonts/Dosis/static/Dosis-SemiBold.ttf new file mode 100644 index 0000000..73bd1ca Binary files /dev/null and b/fonts/Dosis/static/Dosis-SemiBold.ttf differ diff --git a/fonts/Open_Sans/LICENSE.txt b/fonts/Open_Sans/LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/fonts/Open_Sans/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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. diff --git a/fonts/Open_Sans/OpenSans-Italic-VariableFont_wdth,wght.ttf b/fonts/Open_Sans/OpenSans-Italic-VariableFont_wdth,wght.ttf new file mode 100644 index 0000000..ae4c04c Binary files /dev/null and b/fonts/Open_Sans/OpenSans-Italic-VariableFont_wdth,wght.ttf differ diff --git a/fonts/Open_Sans/OpenSans-VariableFont_wdth,wght.ttf b/fonts/Open_Sans/OpenSans-VariableFont_wdth,wght.ttf new file mode 100644 index 0000000..cbb30ef Binary files /dev/null and b/fonts/Open_Sans/OpenSans-VariableFont_wdth,wght.ttf differ diff --git a/fonts/Open_Sans/README.txt b/fonts/Open_Sans/README.txt new file mode 100644 index 0000000..c222e44 --- /dev/null +++ b/fonts/Open_Sans/README.txt @@ -0,0 +1,100 @@ +Open Sans Variable Font +======================= + +This download contains Open Sans as both variable fonts and static fonts. + +Open Sans is a variable font with these axes: + wdth + wght + +This means all the styles are contained in these files: + OpenSans-VariableFont_wdth,wght.ttf + OpenSans-Italic-VariableFont_wdth,wght.ttf + +If your app fully supports variable fonts, you can now pick intermediate styles +that aren’t available as static fonts. Not all apps support variable fonts, and +in those cases you can use the static font files for Open Sans: + static/OpenSans_Condensed/OpenSans_Condensed-Light.ttf + static/OpenSans_Condensed/OpenSans_Condensed-Regular.ttf + static/OpenSans_Condensed/OpenSans_Condensed-Medium.ttf + static/OpenSans_Condensed/OpenSans_Condensed-SemiBold.ttf + static/OpenSans_Condensed/OpenSans_Condensed-Bold.ttf + static/OpenSans_Condensed/OpenSans_Condensed-ExtraBold.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Light.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Regular.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Medium.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBold.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Bold.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBold.ttf + static/OpenSans/OpenSans-Light.ttf + static/OpenSans/OpenSans-Regular.ttf + static/OpenSans/OpenSans-Medium.ttf + static/OpenSans/OpenSans-SemiBold.ttf + static/OpenSans/OpenSans-Bold.ttf + static/OpenSans/OpenSans-ExtraBold.ttf + static/OpenSans_Condensed/OpenSans_Condensed-LightItalic.ttf + static/OpenSans_Condensed/OpenSans_Condensed-Italic.ttf + static/OpenSans_Condensed/OpenSans_Condensed-MediumItalic.ttf + static/OpenSans_Condensed/OpenSans_Condensed-SemiBoldItalic.ttf + static/OpenSans_Condensed/OpenSans_Condensed-BoldItalic.ttf + static/OpenSans_Condensed/OpenSans_Condensed-ExtraBoldItalic.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-LightItalic.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Italic.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-MediumItalic.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBoldItalic.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-BoldItalic.ttf + static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBoldItalic.ttf + static/OpenSans/OpenSans-LightItalic.ttf + static/OpenSans/OpenSans-Italic.ttf + static/OpenSans/OpenSans-MediumItalic.ttf + static/OpenSans/OpenSans-SemiBoldItalic.ttf + static/OpenSans/OpenSans-BoldItalic.ttf + static/OpenSans/OpenSans-ExtraBoldItalic.ttf + +Get started +----------- + +1. Install the font files you want to use + +2. Use your app's font picker to view the font family and all the +available styles + +Learn more about variable fonts +------------------------------- + + https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts + https://variablefonts.typenetwork.com + https://medium.com/variable-fonts + +In desktop apps + + https://theblog.adobe.com/can-variable-fonts-illustrator-cc + https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts + +Online + + https://developers.google.com/fonts/docs/getting_started + https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide + https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts + +Installing fonts + + MacOS: https://support.apple.com/en-us/HT201749 + Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux + Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows + +Android Apps + + https://developers.google.com/fonts/docs/android + https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts + +License +------- +Please read the full license text (LICENSE.txt) to understand the permissions, +restrictions and requirements for usage, redistribution, and modification. + +You can use them in your products & projects - print or digital, +commercial or otherwise. + +This isn't legal advice, please consider consulting a lawyer and see the full +license for all details. diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-Bold.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-Bold.ttf new file mode 100644 index 0000000..ab4d993 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-Bold.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-BoldItalic.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-BoldItalic.ttf new file mode 100644 index 0000000..5dcb3a5 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-BoldItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-ExtraBold.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-ExtraBold.ttf new file mode 100644 index 0000000..6fce624 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-ExtraBold.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-ExtraBoldItalic.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-ExtraBoldItalic.ttf new file mode 100644 index 0000000..788be48 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-ExtraBoldItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-Italic.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-Italic.ttf new file mode 100644 index 0000000..68cff8f Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-Italic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-Light.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-Light.ttf new file mode 100644 index 0000000..1638514 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-Light.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-LightItalic.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-LightItalic.ttf new file mode 100644 index 0000000..d321563 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-LightItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-Medium.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-Medium.ttf new file mode 100644 index 0000000..faa5386 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-Medium.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-MediumItalic.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-MediumItalic.ttf new file mode 100644 index 0000000..e15c7d4 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-MediumItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-Regular.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-Regular.ttf new file mode 100644 index 0000000..e21ff5f Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-Regular.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-SemiBold.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-SemiBold.ttf new file mode 100644 index 0000000..2b18a1c Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-SemiBold.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans/OpenSans-SemiBoldItalic.ttf b/fonts/Open_Sans/static/OpenSans/OpenSans-SemiBoldItalic.ttf new file mode 100644 index 0000000..1f86d18 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans/OpenSans-SemiBoldItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Bold.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Bold.ttf new file mode 100644 index 0000000..8d7dc04 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Bold.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-BoldItalic.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-BoldItalic.ttf new file mode 100644 index 0000000..5b9791f Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-BoldItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-ExtraBold.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-ExtraBold.ttf new file mode 100644 index 0000000..09125ec Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-ExtraBold.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-ExtraBoldItalic.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-ExtraBoldItalic.ttf new file mode 100644 index 0000000..ee1f69f Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-ExtraBoldItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Italic.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Italic.ttf new file mode 100644 index 0000000..73ceb69 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Italic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Light.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Light.ttf new file mode 100644 index 0000000..fd82b9b Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Light.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-LightItalic.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-LightItalic.ttf new file mode 100644 index 0000000..631d70b Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-LightItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Medium.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Medium.ttf new file mode 100644 index 0000000..b3287f5 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Medium.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-MediumItalic.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-MediumItalic.ttf new file mode 100644 index 0000000..a186079 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-MediumItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Regular.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Regular.ttf new file mode 100644 index 0000000..ed90093 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-Regular.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-SemiBold.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-SemiBold.ttf new file mode 100644 index 0000000..cf41701 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-SemiBold.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-SemiBoldItalic.ttf b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-SemiBoldItalic.ttf new file mode 100644 index 0000000..edcc9d1 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_Condensed/OpenSans_Condensed-SemiBoldItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Bold.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Bold.ttf new file mode 100644 index 0000000..bd1abee Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Bold.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-BoldItalic.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-BoldItalic.ttf new file mode 100644 index 0000000..18b5449 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-BoldItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBold.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBold.ttf new file mode 100644 index 0000000..0419b55 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBold.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBoldItalic.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBoldItalic.ttf new file mode 100644 index 0000000..41a93e2 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-ExtraBoldItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Italic.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Italic.ttf new file mode 100644 index 0000000..6e3f49c Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Italic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Light.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Light.ttf new file mode 100644 index 0000000..7259e9f Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Light.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-LightItalic.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-LightItalic.ttf new file mode 100644 index 0000000..eb1b419 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-LightItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Medium.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Medium.ttf new file mode 100644 index 0000000..6a453ae Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Medium.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-MediumItalic.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-MediumItalic.ttf new file mode 100644 index 0000000..82656db Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-MediumItalic.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Regular.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Regular.ttf new file mode 100644 index 0000000..b5e33f3 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-Regular.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBold.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBold.ttf new file mode 100644 index 0000000..cd3877d Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBold.ttf differ diff --git a/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBoldItalic.ttf b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBoldItalic.ttf new file mode 100644 index 0000000..abb57d0 Binary files /dev/null and b/fonts/Open_Sans/static/OpenSans_SemiCondensed/OpenSans_SemiCondensed-SemiBoldItalic.ttf differ diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..047b63d --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,35 @@ +*.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 + +# Remove archived flutter icon +/Runner/Assets.xcassets/AppIcon - archive.appiconset/ diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..b5936e8 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 11.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..9706ed5 --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1,6 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" +// Create the `Secrets.xcconfig` file to store API keys +#include "Secrets.xcconfig" +ASSETCATALOG_COMPILER_APPICON_NAME = AppIconDev +APP_NAME = AntNupDev diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..f2834d3 --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1,6 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" +// Create the `Secrets.xcconfig` file to store API keys +#include "Secrets.xcconfig" +ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon +APP_NAME = AntNupTracker diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..8f0c020 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,102 @@ +# Uncomment this line to define a global platform for your project +platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +# add pods for desired Firebase products +# https://firebase.google.com/docs/ios/setup#available-pods + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + + target.build_configurations.each do |config| + # Here are some configurations automatically generated by flutter + + # You can enable the permissions needed here. For example to enable camera + # permission, just remove the `#` character in front so it looks like this: + # + # ## dart: PermissionGroup.camera + # 'PERMISSION_CAMERA=1' + # + # Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + + ## dart: PermissionGroup.calendar + # 'PERMISSION_EVENTS=1', + + ## dart: PermissionGroup.reminders + # 'PERMISSION_REMINDERS=1', + + ## dart: PermissionGroup.contacts + # 'PERMISSION_CONTACTS=1', + + ## dart: PermissionGroup.camera + 'PERMISSION_CAMERA=1', + + ## dart: PermissionGroup.microphone + # 'PERMISSION_MICROPHONE=1', + + ## dart: PermissionGroup.speech + # 'PERMISSION_SPEECH_RECOGNIZER=1', + + ## dart: PermissionGroup.photos + 'PERMISSION_PHOTOS=1', + + ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] + 'PERMISSION_LOCATION=1', + + ## dart: PermissionGroup.notification + # 'PERMISSION_NOTIFICATIONS=1', + + ## dart: PermissionGroup.mediaLibrary + # 'PERMISSION_MEDIA_LIBRARY=1', + + ## dart: PermissionGroup.sensors + # 'PERMISSION_SENSORS=1', + + ## dart: PermissionGroup.bluetooth + # 'PERMISSION_BLUETOOTH=1', + + ## dart: PermissionGroup.appTrackingTransparency + # 'PERMISSION_APP_TRACKING_TRANSPARENCY=1', + + ## dart: PermissionGroup.criticalAlerts + # 'PERMISSION_CRITICAL_ALERTS=1' + ] + + end + end +end diff --git a/ios/Podfile.lock b/ios/Podfile.lock new file mode 100644 index 0000000..514330d --- /dev/null +++ b/ios/Podfile.lock @@ -0,0 +1,221 @@ +PODS: + - Firebase/CoreOnly (9.2.0): + - FirebaseCore (= 9.2.0) + - Firebase/Messaging (9.2.0): + - Firebase/CoreOnly + - FirebaseMessaging (~> 9.2.0) + - firebase_core (1.19.2): + - Firebase/CoreOnly (= 9.2.0) + - Flutter + - firebase_messaging (11.4.4): + - Firebase/Messaging (= 9.2.0) + - firebase_core + - Flutter + - FirebaseCore (9.2.0): + - FirebaseCoreDiagnostics (~> 9.0) + - FirebaseCoreInternal (~> 9.0) + - GoogleUtilities/Environment (~> 7.7) + - GoogleUtilities/Logger (~> 7.7) + - FirebaseCoreDiagnostics (9.3.0): + - GoogleDataTransport (< 10.0.0, >= 9.1.4) + - GoogleUtilities/Environment (~> 7.7) + - GoogleUtilities/Logger (~> 7.7) + - nanopb (< 2.30910.0, >= 2.30908.0) + - FirebaseCoreInternal (9.3.0): + - "GoogleUtilities/NSData+zlib (~> 7.7)" + - FirebaseInstallations (9.3.0): + - FirebaseCore (~> 9.0) + - GoogleUtilities/Environment (~> 7.7) + - GoogleUtilities/UserDefaults (~> 7.7) + - PromisesObjC (~> 2.1) + - FirebaseMessaging (9.2.0): + - FirebaseCore (~> 9.0) + - FirebaseInstallations (~> 9.0) + - GoogleDataTransport (< 10.0.0, >= 9.1.4) + - GoogleUtilities/AppDelegateSwizzler (~> 7.7) + - GoogleUtilities/Environment (~> 7.7) + - GoogleUtilities/Reachability (~> 7.7) + - GoogleUtilities/UserDefaults (~> 7.7) + - nanopb (< 2.30910.0, >= 2.30908.0) + - Flutter (1.0.0) + - flutter_image_compress (0.0.1): + - Flutter + - Mantle + - SDWebImage + - SDWebImageWebPCoder + - flutter_secure_storage (3.3.1): + - Flutter + - FMDB (2.7.5): + - FMDB/standard (= 2.7.5) + - FMDB/standard (2.7.5) + - gallery_saver (0.0.1): + - Flutter + - google_maps_flutter (0.0.1): + - Flutter + - GoogleMaps + - GoogleDataTransport (9.1.4): + - GoogleUtilities/Environment (~> 7.7) + - nanopb (< 2.30910.0, >= 2.30908.0) + - PromisesObjC (< 3.0, >= 1.2) + - GoogleMaps (5.2.0): + - GoogleMaps/Maps (= 5.2.0) + - GoogleMaps/Base (5.2.0) + - GoogleMaps/Maps (5.2.0): + - GoogleMaps/Base + - GoogleUtilities/AppDelegateSwizzler (7.7.0): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Environment (7.7.0): + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Logger (7.7.0): + - GoogleUtilities/Environment + - GoogleUtilities/Network (7.7.0): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (7.7.0)" + - GoogleUtilities/Reachability (7.7.0): + - GoogleUtilities/Logger + - GoogleUtilities/UserDefaults (7.7.0): + - GoogleUtilities/Logger + - image_picker_ios (0.0.1): + - Flutter + - libwebp (1.2.1): + - libwebp/demux (= 1.2.1) + - libwebp/mux (= 1.2.1) + - libwebp/webp (= 1.2.1) + - libwebp/demux (1.2.1): + - libwebp/webp + - libwebp/mux (1.2.1): + - libwebp/demux + - libwebp/webp (1.2.1) + - location (0.0.1): + - Flutter + - Mantle (2.2.0): + - Mantle/extobjc (= 2.2.0) + - Mantle/extobjc (2.2.0) + - nanopb (2.30909.0): + - nanopb/decode (= 2.30909.0) + - nanopb/encode (= 2.30909.0) + - nanopb/decode (2.30909.0) + - nanopb/encode (2.30909.0) + - path_provider_ios (0.0.1): + - Flutter + - permission_handler_apple (9.0.4): + - Flutter + - PromisesObjC (2.1.1) + - SDWebImage (5.13.1): + - SDWebImage/Core (= 5.13.1) + - SDWebImage/Core (5.13.1) + - SDWebImageWebPCoder (0.9.0): + - libwebp (~> 1.0) + - SDWebImage/Core (~> 5.13) + - shared_preferences_ios (0.0.1): + - Flutter + - sqflite (0.0.2): + - Flutter + - FMDB (>= 2.7.5) + - url_launcher_ios (0.0.1): + - Flutter + +DEPENDENCIES: + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) + - Flutter (from `Flutter`) + - flutter_image_compress (from `.symlinks/plugins/flutter_image_compress/ios`) + - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) + - gallery_saver (from `.symlinks/plugins/gallery_saver/ios`) + - google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`) + - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) + - location (from `.symlinks/plugins/location/ios`) + - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) + - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) + - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`) + - sqflite (from `.symlinks/plugins/sqflite/ios`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) + +SPEC REPOS: + trunk: + - Firebase + - FirebaseCore + - FirebaseCoreDiagnostics + - FirebaseCoreInternal + - FirebaseInstallations + - FirebaseMessaging + - FMDB + - GoogleDataTransport + - GoogleMaps + - GoogleUtilities + - libwebp + - Mantle + - nanopb + - PromisesObjC + - SDWebImage + - SDWebImageWebPCoder + +EXTERNAL SOURCES: + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + firebase_messaging: + :path: ".symlinks/plugins/firebase_messaging/ios" + Flutter: + :path: Flutter + flutter_image_compress: + :path: ".symlinks/plugins/flutter_image_compress/ios" + flutter_secure_storage: + :path: ".symlinks/plugins/flutter_secure_storage/ios" + gallery_saver: + :path: ".symlinks/plugins/gallery_saver/ios" + google_maps_flutter: + :path: ".symlinks/plugins/google_maps_flutter/ios" + image_picker_ios: + :path: ".symlinks/plugins/image_picker_ios/ios" + location: + :path: ".symlinks/plugins/location/ios" + path_provider_ios: + :path: ".symlinks/plugins/path_provider_ios/ios" + permission_handler_apple: + :path: ".symlinks/plugins/permission_handler_apple/ios" + shared_preferences_ios: + :path: ".symlinks/plugins/shared_preferences_ios/ios" + sqflite: + :path: ".symlinks/plugins/sqflite/ios" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" + +SPEC CHECKSUMS: + Firebase: 4ba896cb8e5105d4b9e247e1c1b6222b548df55a + firebase_core: ada8be870601fe3c2684dae2356f634189bd598f + firebase_messaging: 405f36f22122866761e7ba7aa1dcecbae09ef836 + FirebaseCore: 0e27f2a15d8f7b7ef11e7d93e23b1cbab55d748c + FirebaseCoreDiagnostics: 060eb57cc56dfaf40b1b1b5874a5c17c41ce79f8 + FirebaseCoreInternal: 635d1c9a612a6502b6377a0c92af83758076ffff + FirebaseInstallations: 54b40022cb06e462740c9f2b9fbe38b5e78a825a + FirebaseMessaging: 4eaf1b8a7464b2c5e619ad66e9b20ee3e3206b24 + Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a + flutter_image_compress: fd2b476345226e1a10ea352fa306af95704642c1 + flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a + gallery_saver: 9fc173c9f4fcc48af53b2a9ebea1b643255be542 + google_maps_flutter: c59fc576c0d0c7f4dc4bd63832c862d22d5a7c6d + GoogleDataTransport: 5fffe35792f8b96ec8d6775f5eccd83c998d5a3b + GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693 + GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1 + image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb + libwebp: 98a37e597e40bfdb4c911fc98f2c53d0b12d05fc + location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740 + Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d + nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431 + path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 + permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce + PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb + SDWebImage: fb26a455eeda4c7a55e4dcb6172dbb258af7a4ca + SDWebImageWebPCoder: 3dc350894112feab5375cfba9ce0986544a66a69 + shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad + sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 + url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de + +PODFILE CHECKSUM: 48ba0c1e455ab125a7fe9b5a129ad23791e1b2be + +COCOAPODS: 1.11.3 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..416c005 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,617 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + 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 */; }; + 4301869F26CC4044002CC572 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4301869E26CC4044002CC572 /* GoogleService-Info.plist */; }; + 43F88BF027763086008AF6A5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 43F88BDD277625FA008AF6A5 /* InfoPlist.strings */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 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 */; }; + AF13EEDE1653AA3241DB44B6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4AC5FA87FC5D91F08BAEFFD8 /* Pods_Runner.framework */; }; +/* 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 */ + 0B6237CDA5BCB712634F1008 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 4301869D26CC3C3A002CC572 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; + 4301869E26CC4044002CC572 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + 434866BF26C419BB00EA3DD9 /* Secrets.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Secrets.xcconfig; path = Flutter/Secrets.xcconfig; sourceTree = ""; }; + 43F88BDC277625FA008AF6A5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 43F88BE127762981008AF6A5 /* fr-CA */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "fr-CA"; path = "fr-CA.lproj/Main.strings"; sourceTree = ""; }; + 43F88BE227762981008AF6A5 /* fr-CA */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "fr-CA"; path = "fr-CA.lproj/LaunchScreen.strings"; sourceTree = ""; }; + 43F88BE427762981008AF6A5 /* fr-CA */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "fr-CA"; path = "fr-CA.lproj/InfoPlist.strings"; sourceTree = ""; }; + 43F88BEE27762EE9008AF6A5 /* Info-Release.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-Release.plist"; sourceTree = ""; }; + 43F88BF1277AAAD3008AF6A5 /* Info-Debug.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-Debug.plist"; sourceTree = ""; }; + 4AC5FA87FC5D91F08BAEFFD8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 5725F2EE7A310DBFCEB39DBD /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 8317E65BF06E4E5FAD301E34 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AF13EEDE1653AA3241DB44B6 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6FE9F32E8D2A2DDFF4C3BAB3 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 4AC5FA87FC5D91F08BAEFFD8 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + 434866BF26C419BB00EA3DD9 /* Secrets.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + BB6DEE6B068BEDBB2FD27CCA /* Pods */, + 6FE9F32E8D2A2DDFF4C3BAB3 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 4301869D26CC3C3A002CC572 /* Runner.entitlements */, + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 4301869E26CC4044002CC572 /* GoogleService-Info.plist */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + 43F88BEE27762EE9008AF6A5 /* Info-Release.plist */, + 43F88BF1277AAAD3008AF6A5 /* Info-Debug.plist */, + 43F88BDD277625FA008AF6A5 /* InfoPlist.strings */, + ); + path = Runner; + sourceTree = ""; + }; + BB6DEE6B068BEDBB2FD27CCA /* Pods */ = { + isa = PBXGroup; + children = ( + 8317E65BF06E4E5FAD301E34 /* Pods-Runner.debug.xcconfig */, + 5725F2EE7A310DBFCEB39DBD /* Pods-Runner.release.xcconfig */, + 0B6237CDA5BCB712634F1008 /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 48EB4F65EFD82FDD118159EA /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + B2635C0624EB71287C82825A /* [CP] Embed Pods Frameworks */, + 00F778CF884CBB856D2982F5 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + packageProductDependencies = ( + ); + 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 = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + "fr-CA", + ); + mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + ); + 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 */, + 43F88BF027763086008AF6A5 /* InfoPlist.strings in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 4301869F26CC4044002CC572 /* GoogleService-Info.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 00F778CF884CBB856D2982F5 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 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\n"; + }; + 48EB4F65EFD82FDD118159EA /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 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"; + }; + B2635C0624EB71287C82825A /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 43F88BDD277625FA008AF6A5 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 43F88BDC277625FA008AF6A5 /* en */, + 43F88BE427762981008AF6A5 /* fr-CA */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + 43F88BE127762981008AF6A5 /* fr-CA */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + 43F88BE227762981008AF6A5 /* fr-CA */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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 = 12.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; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 87CYK2AQPY; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PRODUCT_BUNDLE_IDENTIFIER = com.brudski.NuptialTracker; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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 = 12.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_LOCALIZABILITY_NONLOCALIZED = YES; + 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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 = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "$(inherited)"; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 87CYK2AQPY; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PRODUCT_BUNDLE_IDENTIFIER = com.brudski.NuptialTracker; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 87CYK2AQPY; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PRODUCT_BUNDLE_IDENTIFIER = com.brudski.NuptialTracker; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + 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 0000000..919434a --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + 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 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + 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 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..c87d15a --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..02acfde --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,19 @@ +import UIKit +import Flutter +import GoogleMaps + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + + guard let mapsAPIKey = Bundle.main.object(forInfoDictionaryKey: "Google Maps API Key") as? String else { + fatalError("Maps API key not found!") + } + GMSServices.provideAPIKey(mapsAPIKey) + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue1024.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue1024.png new file mode 100644 index 0000000..03fdd69 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue1024.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue120.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue120.png new file mode 100644 index 0000000..e71cfde Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue120.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue152.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue152.png new file mode 100644 index 0000000..9b01895 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue152.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue167.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue167.png new file mode 100644 index 0000000..1e42c69 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue167.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue180.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue180.png new file mode 100644 index 0000000..424bce2 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue180.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue40.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue40.png new file mode 100644 index 0000000..8cf1b06 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue40.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue58.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue58.png new file mode 100644 index 0000000..59e13d9 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue58.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue60.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue60.png new file mode 100644 index 0000000..66c752c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue60.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue80.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue80.png new file mode 100644 index 0000000..8cd6a80 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue80.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue87.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue87.png new file mode 100644 index 0000000..aea13cb Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/AntIconNewShortBlue87.png differ 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 0000000..4fafd33 --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "filename" : "AntIconNewShortBlue40.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShortBlue60.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShortBlue58.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue87.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue80.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShortBlue120.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShortBlue120.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "AntIconNewShortBlue180.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShortBlue40.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue58.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue40.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShortBlue80.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "AntIconNewShortBlue152.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "AntIconNewShortBlue167.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "AntIconNewShortBlue1024.png", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/Contents.json new file mode 100644 index 0000000..dd3b87d --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "filename" : "newdevicon40.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "newdevicon60.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "newdevicon58.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "newdevicon87.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "newdevicon80.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "newdevicon120.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "newdevicon120.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "newdevicon180.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "filename" : "newdevicon40.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "newdevicon58.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "newdevicon40.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "filename" : "newdevicon80.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "newdevicon152.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "newdevicon167.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "newdevicon1024.png", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon1024.png b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon1024.png new file mode 100644 index 0000000..62d9f2b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon1024.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon120.png b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon120.png new file mode 100644 index 0000000..9cf9f0d Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon120.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon152.png b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon152.png new file mode 100644 index 0000000..edad583 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon152.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon167.png b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon167.png new file mode 100644 index 0000000..e111db6 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon167.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon180.png b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon180.png new file mode 100644 index 0000000..83b71bd Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon180.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon40.png b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon40.png new file mode 100644 index 0000000..1b7089e Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon40.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon58.png b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon58.png new file mode 100644 index 0000000..c91c937 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon58.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon60.png b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon60.png new file mode 100644 index 0000000..bff799c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon60.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon80.png b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon80.png new file mode 100644 index 0000000..60ab79c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon80.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon87.png b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon87.png new file mode 100644 index 0000000..e19e67c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDev.appiconset/newdevicon87.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort1024.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort1024.png new file mode 100644 index 0000000..e9b009c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort1024.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort120-1.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort120-1.png new file mode 100644 index 0000000..a2e0787 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort120-1.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort120.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort120.png new file mode 100644 index 0000000..a2e0787 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort120.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort152.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort152.png new file mode 100644 index 0000000..9ef773c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort152.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort167.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort167.png new file mode 100644 index 0000000..78493a7 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort167.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort180.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort180.png new file mode 100644 index 0000000..fb2073a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort180.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort40-1.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort40-1.png new file mode 100644 index 0000000..b532aae Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort40-1.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort40-2.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort40-2.png new file mode 100644 index 0000000..b532aae Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort40-2.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort40.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort40.png new file mode 100644 index 0000000..b532aae Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort40.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort58-1.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort58-1.png new file mode 100644 index 0000000..67a3e5b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort58-1.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort58.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort58.png new file mode 100644 index 0000000..67a3e5b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort58.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort60.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort60.png new file mode 100644 index 0000000..5f4aff3 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort60.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort80-1.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort80-1.png new file mode 100644 index 0000000..124d5de Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort80-1.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort80.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort80.png new file mode 100644 index 0000000..124d5de Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort80.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort87.png b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort87.png new file mode 100644 index 0000000..1ecce8c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/AntIconNewShort87.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/Contents.json new file mode 100644 index 0000000..4ed9246 --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIconDevOld.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "filename" : "AntIconNewShort40-2.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShort60.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShort58-1.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShort87.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShort80-1.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShort120-1.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShort120.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "AntIconNewShort180.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShort40-1.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShort58.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShort40.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShort80.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "AntIconNewShort152.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "AntIconNewShort167.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "AntIconNewShort1024.png", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue1024.png b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue1024.png new file mode 100644 index 0000000..58ac1c5 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue1024.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue120.png b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue120.png new file mode 100644 index 0000000..2c7cb2b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue120.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue152.png b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue152.png new file mode 100644 index 0000000..336313f Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue152.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue167.png b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue167.png new file mode 100644 index 0000000..0f3c1a2 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue167.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue180.png b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue180.png new file mode 100644 index 0000000..debb586 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue180.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue40.png b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue40.png new file mode 100644 index 0000000..83d37e9 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue40.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue58.png b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue58.png new file mode 100644 index 0000000..b1efc37 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue58.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue60.png b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue60.png new file mode 100644 index 0000000..81c84c4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue60.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue80.png b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue80.png new file mode 100644 index 0000000..49253e5 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue80.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue87.png b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue87.png new file mode 100644 index 0000000..a2e82c1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/AntIconNewShortBlue87.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/Contents.json new file mode 100644 index 0000000..4fafd33 --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIconOld.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "filename" : "AntIconNewShortBlue40.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShortBlue60.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShortBlue58.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue87.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue80.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShortBlue120.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShortBlue120.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "AntIconNewShortBlue180.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShortBlue40.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue58.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue40.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShortBlue80.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "AntIconNewShortBlue152.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "AntIconNewShortBlue167.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "AntIconNewShortBlue1024.png", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue1024.png b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue1024.png new file mode 100644 index 0000000..586c150 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue1024.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue120.png b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue120.png new file mode 100644 index 0000000..03e48c5 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue120.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue152.png b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue152.png new file mode 100644 index 0000000..e077073 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue152.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue167.png b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue167.png new file mode 100644 index 0000000..2c50cc0 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue167.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue180.png b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue180.png new file mode 100644 index 0000000..5cecf70 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue180.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue40.png b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue40.png new file mode 100644 index 0000000..8e75527 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue40.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue58.png b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue58.png new file mode 100644 index 0000000..49e73a9 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue58.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue60.png b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue60.png new file mode 100644 index 0000000..cdc2827 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue60.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue80.png b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue80.png new file mode 100644 index 0000000..5a71fd5 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue80.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue87.png b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue87.png new file mode 100644 index 0000000..a780118 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/AntIconNewShortBlue87.png differ diff --git a/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/Contents.json new file mode 100644 index 0000000..4fafd33 --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIconOld2.appiconset/Contents.json @@ -0,0 +1,113 @@ +{ + "images" : [ + { + "filename" : "AntIconNewShortBlue40.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShortBlue60.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShortBlue58.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue87.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue80.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShortBlue120.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShortBlue120.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "AntIconNewShortBlue180.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "filename" : "AntIconNewShortBlue40.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue58.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "AntIconNewShortBlue40.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "filename" : "AntIconNewShortBlue80.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "AntIconNewShortBlue152.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "AntIconNewShortBlue167.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "AntIconNewShortBlue1024.png", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/Runner/Assets.xcassets/Contents.json b/ios/Runner/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ios/Runner/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} 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 0000000..0bedcf2 --- /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 0000000..9da19ea 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 0000000..9da19ea 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 0000000..9da19ea 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 0000000..89c2725 --- /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/Assets.xcassets/launchBackground.colorset/Contents.json b/ios/Runner/Assets.xcassets/launchBackground.colorset/Contents.json new file mode 100644 index 0000000..b82c1e7 --- /dev/null +++ b/ios/Runner/Assets.xcassets/launchBackground.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "55", + "green" : "55", + "red" : "55" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/Runner/Assets.xcassets/launchTop.colorset/Contents.json b/ios/Runner/Assets.xcassets/launchTop.colorset/Contents.json new file mode 100644 index 0000000..f35df12 --- /dev/null +++ b/ios/Runner/Assets.xcassets/launchTop.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "244", + "green" : "159", + "red" : "73" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "55", + "green" : "55", + "red" : "55" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..e4d16ab --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Info-Debug.plist b/ios/Runner/Info-Debug.plist new file mode 100644 index 0000000..cf992e3 --- /dev/null +++ b/ios/Runner/Info-Debug.plist @@ -0,0 +1,76 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + $(APP_NAME) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLocalizations + + en + fr + + CFBundleName + $(APP_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + Google Maps API Key + $(MAPS_API_KEY) + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + + NSBonjourServices + + _dartobservatory._tcp + + NSCameraUsageDescription + $(NSCameraUsageDescription) + NSLocationWhenInUseUsageDescription + $(NSLocationWhenInUseUsageDescription) + NSPhotoLibraryUsageDescription + $(NSPhotoLibraryUsageDescription) + UIBackgroundModes + + fetch + remote-notification + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/ios/Runner/Info-Release.plist b/ios/Runner/Info-Release.plist new file mode 100644 index 0000000..e9b0e79 --- /dev/null +++ b/ios/Runner/Info-Release.plist @@ -0,0 +1,74 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + $(APP_NAME) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLocalizations + + en + fr + + CFBundleName + $(APP_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + Google Maps API Key + $(MAPS_API_KEY) + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + + NSCameraUsageDescription + $(NSCameraUsageDescription) + NSLocationWhenInUseUsageDescription + Use location features to get current location for reporting flights and filtering flights based on proximity. + NSPhotoLibraryUsageDescription + Upload existing pictures of ant nuptial flights from your photo library. + NSAppleMusicUsageDescription + $(NSAppleMusicUsageDescription) + UIBackgroundModes + + fetch + remote-notification + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements new file mode 100644 index 0000000..903def2 --- /dev/null +++ b/ios/Runner/Runner.entitlements @@ -0,0 +1,8 @@ + + + + + aps-environment + development + + diff --git a/ios/Runner/en.lproj/Info.plist b/ios/Runner/en.lproj/Info.plist new file mode 100644 index 0000000..b2c7a3c --- /dev/null +++ b/ios/Runner/en.lproj/Info.plist @@ -0,0 +1,73 @@ + + + + + CFBundleLocalizations + + en + fr + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(APP_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + Google Maps API Key + $(MAPS_API_KEY) + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + 192.168.2.31 + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + + + + NSLocationWhenInUseUsageDescription + Enable location features when reporting flights and filtering flights. + NSCameraUsageDescription + Take pictures of nuptial flights + NSPhotoLibraryUsageDescription + Use existing pictures of nuptial flights + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/ios/Runner/en.lproj/InfoPlist.strings b/ios/Runner/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..0e8ee0d --- /dev/null +++ b/ios/Runner/en.lproj/InfoPlist.strings @@ -0,0 +1,15 @@ +/* + InfoPlist.strings + Runner + + Created by Benjamin Rudski on 2021-12-24. + +*/ + +NSLocationWhenInUseUsageDescription = "Use location features to get current location for reporting flights and filtering flights based on proximity."; + +NSCameraUsageDescription = "Use camera to take pictures of ant nuptial flights."; + +NSPhotoLibraryUsageDescription = "Upload existing pictures of ant nuptial flights from your photo library."; + +NSAppleMusicUsageDescription = "Upload existing pictures of ant nuptial flights from your photo library."; diff --git a/ios/Runner/fr-CA.lproj/Info.plist b/ios/Runner/fr-CA.lproj/Info.plist new file mode 100644 index 0000000..b2c7a3c --- /dev/null +++ b/ios/Runner/fr-CA.lproj/Info.plist @@ -0,0 +1,73 @@ + + + + + CFBundleLocalizations + + en + fr + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(APP_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + Google Maps API Key + $(MAPS_API_KEY) + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + 192.168.2.31 + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + + + + NSLocationWhenInUseUsageDescription + Enable location features when reporting flights and filtering flights. + NSCameraUsageDescription + Take pictures of nuptial flights + NSPhotoLibraryUsageDescription + Use existing pictures of nuptial flights + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/ios/Runner/fr-CA.lproj/InfoPlist.strings b/ios/Runner/fr-CA.lproj/InfoPlist.strings new file mode 100644 index 0000000..2ac12df --- /dev/null +++ b/ios/Runner/fr-CA.lproj/InfoPlist.strings @@ -0,0 +1,13 @@ +/* + InfoPlist.strings + Runner + + Created by Benjamin Rudski on 2021-12-24. + +*/ + +NSLocationWhenInUseUsageDescription = "Utiliser les services de localisation pour enregistrer des vols nuptials et pour réorganiser la liste de vols par distance."; + +NSCameraUsageDescription = "Utiliser la caméra pour prendre des photos de vols nuptials de fourmis."; + +NSPhotoLibraryUsageDescription = "Insérer des photos de vols nuptials de votre galerie de photos."; diff --git a/ios/Runner/fr-CA.lproj/LaunchScreen.strings b/ios/Runner/fr-CA.lproj/LaunchScreen.strings new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ios/Runner/fr-CA.lproj/LaunchScreen.strings @@ -0,0 +1 @@ + diff --git a/ios/Runner/fr-CA.lproj/Main.strings b/ios/Runner/fr-CA.lproj/Main.strings new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ios/Runner/fr-CA.lproj/Main.strings @@ -0,0 +1 @@ + diff --git a/l10n.yaml b/l10n.yaml new file mode 100644 index 0000000..c20c760 --- /dev/null +++ b/l10n.yaml @@ -0,0 +1,5 @@ +arb-dir: lib/l10n +template-arb-file: app_en.arb +output_localization-file: app_localizations.dart +header: import 'package:intl/intl.dart' as intl; +untranslated-messages-file: untranslated_messages.txt \ No newline at end of file diff --git a/lib/changelog.dart b/lib/changelog.dart new file mode 100644 index 0000000..6b54b62 --- /dev/null +++ b/lib/changelog.dart @@ -0,0 +1,80 @@ +/* + * changelog.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; +import 'package:ant_nup_tracker/sessions.dart'; +import 'package:ant_nup_tracker/url_manager.dart'; +import 'package:http/http.dart' as http; +import 'package:json_annotation/json_annotation.dart'; + +import 'exceptions.dart'; + +part 'changelog.g.dart'; + +@JsonSerializable() +class Changelog { + String user; + DateTime date; + String event; + + Changelog(this.user, this.date, this.event); + + factory Changelog.fromJson(Map json) => + _$ChangelogFromJson(json); + Map toJson() => _$ChangelogToJson(this); +} + + +Future> fetchChangelogForFlight(int id) async { + final changelogUrl = UrlManager.shared.urlForHistory(id); + // return await Future.delayed(Duration(seconds: 3), ()=>throw NoResponseException()); + try { + final response = await http.get(changelogUrl, headers: SessionManager.shared.headers); + + if (response.statusCode == 401) throw FailedAuthenticationException(); + if (response.statusCode != 200) throw ReadException(response.statusCode); + + try { + final parsedChanges = jsonDecode(response.body).cast< + Map>(); + return parsedChanges + .map((json) => Changelog.fromJson(json)) + .toList(); + } catch (err, stack) { + // print(err); + // print(stack); + throw JsonException(); + } + } catch (error) { + throw NoResponseException(); + } +} + +// Future main() async { +// const id = 19; +// final changelog = await fetchChangelogForFlight(id); +// +// // for (final change in changelog){ +// // // print("Reading change:"); +// // // print(change.event); +// // } +// +// // print("Done changelog!"); +// } \ No newline at end of file diff --git a/lib/changelog.g.dart b/lib/changelog.g.dart new file mode 100644 index 0000000..1ae8a55 --- /dev/null +++ b/lib/changelog.g.dart @@ -0,0 +1,41 @@ +/* + * changelog.g.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'changelog.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Changelog _$ChangelogFromJson(Map json) { + return Changelog( + json['user'] as String, + DateTime.parse(json['date'] as String), + json['event'] as String, + ); +} + +Map _$ChangelogToJson(Changelog instance) => { + 'user': instance.user, + 'date': instance.date.toIso8601String(), + 'event': instance.event, + }; diff --git a/lib/changelog_screen.dart b/lib/changelog_screen.dart new file mode 100644 index 0000000..17a942a --- /dev/null +++ b/lib/changelog_screen.dart @@ -0,0 +1,120 @@ +/* + * changelog_screen.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:ant_nup_tracker/changelog.dart'; +import 'package:ant_nup_tracker/detail_screen.dart'; +// import 'package:ant_nup_tracker/user.dart'; +// import 'package:ant_nup_tracker/users.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:intl/intl.dart'; + +// import 'exceptions.dart'; + +class ChangelogScreen extends DetailScreen> { + // final int _id; + + const ChangelogScreen(int id, {List? initialValue, Key? key}) + : super(id, initialValue: initialValue, key: key); + + @override + _ChangelogScreenState createState() => _ChangelogScreenState(); +} + +class _ChangelogScreenState extends DetailScreenState> { + late TextStyle _labelStyle; + + _ChangelogScreenState() : super(); + + @override + Widget buildDetailScreen(List history) { + final appLocalization = AppLocalizations.of(context)!; + final currentLocale = appLocalization.localeName; + + TextStyle changelogTextStyle = _labelStyle.apply(fontSizeFactor: 1, fontWeightDelta: 2); + + return ListView.builder( + itemCount: history.length * 2, + itemBuilder: (context, index) { + if (index.isOdd) return const Divider(); + final changelog = history[index ~/ 2]; + + return Container( + margin: const EdgeInsets.all(12.0), + child: Column( + children: [ + Container( + margin: const EdgeInsets.symmetric(vertical: 12.0), + child: Row( + children: [ + Expanded( + child: + Text(changelog.event, style: changelogTextStyle)), + ], + ), + ), + Row( + children: [ + Expanded( + child: Text( + changelog.user, + style: _labelStyle, + textAlign: TextAlign.end, + )), + ], + ), + Row( + children: [ + Expanded( + child: Text( + DateFormat.yMMMd(currentLocale) + .add_jm() + .format(changelog.date), + style: _labelStyle, + textAlign: TextAlign.end, + )), + ], + ) + ], + ), + ); + }, + ); + } + + @override + void loadDetailFuture(int id, {bool forceReload = false}) { + setState(() { + detailFuture = fetchChangelogForFlight(id); + }); + } + + @override + String get appBarHeader => + AppLocalizations.of(context)!.flightHistoryAppBarHeader(id); + + @override + Widget build(BuildContext context) { + _labelStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontSizeDelta: 4.0); + + return super.build(context); + } +} diff --git a/lib/comments.dart b/lib/comments.dart new file mode 100644 index 0000000..2138c3b --- /dev/null +++ b/lib/comments.dart @@ -0,0 +1,121 @@ +/* + * comments.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; +import 'dart:io'; + +import 'package:ant_nup_tracker/exceptions.dart'; +import 'package:ant_nup_tracker/url_manager.dart'; +import 'package:ant_nup_tracker/users.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:http/http.dart' as http; + +import 'sessions.dart'; + +part 'comments.g.dart'; + +@JsonSerializable() +class Comment { + final int id; + @JsonKey(name: 'flight') + final int flightID; + final String author; + + @JsonKey(name: 'role') + final Role authorRole; + final String text; + final DateTime time; + + const Comment(this.id, this.flightID, this.author, this.authorRole, this.text, + this.time); + + factory Comment.fromJson(Map json) => + _$CommentFromJson(json); + + // Map toJson() => _$CommentToJson(this); + Map toJson() => { + "text": text, + }; +} + +Future> getCommentsForFlight(int id) async { + final url = UrlManager.shared.urlForComments(id); + + try { + + final response = await http.get(url, headers: SessionManager.shared.headers); + + final status = response.statusCode; + + if (status != 200) throw ReadException(status); + + try { + final rawComments = jsonDecode(utf8.decode(response.bodyBytes)) as List; + final comments = rawComments.map((e) => Comment.fromJson(e)).toList(); + return comments; + } catch (e) { + throw JsonException(); + } + + } on IOException { + throw NoResponseException(); + } +} + +Future addNewComment(int id, String commentText) async { + // final data = comment.toJson(); + final data = { + "text": commentText + }; + final url = UrlManager.shared.urlForComments(id); + + final response = await http.post(url, body: jsonEncode(data), headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Token ${SessionManager.shared.session!.token}', + }); + + // print(response.statusCode); + // print(response.body); + + final statusCode = response.statusCode; + + if (statusCode == 404) throw NoFlightException(id); + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode != 201) throw CommentCreationException(statusCode); +} + +Future updateComment(int id, Comment comment) async { + final data = comment.toJson(); + final url = UrlManager.shared.urlForCommentEdit(id, comment.id); + + final response = await http.put(url, body: jsonEncode(data), headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Token ${SessionManager.shared.session!.token}', + }); + + // print(response.statusCode); + // print(response.body); + + final statusCode = response.statusCode; + + if (statusCode == 404) throw NoFlightException(id); + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode != 200) throw CommentCreationException(statusCode); +} \ No newline at end of file diff --git a/lib/comments.g.dart b/lib/comments.g.dart new file mode 100644 index 0000000..5211e4d --- /dev/null +++ b/lib/comments.g.dart @@ -0,0 +1,79 @@ +/* + * comments.g.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'comments.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Comment _$CommentFromJson(Map json) { + return Comment( + json['id'] as int, + json['flight'] as int, + json['author'] as String, + _$enumDecode(_$RoleEnumMap, json['role']), + json['text'] as String, + DateTime.parse(json['time'] as String), + ); +} + +// Map _$CommentToJson(Comment instance) => { +// 'id': instance.id, +// 'flight': instance.flightID, +// 'author': instance.author, +// 'role': _$RoleEnumMap[instance.authorRole], +// 'text': instance.text, +// 'time': instance.time.toIso8601String(), +// }; + +K _$enumDecode( + Map enumValues, + Object? source, { + K? unknownValue, +}) { + if (source == null) { + throw ArgumentError( + 'A value must be provided. Supported values: ' + '${enumValues.values.join(', ')}', + ); + } + + return enumValues.entries.singleWhere( + (e) => e.value == source, + orElse: () { + if (unknownValue == null) { + throw ArgumentError( + '`$source` is not one of the supported values: ' + '${enumValues.values.join(', ')}', + ); + } + return MapEntry(unknownValue, enumValues.values.first); + }, + ).key; +} + +const _$RoleEnumMap = { + Role.citizen: 0, + Role.professional: 1, + Role.flagged: -1, +}; diff --git a/lib/common_ui_elements.dart b/lib/common_ui_elements.dart new file mode 100644 index 0000000..58e5974 --- /dev/null +++ b/lib/common_ui_elements.dart @@ -0,0 +1,53 @@ +/* + * common_ui_elements.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:flutter/material.dart'; + +class HeaderRow extends StatelessWidget { + const HeaderRow({required this.label, this.headerStyle, Key? key}) : super(key: key); + + final TextStyle? headerStyle; + final String label; + + @override + Widget build(BuildContext context) { + final textStyle = headerStyle ?? Theme.of(context).textTheme.headline6; + + return Column( + children: [ + const Divider( + thickness: 1, + ), + Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Text(label, style: textStyle)), + ], + ), + ), + const Divider( + thickness: 1, + ) + ], + ); + } +} \ No newline at end of file diff --git a/lib/dark_mode_theme_ext.dart b/lib/dark_mode_theme_ext.dart new file mode 100644 index 0000000..96d631e --- /dev/null +++ b/lib/dark_mode_theme_ext.dart @@ -0,0 +1,28 @@ +/* + * dark_mode_theme_ext.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ +import 'package:flutter/material.dart'; + +extension DarkMode on Theme { + bool get isDarkMode => data.brightness == Brightness.dark; +} + +extension DarkModeData on ThemeData { + bool get isDarkMode => brightness == Brightness.dark; +} \ No newline at end of file diff --git a/lib/detail_screen.dart b/lib/detail_screen.dart new file mode 100644 index 0000000..6ba6eb0 --- /dev/null +++ b/lib/detail_screen.dart @@ -0,0 +1,127 @@ +/* + * detail_screen.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:flutter/material.dart'; + +import 'exceptions.dart'; + +abstract class DetailScreen extends StatefulWidget { + const DetailScreen(this.id, {this.initialValue, Key? key}) : super(key: key); + + @protected + final K id; + + @protected + final T? initialValue; + + // @override + // _DetailScreenState createState() => _DetailScreenState(); +} + +abstract class DetailScreenState extends State> { + // DetailScreenState(this.id, {this.initialValue}); + DetailScreenState(); + + @protected + late final K id; + + @protected + late final T? initialValue; + + @protected + late Future detailFuture; + + @protected + void loadDetailFuture(K id, {bool forceReload = false}); + + @override + void initState() { + super.initState(); + id = widget.id; + initialValue = widget.initialValue; + if (initialValue == null) { + loadDetailFuture(id); + } else { + detailFuture = Future(() => initialValue!); + } + } + + @protected + Widget buildDetailScreen(T result); + + /// Override to perform non-UI related data tasks + @protected + void processData(T data) {} + + @protected + String get appBarHeader; + + @protected + List actions = []; + + Widget _buildMainBody(BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState != ConnectionState.done) { + // print("Loading the detail screen."); + return const CircularProgressIndicator(); + } + + if (snapshot.hasData) { + return RefreshIndicator( + onRefresh: () async { + setState(() { + loadDetailFuture(id, forceReload: true); + }); + }, + child: buildDetailScreen(snapshot.data!)); + } else if (snapshot.hasError) { + final error = snapshot.error! as LocalisableException; + return ExceptionWidget(error, () => loadDetailFuture(id)); + } else { + return const CircularProgressIndicator(); + } + } + + @override + @mustCallSuper + Widget build(BuildContext context) { + return FutureBuilder( + future: detailFuture, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + processData(snapshot.data!); + }// else { + // print("Waiting for data............................."); + // } + + return Scaffold( + appBar: AppBar( + title: Text(appBarHeader), + actions: actions, + ), + body: SafeArea( + child: Center( + child: _buildMainBody(context, snapshot), + ), + ), + ); + }); + } +} diff --git a/lib/exceptions.dart b/lib/exceptions.dart new file mode 100644 index 0000000..d1b23a6 --- /dev/null +++ b/lib/exceptions.dart @@ -0,0 +1,515 @@ +/* + * exceptions.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + +abstract class LocalisableException implements Exception { + String getLocalisedName(BuildContext context); + String getLocalisedDescription(BuildContext context); +} + +class ReadException implements LocalisableException { + final int status; + ReadException(this.status); + + @override + String toString() => "Read Exception: Server returned status $status"; + + @override + String getLocalisedDescription(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.readExceptionBody(status); + } + + @override + String getLocalisedName(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.readExceptionHeader; + } +} + +class JsonException implements LocalisableException { + @override + String getLocalisedDescription(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.jsonExceptionBody; + } + + @override + String getLocalisedName(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.jsonExceptionHeader; + } +} + +class GetException implements LocalisableException { + final int status; + GetException(this.status); + + @override + String toString() => "Get Exception: Server returned status $status"; + + @override + String getLocalisedDescription(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.getExceptionBody(status); + } + + @override + String getLocalisedName(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.getExceptionHeader; + } +} + +class InvalidIdException implements LocalisableException { + @override + String getLocalisedDescription(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.invalidIdExceptionBody; + } + + @override + String getLocalisedName(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.invalidIdExceptionHeader; + } +} + +class NoFlightException implements LocalisableException { + final int id; + + NoFlightException(this.id); + + @override + String getLocalisedDescription(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.noFlightExceptionBody(id); + } + + @override + String getLocalisedName(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.noFlightExceptionHeader; + } +} + +class NoImageException implements LocalisableException { + final int id; + + NoImageException(this.id); + + @override + String getLocalisedDescription(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.noImageExceptionBody(id); + } + + @override + String getLocalisedName(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.noImageExceptionHeader; + } +} + +class InvalidImageTypeException implements LocalisableException { + final String? mimeType; + + InvalidImageTypeException([this.mimeType]); + + @override + String getLocalisedDescription(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.invalidImageTypeExceptionBody(mimeType ?? "none"); + } + + @override + String getLocalisedName(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.invalidImageTypeExceptionHeader; + } +} + +class NoResponseException implements LocalisableException { + @override + String getLocalisedDescription(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.noResponseExceptionBody; + } + + @override + String getLocalisedName(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.noResponseExceptionHeader; + } +} + +class FailedAuthenticationException implements LocalisableException { + @override + String getLocalisedDescription(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.failedAuthenticationExceptionBody; + } + + @override + String getLocalisedName(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.failedAuthenticationExceptionHeader; + } +} + +class NoWeatherException implements LocalisableException { + final int _id; + + const NoWeatherException(this._id); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.noWeatherExceptionBody(_id); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.noWeatherExceptionHeader; + } +} + +class EmptyUsernamePasswordException implements LocalisableException { + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.emptyUsernamePasswordExceptionBody; + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.emptyUsernamePasswordExceptionHeader; + } +} + +class IncorrectCredentialsException implements LocalisableException { + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.incorrectCredentialsExceptionBody; + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.incorrectCredentialsExceptionHeader; + } +} + +class ForbiddenAccessException implements LocalisableException { + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.forbiddenAccessExceptionBody; + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.forbiddenAccessExceptionHeader; + } +} + +class InsufficientPrivilegesException implements LocalisableException { + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.insufficientPrivilegesExceptionBody; + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.insufficientPrivilegesExceptionHeader; + } +} + +class LoginException implements LocalisableException { + final int status; + + LoginException(this.status); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.loginExceptionBody(status); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.loginExceptionHeader; + } +} + +class LogoutException implements LocalisableException { + final int status; + + LogoutException(this.status); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.logoutExceptionBody(status); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.logoutExceptionHeader; + } +} + +class AddFlightException implements LocalisableException { + final int _status; + + AddFlightException(this._status); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.addFlightExceptionBody(_status); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.addFlightExceptionHeader; + } + +} + +class EditFlightException implements LocalisableException { + final int _status; + + EditFlightException(this._status); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.editFlightExceptionBody(_status); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.editFlightExceptionHeader; + } + +} + +class CommentCreationException implements LocalisableException { + final int _status; + + CommentCreationException(this._status); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.commentCreationExceptionBody(_status); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.commentCreationExceptionHeader; + } + +} + +class FlightVerificationException implements LocalisableException { + final int _status; + + FlightVerificationException(this._status); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.flightVerificationExceptionBody(_status); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.flightVerificationExceptionHeader; + } + +} + +class ImageCreationException implements LocalisableException { + final int _status; + + ImageCreationException(this._status); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.imageCreationExceptionBody(_status); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.imageCreationExceptionHeader; + } + +} + +class ImageDeletionException implements LocalisableException { + final int _status; + + ImageDeletionException(this._status); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.imageDeletionExceptionBody(_status); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.imageDeletionExceptionHeader; + } + +} + +class NotImageRowException implements LocalisableException { + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.notImageRowExceptionBody; + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.notImageRowExceptionHeader; + } +} + +class NotificationUpdateException implements LocalisableException { + final int _status; + + NotificationUpdateException(this._status); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.notificationUpdateExceptionBody(_status); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.notificationUpdateExceptionHeader; + } + +} + +class TokenVerificationException implements LocalisableException { + final int _status; + + TokenVerificationException(this._status); + + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.tokenVerificationExceptionBody(_status); + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.tokenVerificationExceptionHeader; + } + +} + +class GenusNotFoundException implements LocalisableException { + final int id; + + GenusNotFoundException(this.id); + + @override + String getLocalisedDescription(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.genusNotFoundExceptionBody(id); + } + + @override + String getLocalisedName(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.genusNotFoundExceptionHeader; + } +} + +class NoFlightResultsException implements LocalisableException { + @override + String getLocalisedDescription(BuildContext context) { + return AppLocalizations.of(context)!.noFlightResultsExceptionBody; + } + + @override + String getLocalisedName(BuildContext context) { + return AppLocalizations.of(context)!.noFlightResultsExceptionHeader; + } +} + +class ExceptionWidget extends StatelessWidget { + final LocalisableException _exception; + final void Function()? _tryAgainAction; + final IconData _iconData; + + const ExceptionWidget(this._exception, this._tryAgainAction, {Key? key, IconData icon = Icons.error}) + : _iconData = icon, super(key: key); + + @override + Widget build(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + // final _labelStyle = + // Theme.of(context).textTheme.bodyText2!.apply(fontSizeDelta: 4.0); + + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Icon( + _iconData, + size: 96, + color: Theme.of(context).colorScheme.primary, + ), + Row( + children: [ + Expanded( + child: Text( + _exception.getLocalisedName(context), + // style: Theme.of(context).textTheme.headline5, + textAlign: TextAlign.center, + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: Text( + _exception.getLocalisedDescription(context), + // style: _labelStyle, + textAlign: TextAlign.center, + ), + ), + ], + ), + if (_tryAgainAction != null) TextButton( + onPressed: () { + _tryAgainAction!(); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(appLocalization.tryAgainButton), + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/filtering.dart b/lib/filtering.dart new file mode 100644 index 0000000..4ba7e7d --- /dev/null +++ b/lib/filtering.dart @@ -0,0 +1,2076 @@ +/* + * filtering.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; +import 'dart:io'; + +import 'package:ant_nup_tracker/common_ui_elements.dart'; +import 'package:ant_nup_tracker/location_picker.dart'; +import 'package:ant_nup_tracker/users.dart'; +import 'package:flutter/material.dart'; +import 'package:collection/collection.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:intl/intl.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; + +import 'flights.dart'; + +enum ListOrdering { + flightId, + dateOfFlight, + dateRecorded, + // lastUpdated, + location +} + +final _orderingEnumMap = { + ListOrdering.flightId: 0, + ListOrdering.dateOfFlight: 1, + ListOrdering.dateRecorded: 2, + ListOrdering.location: 3 +}; + +enum SortingDirection { ascending, descending } + +final _sortingDirectionEnumMap = { + SortingDirection.ascending: 1, + SortingDirection.descending: -1 +}; + +abstract class ListFilter { + // String get urlString; + Map get queryParameters; + Map toJson(); +} + +// class TaxonomyFilter implements ListFilter { +// const TaxonomyFilter(this._genus, [this._species]); +// +// final String _genus; +// final String? _species; +// +// @override +// Map get queryParameters => +// {"genus": _genus, if (_species != null) "species": _species!}; +// } + +class TaxonomyFilter implements ListFilter { + TaxonomyFilter( + {Iterable genera = const [], + Iterable species = const []}) { + _genera.addAll(genera); + _species.addAll(species); + } + + // TaxonomyFilter.fromStrings( + // Iterable genera, Iterable> species) { + // for (var genus in genera) { + // _genera.add(Genus.get(genus)); + // } + // + // for (var taxonomy in species) { + // final genusName = taxonomy.item1; + // final speciesName = taxonomy.item2; + // + // final genus = Genus.get(genusName); + // final speciesObject = Species.get(genus, speciesName); + // + // _species.add(speciesObject); + // } + // } + + final _genera = []; + final _species = []; + + List get genera => List.unmodifiable(_genera); + List get species => List.unmodifiable(_species); + + String _generateTaxonomyString() => _genera + .map((e) => e.toString()) + .followedBy(_species.map((e) => e.toString())) + .join(","); + + @override + Map get queryParameters => + {"taxonomy": _generateTaxonomyString()}; + + @override + bool operator ==(Object other) { + if (other is! TaxonomyFilter) return false; + if (identical(this, other)) return true; + + const genusListEquality = ListEquality(); + const speciesListEquality = ListEquality(); + + return genusListEquality.equals(_genera, other._genera) && + speciesListEquality.equals(_species, other._species); + } + + @override + int get hashCode => + genera.fold( + 0, (previousValue, element) => previousValue + element.hashCode) + + species.fold( + 0, (previousValue, element) => previousValue + element.hashCode); + + @override + Map toJson() { + return { + 'genera': _genera.map((e) => e.id).toList(growable: false), + 'species': _species.map((e) => e.id).toList(growable: false) + }; + } + + factory TaxonomyFilter.fromJson(Map json) { + final genusIds = json['genera'] as List; + final speciesIds = json['species'] as List; + + final genera = genusIds.map((e) => Genus.get(e as int)); + final species = speciesIds.map((e) => Species.get(e as int)); + + return TaxonomyFilter(genera: genera, species: species); + } +} + +class DateFilter implements ListFilter { + DateFilter([this.maxDate, this.minDate]); + + final DateTime? maxDate; + final DateTime? minDate; + + final _dateFormatter = DateFormat("y-M-d"); + + @override + Map get queryParameters => { + if (maxDate != null) "max_date": _dateFormatter.format(maxDate!), + if (minDate != null) "min_date": _dateFormatter.format(minDate!), + }; + + @override + bool operator ==(Object other) { + if (other is! DateFilter) return false; + if (identical(this, other)) return true; + + return maxDate == other.maxDate && minDate == other.minDate; + } + + @override + int get hashCode => maxDate.hashCode + minDate.hashCode; + + @override + Map toJson() { + return { + 'maxDate': maxDate?.toIso8601String(), + 'minDate': minDate?.toIso8601String() + }; + } + + factory DateFilter.fromJson(Map json) { + final maxDateString = json['maxDate'] as String?; + final minDateString = json['minDate'] as String?; + + final maxDate = + maxDateString != null ? DateTime.parse(maxDateString) : null; + final minDate = + minDateString != null ? DateTime.parse(minDateString) : null; + + return DateFilter(maxDate, minDate); + } +} + +class LocationFilter implements ListFilter { + const LocationFilter(this.location); + + final LatLng location; + + @override + Map get queryParameters => + {"loc": "${location.latitude},${location.longitude}"}; + + @override + bool operator ==(Object other) { + if (other is! LocationFilter) return false; + if (identical(this, other)) return true; + + return other.location == location; + } + + @override + int get hashCode => location.hashCode; + + @override + Map toJson() { + return {'location': location.toJson()}; + } + + factory LocationFilter.fromJson(Map json) { + final locationString = json['location']; + final location = LatLng.fromJson(locationString)!; + + return LocationFilter(location); + } +} + +class ImageFilter implements ListFilter { + const ImageFilter(this.hasImages); + + final bool hasImages; + + @override + Map get queryParameters => + {"has_images": hasImages.toString()}; + + @override + bool operator ==(Object other) { + if (other is! ImageFilter) return false; + if (identical(this, other)) return true; + + return other.hasImages == hasImages; + } + + @override + int get hashCode => hasImages.hashCode; + + @override + Map toJson() { + return {'hasImages': hasImages}; + } + + factory ImageFilter.fromJson(Map json) { + final hasImages = json['hasImages'] as bool; + + return ImageFilter(hasImages); + } +} + +class VerificationFilter implements ListFilter { + const VerificationFilter(this.verified, this.userRole); + + final bool? verified; + final Role? userRole; + + @override + Map get queryParameters => { + if (verified != null) "verified": verified!.toString(), + if (userRole != null) + "user_role": + userRole == Role.professional ? "professional" : "enthusiast" + }; + + @override + bool operator ==(Object other) { + if (other is! VerificationFilter) return false; + if (identical(this, other)) return true; + + return (verified == other.verified && userRole == other.userRole); + } + + static final _roleEnumMap = { + Role.citizen: 0, + Role.professional: 1, + Role.flagged: -1 + }; + + @override + Map toJson() { + return { + 'verified': verified, + 'userRole': userRole != null ? _roleEnumMap[userRole] : null + }; + } + + factory VerificationFilter.fromJson(Map json) { + final verified = json['verified'] as bool?; + final userRoleInt = json['userRole'] as int?; + + final Role? userRole = userRoleInt != null + ? _roleEnumMap.entries + .firstWhere((entry) => entry.value == userRoleInt) + .key + : null; + + return VerificationFilter(verified, userRole); + } + + @override + int get hashCode => verified.hashCode + userRole.hashCode; +} + +class FilteringManager { + FilteringManager._(); + static final shared = FilteringManager._(); + + DateFilter? dateFilter; + TaxonomyFilter? taxonomyFilter; + LocationFilter? locationFilter; + ImageFilter? imageFilter; + VerificationFilter? verificationFilter; + + void configureFrom(FilteringManager filteringManager) { + dateFilter = filteringManager.dateFilter; + taxonomyFilter = filteringManager.taxonomyFilter; + locationFilter = filteringManager.locationFilter; + imageFilter = filteringManager.imageFilter; + verificationFilter = filteringManager.verificationFilter; + ordering = filteringManager.ordering; + direction = filteringManager.direction; + } + + Future saveFilters() async { + final directory = await getApplicationDocumentsDirectory(); + final path = directory.path; + final file = File("$path/filtering.json"); + // print("Converting to JSON...."); + // print(toJson()); + // print(jsonEncode(toJson())); + file.writeAsString(jsonEncode(toJson())); + } + + Map toJson() => { + 'dateFilter': dateFilter?.toJson(), + 'taxonomyFilter': taxonomyFilter?.toJson(), + 'locationFilter': locationFilter?.toJson(), + 'imageFilter': imageFilter?.toJson(), + 'verificationFilter': verificationFilter?.toJson(), + 'ordering': _orderingEnumMap[ordering], + 'direction': _sortingDirectionEnumMap[direction], + }; + + Future get canLoadFilters async { + final directory = await getApplicationDocumentsDirectory(); + final path = directory.path; + final file = File("$path/filtering.json"); + + return await file.exists(); + } + + Future readFilters() async { + final directory = await getApplicationDocumentsDirectory(); + final path = directory.path; + final file = File("$path/filtering.json"); + + try { + final contents = await file.readAsString(); + final json = jsonDecode(contents); + final loaded = FilteringManager._fromJson(json); + shared.configureFrom(loaded); + } catch (error, stacktrace) { + // print(error); + // print(stacktrace); + } + } + + Future loadFilters() async { + if (await canLoadFilters) await readFilters(); + } + + factory FilteringManager._fromJson(Map json) { + final dateFilter = json['dateFilter'] != null + ? DateFilter?.fromJson(json['dateFilter']) + : null; + final taxonomyFilter = json['taxonomyFilter'] != null + ? TaxonomyFilter?.fromJson(json['taxonomyFilter']) + : null; + final locationFilter = json['locationFilter'] != null + ? LocationFilter?.fromJson(json['locationFilter']) + : null; + final imageFilter = json['imageFilter'] != null + ? ImageFilter?.fromJson(json['imageFilter']) + : null; + final verificationFilter = json['verificationFilter'] != null + ? VerificationFilter?.fromJson(json['verificationFilter']) + : null; + + final orderingInt = json['ordering'] as int; + + final ordering = _orderingEnumMap.entries + .firstWhere((entry) => entry.value == orderingInt) + .key; + + final directionInt = json['direction'] as int; + + final direction = _sortingDirectionEnumMap.entries + .firstWhere((entry) => entry.value == directionInt) + .key; + + final newFilteringManager = FilteringManager._(); + newFilteringManager.dateFilter = dateFilter; + newFilteringManager.taxonomyFilter = taxonomyFilter; + newFilteringManager.locationFilter = locationFilter; + newFilteringManager.imageFilter = imageFilter; + newFilteringManager.verificationFilter = verificationFilter; + newFilteringManager.ordering = ordering; + newFilteringManager.direction = direction; + + return newFilteringManager; + } + + List get filters => [ + if (locationFilter != null) locationFilter!, + if (dateFilter != null) dateFilter!, + if (taxonomyFilter != null) taxonomyFilter!, + if (imageFilter != null) imageFilter!, + if (verificationFilter != null) verificationFilter!, + ]; + + ListOrdering ordering = ListOrdering.flightId; + SortingDirection direction = SortingDirection.descending; +} + +class FilteringScreen extends StatefulWidget { + // const FilteringScreen({this.currentLocation, Key? key}) : super(key: key); + const FilteringScreen({Key? key}) : super(key: key); + + // final LatLng? currentLocation; + + @override + _FilteringScreenState createState() => _FilteringScreenState(); +} + +class _FilteringScreenState extends State + with TickerProviderStateMixin { + late AppLocalizations _appLocalizations; + late LatLng _currentLocation; + + var _ordering = FilteringManager.shared.ordering; + var _direction = FilteringManager.shared.direction; + var _dateFilter = FilteringManager.shared.dateFilter; + var _taxonomyFilter = FilteringManager.shared.taxonomyFilter; + var _locationFilter = FilteringManager.shared.locationFilter; + var _imageFilter = FilteringManager.shared.imageFilter; + var _verificationFilter = FilteringManager.shared.verificationFilter; + + @override + void initState() { + super.initState(); + _currentLocation = _locationFilter?.location ?? const LatLng(0, 0); + + // if (_locationFilter == null) { + // getCurrentLocation() + // .then((location) => _currentLocation = location ?? _currentLocation); + // } + } + + String _localizedOrderingName(ListOrdering listOrdering) { + switch (listOrdering) { + case ListOrdering.flightId: + return _appLocalizations.flightID; + case ListOrdering.dateOfFlight: + return _appLocalizations.dateOfFlight; + case ListOrdering.dateRecorded: + return _appLocalizations.dateRecordedDetailLabel; + case ListOrdering.location: + return _appLocalizations.distance; + } + } + + String _localizedSortingDirectionName(SortingDirection direction) { + switch (direction) { + case SortingDirection.ascending: + return _appLocalizations.ascending; + case SortingDirection.descending: + return _appLocalizations.descending; + } + } + + Widget _buildFilteringForm() { + return ListView( + primary: true, + padding: const EdgeInsets.all(16.0), + children: [ + HeaderRow(label: _appLocalizations.sorting), + _buildSortingSection(), + HeaderRow(label: _appLocalizations.filtering), + DateFilteringRow( + onFilteringChanged: (dateFilter) => _dateFilter = dateFilter, + filter: _dateFilter, + ), + TaxonomyFilteringRow( + onFilteringChanged: (taxonomyFilter) => + _taxonomyFilter = taxonomyFilter, + filter: _taxonomyFilter, + ), + ImageFilteringRow( + onFilteringChanged: (imageFilter) => _imageFilter = imageFilter, + filter: _imageFilter, + ), + VerificationFilteringRow( + onFilteringChanged: (verificationFilter) => + _verificationFilter = verificationFilter, + filter: _verificationFilter, + ) + ], + ); + } + + Widget _buildSortingSection() { + // return AnimatedSize( + // duration: const Duration(milliseconds: 250), + // curve: Curves.easeIn, + // alignment: Alignment.topCenter, + // child: Column( + // children: [ + // _buildSortingRow(), + // if (_ordering == ListOrdering.location) _buildLocationSelectRow(), + // ], + // ), + // ); + return SortingSection( + ordering: _ordering, + direction: _direction, + locationFilter: _locationFilter, + onSortingChanged: (ordering, direction, locationFilter) { + // print("Sorting is now changed..."); + _ordering = ordering; + _direction = direction; + if (_ordering == ListOrdering.location) { + // print( + // "We have a filter at this location: ${locationFilter?.location ?? "None"}"); + _locationFilter = locationFilter ?? LocationFilter(_currentLocation); + } else { + _locationFilter = null; + } + // setState(() => updateFilters()); + // print("Now, at the screen level, we have filter at ${locationFilter?.location ?? "None"}"); + }, + ); + } + + // Widget _buildSortingRow() { + // return Padding( + // padding: const EdgeInsets.all(8.0), + // child: Wrap( + // alignment: WrapAlignment.spaceEvenly, + // crossAxisAlignment: WrapCrossAlignment.center, + // runAlignment: WrapAlignment.start, + // spacing: 16, + // runSpacing: 16, + // children: [ + // // ConstrainedBox( + // // child: Text(_appLocalizations.sortBy), + // // constraints: const BoxConstraints(maxWidth: 500), + // // ), + // ConstrainedBox( + // constraints: const BoxConstraints(maxWidth: 500), + // child: ToggleButtons( + // isSelected: [ + // for (var direction in SortingDirection.values) + // _direction == direction + // ], + // children: [ + // for (var direction in SortingDirection.values) + // Padding( + // padding: const EdgeInsets.all(8.0), + // child: Text(_localizedSortingDirectionName(direction)), + // ) + // ], + // onPressed: (index) => setState( + // () => _direction = SortingDirection.values[index], + // ), + // ), + // ), + // ConstrainedBox( + // constraints: const BoxConstraints(maxWidth: 500), + // child: DropdownButton( + // items: ListOrdering.values + // .map((e) => DropdownMenuItem( + // value: e, child: Text(_localizedOrderingName(e)))) + // .toList(), + // value: _ordering, + // icon: const Icon(Icons.sort), + // onChanged: (ordering) => setState(() { + // _ordering = ordering ?? ListOrdering.flightId; + // if (_ordering == ListOrdering.location) { + // _locationFilter = + // _locationFilter ?? LocationFilter(_currentLocation); + // } else { + // _locationFilter = null; + // } + // }), + // ), + // ), + // ], + // ), + // ); + // } + + bool get didNotChangeFilters => + _ordering == FilteringManager.shared.ordering && + _direction == FilteringManager.shared.direction && + _imageFilter == FilteringManager.shared.imageFilter && + _verificationFilter == FilteringManager.shared.verificationFilter && + _dateFilter == FilteringManager.shared.dateFilter && + _locationFilter == FilteringManager.shared.locationFilter && + _taxonomyFilter == FilteringManager.shared.taxonomyFilter; + + void updateFilters() { + FilteringManager.shared.dateFilter = _dateFilter; + FilteringManager.shared.taxonomyFilter = _taxonomyFilter; + FilteringManager.shared.ordering = _ordering; + FilteringManager.shared.locationFilter = _locationFilter; + FilteringManager.shared.direction = _direction; + FilteringManager.shared.imageFilter = _imageFilter; + FilteringManager.shared.verificationFilter = _verificationFilter; + } + + // Widget _buildLocationSelectRow() { + // return LocationSelectRow( + // initialLocation: _locationFilter?.location ?? _currentLocation, + // onLocationSelected: (location) { + // print("Now, in filtering manager, selected: $location"); + // updateFilters(); + // setState(() { + // _locationFilter = LocationFilter(location); + // }); + // }); + // } + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + return Scaffold( + appBar: AppBar( + title: Text(_appLocalizations.filteringAndSorting), + actions: [ + IconButton( + onPressed: () async { + final shouldReload = !didNotChangeFilters; + if (shouldReload) { + // print("Changed filters!!!"); + updateFilters(); + await FilteringManager.shared.saveFilters(); + } else { + // print("No filters changed!"); + } + // print("Printing filters:"); + for (var filter in FilteringManager.shared.filters) { + // print(filter.queryParameters); + } + Navigator.of(context).pop(shouldReload); + }, + tooltip: _appLocalizations.done, + icon: const Icon(Icons.done), + ) + ], + ), + body: SafeArea(child: _buildFilteringForm()), + ); + } +} + +class LocationSelectRow extends StatefulWidget { + const LocationSelectRow( + {this.initialLocation, required this.onLocationSelected, Key? key}) + : super(key: key); + + final LatLng? initialLocation; + final void Function(LatLng) onLocationSelected; + + @override + _LocationSelectRowState createState() => _LocationSelectRowState(); +} + +class _LocationSelectRowState extends State { + late LatLng _selectedLocation; + + // late void Function(LatLng) _onLocationSelected; + + @override + void initState() { + super.initState(); + // _getLocationFuture = getCurrentLocation().then((value) => value ?? const LatLng(0.0, 0.0)); + _getLocationFuture = getFilterLocation(); + _selectedLocation = widget.initialLocation ?? const LatLng(0, 0); + // _onLocationSelected = widget.onLocationSelected; + + // if (widget.initialLocation == null) { + // getCurrentLocation().then((location){ + // if (location != null) { + // setState(() => _selectedLocation = location); + // } + // }); + // } + } + + Future getFilterLocation() async { + return widget.initialLocation ?? + await getCurrentLocation() ?? + const LatLng(0.0, 0.0); + } + + Future _getNewLocation() async { + final newLocation = await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LocationPickerView( + locationPickerMode: LocationPickerMode.locationOnly, + initialLocation: _selectedLocation, + ), + fullscreenDialog: true), + ); + + if (newLocation == null) return; + + setState(() { + _selectedLocation = newLocation; + _getLocationFuture = getFilterLocation(); + // print("Selected new location $newLocation"); + }); + + widget.onLocationSelected(newLocation); + } + + late Future _getLocationFuture; + + @override + Widget build(BuildContext context) { + return ListTile( + leading: const Icon(Icons.location_pin), + trailing: IconButton( + icon: const Icon(Icons.edit), + tooltip: AppLocalizations.of(context)!.edit, + onPressed: _getNewLocation, + ), + title: Text( + // AppLocalizations.of(context)!.fromLocation( + stringFromLocation( + location: _selectedLocation, + ), + // ), + ), + onTap: _getNewLocation, + ); + + // return FutureBuilder( + // future: _getLocationFuture, + // builder: (BuildContext context, AsyncSnapshot snapshot) { + // if (snapshot.connectionState == ConnectionState.done && + // snapshot.hasData) { + // _selectedLocation = snapshot.data ?? const LatLng(0.0, 0.0); + // + // return ListTile( + // leading: const Icon(Icons.location_pin), + // trailing: IconButton( + // icon: const Icon(Icons.edit), + // tooltip: AppLocalizations.of(context)!.edit, + // onPressed: _getNewLocation, + // ), + // title: Text( + // // AppLocalizations.of(context)!.fromLocation( + // stringFromLocation( + // location: _selectedLocation, + // ), + // // ), + // ), + // onTap: _getNewLocation, + // ); + // } + // + // // if (snapshot.hasError){ + // // print(snapshot.error); + // // print(snapshot.stackTrace); + // // } + // + // return const ListTile( + // title: Text("Updating Location"), + // leading: CircularProgressIndicator(), + // ); + // }, + // ); + } +} + +class SortingSection extends StatefulWidget { + const SortingSection({ + Key? key, + this.ordering = ListOrdering.flightId, + this.direction = SortingDirection.descending, + this.locationFilter, + required this.onSortingChanged, + }) : super(key: key); + + final ListOrdering ordering; + final SortingDirection direction; + final LocationFilter? locationFilter; + final void Function(ListOrdering ordering, SortingDirection direction, + LocationFilter? locationFilter) onSortingChanged; + + @override + State createState() => _SortingSectionState(); +} + +class _SortingSectionState extends State { + late AppLocalizations _appLocalizations; + // late LatLng? _currentLocation; + late var _ordering = widget.ordering; + late var _direction = widget.direction; + late var _locationFilter = widget.locationFilter; + late final _onSortingChanged = widget.onSortingChanged; + + @override + void initState() { + super.initState(); + _getLocationFuture = getFilterLocation(); + // _currentLocation = _locationFilter?.location ?? const LatLng(0, 0); + + // if (_locationFilter == null) { + // getCurrentLocation() + // .then((location) => _currentLocation = location ?? _currentLocation); + // } + } + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + return AnimatedSize( + duration: const Duration(milliseconds: 250), + curve: Curves.easeIn, + alignment: Alignment.topCenter, + child: Column( + children: [ + _buildSortingRow(), + if (_ordering == ListOrdering.location) _buildLocationSelectRow(), + ], + ), + ); + } + + Widget _buildSortingRow() { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Wrap( + alignment: WrapAlignment.spaceEvenly, + crossAxisAlignment: WrapCrossAlignment.center, + runAlignment: WrapAlignment.start, + spacing: 16, + runSpacing: 16, + children: [ + // ConstrainedBox( + // child: Text(_appLocalizations.sortBy), + // constraints: const BoxConstraints(maxWidth: 500), + // ), + ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 500), + child: ToggleButtons( + isSelected: [ + for (var direction in SortingDirection.values) + _direction == direction + ], + children: [ + for (var direction in SortingDirection.values) + Padding( + padding: const EdgeInsets.all(8.0), + child: Text(_localizedSortingDirectionName(direction)), + ) + ], + onPressed: (index) => setState( + () { + _direction = SortingDirection.values[index]; + _onSortingChanged(_ordering, _direction, _locationFilter); + }, + ), + ), + ), + ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 500), + child: DropdownButton( + items: ListOrdering.values + .map((e) => DropdownMenuItem( + value: e, child: Text(_localizedOrderingName(e)))) + .toList(), + value: _ordering, + icon: const Icon(Icons.sort), + onChanged: (ordering) => setState(() { + _ordering = ordering ?? ListOrdering.flightId; + // if (_ordering == ListOrdering.location) { + // // _locationFilter = + // // _locationFilter ?? LocationFilter(_currentLocation); + // } else { + // _locationFilter = null; + // } + + if (_ordering != ListOrdering.location) { + _locationFilter = null; + } + + _onSortingChanged(_ordering, _direction, _locationFilter); + }), + ), + ), + ], + ), + ); + } + + late Future _getLocationFuture; + + Future getFilterLocation() async { + return _locationFilter?.location ?? + await getCurrentLocation() ?? + const LatLng(0.0, 0.0); + } + + Widget _buildLocationSelectRow() { + return FutureBuilder( + future: _getLocationFuture, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return LocationSelectRow( + initialLocation: snapshot.data!, + onLocationSelected: (location) { + _locationFilter = LocationFilter(location); + // print("Now, in filtering manager, selected: $location"); + _onSortingChanged(_ordering, _direction, _locationFilter); + setState(() { + _getLocationFuture = getFilterLocation(); + }); + }); + } else { + return ListTile( + title: Text(_appLocalizations.updatingLocation), + leading: const CircularProgressIndicator(), + ); + } + }); + } + + String _localizedOrderingName(ListOrdering listOrdering) { + switch (listOrdering) { + case ListOrdering.flightId: + return _appLocalizations.flightID; + case ListOrdering.dateOfFlight: + return _appLocalizations.dateOfFlight; + case ListOrdering.dateRecorded: + return _appLocalizations.dateRecordedDetailLabel; + case ListOrdering.location: + return _appLocalizations.distance; + } + } + + String _localizedSortingDirectionName(SortingDirection direction) { + switch (direction) { + case SortingDirection.ascending: + return _appLocalizations.ascending; + case SortingDirection.descending: + return _appLocalizations.descending; + } + } +} + +abstract class FilteringRow extends StatefulWidget { + const FilteringRow({ + Key? key, + this.filter, + required this.onFilteringChanged, + }) : super(key: key); + + final T? filter; + final void Function(T?) onFilteringChanged; + + // @override + // _FilteringRowState createState() => _FilteringRowState(); +} + +abstract class _FilteringRowState + extends State> with TickerProviderStateMixin { + @protected + late bool isFiltering; + + @protected + void processInitialValue(T? filter); + + @override + void initState() { + isFiltering = widget.filter != null; + processInitialValue(widget.filter); + super.initState(); + } + + @protected + T? createFilter(); + + @protected + String get filterLabel; + + @protected + Widget buildBody(BuildContext context); + + @protected + Duration get duration => const Duration(milliseconds: 250); + + @protected + Curve get curve => Curves.easeIn; + + @override + @mustCallSuper + Widget build(BuildContext context) { + return AnimatedSize( + duration: duration, + alignment: Alignment.topCenter, + curve: curve, + child: Column( + children: [ + InkWell( + onTap: () { + setState(() { + isFiltering = !isFiltering; + widget.onFilteringChanged(createFilter()); + }); + }, + child: Row( + children: [ + Text(filterLabel), + const Spacer(), + Switch( + value: isFiltering, + onChanged: (value) { + setState(() => isFiltering = value); + widget.onFilteringChanged(createFilter()); + }) + ], + ), + ), + if (isFiltering) buildBody(context), + const Divider() + ], + ), + ); + } +} + +class DateFilteringRow extends FilteringRow { + const DateFilteringRow({ + Key? key, + DateFilter? filter, + required void Function(DateFilter?) onFilteringChanged, + }) : super( + key: key, + filter: filter, + onFilteringChanged: onFilteringChanged, + ); + + @override + State createState() => _DateFilteringRowState(); +} + +class _DateFilteringRowState extends _FilteringRowState { + late bool _hasMinDate; + late DateTime? _minDate; + late bool _hasMaxDate; + late DateTime? _maxDate; + + late AppLocalizations _appLocalizations; + + @override + void processInitialValue(DateFilter? filter) { + _hasMinDate = widget.filter?.minDate != null; + _minDate = widget.filter?.minDate ?? DateTime.now(); + _hasMaxDate = widget.filter?.maxDate != null; + _maxDate = widget.filter?.maxDate ?? DateTime.now(); + } + + @override + DateFilter? createFilter() { + return isFiltering && (_hasMinDate || _hasMaxDate) + ? DateFilter( + _hasMaxDate ? _maxDate : null, _hasMinDate ? _minDate : null) + : null; + } + + @override + String get filterLabel => _appLocalizations.filterByDate; + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + return super.build(context); + } + + static final earliestDate = DateTime(1900); + + @override + Widget buildBody(BuildContext context) { + // var labelTheme = Theme.of(context).textTheme.bodyText1!; + final labelTheme = Theme.of(context).textTheme.subtitle1!; + // var activeColor = labelTheme.color; + final deactivatedColor = Theme.of(context).disabledColor; + final deactivatedLabelTheme = labelTheme.apply(color: deactivatedColor); + return Column( + children: [ + InkWell( + onTap: () { + setState(() => _hasMinDate = !_hasMinDate); + widget.onFilteringChanged(createFilter()); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Checkbox( + value: _hasMinDate, + onChanged: isFiltering + ? (value) { + setState(() => _hasMinDate = value ?? false); + widget.onFilteringChanged(createFilter()); + } + : null, + ), + Text( + _appLocalizations.minDate, + style: _hasMinDate ? labelTheme : deactivatedLabelTheme, + ), + const Spacer(), + Text( + DateFormat.yMMMd(_appLocalizations.localeName) + .format(_minDate ?? _maxDate ?? DateTime.now()), + style: _hasMinDate ? labelTheme : deactivatedLabelTheme, + ), + IconButton( + onPressed: _hasMinDate + ? () async { + final newMinDate = await showDatePicker( + context: context, + firstDate: earliestDate, + initialDate: _hasMinDate + ? _minDate! + : _hasMaxDate + ? _maxDate! + : DateTime.now(), + lastDate: _hasMaxDate ? _maxDate! : DateTime.now()); + setState(() => _minDate = newMinDate); + widget.onFilteringChanged(createFilter()); + } + : null, + icon: const Icon( + Icons.edit, + // color: _hasMinDate ? activeColor : deactivatedColor, + ), + tooltip: _appLocalizations.edit, + disabledColor: deactivatedColor, + ) + ], + ), + ), + InkWell( + onTap: () { + setState(() => _hasMaxDate = !_hasMaxDate); + widget.onFilteringChanged(createFilter()); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Checkbox( + value: _hasMaxDate, + onChanged: isFiltering + ? (value) { + setState(() => _hasMaxDate = value ?? false); + widget.onFilteringChanged(createFilter()); + } + : null, + ), + Text( + _appLocalizations.maxDate, + style: _hasMaxDate ? labelTheme : deactivatedLabelTheme, + ), + const Spacer(), + Text( + DateFormat.yMMMd(_appLocalizations.localeName) + .format(_maxDate ?? _minDate ?? DateTime.now()), + style: _hasMaxDate ? labelTheme : deactivatedLabelTheme, + ), + IconButton( + onPressed: _hasMaxDate + ? () async { + final newMaxDate = await showDatePicker( + context: context, + firstDate: _hasMinDate ? _minDate! : earliestDate, + initialDate: _maxDate ?? _minDate ?? DateTime.now(), + lastDate: DateTime.now()); + setState(() => _maxDate = newMaxDate); + widget.onFilteringChanged(createFilter()); + } + : null, + icon: const Icon( + Icons.edit, + // color: _hasMaxDate ? activeColor : deactivatedColor, + ), + tooltip: _appLocalizations.edit, + disabledColor: deactivatedColor, + ) + ], + ), + ) + ], + ); + } +} + +class TaxonomyFilteringRow extends FilteringRow { + const TaxonomyFilteringRow({ + Key? key, + TaxonomyFilter? filter, + required void Function(TaxonomyFilter?) onFilteringChanged, + }) : super( + key: key, + filter: filter, + onFilteringChanged: onFilteringChanged, + ); + + @override + _TaxonomyFilteringRowState createState() => _TaxonomyFilteringRowState(); +} + +class _TaxonomyFilteringRowState extends _FilteringRowState { + late List _genera; + late List _species; + + late AppLocalizations _appLocalizations; + + @override + TaxonomyFilter? createFilter() => + isFiltering ? TaxonomyFilter(genera: _genera, species: _species) : null; + + @override + void processInitialValue(TaxonomyFilter? filter) { + _genera = List.of(widget.filter?.genera ?? const []); + _species = List.of(widget.filter?.species ?? const []); + } + + @override + Widget buildBody(BuildContext context) { + // var labelTheme = Theme.of(context).textTheme.bodyText1!; + var labelTheme = Theme.of(context).textTheme.subtitle1; + + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: Text( + _appLocalizations.filteringByGenera(_genera.length), + style: labelTheme, + ), + ), + Padding( + padding: const EdgeInsets.all(16.0), + child: Text( + _appLocalizations.filteringBySpecies(_species.length), + style: labelTheme, + ), + ) + ], + ), + IconButton( + icon: const Icon(Icons.edit), + tooltip: _appLocalizations.edit, + onPressed: () async { + // final newFilter = await Navigator.of(context) + // .push(MaterialPageRoute( + // builder: (context) => TaxonomyFilteringScreen( + // selectedGenera: _genera, + // selectedSpecies: _species, + // ), + // )); + + final newFilter = await Navigator.of(context) + .push(MaterialPageRoute( + builder: (context) => TaxonomyFilteringScreen( + selectedGenera: List.of(_genera), + selectedSpecies: List.of(_species), + taxonomySelectionScreenType: TaxonomySelectionScreenType.filtering, + // filteringScreenHeader: + // _appLocalizations.filterByTaxonomy, + ), + fullscreenDialog: true)); + + if (newFilter == null) { + return; + } + + setState(() { + _genera = newFilter.genera; + _species = newFilter.species; + }); + + widget.onFilteringChanged(createFilter()); + + // if (newFilter != null) { + // setState(() { + // _genera = newFilter.genera; + // _species = newFilter.species; + // }); + // } + }, + ) + ], + ); + } + + @override + String get filterLabel => _appLocalizations.filterByTaxonomy; + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + return super.build(context); + } +} + +class NameableSearchDelegate extends SearchDelegate { + NameableSearchDelegate({ + required this.universe, + // required this.onResultSelected, + // this.initiallySelected = const [], + String? searchFieldLabel, + TextStyle? searchFieldStyle, + InputDecorationTheme? searchFieldDecorationTheme, + TextInputType? keyboardType, + TextInputAction textInputAction = TextInputAction.search, + }) : super( + searchFieldLabel: searchFieldLabel, + searchFieldStyle: searchFieldStyle, + searchFieldDecorationTheme: searchFieldDecorationTheme, + keyboardType: keyboardType, + textInputAction: textInputAction, + ); + + final List universe; + // final List initiallySelected; + // final void Function(String result) onResultSelected; + + // late final List selectedResults; + + List _getResults(String query) { + if (query.trim().isEmpty) return universe; + + final results = universe + .where((element) => + element.name.toLowerCase().contains(query.toLowerCase())) + .toList(growable: false); + + results.sort((s1, s2) { + final positionBasedOrdering = s1.name + .toLowerCase() + .indexOf(query.toLowerCase()) + .compareTo(s2.name.toLowerCase().indexOf(query.toLowerCase())); + return positionBasedOrdering != 0 + ? positionBasedOrdering + : s1.name.compareTo(s2.name); + }); + + // print("There are ${results.length} results"); + + return results; + } + + @override + List buildActions(BuildContext context) { + return [ + IconButton( + onPressed: () { + query = ""; + showSuggestions(context); + }, + icon: const Icon(Icons.clear), + tooltip: AppLocalizations.of(context)!.clear, + ) + ]; + } + + @override + Widget buildLeading(BuildContext context) { + return IconButton( + onPressed: () => close(context, null), icon: const BackButtonIcon()); + } + + @override + Widget buildResults(BuildContext context) { + final results = _getResults(query); + return ListView.builder( + itemCount: results.length, + itemBuilder: (context, index) => ListTile( + title: Text(results[index].name), + onTap: () => close(context, results[index])), + ); + } + + @override + Widget buildSuggestions(BuildContext context) { + final suggestions = _getResults(query); + return ListView.builder( + itemCount: suggestions.length, + itemBuilder: (context, index) => ListTile( + title: Text(suggestions[index].name), + onTap: () { + query = suggestions[index].name; + // buildResults(context); + showResults(context); + }, + ), + ); + } +} + +enum TaxonomySelectionScreenType { + filtering, + notifications +} + +extension GetLabels on TaxonomySelectionScreenType { + String getScreenTitle(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + switch (this) { + case TaxonomySelectionScreenType.filtering: + return appLocalizations.filterByTaxonomy; + case TaxonomySelectionScreenType.notifications: + return appLocalizations.notifications; + } + } + + String getGeneraHeader(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + + switch (this) { + case TaxonomySelectionScreenType.filtering: + return appLocalizations.filteringGenera; + case TaxonomySelectionScreenType.notifications: + return appLocalizations.notifyingGenera; + } + } + + String getSpeciesHeader(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + + switch (this) { + case TaxonomySelectionScreenType.filtering: + return appLocalizations.filteringSpecies; + case TaxonomySelectionScreenType.notifications: + return appLocalizations.notifyingSpecies; + } + } +} + +class TaxonomyFilteringScreen extends StatefulWidget { + const TaxonomyFilteringScreen( + {this.selectedGenera = const [], + this.selectedSpecies = const [], + this.onFilteringSaved, + // required this.filteringScreenHeader, + this.taxonomySelectionScreenType = TaxonomySelectionScreenType.filtering, + Key? key}) + : super(key: key); + + final List selectedGenera; + final List selectedSpecies; + // final String filteringScreenHeader; + final TaxonomySelectionScreenType taxonomySelectionScreenType; + + final Future Function(TaxonomyFilter?)? onFilteringSaved; + + @override + _TaxonomyFilteringScreenState createState() => + _TaxonomyFilteringScreenState(); +} + +class _TaxonomyFilteringScreenState extends State { + late AppLocalizations _appLocalizations; + late List _selectedGenera; + late List _selectedSpecies; + + late List _genusListEntries; + late List _speciesListEntries; + + @override + void initState() { + // _selectedGenera = List.of(widget.selectedGenera); + // _selectedSpecies = List.of(widget.selectedSpecies); + _selectedGenera = widget.selectedGenera; + _selectedSpecies = widget.selectedSpecies; + super.initState(); + + _genusListEntries = _selectedGenera.map((e) => Text(e.toString())).toList(); + _speciesListEntries = + _selectedSpecies.map((e) => Text(e.toString())).toList(); + } + + TaxonomyFilter? _generateFlightFilter() { + if (_selectedSpecies.isEmpty && _selectedGenera.isEmpty) return null; + + return TaxonomyFilter(genera: _selectedGenera, species: _selectedSpecies); + } + + Future doneFiltering() async { + final newFilter = _generateFlightFilter(); + if (widget.onFilteringSaved != null) { + showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text(_appLocalizations.updatingSettings), + content: const LinearProgressIndicator(), + ), + barrierDismissible: false); + await widget.onFilteringSaved!(newFilter); + } + Navigator.of(context).pop(newFilter); + if (widget.onFilteringSaved != null) { + Navigator.of(context).pop(newFilter); + } + } + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + + return Scaffold( + appBar: AppBar( + title: Text(widget.taxonomySelectionScreenType.getScreenTitle(context)), + actions: [ + IconButton( + icon: const Icon(Icons.delete_sweep), + tooltip: _appLocalizations.clear, + onPressed: () => setState( + () { + _selectedGenera.clear(); + _selectedSpecies.clear(); + }, + ), + ), + IconButton( + onPressed: doneFiltering, + icon: const Icon(Icons.done), + tooltip: _appLocalizations.done, + ) + ], + ), + floatingActionButton: _buildAddFilteringButton(), + body: SafeArea( + child: ListView( + primary: true, + padding: const EdgeInsets.all(8.0), + children: [ + // HeaderRow(label: _appLocalizations.filteringGenera), + HeaderRow(label: widget.taxonomySelectionScreenType.getGeneraHeader(context)), + for (var genus in _selectedGenera) + Dismissible( + key: ValueKey(genus), + child: ListTile(title: Text(genus.toString())), + onDismissed: (_) => + setState(() => _selectedGenera.remove(genus)), + background: Container( + color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text(_appLocalizations.delete), + const Icon(Icons.delete) + ], + ), + ), + ), + // HeaderRow(label: _appLocalizations.filteringSpecies), + HeaderRow(label: widget.taxonomySelectionScreenType.getSpeciesHeader(context)), + if (_selectedSpecies.isNotEmpty) + for (var species in _selectedSpecies) + Dismissible( + key: ValueKey(species), + child: ListTile(title: Text(species.toString())), + onDismissed: (_) => + setState(() => _selectedSpecies.remove(species)), + background: Container( + color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text(_appLocalizations.delete), + const Icon(Icons.delete) + ], + ), + ), + ) + ], + ), + ), + ); + } + + FloatingActionButton _buildAddFilteringButton() { + return FloatingActionButton( + onPressed: () async { + // final newFilter = + await Navigator.of(context).push(MaterialPageRoute( + builder: (context) => TaxonomyFilteringGeneraScreen( + selectedGenera: _selectedGenera, + selectedSpecies: _selectedSpecies, + ))); + // if (newFilter != null) { + // setState(() { + // _selectedGenera = newFilter.genera; + // _selectedSpecies = newFilter.species; + // }); + // } + setState(() {}); + }, + child: const Icon(Icons.add), + ); + } +} + +class TaxonomyFilteringGeneraScreen extends StatelessWidget { + TaxonomyFilteringGeneraScreen({ + Key? key, + this.selectedGenera = const [], + this.selectedSpecies = const [], + }) : super(key: key); + + final List selectedGenera; + final List selectedSpecies; + + final _listScrollController = ItemScrollController(); + + // final genera = List.unmodifiable(TaxonomyManager.shared.genera); + final genera = Genus.getAll(); + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + + return Scaffold( + appBar: AppBar( + title: Text(appLocalizations.selectGenus), + actions: [ + IconButton( + onPressed: () async { + final genus = await showSearch( + context: context, + delegate: NameableSearchDelegate(universe: genera)); + + // print("Got genus $genus"); + + if (genus == null || genus is! Genus) { + return; + } + + // final index = genera.indexWhere((element) => element.name == genus); + final index = genera.indexOf(genus); + + // print("Item is at index $index"); + _listScrollController.scrollTo( + index: index, + duration: const Duration(milliseconds: 750), + curve: Curves.easeIn); + }, + icon: const Icon(Icons.search)) + ], + ), + body: SafeArea( + child: ScrollablePositionedList.separated( + itemScrollController: _listScrollController, + itemCount: genera.length, + itemBuilder: (context, index) => ListTile( + title: Text(genera[index].name), + trailing: const Icon(Icons.more_horiz), + onTap: () { + // print(genera[index]); + final genus = genera[index]; + // final genus = Genus.get(genera[index]); + + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => TaxonomyFilteringSpeciesScreen( + genus: genus, + selectedGenera: selectedGenera, + selectedSpecies: selectedSpecies, + ))); + }), + separatorBuilder: (context, index) => const Divider(), + ), + ), + ); + } +} + +class TaxonomyFilteringSpeciesScreen extends StatefulWidget { + const TaxonomyFilteringSpeciesScreen({ + Key? key, + required this.genus, + this.selectedGenera = const [], + this.selectedSpecies = const [], + }) : super(key: key); + + final Genus genus; + final List selectedGenera; + final List selectedSpecies; + + @override + _TaxonomyFilteringSpeciesScreenState createState() => + _TaxonomyFilteringSpeciesScreenState(); +} + +class _TaxonomyFilteringSpeciesScreenState + extends State { + late final List _species; + late final Genus _genus; + + late final List _selectedGenera; + late final List _selectedSpecies; + + final _listScrollController = ItemScrollController(); + + @override + void initState() { + _genus = widget.genus; + _selectedGenera = widget.selectedGenera; + _selectedSpecies = widget.selectedSpecies; + _species = + _genus.species; //TaxonomyManager.shared.speciesForGenus(_genus.name); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + + return Scaffold( + appBar: AppBar( + title: Text(appLocalizations.selectSpecies), + actions: [ + IconButton( + onPressed: () async { + final foundSpecies = await showSearch( + context: context, + delegate: NameableSearchDelegate(universe: _species)); + + // print("Got species $foundSpecies"); + + if (foundSpecies == null || foundSpecies is! Species) { + return; + } + + final index = _species.indexOf(foundSpecies); + + final adjustedIndex = index + 3; + + // print("Item is at index $index"); + _listScrollController.scrollTo( + index: adjustedIndex, + duration: const Duration(milliseconds: 750), + curve: Curves.easeIn); + }, + icon: const Icon(Icons.search)), + IconButton( + onPressed: () => setState(() { + _selectedSpecies + .removeWhere((element) => element.genus == _genus); + if (_selectedGenera.contains(_genus)) { + _selectedGenera.remove(_genus); + } + }), + icon: const Icon(Icons.delete_sweep), + tooltip: appLocalizations.clear, + ), + // IconButton(onPressed: (){}, icon: const Icon(Icons.done)) + ], + ), + body: SafeArea( + child: ScrollablePositionedList.separated( + itemScrollController: _listScrollController, + padding: const EdgeInsets.all(8.0), + itemCount: _species.length + 3, + itemBuilder: (context, index) { + if (index == 0) { + return HeaderRow(label: appLocalizations.entireGenus); + } else if (index == 1) { + return ListTile( + title: Text(_genus.name), + onTap: () { + if (_selectedGenera.contains(_genus)) { + setState(() => _selectedGenera.remove(_genus)); + } else { + setState(() => _selectedGenera.add(_genus)); + } + }, + trailing: _selectedGenera.contains(_genus) + ? const Icon(Icons.check) + : null, + ); + } else if (index == 2) { + return HeaderRow( + label: appLocalizations.species, + ); + } else { + final adjustedIndex = index - 3; + // final _speciesName = + final _rowSpecies = _species[adjustedIndex]; + var _speciesName = _species[adjustedIndex].name; + return ListTile( + title: Text(_rowSpecies.toString()), + trailing: _selectedSpecies.any((element) => + element.genus == _genus && element.name == _speciesName) + ? const Icon(Icons.check) + : null, + onTap: () { + // final relevantSpecies = Species.get(_genus, _speciesName); + final relevantSpecies = _species[adjustedIndex]; + if (_selectedSpecies.contains(relevantSpecies)) { + setState(() { + _selectedSpecies.remove(relevantSpecies); + }); + } else { + setState(() { + _selectedSpecies.add(relevantSpecies); + }); + } + }, + ); + } + }, + separatorBuilder: (context, index) => + index >= 3 ? const Divider() : const SizedBox.shrink(), + )), + ); + } +} + +class ImageFilteringRow extends FilteringRow { + const ImageFilteringRow({ + Key? key, + ImageFilter? filter, + required void Function(ImageFilter?) onFilteringChanged, + }) : super( + key: key, + filter: filter, + onFilteringChanged: onFilteringChanged, + ); + + @override + State createState() => _ImageFilteringRowState(); +} + +class _ImageFilteringRowState extends _FilteringRowState { + bool _hasImages = false; + late AppLocalizations _appLocalizations; + + @override + Widget buildBody(BuildContext context) { + return Column( + children: [ + RadioListTile( + groupValue: _hasImages, + value: false, + onChanged: (value) { + setState(() { + _hasImages = value!; + }); + widget.onFilteringChanged(createFilter()); + }, + title: Text(_appLocalizations.noImages), + ), + RadioListTile( + groupValue: _hasImages, + value: true, + onChanged: (value) { + setState(() { + _hasImages = value!; + }); + widget.onFilteringChanged(createFilter()); + }, + title: Text(_appLocalizations.hasImages), + ), + ], + ); + } + + @override + ImageFilter? createFilter() => isFiltering ? ImageFilter(_hasImages) : null; + + @override + String get filterLabel => _appLocalizations.filterByImages; + + @override + void processInitialValue(ImageFilter? filter) { + _hasImages = filter?.hasImages ?? false; + } + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + return super.build(context); + } +} + +class VerificationFilteringRow extends FilteringRow { + const VerificationFilteringRow({ + Key? key, + VerificationFilter? filter, + required void Function(VerificationFilter?) onFilteringChanged, + }) : super( + key: key, + filter: filter, + onFilteringChanged: onFilteringChanged, + ); + + @override + State createState() => _VerificationFilteringRowState(); +} + +class _VerificationFilteringRowState + extends _FilteringRowState { + var _isFilteringUserRole = false; + late Role _userRole; + var _isFilteringVerification = false; + late bool _verified; + + late AppLocalizations _appLocalizations; + + @override + Widget buildBody(BuildContext context) { + final labelTheme = Theme.of(context).textTheme.subtitle1!; + final deactivatedColor = Theme.of(context).disabledColor; + final deactivatedLabelTheme = labelTheme.apply(color: deactivatedColor); + + return Column( + children: [ + InkWell( + onTap: () { + setState(() { + _isFilteringUserRole = !_isFilteringUserRole; + }); + widget.onFilteringChanged(createFilter()); + }, + child: Row( + children: [ + Checkbox( + value: _isFilteringUserRole, + onChanged: (value) { + setState(() => _isFilteringUserRole = value!); + widget.onFilteringChanged(createFilter()); + }, + ), + Text( + _appLocalizations.filteringByUserRole, + style: + _isFilteringUserRole ? labelTheme : deactivatedLabelTheme, + ), + const Spacer(), + DropdownButton( + items: [ + DropdownMenuItem( + value: Role.professional, + child: Text(_appLocalizations.professionalUser), + ), + DropdownMenuItem( + value: Role.citizen, + child: Text(_appLocalizations.citizenUser), + ) + ], + value: _userRole, + onChanged: _isFilteringUserRole + ? (value) { + setState(() { + _userRole = value!; + }); + widget.onFilteringChanged(createFilter()); + } + : null, + ) + ], + ), + ), + InkWell( + onTap: () { + setState(() { + _isFilteringVerification = !_isFilteringVerification; + }); + widget.onFilteringChanged(createFilter()); + }, + child: Row( + children: [ + Checkbox( + value: _isFilteringVerification, + onChanged: (value) { + setState(() => _isFilteringVerification = value!); + widget.onFilteringChanged(createFilter()); + }, + ), + Text( + _appLocalizations.filteringByVerification, + style: _isFilteringVerification + ? labelTheme + : deactivatedLabelTheme, + ), + const Spacer(), + DropdownButton( + items: [ + DropdownMenuItem( + value: true, + child: Text(_appLocalizations.verified), + ), + DropdownMenuItem( + value: false, + child: Text(_appLocalizations.notVerified), + ) + ], + value: _verified, + onChanged: _isFilteringVerification + ? (value) { + setState(() { + _verified = value!; + }); + widget.onFilteringChanged(createFilter()); + } + : null, + ) + ], + ), + ) + ], + ); + } + + @override + VerificationFilter? createFilter() { + return (isFiltering && (_isFilteringUserRole || _isFilteringVerification)) + ? VerificationFilter(_isFilteringVerification ? _verified : null, + _isFilteringUserRole ? _userRole : null) + : null; + } + + @override + String get filterLabel => _appLocalizations.filterByVerification; + + @override + void processInitialValue(VerificationFilter? filter) { + _isFilteringUserRole = filter?.userRole != null; + _userRole = filter?.userRole ?? Role.professional; + _isFilteringVerification = filter?.verified != null; + _verified = filter?.verified ?? true; + } + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + return super.build(context); + } +} diff --git a/lib/first_time_screen.dart b/lib/first_time_screen.dart new file mode 100644 index 0000000..7f0c677 --- /dev/null +++ b/lib/first_time_screen.dart @@ -0,0 +1,765 @@ +/* + * first_time_screen.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:ant_nup_tracker/common_ui_elements.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +// import 'package:location/location.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'launch_url.dart'; +import 'url_manager.dart'; +import 'filtering.dart'; +import 'dark_mode_theme_ext.dart'; + +// Plan for the first login screen +/* + First page: Cartoon ant, welcome, broad overview + Second page: Load taxonomy, select filtering (eventually include count for how many flights will be loaded) + Third page: Create account or login + Last page: big picture about project & useful links + */ + +class FirstTimeScreen extends StatefulWidget { + const FirstTimeScreen({Key? key}) : super(key: key); + + @override + _FirstTimeScreenState createState() => _FirstTimeScreenState(); +} + +class _FirstTimeScreenState extends State { + final PageController _pageController = PageController(initialPage: 0); + + final pageCount = 3; + + Future goToPreviousPage() async => await _pageController.previousPage( + duration: const Duration(milliseconds: 500), + curve: Curves.easeOut, + ); + Future goToNextPage() async => await _pageController.nextPage( + duration: const Duration(milliseconds: 500), + curve: Curves.easeIn, + ); + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + return Scaffold( + appBar: AppBar( + automaticallyImplyLeading: false, + title: Text(appLocalizations.welcomeHeader), + ), + body: SafeArea( + child: PageView( + physics: const NeverScrollableScrollPhysics(), + controller: _pageController, + onPageChanged: (_) => setState(() {}), + children: [ + SimpleWelcomeScreen( + pageController: _pageController, + ), + PermissionsScreen( + pageController: _pageController, + ), + InitialSettingsScreen( + pageController: _pageController, + ), + MoreDetailsWelcome( + pageController: _pageController, + ) + ], + ), + ), + ); + } +} + +abstract class PageScreen { + PageController get pageController; + Duration get duration; + Curve get nextCurve; + Curve get previousCurve; + + void onNextPage(); + void onPreviousPage(); + void onDone(); +} + +class SimpleWelcomeScreen extends StatelessWidget implements PageScreen { + const SimpleWelcomeScreen({ + Key? key, + required this.pageController, + this.duration = const Duration(milliseconds: 50), + this.nextCurve = Curves.easeIn, + this.previousCurve = Curves.easeOut, + }) : super(key: key); + + @override + final PageController pageController; + + @override + final Duration duration; + + @override + final Curve nextCurve; + + @override + final Curve previousCurve; + + @override + void onNextPage() { + pageController.nextPage(duration: duration, curve: nextCurve); + } + + @override + void onPreviousPage() {} + + @override + void onDone() {} + + // final void Function()? onNextButtonPress; + // final void Function()? onPreviousButtonPress; + // + // bool get _shouldShowButtons => + // onPreviousButtonPress != null || onNextButtonPress != null; + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + return ListView( + padding: const EdgeInsets.all(16.0), + children: [ + Text( + appLocalizations.welcomeHeader, + style: Theme.of(context).textTheme.headline5, + textAlign: TextAlign.center, + ), + Image( + image: Theme.of(context).isDarkMode ? const AssetImage("assets/cartoon_ant/dark/cartoon_ant.png") : const AssetImage("assets/cartoon_ant/cartoon_ant.png"), + height: 200, + matchTextDirection: true, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image( + image: const AssetImage("assets/ant_circles/white_ant.png"), + color: Theme.of(context).textTheme.headline6!.color, + colorBlendMode: BlendMode.srcATop, + ), + ), + Expanded( + child: Text( + appLocalizations.welcomeBullet1, + style: Theme.of(context).textTheme.headline6, + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image( + image: const AssetImage("assets/ant_circles/white_ant.png"), + color: Theme.of(context).textTheme.headline6!.color, + colorBlendMode: BlendMode.srcATop, + ), + ), + Expanded( + child: Text( + appLocalizations.welcomeBullet2, + style: Theme.of(context).textTheme.headline6, + )), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image( + image: const AssetImage("assets/ant_circles/white_ant.png"), + color: Theme.of(context).textTheme.headline6!.color, + colorBlendMode: BlendMode.srcATop, + ), + ), + Expanded( + child: Text( + appLocalizations.welcomeBullet3, + style: Theme.of(context).textTheme.headline6, + )), + ], + ), + ), + NextPreviousButtonRow( + onNextPage: onNextPage, + ) + ], + ); + } +} + +class PermissionsScreen extends StatelessWidget implements PageScreen { + const PermissionsScreen({ + Key? key, + required this.pageController, + this.duration = const Duration(milliseconds: 50), + this.nextCurve = Curves.easeIn, + this.previousCurve = Curves.easeOut, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + + const textStyle = TextStyle(fontSize: 14); + + // Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 14); + var headingStyle = Theme.of(context).textTheme.headline6; + // textStyle.copyWith(fontWeight: FontWeight.bold, fontSize: 18); + return ListView( + padding: const EdgeInsets.all(16.0), + children: [ + Text( + appLocalizations.appPermissionsHeader, + style: Theme.of(context).textTheme.headline5, + textAlign: TextAlign.center, + ), + Text( + appLocalizations.appPermissionsSubtitle, + style: textStyle, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Icon( + Icons.location_pin, + color: Theme.of(context).textTheme.headline6!.color, + size: 32.0, + ), + ), + Expanded( + child: Column( + children: [ + Align( + child: Text( + appLocalizations.location, + style: headingStyle, + ), + alignment: Alignment.centerLeft, + ), + Text( + appLocalizations.locationPermissionDetails, + style: textStyle, + ), + ], + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Icon( + Icons.camera_alt, + color: Theme.of(context).textTheme.headline6!.color, + size: 32.0, + ), + ), + Expanded( + child: Column( + children: [ + Align( + child: Text( + appLocalizations.camera, + style: headingStyle, + ), + alignment: Alignment.centerLeft, + ), + Align( + child: Text( + appLocalizations.cameraPermissionDetails, + style: textStyle, + ), + alignment: Alignment.centerLeft, + ), + ], + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Icon( + Icons.photo, + color: Theme.of(context).textTheme.headline6!.color, + size: 32.0, + ), + ), + Expanded( + child: Column( + children: [ + Align( + child: Text( + appLocalizations.gallery, + style: headingStyle, + ), + alignment: Alignment.centerLeft, + ), + Text( + appLocalizations.galleryPermissionDetails, + style: textStyle, + ), + ], + ), + ), + ], + ), + ), + Text( + appLocalizations.permissionsScreenBottomNote, + style: textStyle, + ), + NextPreviousButtonRow( + onPreviousPage: onPreviousPage, + onNextPage: onNextPage, + ) + ], + ); + } + + @override + final Curve nextCurve; + + @override + final Curve previousCurve; + + @override + final Duration duration; + + @override + void onDone() {} + + @override + Future onNextPage() async { + // Request permissions + await [Permission.location, Permission.camera, Permission.photos, Permission.storage].request(); + + pageController.nextPage(duration: duration, curve: nextCurve); + } + + @override + void onPreviousPage() { + pageController.previousPage(duration: duration, curve: previousCurve); + } + + @override + final PageController pageController; +} + +class InitialSettingsScreen extends StatefulWidget implements PageScreen { + const InitialSettingsScreen({ + Key? key, + required this.pageController, + this.duration = const Duration(milliseconds: 250), + this.nextCurve = Curves.easeIn, + this.previousCurve = Curves.easeOut, + }) : super(key: key); + + // final void Function()? onPreviousButtonPress; + // final void Function()? onNextButtonPress; + + @override + _InitialSettingsScreenState createState() => _InitialSettingsScreenState(); + + @override + final Duration duration; + + @override + final PageController pageController; + + @override + final Curve previousCurve; + + @override + final Curve nextCurve; + + @override + void onDone() {} + + @override + void onNextPage() async { + await FilteringManager.shared.saveFilters(); + pageController.nextPage(duration: duration, curve: nextCurve); + } + + @override + void onPreviousPage() { + pageController.previousPage(duration: duration, curve: previousCurve); + } +} + +class _InitialSettingsScreenState extends State { + // bool get _shouldShowButtons => + // widget.onPreviousButtonPress != null || widget.onNextButtonPress != null; + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + return ListView( + padding: const EdgeInsets.all(16.0), + children: [ + HeaderRow(label: appLocalizations.setUpSorting), + SortingSection( + ordering: FilteringManager.shared.ordering, + direction: FilteringManager.shared.direction, + locationFilter: FilteringManager.shared.locationFilter, + onSortingChanged: (ordering, direction, locationFilter) { + FilteringManager.shared.ordering = ordering; + FilteringManager.shared.direction = direction; + FilteringManager.shared.locationFilter = locationFilter; + // print("Now selected location: ${locationFilter?.location ?? "None"}."); + }, + ), + HeaderRow(label: appLocalizations.setUpFiltering), + TaxonomyFilteringRow( + filter: FilteringManager.shared.taxonomyFilter, + onFilteringChanged: (taxonomyFilter) => + FilteringManager.shared.taxonomyFilter = taxonomyFilter, + ), + DateFilteringRow( + filter: FilteringManager.shared.dateFilter, + onFilteringChanged: (dateFilter) => + FilteringManager.shared.dateFilter = dateFilter, + ), + ImageFilteringRow( + filter: FilteringManager.shared.imageFilter, + onFilteringChanged: (imageFilter) => + FilteringManager.shared.imageFilter = imageFilter, + ), + VerificationFilteringRow( + filter: FilteringManager.shared.verificationFilter, + onFilteringChanged: (verificationFilter) => + FilteringManager.shared.verificationFilter = verificationFilter, + ), + NextPreviousButtonRow( + onNextPage: widget.onNextPage, + onPreviousPage: widget.onPreviousPage, + ) + ], + ); + } +} + +class MoreDetailsWelcome extends StatelessWidget implements PageScreen { + const MoreDetailsWelcome({ + Key? key, + required this.pageController, + this.duration = const Duration(milliseconds: 250), + this.nextCurve = Curves.easeIn, + this.previousCurve = Curves.easeOut, + }) : super(key: key); + + @override + final Duration duration; + + @override + final PageController pageController; + + @override + final Curve previousCurve; + + @override + final Curve nextCurve; + + @override + void onDone() async { + final prefs = await SharedPreferences.getInstance(); + prefs.setBool('hasLoadedWelcome', true); + } + + @override + void onNextPage() async {} + + @override + void onPreviousPage() { + pageController.previousPage(duration: duration, curve: previousCurve); + } + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + return ListView( + padding: const EdgeInsets.all(16.0), + children: [ + Image( + image: Theme.of(context).isDarkMode ? const AssetImage("assets/cartoon_ant/dark/cartoon_ant.png") : const AssetImage("assets/cartoon_ant/cartoon_ant.png"), + height: 200, + matchTextDirection: true, + ), + Padding( + padding: const EdgeInsets.all(4.0), + child: Text( + appLocalizations.welcomeBodyText, + style: Theme.of(context).textTheme.headline5, + textAlign: TextAlign.center, + ), + ), + const SizedBox( + height: 32, + ), + Padding( + padding: const EdgeInsets.all(4.0), + child: Text( + appLocalizations.welcomeBottomText, + style: Theme.of(context).textTheme.headline5, + textAlign: TextAlign.center, + ), + ), + // ElevatedButton( + // onPressed: () => Navigator.of(context).pop(), + // child: Text(appLocalizations.viewFlightList), + // ), + const SizedBox(height: 32.0), + ElevatedButton.icon( + onPressed: () async { + final urlString = UrlManager.shared.aboutUrl.toString(); + await launchUrl(urlString); + }, + label: Text(appLocalizations.moreAboutUs), + icon: const Icon(Icons.open_in_new), + ), + ElevatedButton.icon( + onPressed: () async { + final urlString = UrlManager.shared.privacyUrl.toString(); + await launchUrl(urlString); + }, + label: Text(appLocalizations.privacyPolicy), + icon: const Icon(Icons.open_in_new), + ), + ElevatedButton( + onPressed: () { + // Navigator.of(context).push(MaterialPageRoute( + // builder: (context) => const PackagesScreen(), + // )); + showLicensePage(context: context, applicationLegalese: appLocalizations.applicationLegalese, applicationIcon: Image( + image: Theme.of(context).isDarkMode ? const AssetImage("assets/cartoon_ant/dark/cartoon_ant.png") : const AssetImage("assets/cartoon_ant/cartoon_ant.png"), + height: 80, + matchTextDirection: true, + )); + }, + child: Text(appLocalizations.packagesInfo), + ), + NextPreviousButtonRow( + onPreviousPage: onPreviousPage, + onDone: () { + onDone(); + + // Pop to show the list + Navigator.of(context).pop(); + }, + ) + ], + ); + } +} + +class NextPreviousButtonRow extends StatelessWidget { + const NextPreviousButtonRow({ + Key? key, + this.onNextPage, + this.onPreviousPage, + this.onDone, + }) : super(key: key); + + final void Function()? onNextPage; + + final void Function()? onPreviousPage; + + final void Function()? onDone; + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + return Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + if (onPreviousPage != null) + ElevatedButton( + onPressed: onPreviousPage, + child: Text(appLocalizations.previous)), + if (onNextPage != null) + ElevatedButton( + onPressed: onNextPage, child: Text(appLocalizations.next)), + if (onDone != null) + ElevatedButton(onPressed: onDone, child: Text(appLocalizations.done)) + ], + ); + } +} + +// class NextPreviousButtonRow extends StatefulWidget { +// const NextPreviousButtonRow({ +// Key? key, +// required this.pageController, +// required this.pageCount, +// required this.duration, +// required this.curve, +// this.resizeDuration = const Duration(milliseconds: 50), +// this.onFinished, +// }) : super(key: key); +// +// final int pageCount; +// final PageController pageController; +// final Duration duration; +// final Curve curve; +// final Duration resizeDuration; +// final void Function()? onFinished; +// +// @override +// _NextPreviousButtonRowState createState() => _NextPreviousButtonRowState(); +// } +// +// class _NextPreviousButtonRowState extends State { +// bool get isOnFirstPage => +// (widget.pageController.page ?? widget.pageController.initialPage) +// .toInt() == +// 0; +// bool get isOnLastPage => +// (widget.pageController.page ?? widget.pageController.initialPage) +// .toInt() == +// widget.pageCount - 1; +// +// @override +// Widget build(BuildContext context) { +// final appLocalizations = AppLocalizations.of(context)!; +// return Row( +// crossAxisAlignment: CrossAxisAlignment.center, +// mainAxisAlignment: MainAxisAlignment.spaceAround, +// children: [ +// if (!isOnFirstPage) +// ElevatedButton( +// onPressed: () async { +// widget.pageController +// .previousPage( +// duration: widget.duration, curve: widget.curve) +// .then((value) => setState(() {})); +// }, +// child: Text(appLocalizations.previous)), +// // if (!isOnLastPage && !isOnFirstPage) +// // const SizedBox( +// // width: 48, +// // ), +// if (!isOnLastPage) +// ElevatedButton( +// onPressed: () async { +// widget.pageController +// .nextPage(duration: widget.duration, curve: widget.curve) +// .then((value) => setState(() {})); +// }, +// child: Text(appLocalizations.next)), +// if (isOnLastPage) +// ElevatedButton( +// onPressed: () { +// if (widget.onFinished != null) { +// widget.onFinished!(); +// } +// }, +// child: Text(appLocalizations.done)) +// ], +// ); +// } +// } + +// class NextPreviousButtonRow extends StatelessWidget { +// const NextPreviousButtonRow( +// {Key? key, +// required this.pageController, +// required this.pageCount, +// required this.duration, +// required this.curve, +// this.resizeDuration = const Duration(milliseconds: 50), +// }) +// : super(key: key); +// +// final int pageCount; +// final PageController pageController; +// final Duration duration; +// final Curve curve; +// final Duration resizeDuration; +// +// bool get isOnFirstPage => pageController.page == 0; +// bool get isOnLastPage => pageController.page == pageCount - 1; +// +// @override +// Widget build(BuildContext context) { +// final appLocalizations = AppLocalizations.of(context)!; +// return Row( +// crossAxisAlignment: CrossAxisAlignment.center, +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// if (!isOnFirstPage) +// AnimatedContainer( +// duration: resizeDuration, +// width: isOnLastPage ? 400 : 250, +// child: ElevatedButton( +// onPressed: () => +// pageController.previousPage(duration: duration, curve: curve), +// child: Text(appLocalizations.previous)), +// ), +// if (!isOnFirstPage && !isOnLastPage) +// const SizedBox( +// width: 48, +// ), +// if (!isOnLastPage) +// AnimatedContainer( +// duration: resizeDuration, +// width: isOnFirstPage ? 400 : 250, +// child: ElevatedButton( +// onPressed: () => +// pageController.nextPage(duration: duration, curve: curve), +// child: Text(appLocalizations.next)), +// ) +// ], +// ); +// } +// } diff --git a/lib/flight_database.dart b/lib/flight_database.dart new file mode 100644 index 0000000..d56821e --- /dev/null +++ b/lib/flight_database.dart @@ -0,0 +1,416 @@ +/* + * flight_database.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:ant_nup_tracker/flight_list.dart'; +import 'package:ant_nup_tracker/users.dart'; +import 'package:lat_lng_to_timezone/lat_lng_to_timezone.dart'; +import 'package:sqflite/sqflite.dart'; +import 'package:timezone/timezone.dart'; +import 'package:tuple/tuple.dart'; +import 'flights.dart'; + +const dbName = "flights.db"; + +class FlightDatabase { + FlightDatabase._(); + + static const flightTableName = "flights"; + static const flightIdColumn = "flightId"; + static const genusColumn = "genus"; + static const speciesColumn = "species"; + static const confidenceColumn = "confidence"; + static const dateOfFlightColumn = "dateOfFlight"; + static const sizeColumn = "sizeOfFlight"; + static const latitudeColumn = "latitude"; + static const longitudeColumn = "longitude"; + static const radiusColumn = "radius"; + static const dateRecordedColumn = "dateRecorded"; + static const ownerColumn = "owner"; + static const ownerRoleColumn = "ownerRole"; + static const hasWeatherColumn = "hasWeather"; + static const validatedColumn = "validated"; + static const validatedByColumn = "validatedBy"; + static const validatedAtColumn = "validatedAt"; + static const lastUpdatedColumn = "lastUpdated"; + + static const createFlightsTable = """ +create table if not exists $flightTableName ( + $flightIdColumn int primary key, + $speciesColumn int not null, + $confidenceColumn int not null CHECK($confidenceColumn = 0 OR $confidenceColumn = 1), + $dateOfFlightColumn text not null, + $sizeColumn int not null CHECK($sizeColumn = 0 OR $sizeColumn = 1), + $latitudeColumn real not null, + $longitudeColumn real not null, + $radiusColumn real not null CHECK($radiusColumn >= 0), + $dateRecordedColumn text not null, + $ownerColumn text not null, + $ownerRoleColumn int not null CHECK($ownerRoleColumn >= -1 AND $ownerRoleColumn <= 1), + $hasWeatherColumn int not null CHECK($hasWeatherColumn = 0 OR $hasWeatherColumn = 1), + $validatedColumn int not null CHECK($validatedColumn = 0 OR $validatedColumn = 1), + $validatedAtColumn text, + $validatedByColumn text, + $lastUpdatedColumn date not null +)"""; + + static const dropFlightsTable = """ + drop table $flightTableName + """; + + static const genusTableName = "genera"; + static const genusIdColumn = "id"; + static const genusNameColumn = "name"; + + static const speciesTableName = "species"; + static const speciesIdColumn = "id"; + static const speciesGenusColumn = "genus"; + static const speciesNameColumn = "name"; + + static const createGenusTable = """ +create table if not exists $genusTableName ( + $genusIdColumn int primary key, + $genusNameColumn text not null +)"""; + + static const createSpeciesTable = """ +create table if not exists $speciesTableName ( + $speciesIdColumn int primary key, + $speciesNameColumn text not null, + $speciesGenusColumn int not null, + foreign key($speciesGenusColumn) REFERENCES $genusTableName($genusIdColumn) +)"""; + + static const dropGeneraTable = """ + drop table $genusTableName + """; + + static const dropSpeciesTable = """ + drop table $speciesTableName + """; + + static const enableForeignKey = """ +PRAGMA foreign_keys = ON +"""; + + static final shared = FlightDatabase._(); + + Database? _db; + + bool get isInitialized => _db != null; + + Future initializeDatabase({bool clear = false}) async { + final dbExists = await databaseExists(dbName); + + if (dbExists && clear) { + await deleteDatabase(dbName); + } + + _db = await openDatabase( + dbName, + version: 1, + onCreate: (db, version) { + db.execute(enableForeignKey); + db.execute(createGenusTable); + db.execute(createSpeciesTable); + db.execute(createFlightsTable); + }, + ); + // + // if (clear){ + // // _db!.execute(dropFlightsTable); + // // _db!.execute(createFlightsTable); + // } + + return dbExists; + } + + // Future clearDatabase() async { + // final dbExists = await databaseExists(dbName); + // + // if (!dbExists) { + // return; + // } + // + // _db = await openDatabase( + // dbName, + // version: 1, + // onOpen: (db) { + // + // } + // ); + // + // _db!.close(); + // _db = null; + // } + + Future>> readFlights() async { + final db = _db; + + if (db == null) return {}; + + final flights = >{}; + + final records = await db.query(flightTableName); + + // print("Database contains ${records.length} records"); + + for (var record in records) { + final flightId = record[flightIdColumn] as int; + // print("Reading record $flightId from database."); + final taxonomyId = record[speciesColumn] as int; + final taxonomy = Species.get(taxonomyId); + // final genusName = record[genusColumn] as String; + // final speciesName = record[speciesColumn] as String; + // + // final genus = Genus.get(genusName); + // final taxonomy = Species.get(genus, speciesName); + + final confidence = _confidenceMap.keys.firstWhere( + (element) => _confidenceMap[element] == record[confidenceColumn] as int, + ); + // final dateOfFlight = DateTime.parse(record[dateOfFlightColumn] as String); + final size = _flightSizeMap.keys.firstWhere( + (element) => _flightSizeMap[element] == record[sizeColumn] as int, + ); + final latitude = record[latitudeColumn] as double; + final longitude = record[longitudeColumn] as double; + + final timezone = latLngToTimezoneString(latitude, longitude); + + final location = getLocation(timezone); + + final dateOfFlight = TZDateTime.parse(location, record[dateOfFlightColumn] as String); + + final radius = record[radiusColumn] as double; + final dateRecorded = DateTime.parse(record[dateRecordedColumn] as String); + final owner = record[ownerColumn] as String; + final ownerRole = _ownerRoleMap.keys.firstWhere( + (element) => _ownerRoleMap[element] == record[ownerRoleColumn] as int, + ); + final hasWeather = (record[hasWeatherColumn] == 1) || false; + final validated = (record[validatedColumn] == 1) || false; + final validatedBy = record[validatedByColumn] as String?; + final validatedAt = record[validatedAtColumn] != null + ? DateTime.parse(record[validatedAtColumn] as String) + : null; + + final lastUpdated = DateTime.parse(record[lastUpdatedColumn] as String); + + flights[flightId] = Tuple2( + Flight( + flightId, + taxonomy, + confidence, + dateOfFlight, + size, + latitude, + longitude, + radius, + dateRecorded, + owner, + ownerRole, + hasWeather, + validated, + // [], + validatedBy, + validatedAt), + lastUpdated); + } + + return flights; + } + + Future addFlight(Flight flight, DateTime lastUpdated) async { + final db = _db; + + if (db == null) return; + + // print("Inserting new flight ${flight.flightID} into DB."); + + await db.insert(flightTableName, flight.toMap(lastUpdated)); + } + + Future addFlights(Iterable> flights) async { + final db = _db; + + if (db == null) return; + + final batch = db.batch(); + + for (var flightRow in flights) { + final flight = flightRow.item1; + final lastUpdated = flightRow.item2; + batch.insert(flightTableName, flight.toMap(lastUpdated)); + } + + await batch.commit(noResult: true); + } + + Future updateFlight(Flight flight, DateTime lastUpdated) async { + final db = _db; + if (db == null) return; + + await db.update(flightTableName, flight.toMap(lastUpdated), + where: "$flightIdColumn = ?", whereArgs: [flight.flightID]); + } + + Future> readGenera() async { + final db = _db; + + if (db == null) return {}; + + // final genera = {}; + + final genusRecords = await db.query(genusTableName); + + // final recordsAsJson = genusRecords.map((e) => jsonEncode(e)); + + final generaList = Genus.loadGeneraFromJson(genusRecords); + + final generaEntries = generaList.map((e) => MapEntry(e.id, e)); + + // genera.addEntries(generaEntries); + + return Map.fromEntries(generaEntries); + } + + Future> readSpecies() async { + final db = _db; + + if (db == null) return {}; + + // final species = {}; + + final speciesRecords = await db.query(speciesTableName); + + // final recordsAsJson = speciesRecords.map((e) => jsonEncode(e)); + + final speciesList = Species.loadSpeciesFromJson(speciesRecords); + + final speciesEntries = speciesList.map((e) => MapEntry(e.id, e)); + + return Map.fromEntries(speciesEntries); + + } + + Future addGenus(Genus genus) async { + final db = _db; + + if (db == null) return; + + await db.insert(genusTableName, genus.toMap()); + } + + Future addGenera(Iterable genera) async { + final db = _db; + + if (db == null) return; + + final batch = db.batch(); + + for (var genus in genera) { + batch.insert(genusTableName, genus.toMap()); + } + + await batch.commit(noResult: true); + } + + Future addSpecies(Species species) async { + final db = _db; + + if (db == null) return; + + await db.insert(speciesTableName, species.toMap()); + } + + Future addManySpecies(Iterable speciesList) async { + final db = _db; + + if (db == null) return; + + final batch = db.batch(); + + for (var species in speciesList) { + batch.insert(speciesTableName, species.toMap()); + } + + await batch.commit(noResult: true); + } +} + +final _confidenceMap = { + ConfidenceLevels.low: 0, + ConfidenceLevels.high: 1, +}; + +final _flightSizeMap = { + FlightSize.manyQueens: 0, + FlightSize.singleQueen: 1, +}; + +final _ownerRoleMap = { + Role.flagged: -1, + Role.citizen: 0, + Role.professional: 1, +}; + +extension DatabaseStorage on Flight { + Map toMap(DateTime lastUpdated) => { + FlightDatabase.flightIdColumn: flightID, + // FlightDatabase.genusColumn: taxonomy.genus.name, + FlightDatabase.speciesColumn: taxonomy.id, + FlightDatabase.confidenceColumn: _confidenceMap[confidence], + FlightDatabase.dateOfFlightColumn: dateOfFlight.toIso8601String(), + FlightDatabase.sizeColumn: _flightSizeMap[size], + FlightDatabase.latitudeColumn: latitude, + FlightDatabase.longitudeColumn: longitude, + FlightDatabase.radiusColumn: radius, + FlightDatabase.dateRecordedColumn: dateRecorded.toIso8601String(), + FlightDatabase.ownerColumn: owner, + FlightDatabase.ownerRoleColumn: _ownerRoleMap[ownerRole], + FlightDatabase.hasWeatherColumn: hasWeather ? 1 : 0, + FlightDatabase.validatedColumn: validated ? 1 : 0, + FlightDatabase.validatedByColumn: validatedBy, + FlightDatabase.validatedAtColumn: validatedAt?.toIso8601String(), + FlightDatabase.lastUpdatedColumn: lastUpdated.toIso8601String() + }; +} + +class FlightDatabaseReadResults { + final Map flights; + final List entries; + + const FlightDatabaseReadResults(this.flights, this.entries); +} + +extension DatabaseStorageGenus on Genus { + Map toMap() => { + FlightDatabase.genusIdColumn: id, + FlightDatabase.genusNameColumn: name, + }; +} + +extension DatabaseStorageSpecies on Species { + Map toMap() => { + FlightDatabase.speciesIdColumn: id, + FlightDatabase.speciesNameColumn: name, + FlightDatabase.speciesGenusColumn: genus.id, + }; +} diff --git a/lib/flight_detail.dart b/lib/flight_detail.dart new file mode 100644 index 0000000..87a2a9d --- /dev/null +++ b/lib/flight_detail.dart @@ -0,0 +1,333 @@ +/* + * flight_detail.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; +import 'dart:io'; + +import 'package:ant_nup_tracker/flight_form.dart'; +import 'package:ant_nup_tracker/flights.dart'; +import 'package:ant_nup_tracker/images.dart'; +import 'package:ant_nup_tracker/sessions.dart'; +import 'package:ant_nup_tracker/url_manager.dart'; +import 'package:http/http.dart' as http; +import 'package:image_picker/image_picker.dart'; + +import 'exceptions.dart'; + +abstract class FlightDetailObserver { + void fetchedFlightDetail(Flight flight); + void fetchedFlightDetailWithError(LocalisableException error); +} + +class FlightDetailFetcher { + FlightDetailFetcher._(); + + static final shared = FlightDetailFetcher._(); + + FlightDetailObserver? _observer; + set observer(FlightDetailObserver? o) => _observer = o; + + void fetchFlightDetailForId(int id) { + final url = UrlManager.shared.urlForFlight(id); + + http.get(url).then((res) { + final status = res.statusCode; + + if (status == 401) throw FailedAuthenticationException(); + if (status == 404) throw NoFlightException(id); + if (status != 200) throw GetException(status); + + Flight flight; + + try { + final json = jsonDecode(res.body); + flight = Flight.fromJson(json); + } catch (err) { + throw JsonException(); + } + + _observer?.fetchedFlightDetail(flight); + }).catchError((error) { + _observer?.fetchedFlightDetailWithError(error); + }, test: (error) => error is LocalisableException).catchError( + (error, stacktrace) { + // print(error); + // print(stacktrace); + _observer?.fetchedFlightDetailWithError(NoResponseException()); + }); + } +} + +Future fetchFlight(int id) async { + final url = UrlManager.shared.urlForFlight(id); + + try { + final String? authorization; + + if (SessionManager.shared.isLoggedIn) { + // print("SessionManager is logged in."); + authorization = "Token ${SessionManager.shared.session!.token}"; + } else { + // print("SessionManager is not logged in."); + authorization = null; + } + + final response = await http.get(url, + headers: {if (authorization != null) "Authorization": authorization}); + + final status = response.statusCode; + + if (status == 401) throw FailedAuthenticationException(); + if (status == 404) throw NoFlightException(id); + if (status != 200) throw GetException(status); + + try { + final json = jsonDecode(response.body); + final flight = Flight.fromJson(json); + // await flight.loadImages(); + return flight; + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } on IOException catch (err) { + // print(err); + throw NoResponseException(); + } +} + +// Future addNewFlight(FlightFormData flightFormData) async { +// final data = flightFormData.toJson(); +// final url = UrlManager.shared.listUrl; +// +// print("Sending request: ${jsonEncode(data)}"); +// +// final response = await http.post(url, body: jsonEncode(data), headers: { +// "Content-Type": "application/json", +// "Authorization": "Token ${SessionManager.shared.session!.token}" +// }); +// +// var statusCode = response.statusCode; +// +// print(statusCode); +// print(response.body); +// +// if (statusCode == 401) throw FailedAuthenticationException(); +// if (statusCode != 201) throw AddFlightException(statusCode); +// +// // if (statusCode == 201) {} +// } + +Future addNewFlight( + FlightFormData flightFormData, Iterable images) async { + final data = flightFormData.toJson(); + final url = UrlManager.shared.filteredListUrl; + + // print("Sending request: ${jsonEncode(data)}"); + // + final response = await http.post(url, body: jsonEncode(data), headers: { + "Content-Type": "application/json", + "Authorization": "Token ${SessionManager.shared.session!.token}" + }); + + var statusCode = response.statusCode; + + // print(statusCode); + // print(response.body); + + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode != 201) throw AddFlightException(statusCode); + + final newFlight = Flight.fromJson(jsonDecode(response.body)); + + final id = newFlight.flightID; + + for (var image in images) { + await addImageToFlight(id, image); + } + + // if (statusCode == 201) {} +} + +enum FlightUpdateMethod { content, images, all, none } + +Future updateFlight(int id, FlightFormData flightFormData, + Iterable newImages, Iterable removedImages, + [FlightUpdateMethod updateMethod = FlightUpdateMethod.all]) async { + if (updateMethod == FlightUpdateMethod.none) { + return; + } + + final data = flightFormData.toJson(); + final url = UrlManager.shared.urlForFlight(id); + + if (updateMethod == FlightUpdateMethod.content || + updateMethod == FlightUpdateMethod.all) { + final response = await http.put(url, body: jsonEncode(data), headers: { + "Content-Type": "application/json", + "Authorization": "Token ${SessionManager.shared.session!.token}" + }); + + // print(response.statusCode); + // print(response.body); + + final statusCode = response.statusCode; + + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode != 200) throw EditFlightException(statusCode); + } + + if (updateMethod == FlightUpdateMethod.images || + updateMethod == FlightUpdateMethod.all) { + for (var image in newImages) { + await addImageToFlight(id, image); + } + + for (var imageId in removedImages) { + await deleteImage(id, imageId); + } + } +} + +Future validateFlight(int id, {required bool isValidated}) async { + final shouldValidate = !isValidated; + final url = UrlManager.shared.urlForValidate(id); + + var data = { + // "flightID" : id, + "validate": shouldValidate, + }; + + final response = await http.post(url, body: jsonEncode(data), headers: { + "Content-Type": "application/json", + "Authorization": "Token ${SessionManager.shared.session!.token}" + }); + + final statusCode = response.statusCode; + + // print(statusCode); + // print(response.body); + + if (statusCode == 404) throw NoFlightException(id); + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode == 403) throw InsufficientPrivilegesException(); + + if (statusCode != 200) throw FlightVerificationException(statusCode); +} + +Future unValidateFlight(int id) async {} + +Future> loadSpeciesForGenus(Genus g) async { + final speciesUrl = UrlManager.shared.urlForSpeciesList(g); + final headers = SessionManager.shared.headers; + + try { + final response = await http.get(speciesUrl, headers: headers); + final status = response.statusCode; + + if (status == 401) throw FailedAuthenticationException(); + if (status == 404) throw GenusNotFoundException(g.id); + if (status != 200) throw ReadException(status); + + try { + final results = jsonDecode(response.body) as List; + + final species = Species.loadSpeciesFromJson(results); + // print("Loaded species $species"); + return species; + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } on IOException { + throw NoResponseException(); + } +} + +Future> loadGenera() async { + final generaUrl = UrlManager.shared.generaUrl; + final headers = SessionManager.shared.headers; + + try { + final response = await http.get(generaUrl, headers: headers); + final status = response.statusCode; + + if (status == 401) throw FailedAuthenticationException(); + if (status != 200) throw ReadException(status); + + try { + final jsonList = jsonDecode(response.body) as List; + final genera = Genus.loadGeneraFromJson(jsonList); + + return genera; + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } on IOException { + throw NoResponseException(); + } +} + +class TaxonomyDetails { + TaxonomyDetails({ + required this.version, + required this.genusCount, + required this.speciesCount, + }); + + final int version; + final int genusCount; + final int speciesCount; +} + +Future loadTaxonomyDetails() async { + final taxonomyVersionUrl = UrlManager.shared.taxonomyVersionUrl; + + try { + final response = await http.get(taxonomyVersionUrl); + final status = response.statusCode; + + if (status != 200) throw ReadException(status); + + try { + final content = jsonDecode(response.body); + final version = content["version"] as int; + final genusCount = content["genus_count"] as int; + final speciesCount = content["species_count"] as int; + + return TaxonomyDetails( + version: version, + genusCount: genusCount, + speciesCount: speciesCount, + ); + + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } on IOException { + throw NoResponseException(); + } +} diff --git a/lib/flight_detail_screen.dart b/lib/flight_detail_screen.dart new file mode 100644 index 0000000..d3f2874 --- /dev/null +++ b/lib/flight_detail_screen.dart @@ -0,0 +1,1082 @@ +/* + * flight_detail_screen.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:ant_nup_tracker/changelog_screen.dart'; +import 'package:ant_nup_tracker/comments.dart'; +import 'package:ant_nup_tracker/flight_detail.dart'; +import 'package:ant_nup_tracker/flight_form.dart'; +import 'package:ant_nup_tracker/flight_list.dart'; +import 'package:ant_nup_tracker/flights.dart'; +import 'package:ant_nup_tracker/images.dart'; +import 'package:ant_nup_tracker/sessions.dart'; +import 'package:ant_nup_tracker/user_detail_screen.dart'; +import 'package:ant_nup_tracker/users.dart'; +import 'package:ant_nup_tracker/weather_detail_screen.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:cached_network_image/cached_network_image.dart'; + +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:intl/intl.dart'; + +import 'common_ui_elements.dart'; +import 'detail_screen.dart'; +import 'exceptions.dart'; + +class FlightDetailScreen extends DetailScreen { + // final int _flightID; + // final Flight _flight; + + const FlightDetailScreen(int id, {Flight? initialValue, Key? key}) + : super(id, initialValue: initialValue, key: key); + + @override + _FlightDetailScreenState createState() => _FlightDetailScreenState(); +} + +class _FlightDetailScreenState extends DetailScreenState { + // implements FlightDetailObserver { + + // final int _id; + // late Future fetchFlightFuture; + Flight? flight; + + late AppLocalizations _appLocalizations; + + _FlightDetailScreenState() : super(); + + late TextStyle _labelStyle; + + Widget _buildTextLabelDetailRow({ + required String label, + String? detail, + TextStyle? detailStyle, + }) { + var textStyle = detailStyle ?? _labelStyle.apply(fontWeightDelta: 2); + + return Container( + margin: const EdgeInsets.symmetric(vertical: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Text(label, style: _labelStyle)), + if (detail != null) + Expanded( + child: Text( + detail, + style: textStyle, + textAlign: TextAlign.end, + )), + ], + ), + ); + } + + Widget _buildUserRow( + {required String label, + required String username, + Role userRole = Role.citizen}) { + var textStyle = _labelStyle.apply(fontWeightDelta: 2); + return InkWell( + onTap: () => Navigator.of(context) + .push(MaterialPageRoute(builder: (_) => UserDetailScreen(username))), + child: Container( + margin: const EdgeInsets.symmetric(vertical: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Text(label, style: _labelStyle)), + Container( + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width / 2), + child: Row( + children: [ + Expanded( + child: Text( + username, + style: textStyle, + textAlign: TextAlign.end, + )), + if (userRole == Role.flagged) + // const Icon(Icons.warning, color: Colors.red), + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: const Image( + image: AssetImage("assets/ant_circles/red_ant.png"), + width: 16.0, + ), + ), + if (userRole == Role.professional) + // const Icon(Icons.verified, color: Colors.green), + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: const Image( + image: AssetImage("assets/ant_circles/green_ant.png"), + width: 16.0, + ), + ), + const Icon(Icons.more_horiz), + ], + ), + ) + ], + ), + ), + ); + } + + Widget _buildWeatherRows() { + return Column( + children: [ + HeaderRow(label: _appLocalizations.weatherHeader), + ListTile( + contentPadding: const EdgeInsets.all(8.0), + title: Text(_appLocalizations.weatherLabel, style: _labelStyle,), + trailing: const Icon(Icons.more_horiz), + onTap: () => Navigator.of(context).push(MaterialPageRoute( + builder: (_) => WeatherDetailScreen( + id, + flight: flight!, + ))), + ), + // InkWell( + // onTap: () => Navigator.of(context) + // .push(MaterialPageRoute(builder: (_) => WeatherDetailScreen(id))), + // child: Container( + // margin: const EdgeInsets.symmetric(vertical: 12.0), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Expanded( + // child: Text(_appLocalizations.weatherLabel, + // style: _labelStyle)), + // const Icon(Icons.more_horiz) + // ], + // ), + // ), + // ), + ], + ); + } + + // Widget _buildImageRow(Uri imageUrl) { + // return Column( + // children: [ + // _buildHeaderRow(label: _appLocalizations.imageHeaderDetail), + // GestureDetector( + // child: Image.network(imageUrl.toString()), + // onTap: () { + // Navigator.of(context).push( + // MaterialPageRoute( + // builder: (BuildContext context) { + // return Stack( + // children: [ + // Scaffold( + // appBar: AppBar( + // backgroundColor: Colors.transparent, + // elevation: 0.0, + // // actions: [ + // // IconButton( + // // onPressed: () { + // // Navigator.of(context).push( + // // MaterialPageRoute( + // // builder: (context) => FlightFormScreen( + // // flight: flight, + // // ), + // // ), + // // ); + // // }, + // // icon: Icon(Icons.edit), + // // tooltip: appLocalization.edit, + // // ) + // // ], + // ), + // body: Container( + // child: InteractiveViewer( + // child: Image.network(imageUrl.toString()), + // ), + // width: MediaQuery.of(context).size.width, + // height: MediaQuery.of(context).size.height, + // color: Colors.black, + // ), + // extendBody: true, + // extendBodyBehindAppBar: true, + // ), + // ], + // ); + // }, + // fullscreenDialog: true, + // ), + // ); + // }, + // ) + // ], + // ); + // } + + Widget _buildImagesRow() { + + return FutureBuilder(future: flight!.loadImagesFuture, + builder: (BuildContext context, AsyncSnapshot> snapshot){ + + if (snapshot.connectionState == ConnectionState.done && snapshot.hasData){ + final images = snapshot.data!; + + if (images.isEmpty) { + // return Padding( + // padding: const EdgeInsets.all(8.0), + // child: Text(_appLocalizations.noImages, style: _labelStyle,), + // ); + return ListTile(contentPadding: const EdgeInsets.all(8.0), title: Text(_appLocalizations.noImages, style: _labelStyle,)); + } + + final imageWidgets = images.map((image) { + final imageUrl = image.image; + var heroTag = "image_${image.id}"; + return GestureDetector( + child: Padding( + padding: const EdgeInsets.all(8.0), + // child: Image.network(imageUrl.toString()), + child: Hero( + tag: heroTag, + child: CachedNetworkImage( + fit: BoxFit.cover, + width: MediaQuery.of(context).size.width < 280 ? MediaQuery.of(context).size.width : 280, + imageUrl: imageUrl.toString(), + httpHeaders: SessionManager.shared.headers, + progressIndicatorBuilder: (context, url, progress) => Center( + child: SizedBox( + height: 32, + width: 32, + child: CircularProgressIndicator( + value: progress.progress))), + ), + )), + onTap: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) { + return ImageViewer( + imageUrl: imageUrl, + heroTag: heroTag, + ); + }, + fullscreenDialog: true, + ), + ); + }, + ); + }).toList(growable: false); + + return SizedBox( + height: 480, + child: ListView( + scrollDirection: Axis.horizontal, + children: imageWidgets, + ), + ); + } + + else { + return SizedBox( + height: 480, + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const CircularProgressIndicator(), + Text(_appLocalizations.loadingImages) + ], + ), + ), + ); + } + + }); + } + + Widget _buildRecordHistoryRow(int id) { + return ListTile( + onTap: () => Navigator.of(context) + .push(MaterialPageRoute(builder: (_) => ChangelogScreen(id))), + contentPadding: const EdgeInsets.all(8.0), + title: Text(_appLocalizations.recordHistoryLabel, style: _labelStyle,), + trailing: const Icon(Icons.more_horiz), + ); + } + + Widget _buildLocationRow(LatLng location, double radius) { + return Container( + width: MediaQuery.of(context).size.width, + // height: MediaQuery.of(context).size.width < 400 + // ? 400 + // : MediaQuery.of(context).size.width, + height: 400, + padding: const EdgeInsets.all(8.0), + child: GoogleMap( + initialCameraPosition: CameraPosition(target: location, zoom: 10), + gestureRecognizers: { + Factory(() => PanGestureRecognizer()), + Factory(() => ScaleGestureRecognizer()), + }, + markers: { + Marker( + markerId: const MarkerId("flightLocation"), + position: location, + ) + }, + circles: { + Circle( + circleId: const CircleId("flightRadius"), + center: location, + radius: 1000 * radius, + strokeColor: Colors.red, + strokeWidth: 2) + }, + ), + ); + } + + Widget _buildVerifiedRows( + {required String verifiedBy, required DateTime verifiedAt}) { + final currentLocale = _appLocalizations.localeName; + return Column( + children: [ + HeaderRow(label: _appLocalizations.verificationInformationHeader), + _buildUserRow( + label: _appLocalizations.verifiedByLabel, + username: verifiedBy, + userRole: Role.professional), + _buildTextLabelDetailRow( + label: _appLocalizations.dateVerifiedDetailLabel, + detail: DateFormat.yMMMd(currentLocale).format(verifiedAt)), + _buildTextLabelDetailRow( + label: _appLocalizations.timeVerifiedDetailLabel, + detail: DateFormat.jm(currentLocale).format(verifiedAt)), + ], + ); + } + + String getConfidenceString(ConfidenceLevels level) { + switch (level) { + case ConfidenceLevels.low: + return AppLocalizations.of(context)!.lowConfidence; + case ConfidenceLevels.high: + return AppLocalizations.of(context)!.highConfidence; + } + } + + String getSizeString(FlightSize size) { + switch (size) { + case FlightSize.manyQueens: + return AppLocalizations.of(context)!.manyQueens; + case FlightSize.singleQueen: + return AppLocalizations.of(context)!.singleQueen; + } + } + + // @override + // void initState() { + // super.initState(); + // _loadFlight(_id); + // fetchFlightFuture = fetchFlight(_id); + // // FlightDetailFetcher.shared.observer = this; + // // FlightDetailFetcher.shared.fetchFlightDetailForId(_flightID); + // } + + @override + void loadDetailFuture(int id, {bool forceReload = false}) { + setState(() { + detailFuture = FlightStore.shared.getFlight(id, forceReload: forceReload); + }); + } + + AlertDialog _buildLoadingDialog(String title) => AlertDialog( + title: Text(title), + content: const LinearProgressIndicator(), + ); + + AlertDialog _buildExceptionDialog(LocalisableException exception) { + return AlertDialog( + title: Text(exception.getLocalisedName(context)), + content: Text(exception.getLocalisedDescription(context)), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(_appLocalizations.ok), + ) + ], + ); + } + + Future _createNewComment(TextEditingController commentTextController, + GlobalKey commentFormKey) async { + if (!commentFormKey.currentState!.validate()) { + return; + } + + final commentText = commentTextController.text; + + // final newComment = Comment( + // 0, + // flight!.flightID, + // SessionManager.shared.session!.username, + // SessionManager.shared.session!.role, + // commentText, + // DateTime.now(), + // ); + Navigator.of(context).pop(); + showDialog( + context: context, + builder: (context) => + _buildLoadingDialog(_appLocalizations.uploadingComment), + barrierDismissible: false); + try { + await addNewComment(id, commentText); + commentTextController.dispose(); + Navigator.of(context).pop(); + setState(() {}); + // loadDetailFuture(id, forceReload: true); + } on LocalisableException catch (exception) { + Navigator.of(context).pop(); + await showDialog( + context: context, + builder: (context) => _buildExceptionDialog(exception), + ); + commentTextController.dispose(); + + showDialog( + context: context, + builder: (context) => _buildCommentDialog(commentText: commentText), + ); + } + } + + Future _updateExistingComment( + TextEditingController commentTextController, + GlobalKey commentFormKey, + {required int commentId}) async { + if (!commentFormKey.currentState!.validate()) { + return; + } + + final commentText = commentTextController.text; + + final updatedComment = Comment( + commentId, + flight!.flightID, + SessionManager.shared.session!.username, + SessionManager.shared.session!.role, + commentText, + DateTime.now(), + ); + Navigator.of(context).pop(); + showDialog( + context: context, + builder: (context) => + _buildLoadingDialog(_appLocalizations.uploadingComment), + barrierDismissible: false); + try { + await updateComment(id, updatedComment); + commentTextController.dispose(); + Navigator.of(context).pop(); + // loadDetailFuture(id, forceReload: true); + setState(() {}); + } on LocalisableException catch (exception) { + Navigator.of(context).pop(); + await showDialog( + context: context, + builder: (context) => _buildExceptionDialog(exception), + ); + commentTextController.dispose(); + + showDialog( + context: context, + builder: (context) => + _buildCommentDialog(comment: updatedComment, isEditing: true), + ); + } + } + + AlertDialog _buildCommentDialog( + {Comment? comment, String? commentText, bool isEditing = false}) { + final commentTextController = + TextEditingController(text: isEditing ? comment?.text : commentText); + final commentFormKey = GlobalKey(); + + final header = isEditing + ? _appLocalizations.editComment + : _appLocalizations.createComment; + + final saveLabel = + isEditing ? _appLocalizations.update : _appLocalizations.save; + // final saveAction = isEditing ? _updateExistingComment : _createNewComment; + + return AlertDialog( + title: Text(header), + content: SizedBox( + height: 120, + child: Form( + key: commentFormKey, + child: TextFormField( + // expands: true, + controller: commentTextController, + decoration: InputDecoration( + labelText: _appLocalizations.comment, + ), + expands: true, + minLines: null, + maxLines: null, + // onChanged: (value) => setState(() {}), + validator: (value) { + if (value == null || value.isEmpty) { + return _appLocalizations.emptyComment; + } + + return null; + }, + textCapitalization: TextCapitalization.sentences, + ), + ), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + commentTextController.clear(); + // commentTextController.dispose(); + }, + child: Text(_appLocalizations.cancel), + ), + TextButton( + onPressed: () => isEditing + ? _updateExistingComment(commentTextController, commentFormKey, + commentId: comment!.id) + : _createNewComment(commentTextController, commentFormKey), + child: Text(saveLabel), + ), + ], + ); + } + + AlertDialog _buildValidateDialog({required bool isValidated}) { + return AlertDialog( + title: Text(isValidated + ? _appLocalizations.unVerifyFlightHeader + : _appLocalizations.verifyFlightHeader), + content: Text(isValidated + ? _appLocalizations.unVerifyFlightBody + : _appLocalizations.verifyFlightBody), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(false); + }, + child: Text(_appLocalizations.cancel), + ), + TextButton( + onPressed: () async { + try { + // print("Validating flight ${flight!.flightID}"); + showDialog( + context: context, + builder: (context) => _buildLoadingDialog(isValidated + ? _appLocalizations.unVerifyingFlight + : _appLocalizations.verifyingFlight), + barrierDismissible: false); + await validateFlight(flight!.flightID, + isValidated: isValidated); + Navigator.of(context).pop(true); + Navigator.of(context).pop(true); + } on LocalisableException catch (exception) { + Navigator.of(context).pop(); + showDialog( + context: context, + builder: (context) => _buildExceptionDialog(exception)); + } + }, + child: Text(_appLocalizations.ok)) + ], + ); + } + + void _createComment() { + showDialog(context: context, builder: (context) => _buildCommentDialog()); + } + + void _editComment(Comment comment) { + showDialog( + context: context, + builder: (context) => + _buildCommentDialog(comment: comment, isEditing: true)); + } + + Future _validateFlight(bool isValidated) async { + final shouldReload = await showDialog( + context: context, + builder: (context) => _buildValidateDialog(isValidated: isValidated)); + + // print("Should reload: $shouldReload"); + + return shouldReload ?? false; + } + + // void _invalidateFlight() { + // showDialog( + // context: context, builder: (context) => _buildUnValidateDialog()); + // } + + @override + List get actions { + if (SessionManager.shared.isLoggedIn && flight != null) { + // print("Logged in: ${SessionManager.shared.isLoggedIn}"); + // print("Flight is null: ${flight == null}"); + // print("Username: ${SessionManager.shared.session?.username}"); + // print("Flight owner: ${flight?.owner}"); + + return [ + if (SessionManager.shared.session!.role == Role.professional && + flight!.ownerRole != Role.professional) + _buildValidateButton(flight!.validated), + _buildCommentButton(), + if (SessionManager.shared.session!.username == flight!.owner) + _buildEditButton() + ]; + } else { + // print("Not logged in or flight is null"); + return []; + } + } + + IconButton _buildEditButton() { + return IconButton( + onPressed: () async { + var shouldReload = await Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => FlightFormScreen( + flight: flight, + ), + ), + ); + + if (shouldReload ?? false) { + loadDetailFuture(id, forceReload: true); + } + }, + icon: const Icon(Icons.edit), + tooltip: AppLocalizations.of(context)!.edit, + ); + } + + IconButton _buildCommentButton() { + return IconButton( + icon: const Icon(Icons.comment), + tooltip: _appLocalizations.comment, + onPressed: () => _createComment(), + ); + } + + IconButton _buildValidateButton(bool isValidated) { + return IconButton( + icon: const Icon(Icons.verified), + tooltip: flight!.validated + ? _appLocalizations.unVerifyFlightHeader + : _appLocalizations.verifyFlightHeader, + onPressed: () async { + final shouldReload = await _validateFlight(isValidated); + + if (shouldReload) { + // FlightStore.shared.getFlight(id, forceReload: true); + loadDetailFuture(id, forceReload: true); + } + }, + ); + } + + @override + String get appBarHeader => + AppLocalizations.of(context)!.flightDetailHeader(id); + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + _labelStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontSizeDelta: 4.0); + // _headerStyle = + // Theme.of(context).textTheme.bodyText2!.apply(fontWeightDelta: 2); + + return super.build(context); + } + + @override + void processData(Flight flight) { + this.flight = flight; +// print(""" +// ****************************************************************** +// Processing the data....... +// id: ${flight.flightID} +// taxonomy: ${flight.taxonomy} +// owner: ${flight.owner} +// verified: ${flight.validated} +// ****************************************************************** +// """); + } + + @override + Widget buildDetailScreen(Flight flight) { + final currentLocale = _appLocalizations.localeName; + var italicStyle = + _labelStyle.apply(fontStyle: FontStyle.italic, fontWeightDelta: 2); + + // print("Flight is verified: ${flight.validated}"); + + return ListView( + padding: const EdgeInsets.all(8.0), + children: [ + HeaderRow(label: _appLocalizations.basicInfo), + _buildTextLabelDetailRow( + label: _appLocalizations.flightID, detail: "${flight.flightID}"), + _buildTextLabelDetailRow( + label: _appLocalizations.genus, + detail: flight.taxonomy.genus.name, + detailStyle: italicStyle), + _buildTextLabelDetailRow( + label: _appLocalizations.species, + detail: flight.taxonomy.name, + detailStyle: italicStyle), + _buildTextLabelDetailRow( + label: _appLocalizations.speciesConfidence, + detail: getConfidenceString(flight.confidence)), + _buildTextLabelDetailRow( + label: _appLocalizations.flightSize, + detail: getSizeString(flight.size)), + HeaderRow(label: _appLocalizations.dateAndTimeOfFlight), + _buildTextLabelDetailRow( + label: _appLocalizations.dateOfFlight, + detail: + DateFormat.yMMMd(currentLocale).format(flight.dateOfFlight)), + _buildTextLabelDetailRow( + label: _appLocalizations.timeOfFlight, + detail: DateFormat.jm(currentLocale).format(flight.dateOfFlight)), + HeaderRow(label: _appLocalizations.flightLocationHeader), + // _buildTextLabelDetailRow(label: "MAP GOES HERE"), + _buildLocationRow( + LatLng(flight.latitude, flight.longitude), flight.radius), + _buildTextLabelDetailRow( + label: _appLocalizations.gpsCoordinatesLabel, + detail: stringFromCoordinates( + latitude: flight.latitude, + longitude: flight.longitude, + precision: 2)), + _buildTextLabelDetailRow( + label: _appLocalizations.radiusDetailLabel, + detail: _appLocalizations.radiusDistanceDetail(flight.radius)), + HeaderRow(label: _appLocalizations.recordingInformationHeader), + _buildUserRow( + label: _appLocalizations.recordedByLabel, + username: flight.owner, + userRole: flight.ownerRole), + _buildTextLabelDetailRow( + label: _appLocalizations.dateRecordedDetailLabel, + detail: + DateFormat.yMMMd(currentLocale).format(flight.dateRecorded)), + _buildTextLabelDetailRow( + label: _appLocalizations.timeRecordedDetailLabel, + detail: DateFormat.jm(currentLocale).format(flight.dateRecorded)), + // if (flight.imageUrl != null) _buildImageRow(flight.imageUrl!), + // if (flight.images.isNotEmpty) + HeaderRow(label: _appLocalizations.imageHeaderDetail), + // if (flight.images.isNotEmpty) + _buildImagesRow(), + // for (var image in flight.images) _buildImageRow(image), + if (flight.hasWeather) _buildWeatherRows(), + if (flight.validated && flight.ownerRole != Role.professional) + _buildVerifiedRows( + verifiedBy: flight.validatedBy!, verifiedAt: flight.validatedAt!), + HeaderRow(label: _appLocalizations.commentsHeader), + // if (flight.comments.isEmpty) + // _buildTextLabelDetailRow(label: _appLocalizations.noCommentsMessage), + // if (flight.comments.isNotEmpty) _buildCommentsSection(flight.comments), + CommentSection(id: id, editAction: _editComment), + // for (final comment in flight!.comments) _buildCommentRow(comment), + HeaderRow(label: _appLocalizations.recordHistoryHeader), + _buildRecordHistoryRow(id) + ], + ); + } +} + +class CommentRow extends StatelessWidget { + const CommentRow({Key? key, required this.comment, required this.editAction}) + : super(key: key); + + final Comment comment; + final void Function(Comment) editAction; + + @override + Widget build(BuildContext context) { + final _appLocalizations = AppLocalizations.of(context)!; + final currentLocale = _appLocalizations.localeName; + final textStyle = Theme.of(context) + .textTheme + .bodyText2! + .apply(fontSizeDelta: 4.0) + .apply(fontWeightDelta: 2); + + return Card( + margin: const EdgeInsets.symmetric(vertical: 4.0), + elevation: 2.0, + // padding: EdgeInsets.all(4.0), + // decoration: BoxDecoration( + // color: Theme.of(context).cardColor, + // borderRadius: BorderRadius.circular(8), + // border: Border.all(color: Theme.of(context).dividerColor, width: 2), + // boxShadow: [ + // BoxShadow( + // offset: Offset(2, 2), + // color: Theme.of(context).shadowColor, + // blurRadius: 1.0, + // spreadRadius: 0) + // ]), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Row( + // crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + comment.text, + style: textStyle, + )), + if (comment.author == SessionManager.shared.session?.username) + IconButton( + onPressed: () => editAction(comment), + icon: const Icon(Icons.edit), + tooltip: _appLocalizations.editComment, + ), + ], + ), + TextButton( + onPressed: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => UserDetailScreen(comment.author), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + child: Text(comment.author, + style: textStyle.apply( + fontSizeDelta: -3, fontWeightDelta: -2), + textAlign: TextAlign.end), + ), + if (comment.authorRole == Role.flagged) + // const Icon(Icons.warning, color: Colors.red), + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: const Image( + image: AssetImage("assets/ant_circles/red_ant.png"), + width: 16.0, + ), + ), + if (comment.authorRole == Role.professional) + // const Icon(Icons.verified, color: Colors.green) + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: const Image( + image: AssetImage("assets/ant_circles/green_ant.png"), + width: 16.0, + ), + ) + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + child: Text( + DateFormat.yMMMd(currentLocale) + .add_jm() + .format(comment.time), + textAlign: TextAlign.end)) + ], + ) + ], + ), + ), + ); + } +} + +class CommentSection extends StatefulWidget { + const CommentSection( + {Key? key, + required this.id, + required this.editAction, + this.fetchCommentsFuture}) + : super(key: key); + + final int id; + final void Function(Comment) editAction; + final Future>? fetchCommentsFuture; + + @override + _CommentSectionState createState() => _CommentSectionState(); +} + +class _CommentSectionState extends State { + late Future> _fetchCommentsFuture; + + @override + void initState() { + _fetchCommentsFuture = + widget.fetchCommentsFuture ?? getCommentsForFlight(widget.id); + + super.initState(); + } + + void reload() { + setState(() { + _fetchCommentsFuture = getCommentsForFlight(widget.id); + }); + } + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + + final _labelStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontSizeDelta: 4.0); + + return FutureBuilder( + future: _fetchCommentsFuture, + builder: (BuildContext context, AsyncSnapshot> snapshot) { + if (snapshot.connectionState != ConnectionState.done) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const CircularProgressIndicator(), + Text(appLocalizations.loadingComments), + ], + ); + } + + if (snapshot.hasData) { + final comments = snapshot.data!; + + if (comments.isEmpty) { + return ListTile( + contentPadding: const EdgeInsets.all(8.0), + title: Text(appLocalizations.noCommentsMessage, style: _labelStyle,), + ); + } + + return Column( + children: comments + .map((comment) => + CommentRow(comment: comment, editAction: widget.editAction)) + .toList(), + ); + } + + return const CircularProgressIndicator(); + }, + ); + } +} + +class ImageViewer extends StatefulWidget { + const ImageViewer({Key? key, required this.imageUrl, this.heroTag}) + : super(key: key); + + final Uri imageUrl; + final String? heroTag; + + @override + _ImageViewerState createState() => _ImageViewerState(); +} + +class _ImageViewerState extends State { + var appBarVisible = true; + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Scaffold( + appBar: appBarVisible + ? AppBar( + // backgroundColor: Colors.black54.withOpacity(0.6), + backgroundColor: Colors.transparent, + elevation: 1.0, + // actions: [ + // IconButton( + // onPressed: () { + // Navigator.of(context).push( + // MaterialPageRoute( + // builder: (context) => FlightFormScreen( + // flight: flight, + // ), + // ), + // ); + // }, + // icon: Icon(Icons.edit), + // tooltip: appLocalization.edit, + // ) + // ], + ) + : null, + body: GestureDetector( + onTap: () => setState(() { + appBarVisible = !appBarVisible; + }), + child: Container( + child: InteractiveViewer( + boundaryMargin: const EdgeInsets.symmetric(vertical: 32), + // child: Image.network(imageUrl.toString()), + child: widget.heroTag != null + ? Hero( + child: CachedNetworkImage( + imageUrl: widget.imageUrl.toString()), + tag: widget.heroTag!, + ) + : CachedNetworkImage(imageUrl: widget.imageUrl.toString()), + maxScale: 10.0, + ), + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + color: Colors.black, + ), + ), + extendBody: true, + extendBodyBehindAppBar: true, + ), + ], + ); + } +} diff --git a/lib/flight_form.dart b/lib/flight_form.dart new file mode 100644 index 0000000..3893c5b --- /dev/null +++ b/lib/flight_form.dart @@ -0,0 +1,2035 @@ +/* + * flight_form.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; +import 'dart:io'; +import 'dart:typed_data'; + +import 'package:ant_nup_tracker/exceptions.dart'; +import 'package:ant_nup_tracker/flight_detail.dart'; +import 'package:ant_nup_tracker/flights.dart'; +import 'package:ant_nup_tracker/location_picker.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:collection/collection.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:intl/intl.dart'; +import 'package:lat_lng_to_timezone/lat_lng_to_timezone.dart'; +import 'package:flutter_image_compress/flutter_image_compress.dart'; +import 'package:permission_handler/permission_handler.dart' as ph; +import 'package:gallery_saver/gallery_saver.dart'; +// import 'package:json_annotation/json_annotation.dart'; + +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:timezone/timezone.dart' as tz; +import 'package:tuple/tuple.dart'; + +import 'common_ui_elements.dart'; +import 'dark_mode_theme_ext.dart'; + +// part 'flight_form.g.dart'; + +class FlightImagesRowWidget extends StatefulWidget { + const FlightImagesRowWidget( + {Key? key, + this.images = const [], + required this.onImageAdded, + required this.onImageRemoved}) + : super(key: key); + + final Iterable images; + final void Function(NewImage, int) onImageAdded; + final void Function(FlightFormImage, int) onImageRemoved; + + @override + _FlightImagesRowWidgetState createState() => _FlightImagesRowWidgetState(); +} + +class _FlightImagesRowWidgetState extends State { + final List images = []; + late AppLocalizations _appLocalizations; + + final _animatedListKey = GlobalKey(); + final _scrollController = ScrollController(); + + @override + void initState() { + images.clear(); + images.addAll(widget.images); + // print("There are ${images.length} images..."); + super.initState(); + } + + Future _getImageSource() async { + // if (kIsWeb) return OptionalImageSource.gallery; + + final useCamera = await ph.Permission.camera.isGranted; + + var isAndroid = false; + // var isIOS = false; + + if (!kIsWeb) { + isAndroid = Platform.isAndroid; + // isIOS = Platform.isIOS; + } + + final usePhotos = isAndroid + ? await ph.Permission.storage.isGranted + : await ph.Permission.photos.isGranted; + + // print("Will use camera: $useCamera"); + // print("Will use photos: $usePhotos"); + + if (!usePhotos && !useCamera) { + final choiceDialog = AlertDialog( + title: Text(_appLocalizations.noImageSourcesHeader), + content: Text(_appLocalizations.noImageSourcesContent), + actions: [ + TextButton( + child: Text(_appLocalizations.ok), + onPressed: () => Navigator.of(context).pop(null), + ) + ], + ); + return await showDialog( + context: context, builder: (context) => choiceDialog); + } + + final choiceDialog = SimpleDialog( + title: Text(_appLocalizations.chooseImageSource), + children: [ + if (!kIsWeb && useCamera) + SimpleDialogOption( + child: Text(_appLocalizations.camera), + onPressed: () => Navigator.of(context).pop(ImageSource.camera), + ), + if (usePhotos) + SimpleDialogOption( + child: Text(_appLocalizations.gallery), + onPressed: () => Navigator.of(context).pop(ImageSource.gallery), + ), + // SimpleDialogOption( + // child: Text(_appLocalizations.noImage), + // onPressed: () => Navigator.of(context).pop(OptionalImageSource.none), + // ), + SimpleDialogOption( + child: Text(_appLocalizations.cancel), + onPressed: () => Navigator.of(context).pop(null), + ) + ], + ); + + return await showDialog( + context: context, builder: (context) => choiceDialog); + } + + Future addNewImage() async { + final imageSource = await _getImageSource(); + final imagePicker = ImagePicker(); + final XFile? pickedImage; + switch (imageSource) { + case null: // Pressed cancel + return null; + case ImageSource.camera: // Get picture from the camera + pickedImage = await imagePicker.pickImage(source: ImageSource.camera); + if (pickedImage == null) return null; + + // pickedImage.saveTo(pickedImage.path); + await GallerySaver.saveImage(pickedImage.path); + // print("Saved picture... $didSave"); + + break; + case ImageSource.gallery: // Get picture from user photos + pickedImage = await imagePicker.pickImage(source: ImageSource.gallery); + if (pickedImage == null) return null; + break; + } + + var imageBytes = await pickedImage.readAsBytes(); + + var compressedImage = + await FlutterImageCompress.compressWithList(imageBytes, quality: 90); + + final newImage = NewImage(pickedImage, compressedImage); + + // final newIndex = _intermediateData.addNewImage(newImage); + + final newIndex = images.length; + + images.insert(newIndex, newImage); + + _animatedListKey.currentState!.insertItem(newIndex); + _scrollController.animateTo(_scrollController.position.maxScrollExtent, + duration: const Duration(milliseconds: 500), curve: Curves.easeOutCirc); + + return newIndex; + } + + Widget _loadImage(FlightFormImage image) { + if (image is NewImage) { + return Image.memory( + image.imageBytes, + fit: BoxFit.cover, + ); + } else if (image is ExistingImage) { + return CachedNetworkImage( + imageUrl: image.image.toString(), + progressIndicatorBuilder: (context, url, progress) => + CircularProgressIndicator( + value: progress.progress, + ), + fit: BoxFit.cover, + ); + } else { + return Image( + fit: BoxFit.cover, + image: Theme.of(context).isDarkMode + ? const AssetImage("assets/cartoon_ant/dark/cartoon_ant.png") + : const AssetImage("assets/cartoon_ant/cartoon_ant.png"), + ); + } + } + + Widget _buildImageRow(int index, FlightFormImage image) { + // print("Building row for image at index $index..."); + return SizedBox( + // width: 480, + height: 320, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Dismissible( + direction: DismissDirection.vertical, + key: ValueKey(image.hashCode), + onDismissed: (direction) { + // final image = images[index]; + images.removeAt(index); + _animatedListKey.currentState!.removeItem( + index, + (context, animation) => + Container(), //_loadImage(image)//_buildImageRow(index, image), + ); + widget.onImageRemoved(image, index); + }, + background: Container( + color: Colors.red, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(_appLocalizations.delete), + const Icon(Icons.delete) + ], + ), + ), + ), + child: _loadImage(image), + ), + ), + ); + } + + Widget _buildAddButton() { + return SizedBox( + width: 180, + height: 320, + child: InkWell( + onTap: () async { + final index = await addNewImage(); + + if (index != null) { + widget.onImageAdded(images[index] as NewImage, index); + } + }, + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [const Icon(Icons.add), Text(_appLocalizations.addImage)], + ), + ), + ), + ); + } + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + return SizedBox( + height: 340, + child: AnimatedList( + key: _animatedListKey, + scrollDirection: Axis.horizontal, + controller: _scrollController, + initialItemCount: images.length + 1, + shrinkWrap: true, + itemBuilder: + (BuildContext context, int index, Animation animation) => + index < images.length + ? _buildImageRow(index, images[index]) + : _buildAddButton(), + ), + ); + } +} + +class FlightFormScreen extends StatefulWidget { + const FlightFormScreen({this.flight, this.currentLocation, Key? key}) + : super(key: key); + + final Flight? flight; + final LatLng? currentLocation; + + @override + _FlightFormScreenState createState() => _FlightFormScreenState(); +} + +class _FlightFormScreenState extends State { + @override + void initState() { + super.initState(); + _flight = widget.flight; + if (_flight != null) { + _intermediateData = FlightFormIntermediateData.from(_flight!); + } else { + _intermediateData = FlightFormIntermediateData.blank( + currentLocation: widget.currentLocation, + ); + // getCurrentLocation().then((location) { + // if (location != null) { + // print( + // "Got current location ${stringFromLocation(location: location)}!"); + // _intermediateData.location = location; + // print("Selected Location is ${_intermediateData.location}"); + // // setState(() {}); + // } + // }); + } + _genusController = + TextEditingController(text: _intermediateData.genus?.name); + _speciesController = + TextEditingController(text: _intermediateData.species?.name); + _speciesSuggestions = _intermediateData.genus?.species ?? []; + // print(_flight); + } + + late final Flight? _flight; + // late final _FlightFormData _flightFormData; + + late TextStyle _labelStyle; + // late TextStyle _headerStyle; + late AppLocalizations _appLocalizations; + + final _animatedListKey = GlobalKey(); + + final _scrollController = ScrollController(); + + TextStyle get _detailStyle => _labelStyle.apply(fontWeightDelta: 2); + + bool get isEditing => _flight != null; + + String get appBarTitle => isEditing + ? AppLocalizations.of(context)!.editingFlightAppBar(_flight!.flightID) + : AppLocalizations.of(context)!.newFlightAppBar; + + Future Function() get doneAction => isEditing ? update : save; + + String get doneTooltip => + isEditing ? _appLocalizations.update : _appLocalizations.save; + + late FlightFormIntermediateData _intermediateData; + + // String _genus = ""; + // String _species = ""; + + late TextEditingController _genusController; + final _genusFocusNode = FocusNode(); + + late TextEditingController _speciesController; + final _speciesFocusNode = FocusNode(); + + Iterable _speciesSuggestions = []; + + // ConfidenceLevels _confidenceLevel = ConfidenceLevels.low; + // FlightSize _flightSize = FlightSize.manyQueens; + // DateTime _date = DateTime.now(); + // TimeOfDay _time = TimeOfDay.now(); + // LatLng _location = LatLng(0.0, 0.0); + // double _radius = 0.0; + // bool _hasImage = false; + // Uint8List? _image; + + // final _locationService = Location(); + + // Future _getCurrentLocation() async { + // var serviceEnabled = await _locationService.serviceEnabled(); + // + // if (!serviceEnabled) { + // // serviceEnabled = await + // } + // } + + // Widget _buildTextLabelDetailRow({ + // required String label, + // String? detail, + // TextStyle? detailStyle, + // }) { + // var textStyle = detailStyle ?? _labelStyle.apply(fontWeightDelta: 2); + // + // return Container( + // margin: EdgeInsets.symmetric(vertical: 12.0), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Expanded(child: Text(label, style: _labelStyle)), + // if (detail != null) + // Expanded( + // child: Text( + // detail, + // style: textStyle, + // textAlign: TextAlign.end, + // )), + // ], + // ), + // ); + // } + + // Widget _buildHeaderRow({required String label, TextStyle? headerStyle}) { + // var textStyle = headerStyle ?? _headerStyle; + // + // return Column( + // children: [ + // const Divider( + // thickness: 1, + // ), + // Padding( + // padding: const EdgeInsets.only(top: 8.0), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Expanded(child: Text(label, style: textStyle)), + // ], + // ), + // ), + // const Divider( + // thickness: 1, + // ) + // ], + // ); + // } + + Widget _buildTaxonomyRow() { + return LayoutBuilder( + builder: (context, constraints) { + final screenWidth = constraints.maxWidth; + + double widgetWidth = screenWidth; + + if (screenWidth >= 800) widgetWidth = screenWidth / 2 - 8; + + return Wrap( + spacing: 8, + runSpacing: 8, + // runAlignment: WrapAlignment.spaceBetween, + // alignment: WrapAlignment.spaceBetween, + children: [ + SizedBox( + width: widgetWidth, + // margin: EdgeInsets.symmetric(vertical: 16), + child: SizedBox( + height: 80, + child: RawAutocomplete( + textEditingController: _genusController, + focusNode: _genusFocusNode, + optionsViewBuilder: (context, onSelected, options) => Align( + alignment: Alignment.topLeft, + child: Material( + elevation: 2.0, + child: ConstrainedBox( + constraints: const BoxConstraints(maxHeight: 200.0), + child: ListView.builder( + shrinkWrap: true, + itemCount: options.length, + itemBuilder: (context, index) => InkWell( + onTap: () => onSelected(options.elementAt(index)), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0, + vertical: 16.0, + ), + child: Text( + options.elementAt(index).name, + style: Theme.of(context).textTheme.bodyText2!, + ), + ), + ), + ), + ), + ), + ), + optionsBuilder: (value) { + // var genera = TaxonomyManager.shared.genera; + + final genera = Genus.getAll(); + + // print("Building options."); + + if (value.text.trim().isEmpty) return genera; + + final results = genera + .where((element) => element.name + .toLowerCase() + .contains(value.text.toLowerCase())) + .toList(growable: false); + + results.sort((s1, s2) { + final positionBasedOrdering = s1.name + .toLowerCase() + .indexOf(value.text.toLowerCase()) + .compareTo(s2.name + .toLowerCase() + .indexOf(value.text.toLowerCase())); + return positionBasedOrdering != 0 + ? positionBasedOrdering + : s1.name.compareTo(s2.name); + }); + + // print("There are ${results.length} results"); + + return results; + }, + onSelected: (option) { + // print("Selected $option"); + + // setState(() { + // assert(TaxonomyManager.shared.genera.contains(option)); + _intermediateData.genus = option; + _speciesSuggestions = option.species; + // print(_speciesSuggestions); + setState(() {}); + // setState(() => _genus = option); + // setState(() => _flightFormData.updateGenus(option)); + + // print("Flight form genus is now ${_flightFormData.genus}"); + // }); + }, + fieldViewBuilder: (context, textEditingController, focusNode, + onFieldSubmitted) { + // print("building the form field for genus"); + + // textEditingController.text = _genus; + + // textEditingController.text = _genus; + // + // _globalKey.currentState!.save(); + + // print("Assigned the default value"); + + return TextFormField( + // initialValue: _genus, + controller: textEditingController, + decoration: InputDecoration( + labelText: _appLocalizations.genus, + filled: true, + ), + focusNode: focusNode, + validator: (value) { + if (value == null || value.isEmpty) { + return _appLocalizations.emptyGenus; + } + + if (Genus.getByName(value) == null) { + return _appLocalizations.invalidGenus; + } + return null; + }, + textInputAction: TextInputAction.next, + onSaved: (value) { + // print("Genus field callback: saved $value"); + if (value == null || value.isEmpty) return; + + final newGenus = Genus.getByName(value); + _intermediateData.genus = newGenus; + + if (newGenus != null) { + _speciesSuggestions = newGenus.species; + } + }, + textCapitalization: TextCapitalization.words, + autovalidateMode: AutovalidateMode.onUserInteraction, + ); + }, + ), + ), + ), + SizedBox( + width: widgetWidth, + // margin: EdgeInsets.symmetric(vertical: 16), + child: SizedBox( + height: 80, + child: RawAutocomplete( + textEditingController: _speciesController, + focusNode: _speciesFocusNode, + optionsViewBuilder: (context, onSelected, options) => Align( + alignment: Alignment.topLeft, + child: Material( + elevation: 2.0, + child: ConstrainedBox( + constraints: const BoxConstraints(maxHeight: 200.0), + child: ListView.builder( + shrinkWrap: true, + itemCount: options.length, + itemBuilder: (context, index) => InkWell( + onTap: () => onSelected(options.elementAt(index)), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0, + vertical: 16.0, + ), + child: Text( + options.elementAt(index).name, + style: Theme.of(context).textTheme.bodyText2!, + ), + ), + ), + ), + ), + ), + ), + displayStringForOption: (option) => option.name, + optionsBuilder: (value) { + final suggestions = + _speciesSuggestions.toList(growable: true); + + if (value.text.isEmpty) return suggestions; + + suggestions + ..retainWhere((element) => element.name + .toLowerCase() + .contains(value.text.toLowerCase())) + ..sort((s1, s2) { + final comparisonResult = s1.name + .toLowerCase() + .indexOf(value.text.toLowerCase()) + .compareTo(s2.name + .toLowerCase() + .indexOf(value.text.toLowerCase())); + + return comparisonResult != 0 + ? comparisonResult + : s1.name.compareTo(s2.name); + }); + + return suggestions; + }, + onSelected: (option) { + _intermediateData.species = option; + // print("Option is now $option, having name: ${option.name}"); + setState(() {}); + }, + fieldViewBuilder: (context, textEditingController, focusNode, + onFieldSubmitted) { + // print("Controller has value ${textEditingController.text}"); + return TextFormField( + // initialValue: _genus, + enabled: _intermediateData.genus != null, + controller: textEditingController, + decoration: InputDecoration( + labelText: _appLocalizations.species, + filled: true, + ), + focusNode: focusNode, + validator: (value) { + if (value == null || value.isEmpty) { + return _appLocalizations.emptySpecies; + } + + if (_intermediateData.genus == null) { + return _appLocalizations.emptyGenus; + } + + if (!_intermediateData.genus!.species + .map((e) => e.name) + .contains(value)) { + return _appLocalizations.invalidSpecies; + } + + return null; + }, + textInputAction: TextInputAction.next, + onSaved: (value) { + if (value == null || + value.isEmpty || + _intermediateData.genus == null) return; + + _intermediateData.species = Species.getByGenusAndName( + _intermediateData.genus!, value); + }, + textCapitalization: TextCapitalization.none, + autovalidateMode: AutovalidateMode.onUserInteraction, + ); + }, + ), + ), + ), + ], + ); + }, + ); + } + + String getConfidenceString(ConfidenceLevels level) { + switch (level) { + case ConfidenceLevels.low: + return _appLocalizations.lowConfidence; + case ConfidenceLevels.high: + return _appLocalizations.highConfidence; + } + } + + String getSizeString(FlightSize size) { + switch (size) { + case FlightSize.manyQueens: + return _appLocalizations.manyQueens; + case FlightSize.singleQueen: + return _appLocalizations.singleQueen; + } + } + + Widget _buildFlightSizeRow() { + return Container( + margin: const EdgeInsets.symmetric(vertical: 12), + alignment: Alignment.center, + child: FormField( + onSaved: (flightSize) => _intermediateData.flightSize = flightSize!, + initialValue: _intermediateData.flightSize, + builder: (state) => LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) { + final screenWidth = constraints.maxWidth; + + double widgetWidth = screenWidth; + + if (screenWidth >= 800) widgetWidth = screenWidth / 2 - 8; + + return Wrap( + runAlignment: WrapAlignment.spaceBetween, + alignment: WrapAlignment.spaceBetween, + spacing: 8, + runSpacing: 8, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + SizedBox( + width: widgetWidth, + child: Text( + _appLocalizations.flightSize, + style: _labelStyle, + textAlign: TextAlign.start, + ), + ), + Container( + alignment: Alignment.center, + child: ToggleButtons( + constraints: + BoxConstraints.expand(width: widgetWidth / 2 - 16), + isSelected: [ + for (final s in FlightSize.values) state.value == s + ], + children: [ + for (final s in FlightSize.values) + Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Text(getSizeString(s)), + ) + ], + onPressed: (int selectedIndex) { + state.didChange(FlightSize.values[selectedIndex]); + // setState(() { + // // _flightFormData.flightSize = + // // FlightSize.values[selectedIndex]; + // // _flightSize = FlightSize.values[selectedIndex]; + // }); + // print("Now selected size: ${state.value}"); + }, + ), + ), + ], + ); + }, + ), + )); + } + + Widget _buildSpeciesConfidenceRow() { + return Container( + margin: const EdgeInsets.symmetric(vertical: 12), + alignment: Alignment.center, + child: LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) { + final screenWidth = constraints.maxWidth; + + double widgetWidth = screenWidth; + + if (screenWidth >= 800) widgetWidth = screenWidth / 2 - 8; + + return Wrap( + runAlignment: WrapAlignment.spaceBetween, + alignment: WrapAlignment.spaceBetween, + spacing: 8, + runSpacing: 8, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + SizedBox( + width: widgetWidth, + child: Text( + _appLocalizations.speciesConfidence, + style: _labelStyle, + textAlign: TextAlign.start, + ), + ), + FormField( + onSaved: (confidenceValue) => + _intermediateData.confidenceLevel = confidenceValue!, + initialValue: _intermediateData.confidenceLevel, + builder: (state) => Container( + alignment: Alignment.center, + child: ToggleButtons( + constraints: + BoxConstraints.expand(width: widgetWidth / 2 - 16), + isSelected: [ + for (final c in ConfidenceLevels.values) + // _flightFormData.confidenceLevel == c + state.value == c + ], + children: [ + for (final c in ConfidenceLevels.values) + Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Text(getConfidenceString(c)), + ) + ], + onPressed: (int selectedIndex) { + // setState(() { + // _flightFormData.confidenceLevel = + // ConfidenceLevels.values[selectedIndex]; + // }); + state.didChange(ConfidenceLevels.values[selectedIndex]); + // print("Now selected confidence: ${state.value}"); + }, + ), + ), + ), + ], + ); + }, + )); + } + + final _earliestDate = DateTime.now().subtract(const Duration(days: 365 * 25)); + final _latestDate = DateTime.now(); + + Widget _buildDateAndTimeRow() { + final currentLocale = _appLocalizations.localeName; + // final textStyle = _labelStyle.apply(fontWeightDelta: 2); + + return Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + FormField( + onSaved: (value) => _intermediateData.time = value!, + initialValue: _intermediateData.time, + builder: (state) => Row( + children: [ + Text( + // DateFormat.jm(currentLocale).format(state.value!), + // formatTimeOfDay(state.value!), + state.value!.format(context), + style: _detailStyle, + // textAlign: TextAlign.end, + ), + IconButton( + onPressed: () async { + final newTime = await showTimePicker( + context: context, + initialTime: state.value ?? TimeOfDay.now()); + + if (newTime != null) state.didChange(newTime); + setState(() { + // _flightFormData.updateTime(newTime); + }); + }, + icon: const Icon(Icons.edit), + tooltip: _appLocalizations.edit, + ) + ], + ), + ), + FormField( + initialValue: _intermediateData.date, + onSaved: (date) => _intermediateData.date = date!, + builder: (state) => Row( + children: [ + Text( + DateFormat.yMMMd(currentLocale).format(state.value!), + style: _detailStyle, + // textAlign: TextAlign.end, + ), + IconButton( + onPressed: () async { + final newDate = await showDatePicker( + context: context, + initialDate: state.value!, + firstDate: _earliestDate, + lastDate: _latestDate); + + if (newDate != null) { + setState(() { + state.didChange(newDate); + // _flightFormData.updateDate(newDate); + }); + } + }, + icon: const Icon(Icons.edit), + tooltip: _appLocalizations.edit, + ) + ], + ), + ) + ], + ); + } + + Widget _buildFullLocationRow() { + // var locationString = _buildLocationString( + // latitude: _location.latitude, + // longitude: _location.longitude, + // radius: _radius); + + return Container( + margin: const EdgeInsets.symmetric(vertical: 12.0), + child: FormField>( + onSaved: (resultTuple) { + final newLocation = resultTuple!.item1; + final newRadius = resultTuple.item2; + + _intermediateData.location = newLocation; + _intermediateData.radius = newRadius; + }, + initialValue: + Tuple2(_intermediateData.location, _intermediateData.radius), + builder: (state) => Row( + children: [ + Expanded( + child: Text( + _buildLocationString( + latitude: state.value!.item1.latitude, + longitude: state.value!.item1.longitude, + radius: state.value!.item2, + ), + style: _detailStyle, + )), + IconButton( + onPressed: () async { + final currentLocation = await getCurrentLocation(); + + if (currentLocation != null) { + _intermediateData.location = currentLocation; + state.didChange(Tuple2(currentLocation, 0)); + } + }, + icon: const Icon(Icons.my_location), + tooltip: _appLocalizations.getCurrentLocation, + ), + IconButton( + onPressed: () async { + final newLocationAndRadius = await Navigator.of(context) + .push>(MaterialPageRoute( + builder: (context) => LocationPickerView( + locationPickerMode: + LocationPickerMode.locationAndRadius, + initialLocation: state.value!.item1, + initialRadius: state.value!.item2, + ), + fullscreenDialog: true)); + + if (newLocationAndRadius == null) return; + + // final newLocation = newLocationAndRadius.item1; + // final newRadius = newLocationAndRadius.item2; + + state.didChange(newLocationAndRadius); + + _intermediateData.location = newLocationAndRadius.item1; + _intermediateData.radius = newLocationAndRadius.item2; + + setState(() { + // _flightFormData.updateLocation(newLocation); + // _flightFormData.radius = newRadius; + }); + }, + icon: const Icon(Icons.edit), + tooltip: _appLocalizations.edit, + ) + ], + ), + ), + ); + } + + String _buildLocationString( + {required double latitude, + required double longitude, + required double radius}) { + final locationStringBuffer = StringBuffer(); + locationStringBuffer.write(stringFromCoordinates( + latitude: latitude, longitude: longitude, precision: 2)); + locationStringBuffer.write(" \u00b1 "); + locationStringBuffer.write(_appLocalizations.radiusDistanceDetail(radius)); + return locationStringBuffer.toString(); + } + + // Widget _buildImageToggleRow() { + // return Container( + // margin: const EdgeInsets.symmetric(vertical: 12), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Expanded(child: Text(_appLocalizations.uploadImage)), + // FormField( + // onSaved: (hasImage) => _hasImage = hasImage!, + // initialValue: _hasImage, + // builder: (state) => Switch( + // value: state.value!, + // onChanged: (value) async { + // // final scrollExtent = _scrollController.position.maxScrollExtent; + // state.didChange(value); + // + // setState(() { + // _hasImage = value; + // }); + // + // // print("Scrolling..."); + // // print("Max scroll extent was $scrollExtent"); + // print( + // "Max extent is now ${_scrollController.position.maxScrollExtent}"); + // // print("Min extent is now ${_scrollController.position.minScrollExtent}"); + // // // _scrollController.jumpTo(_scrollController.position.maxScrollExtent); + // _scrollController.animateTo( + // _scrollController.position.maxScrollExtent, + // duration: const Duration(milliseconds: 500), + // curve: Curves.easeOutCirc); + // // + // // _lastScrollPosition = scrollExtent; + // }, + // ), + // ) + // ], + // ), + // ); + // } + + // Widget _loadImage(FlightFormImage image) { + // if (image is NewImage) { + // return Image.memory(image.imageBytes); + // } else if (image is ExistingImage) { + // return CachedNetworkImage( + // imageUrl: image.image.toString(), + // progressIndicatorBuilder: (context, url, progress) => + // CircularProgressIndicator( + // value: progress.progress, + // ), + // ); + // } else { + // return Image( + // image: Theme.of(context).isDarkMode + // ? const AssetImage("assets/cartoon_ant/dark/cartoon_ant.png") + // : const AssetImage("assets/cartoon_ant/cartoon_ant.png"), + // ); + // } + // } + + // Widget _buildImageRow(int index, FlightFormImage image) { + // return Padding( + // padding: const EdgeInsets.all(8.0), + // child: Dismissible( + // key: ValueKey(index), + // onDismissed: (direction) { + // _intermediateData.removeImage(image, index); + // _animatedListKey.currentState!.removeItem( + // index, (context, animation) => _buildImageRow(index, image)); + // }, + // background: Container( + // color: Colors.red, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // Text(_appLocalizations.delete), + // const Icon(Icons.delete) + // ], + // ), + // ), + // child: _loadImage(image), + // ), + // ); + // } + // + // Widget _buildAddImageRow() { + // return Center( + // child: IconButton( + // icon: const Icon(Icons.add), + // tooltip: _appLocalizations.addImage, + // onPressed: addNewImage, + // ), + // ); + // } + + Future addNewImage() async { + final imageSource = await _getImageSource(); + final imagePicker = ImagePicker(); + final XFile? pickedImage; + switch (imageSource) { + case null: // Pressed cancel + return; + case ImageSource.camera: // Get picture from the camera + pickedImage = await imagePicker.pickImage(source: ImageSource.camera); + if (pickedImage == null) return; + break; + case ImageSource.gallery: // Get picture from user photos + pickedImage = await imagePicker.pickImage(source: ImageSource.gallery); + if (pickedImage == null) return; + break; + } + + var imageBytes = await pickedImage.readAsBytes(); + + var compressedImage = + await FlutterImageCompress.compressWithList(imageBytes, quality: 90); + + final newImage = NewImage(pickedImage, compressedImage); + + final newIndex = _intermediateData.addNewImage(newImage); + + _animatedListKey.currentState!.insertItem(newIndex); + _scrollController.animateTo(_scrollController.position.maxScrollExtent, + duration: const Duration(milliseconds: 500), curve: Curves.easeOutCirc); + +// state.didChange(imageBytes); +// // state. +// print("State has been updated"); +// print("State now has length: ${state.value?.length ?? 0}"); +// _image = imageBytes; +// await _flightFormData.updateImage(pickedImage); +// setState(() {}); + } + + // Widget _buildImageRow(int index, FlightFormImage? image) { + // return FormField( + // initialValue: image, + // validator: (value) { + // // if (_hasImage && + // // (_flight != null && _flight!.imageUrl == null || _flight == null) && + // // value == null) return _appLocalizations.pleaseSelectImage; + // if (value == null) return _appLocalizations.pleaseSelectImage; + // }, + // autovalidateMode: AutovalidateMode.always, + // // onSaved: (value) => _image = value, + // onSaved: (value) { + // if (value is NewImage) { + // _intermediateData.addNewImage(value); + // } + // }, + // builder: (state) => Column( + // children: [ + // Dismissible( + // key: ValueKey(index), + // background: Container( + // color: Colors.red, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // Text(_appLocalizations.delete), + // const Icon(Icons.delete) + // ], + // ), + // ), + // onDismissed: (direction) => _intermediateData.removeImage(index), + // child: InkWell( + // child: _getImageContent(state), + // // onTap: image is ExistingImage + // // ? null + // // : () async { + // // final imageSource = await _getImageSource(); + // // final imagePicker = ImagePicker(); + // // final XFile? pickedImage; + // // + // // switch (imageSource) { + // // case null: // Pressed cancel + // // return; + // // case ImageSource.camera: // Get picture from the camera + // // pickedImage = await imagePicker.pickImage( + // // source: ImageSource.camera); + // // if (pickedImage == null) return; + // // break; + // // case ImageSource + // // .gallery: // Get picture from user photos + // // pickedImage = await imagePicker.pickImage( + // // source: ImageSource.gallery); + // // if (pickedImage == null) return; + // // break; + // // // case ImageSource.none: + // // // pickedImage = null; + // // // break; + // // } + // // + // // var imageBytes = await pickedImage.readAsBytes(); + // // state.didChange(imageBytes); + // // + // // // state. + // // + // // print("State has been updated"); + // // + // // print( + // // "State now has length: ${state.value?.length ?? 0}"); + // // + // // _image = imageBytes; + // // + // // // await _flightFormData.updateImage(pickedImage); + // // + // // setState(() {}); + // // }, + // ), + // ), + // if (state.hasError) + // Text( + // state.errorText!, + // style: Theme.of(context) + // .textTheme + // .bodyText1! + // .apply(color: Colors.red), + // textAlign: TextAlign.start, + // ) + // ], + // ), + // ); + // } + + Future _getImageSource() async { + // if (kIsWeb) return OptionalImageSource.gallery; + + final useCamera = await ph.Permission.camera.status; + final usePhotos = await ph.Permission.storage.status; + + // print("Will use camera: $useCamera"); + // print("Will use photos: $usePhotos"); + + final choiceDialog = SimpleDialog( + title: Text(_appLocalizations.chooseImageSource), + children: [ + if (!kIsWeb && useCamera == ph.PermissionStatus.granted) + SimpleDialogOption( + child: Text(_appLocalizations.camera), + onPressed: () => Navigator.of(context).pop(ImageSource.camera), + ), + if (usePhotos == ph.PermissionStatus.granted) + SimpleDialogOption( + child: Text(_appLocalizations.gallery), + onPressed: () => Navigator.of(context).pop(ImageSource.gallery), + ), + // SimpleDialogOption( + // child: Text(_appLocalizations.noImage), + // onPressed: () => Navigator.of(context).pop(OptionalImageSource.none), + // ), + SimpleDialogOption( + child: Text(_appLocalizations.cancel), + onPressed: () => Navigator.of(context).pop(null), + ) + ], + ); + + return await showDialog( + context: context, builder: (context) => choiceDialog); + } + + // Image _getImageContent(FormFieldState state) { + // print("State value for image has length: ${state.value?.length ?? 0}"); + // if (_hasImage && state.value == null && _flight?.imageUrl != null) { + // return Image.network(_flight!.imageUrl!.toString()); + // } else if (state.value != null) { + // // return Image.memory(_flightFormData.image!); + // return Image.memory(state.value!); + // } else { + // return const Image( + // image: AssetImage("assets/cartoon_ant/cartoon_ant.png")); + // } + // } + + final _globalKey = GlobalKey(); + + // Widget _buildFormBody() { + // _appLocalizations = AppLocalizations.of(context)!; + // // var italicStyle = + // // _labelStyle.apply(fontStyle: FontStyle.italic, fontWeightDelta: 2); + // + // return Form( + // key: _globalKey, + // child: ListView( + // children: [ + // _buildHeaderRow(label: _appLocalizations.taxonomy), + // _buildTaxonomyRow(), + // _buildSpeciesConfidenceRow(), + // _buildHeaderRow(label: _appLocalizations.flightSizeHeader), + // _buildFlightSizeRow(), + // _buildHeaderRow(label: _appLocalizations.dateAndTimeOfFlight), + // _buildDateAndTimeRow(), + // _buildHeaderRow(label: _appLocalizations.flightLocationHeader), + // _buildFullLocationRow(), + // _buildHeaderRow(label: _appLocalizations.uploadImage), + // _buildImageToggleRow(), + // if (_hasImage) _buildImageRow() + // ], + // controller: _scrollController, + // ), + // ); + // } + + @override + Widget build(BuildContext context) { + _labelStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontSizeDelta: 4.0); + // _headerStyle = + // Theme.of(context).textTheme.bodyText2!.apply(fontWeightDelta: 2); + _appLocalizations = AppLocalizations.of(context)!; + + return Form( + key: _globalKey, + child: GestureDetector( + onTap: () { + _globalKey.currentState!.save(); + FocusManager.instance.primaryFocus?.unfocus(); + // setState(() {}); + }, + child: Scaffold( + appBar: AppBar( + title: Text(appBarTitle), + actions: [ + IconButton( + onPressed: doneAction, + icon: const Icon(Icons.done), + tooltip: doneTooltip, + ) + ], + ), + body: SafeArea( + child: AnimatedList( + controller: _scrollController, + padding: + const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + key: _animatedListKey, + itemBuilder: (context, index, animation) { + final row = _intermediateData.getRowForIndex(index); + return SizeTransition( + sizeFactor: + animation.drive(CurveTween(curve: Curves.easeIn)), + child: _buildRow(row: row, index: index)); + }, + initialItemCount: _intermediateData.rowCount, + ), + ), + ), + ), + ); + } + + Future save() async { + if (_globalKey.currentState!.validate()) { + _globalKey.currentState!.save(); + } else { + return; + } + // print("Sending... eventually"); + + final timezone = latLngToTimezoneString(_intermediateData.location.latitude, + _intermediateData.location.longitude); + final timeZoneLocation = tz.getLocation(timezone); + + final dateOfFlight = tz.TZDateTime( + timeZoneLocation, + _intermediateData.date.year, + _intermediateData.date.month, + _intermediateData.date.day, + _intermediateData.time.hour, + _intermediateData.time.minute, + ); + + // if () + + // final dateOfFlight = DateTime( + // _intermediateData.date.year, + // _intermediateData.date.month, + // _intermediateData.date.day, + // _intermediateData.time.hour, + // _intermediateData.time.minute); + + // final genus = Genus.get(_intermediateData.genus!); + // final taxonomy = Species.get(genus, _intermediateData.species!); + + final taxonomy = _intermediateData.species!; + + final flightFormData = FlightFormData( + taxonomy: taxonomy, + confidenceLevel: _intermediateData.confidenceLevel, + flightSize: _intermediateData.flightSize, + dateOfFlight: dateOfFlight, + location: _intermediateData.location, + radius: _intermediateData.radius, + // hasImage: _hasImage, + // image: _image, + ); + + try { + showDialog( + context: context, + builder: (context) => _buildLoadingDialog(), + barrierDismissible: false); + await addNewFlight( + flightFormData, _intermediateData.newImages.map((e) => e.imageFile)); + Navigator.of(context).pop(); + Navigator.of(context).pop(true); + } on LocalisableException catch (exception) { + Navigator.of(context).pop(); + showDialog( + context: context, + builder: (context) => _buildExceptionDialog(exception)); + } + } + + Future update() async { + if (_globalKey.currentState!.validate()) { + _globalKey.currentState!.save(); + } else { + return; + } + // print("Sending... eventually"); + + // if () + final timezone = latLngToTimezoneString(_intermediateData.location.latitude, + _intermediateData.location.longitude); + final timeZoneLocation = tz.getLocation(timezone); + + final dateOfFlight = tz.TZDateTime( + timeZoneLocation, + _intermediateData.date.year, + _intermediateData.date.month, + _intermediateData.date.day, + _intermediateData.time.hour, + _intermediateData.time.minute, + ); + + // final dateOfFlight = DateTime( + // _intermediateData.date.year, + // _intermediateData.date.month, + // _intermediateData.date.day, + // _intermediateData.time.hour, + // _intermediateData.time.minute); + + // final genus = Genus.get(_intermediateData.genus); + // final taxonomy = Species.get(genus, _intermediateData.species); + + final taxonomy = _intermediateData.species!; + + final flightFormData = FlightFormData( + taxonomy: taxonomy, + confidenceLevel: _intermediateData.confidenceLevel, + flightSize: _intermediateData.flightSize, + dateOfFlight: dateOfFlight, + location: _intermediateData.location, + radius: _intermediateData.radius, + // hasImage: _hasImage, + // image: _image, + ); + + final originalFlightData = FlightFormIntermediateData.from(_flight!); + final updatedFlightData = _intermediateData; + try { + showDialog( + context: context, + builder: (context) => _buildLoadingDialog(), + barrierDismissible: false, + ); + + var shouldReload = false; + + final updateMethod = FlightFormIntermediateData.getUpdateMethod( + originalFlightData, updatedFlightData); + + if (updateMethod != FlightUpdateMethod.none) { + // print("Not equal! Printing each field..."); + // print( + // "Genus: ${originalFlightData.genus} vs. ${updatedFlightData.genus}"); + // print( + // "Species: ${originalFlightData.species} vs. ${updatedFlightData.species}"); + // print( + // "Confidence: ${originalFlightData.confidenceLevel} vs. ${updatedFlightData.confidenceLevel}"); + // print( + // "Size: ${originalFlightData.flightSize} vs. ${updatedFlightData.flightSize}"); + // print("Date: ${originalFlightData.date} vs. ${updatedFlightData.date}"); + // print("Time: ${originalFlightData.time} vs. ${updatedFlightData.time}"); + // print( + // "Location: ${originalFlightData.location} vs. ${updatedFlightData.location}"); + // print( + // "Radius: ${originalFlightData.radius} vs. ${updatedFlightData.radius}"); + // print( + // "Images: ${originalFlightData.images} vs. ${updatedFlightData.images}"); + await updateFlight( + _flight!.flightID, + flightFormData, + _intermediateData.newImages.map((image) => image.imageFile), + _intermediateData.removedImages, + updateMethod); + shouldReload = true; + } + Navigator.of(context).pop(shouldReload); + Navigator.of(context).pop(shouldReload); + } on LocalisableException catch (exception) { + Navigator.of(context).pop(); + showDialog( + context: context, + builder: (context) => _buildExceptionDialog(exception)); + } + } + + AlertDialog _buildLoadingDialog() => AlertDialog( + title: Text(_appLocalizations.uploadingFlight), + content: const LinearProgressIndicator(), + ); + + AlertDialog _buildExceptionDialog(LocalisableException exception) { + return AlertDialog( + title: Text(exception.getLocalisedName(context)), + content: Text(exception.getLocalisedDescription(context)), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(_appLocalizations.ok), + ) + ], + ); + } + + String getStringForHeader(_FlightFormHeaders header) { + switch (header) { + case _FlightFormHeaders.taxonomy: + return _appLocalizations.taxonomy; + case _FlightFormHeaders.flightSize: + return _appLocalizations.flightSizeHeader; + case _FlightFormHeaders.dateAndTimeOfFlight: + return _appLocalizations.dateAndTimeOfFlight; + case _FlightFormHeaders.flightLocation: + return _appLocalizations.flightLocationHeader; + case _FlightFormHeaders.images: + return _appLocalizations.imagesHeader; + } + } + + Widget _buildRow({required _FlightFormRow row, required int index}) { + if (row is _HeaderRow) { + final text = getStringForHeader(row.content); + return HeaderRow(label: text); + } + + if (row is _TaxonomyRow) { + return _buildTaxonomyRow(); + } + + if (row is _DateAndTimeRow) { + return _buildDateAndTimeRow(); + } + + if (row is _FlightSizeRow) { + return _buildFlightSizeRow(); + } + + if (row is _ConfidenceRow) { + return _buildSpeciesConfidenceRow(); + } + + if (row is _LocationRow) { + return _buildFullLocationRow(); + } + + // if (row is _ImageRow) { + // return _buildImageRow(index, row.content); + // } + + if (row is _ImagesRow) { + return FlightImagesRowWidget( + images: row.content, + onImageAdded: (image, index) { + _intermediateData.addNewImage(image); + }, + onImageRemoved: (image, index) { + _intermediateData.removeImage(image, index); + }); + } + + // if (row is _IconDataRow) { + // return _buildAddImageRow(); + // } + + return Container(); + } +} + +enum _FlightFormHeaders { + taxonomy, + flightSize, + dateAndTimeOfFlight, + flightLocation, + images +} + +// enum _FlightFormRowTypes { +// taxonomyHeader, +// taxonomyRow, +// confidenceRow, +// flightSizeHeader, +// flightSizeRow, +// dateAndTimeRow, +// locationRowHeader, +// locationRow, +// imagesHeader, +// addImageRow, +// imageRow +// } + +abstract class _FlightFormRow { + T get content; + + // set content(T newContent); +} + +class _HeaderRow implements _FlightFormRow<_FlightFormHeaders> { + const _HeaderRow(this._content); + + final _FlightFormHeaders _content; + + @override + _FlightFormHeaders get content => _content; +} + +class _TaxonomyRow implements _FlightFormRow> { + _TaxonomyRow(this._genus, this._species); + + Genus? _genus; + Species? _species; + + void setGenus(Genus? newGenus) => _genus = newGenus; + void setSpecies(Species? newSpecies) => _species = newSpecies; + + @override + Tuple2 get content => Tuple2(_genus, _species); +} + +class _ConfidenceRow implements _FlightFormRow { + _ConfidenceRow(this.content); + + // ConfidenceLevels _confidenceLevel; + + @override + ConfidenceLevels content; +} + +class _FlightSizeRow implements _FlightFormRow { + // _FlightSizeRow(this._flightSize); + // + // FlightSize _flightSize; + // + // @override + // FlightSize get content => _flightSize; + + _FlightSizeRow(this.content); + + @override + FlightSize content; +} + +class _DateAndTimeRow implements _FlightFormRow> { + _DateAndTimeRow(this._date, this._time); + + DateTime _date; + TimeOfDay _time; + + void setDate(DateTime newDate) => _date = newDate; + void setTime(TimeOfDay newTime) => _time = newTime; + + @override + Tuple2 get content => Tuple2(_date, _time); +} + +class _LocationRow implements _FlightFormRow> { + _LocationRow(this._location, this._radius); + + LatLng _location; + double _radius; + + void setLocation(LatLng newLocation) => _location = newLocation; + void setRadius(double newRadius) => _radius = newRadius; + + @override + Tuple2 get content => Tuple2(_location, _radius); +} + +// class _ImageRow implements _FlightFormRow> { +// _ImageRow(this._imageIndex, this._image); +// +// FlightFormImage _image; +// int _imageIndex; +// +// @override +// Tuple2 get content => Tuple2(_imageIndex, _image); +// } + +class _ImagesRow implements _FlightFormRow> { + _ImagesRow(this.content); + + @override + Iterable content; +} + +// class _ImageRow implements _FlightFormRow { +// _ImageRow(this.content); +// +// @override +// FlightFormImage content; +// } + +class _IconDataRow implements _FlightFormRow { + const _IconDataRow(this._content); + + final IconData _content; + + @override + IconData get content => _content; +} + +extension Base64EncodeJson on PickedFile { + Future toBase64Encoded() async => base64Encode(await readAsBytes()); +} + +Future base64EncodeImage(PickedFile? image) async => + image != null ? base64Encode(await image.readAsBytes()) : null; + +String? base64EncodeImageBytes(Uint8List? imageBytes) => + imageBytes != null ? base64Encode(imageBytes) : null; + +abstract class FlightFormImage {} + +class ExistingImage implements FlightFormImage { + final Uri image; + final int imageId; + + const ExistingImage(this.imageId, this.image); + + @override + bool operator ==(Object other) { + return other is ExistingImage && + image == other.image && + imageId == other.imageId; + } + + @override + int get hashCode => image.hashCode + imageId.hashCode; +} + +class NewImage implements FlightFormImage { + final XFile imageFile; + final Uint8List imageBytes; + + const NewImage(this.imageFile, this.imageBytes); + + @override + bool operator ==(Object other) { + return other is NewImage && + other.imageFile == imageFile && + other.imageBytes == imageBytes; + } + + @override + int get hashCode => imageFile.hashCode + imageBytes.hashCode; +} + +class FlightFormIntermediateData { + Genus? get genus => _taxonomyRow.content.item1; + Species? get species => _taxonomyRow.content.item2; + ConfidenceLevels get confidenceLevel => _confidenceRow.content; + FlightSize get flightSize => _flightSizeRow.content; + DateTime get date => _dateAndTimeRow.content.item1; + TimeOfDay get time => _dateAndTimeRow.content.item2; + LatLng get location => _locationRow.content.item1; + double get radius => _locationRow.content.item2; + + tz.TZDateTime get dateAndTimeOfFlight { + final timezone = + latLngToTimezoneString(location.latitude, location.longitude); + final timeZoneLocation = tz.getLocation(timezone); + + return tz.TZDateTime( + timeZoneLocation, + date.year, + date.month, + date.day, + time.hour, + time.minute, + ); + } + + get rowCount => _flightFormSkeleton.length; + + set genus(Genus? newGenus) => _taxonomyRow.setGenus(newGenus); + set species(Species? newSpecies) => _taxonomyRow.setSpecies(newSpecies); + set confidenceLevel(ConfidenceLevels newConfidence) => + _confidenceRow.content = newConfidence; + set flightSize(FlightSize newFlightSize) => + _flightSizeRow.content = newFlightSize; + set date(DateTime newDate) => _dateAndTimeRow.setDate(newDate); + set time(TimeOfDay newTime) => _dateAndTimeRow.setTime(newTime); + set location(LatLng newLocation) => _locationRow.setLocation(newLocation); + set radius(double newRadius) => _locationRow.setRadius(newRadius); + + final _TaxonomyRow _taxonomyRow; + final _ConfidenceRow _confidenceRow; + final _FlightSizeRow _flightSizeRow; + final _DateAndTimeRow _dateAndTimeRow; + final _LocationRow _locationRow; + + final _addRow = const _IconDataRow(Icons.add); + + late final List images; + final _removedImages = []; + + // List get newImages => List.unmodifiable(_flightFormSkeleton + // .whereType<_ImageRow>() + // .map((imageRow) => imageRow.content) + // .whereType()); + + List get newImages => + List.unmodifiable(images.whereType()); + + List get removedImages => List.unmodifiable(_removedImages); + + late final List<_FlightFormRow> _flightFormSkeleton; + + List<_FlightFormRow> _generateFlightFormSkeleton() { + return [ + const _HeaderRow(_FlightFormHeaders.taxonomy), + _taxonomyRow, + _confidenceRow, + const _HeaderRow(_FlightFormHeaders.flightSize), + _flightSizeRow, + const _HeaderRow(_FlightFormHeaders.dateAndTimeOfFlight), + _dateAndTimeRow, + const _HeaderRow(_FlightFormHeaders.flightLocation), + _locationRow, + const _HeaderRow(_FlightFormHeaders.images), + _ImagesRow(images), + _addRow, + ]; + } + + FlightFormIntermediateData.blank({LatLng? currentLocation}) + : _taxonomyRow = _TaxonomyRow(null, null), + _confidenceRow = _ConfidenceRow(ConfidenceLevels.low), + _flightSizeRow = _FlightSizeRow(FlightSize.manyQueens), + _dateAndTimeRow = _DateAndTimeRow(DateTime.now(), TimeOfDay.now()), + _locationRow = _LocationRow(currentLocation ?? const LatLng(0, 0), 0) { + images = []; + _flightFormSkeleton = _generateFlightFormSkeleton(); + } + + FlightFormIntermediateData.from(Flight flight) + : _taxonomyRow = _TaxonomyRow(flight.taxonomy.genus, flight.taxonomy), + _confidenceRow = _ConfidenceRow(flight.confidence), + _flightSizeRow = _FlightSizeRow(flight.size), + _dateAndTimeRow = _DateAndTimeRow( + flight.dateOfFlight, + TimeOfDay.fromDateTime(flight.dateOfFlight), + ), + _locationRow = _LocationRow( + LatLng(flight.latitude, flight.longitude), flight.radius) { + // if (flight.hasImage) { + images = List.from( + flight.images.map((e) => ExistingImage(e.id, e.image))); + _flightFormSkeleton = _generateFlightFormSkeleton(); + // } + } + + int addNewImage(NewImage image) { + // final index = _flightFormSkeleton.length - 1; + // _flightFormSkeleton.insert(index, _ImageRow(image)); + // return index; + images.insert(images.length, image); + return images.length - 1; + } + + void removeImage(FlightFormImage image, int index) { + // final row = _flightFormSkeleton[index]; + // + // if (row is! _ImageRow) { + // throw NotImageRowException(); + // } + + // final image = row.content; + // final image = images[index]; + + if (image is ExistingImage) { + _removedImages.add(image.imageId); + } + + // print("The list images has length ${images.length}"); + + // print(images); + + images.removeAt(index); + // _flightFormSkeleton.removeAt(index); + } + + _FlightFormRow getRowForIndex(int i) { + return _flightFormSkeleton[i]; + } + + @override + bool operator ==(Object other) { + return other is FlightFormIntermediateData && + genus == other.genus && + species == other.species && + confidenceLevel == other.confidenceLevel && + flightSize == other.flightSize && + date == other.date && + time == other.time && + location == other.location && + radius == other.radius && + const ListEquality().equals(images, other.images) && + const ListEquality() + .equals(newImages, other.newImages); + } + + @override + int get hashCode => + genus.hashCode + + species.hashCode + + location.hashCode + + date.hashCode + + time.hashCode; + + static FlightUpdateMethod getUpdateMethod( + FlightFormIntermediateData original, FlightFormIntermediateData updated) { + final changedContent = original.genus != updated.genus || + original.species != updated.species || + original.confidenceLevel != updated.confidenceLevel || + original.flightSize != updated.flightSize || + original.date != updated.date || + original.time != updated.time || + original.location != updated.location || + original.radius != updated.radius; + + final changedImages = + updated.removedImages.isNotEmpty || updated.newImages.isNotEmpty; + + if (changedImages && changedContent) { + return FlightUpdateMethod.all; + } + + if (changedImages) { + return FlightUpdateMethod.images; + } + + if (changedContent) { + return FlightUpdateMethod.content; + } + + return FlightUpdateMethod.none; + } +} + +class FlightFormData { + final Species taxonomy; + final ConfidenceLevels confidenceLevel; + + final FlightSize flightSize; + final tz.TZDateTime dateOfFlight; + final LatLng location; + final double radius; + + // final bool hasImage; + // final Uint8List? image; + + const FlightFormData({ + required this.taxonomy, + required this.confidenceLevel, + required this.flightSize, + required this.dateOfFlight, + required this.location, + required this.radius, + // required this.hasImage, + // this.image, + }); + + FlightFormData.from(FlightFormIntermediateData intermediateData) + : taxonomy = intermediateData.species!, + confidenceLevel = intermediateData.confidenceLevel, + flightSize = intermediateData.flightSize, + // dateOfFlight = DateTime( + // intermediateData.date.year, + // intermediateData.date.month, + // intermediateData.date.day, + // intermediateData.time.hour, + // intermediateData.time.minute, + // ), + dateOfFlight = intermediateData.dateAndTimeOfFlight, + location = intermediateData.location, + radius = intermediateData.radius; + + Map toJson() { + // print("Flight occurred at ${dateOfFlight.toIso8601String()}"); + return { + 'taxonomy': taxonomy.id, + 'confidence': _$ConfidenceLevelsEnumMap[confidenceLevel], + 'size': _$FlightSizeEnumMap[flightSize], + 'dateOfFlight': dateOfFlight.toIso8601String(), + 'latitude': location.latitude, + 'longitude': location.longitude, + 'radius': radius, + // 'hasImage': hasImage, + // if (image != null) 'image': base64EncodeImageBytes(image), + }; + } +} + +const _$ConfidenceLevelsEnumMap = { + ConfidenceLevels.low: 0, + ConfidenceLevels.high: 1, +}; + +const _$FlightSizeEnumMap = { + FlightSize.manyQueens: 0, + FlightSize.singleQueen: 1, +}; diff --git a/lib/flight_form.g.dart b/lib/flight_form.g.dart new file mode 100644 index 0000000..5145ebd --- /dev/null +++ b/lib/flight_form.g.dart @@ -0,0 +1,49 @@ +/* + * flight_form.g.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// // GENERATED CODE - DO NOT MODIFY BY HAND +// +// part of 'flight_form.dart'; +// +// // ************************************************************************** +// // JsonSerializableGenerator +// // ************************************************************************** +// +// Future> _$_FlightFormDataToJson(_FlightFormData instance) async => +// { +// 'taxonomy': instance.species?.toJson(), +// 'confidence': _$ConfidenceLevelsEnumMap[instance.confidenceLevel], +// 'size': _$FlightSizeEnumMap[instance.flightSize], +// 'latitude': instance.latitude, +// 'longitude': instance.longitude, +// 'radius': instance.radius, +// 'hasImage': instance.hasImage, +// 'image': await base64EncodeImage(instance.image), +// }; +// +// const _$ConfidenceLevelsEnumMap = { +// ConfidenceLevels.low: 0, +// ConfidenceLevels.high: 1, +// }; +// +// const _$FlightSizeEnumMap = { +// FlightSize.manyQueens: 0, +// FlightSize.singleQueen: 1, +// }; diff --git a/lib/flight_list.dart b/lib/flight_list.dart new file mode 100644 index 0000000..25b3244 --- /dev/null +++ b/lib/flight_list.dart @@ -0,0 +1,376 @@ +/* + * flight_list.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; + +import 'package:ant_nup_tracker/flight_detail.dart'; +import 'package:ant_nup_tracker/flights.dart'; +import 'package:ant_nup_tracker/sessions.dart'; +import 'package:ant_nup_tracker/url_manager.dart'; +import 'package:http/http.dart' as http; +import 'package:tuple/tuple.dart'; + +import 'exceptions.dart'; +import 'flight_database.dart'; +part 'flight_list.g.dart'; + +// @JsonSerializable(explicitToJson: true) +// class Frame { +// final int count; +// final Uri? next; +// final Uri? previous; +// @_Converter() +// final List results; +// +// Frame(this.count, this.next, this.previous, this.results); +// +// factory Frame.fromJson(Map json) => _$FrameFromJson(json); +// +// Map toJson() => _$FrameToJson(this); +// } +// +// class _Converter implements JsonConverter { +// const _Converter(); +// +// @override +// T fromJson(Object? json) { +// // print("Now decoding: $json"); +// if (json is Map) { +// if (json.keys.toSet().difference(BaseFlight.flightKeys).isEmpty) { +// return BaseFlight.fromJson(json) as T; +// } +// } +// return json! as T; +// } +// +// @override +// Object? toJson(T object) { +// return object; +// } +// } + +class FlightEntry { + final int flightID; + final DateTime lastUpdated; + + const FlightEntry(this.flightID, this.lastUpdated); + + factory FlightEntry.fromJson(Map json) { + final flightID = json["flightID"] as int; + final lastUpdated = DateTime.parse(json["lastUpdated"] as String); + + return FlightEntry(flightID, lastUpdated); + } +} + +class FlightStore { + var _flightEntries = []; + final _flights = >{}; + + final _mainFlightList = []; + + FlightStore._(); + + static final shared = FlightStore._(); + + // int _loadedFromTop = 0; + // + // int get loadedFromTop => _loadedFromTop; + int get totalCount => _flightEntries.length; + int get loadedFlightCount => _mainFlightList.length; + + bool _isReading = false; + bool get isReading => _isReading; + + // bool get canRead => _loadedFromTop < _flightEntries.length; + + // bool canRead(int numberRead) => numberRead < _flightEntries.length; + + bool get canRead => _mainFlightList.length < _flightEntries.length; + + Future load({int n = 15, bool useDatabase = true}) async { + _flightEntries = await fetchFlightEntries(); + // print("Loaded ${_flightEntries.length} flight entries"); + if (useDatabase) { + + if (!FlightDatabase.shared.isInitialized) { + await FlightDatabase.shared.initializeDatabase(); + } + + _flights.addAll(await FlightDatabase.shared.readFlights()); + } + final newFlightCount = await getTopFlights(n); + + // _loadedFromTop += newFlights.length; + + return newFlightCount; + } + + bool flightIsLoaded(int id) { + return _flights.containsKey(id); + } + + bool flightIsOutdated(int id) { + if (!flightIsLoaded(id)) return true; + + final timeLastRead = _flights[id]!.item2; + final timeLastUpdated = _flightEntries + .firstWhere((element) => element.flightID == id) + .lastUpdated; + + return timeLastRead.isBefore(timeLastUpdated); + } + + Future _readFlight({required int id, required bool updatingFlight}) async { + final flight = await fetchFlight(id); + + // print("Reading flight $id from web!"); + + var lastUpdated = DateTime.now().toUtc(); + _flights[id] = Tuple2(flight, lastUpdated); + + if (updatingFlight) { + await FlightDatabase.shared.updateFlight(flight, lastUpdated); + } else { + await FlightDatabase.shared.addFlight(flight, lastUpdated); + } + } + + Future getFlight(int id, {bool forceReload = false}) async { + var isFlightLoaded = flightIsLoaded(id); + if (forceReload || !isFlightLoaded || flightIsOutdated(id)) { + await _readFlight(id: id, updatingFlight: isFlightLoaded); + } + + return _flights[id]!.item1; + } + + Future loadFlightList() async { + _flightEntries = await fetchFlightEntries(); + } + + int getIdForIndex(int i) => _flightEntries[i].flightID; + + Future getTopFlights([int n = 15]) async { + _isReading = true; + // final flights = []; + + _mainFlightList.clear(); + + final flightIds = + _flightEntries.take(n).map((e) => e.flightID).toList(growable: false); + + for (var id in flightIds) { + var flight = await getFlight(id); + // await flight.loadImages(); + _mainFlightList.add(flight); + } + + _isReading = false; + + // print( + // "Top flights have the indices ${_mainFlightList.map((e) => e.flightID)}"); + + // return flights; + + return _mainFlightList.length; + } + + Future getNextFlights({ + // required int startingId, + int count = 15, + }) async { + _isReading = true; + + final lastFlightId = _mainFlightList.last.flightID; + + // final flights = []; + + final flightIds = List.of(_flightEntries) + .skipWhile((e) => e.flightID != lastFlightId) + .skip(1) + .take(count) + .map((e) => e.flightID); + + // print("Loaded new ids: $flightIds"); + + for (var id in flightIds) { + _mainFlightList.add(await getFlight(id)); + } + + // _loadedFromTop += flights.length; + + _isReading = false; + + // return flights; + var flightCount = flightIds.length; + // print("Loaded $flightCount more flights with ids $flightIds"); + return flightCount; + } + + // Future getFlightForIndex(int i) async { + // final id = getIdForIndex(i); + // return await getFlight(id); + // } + + Flight getFlightAtIndex(int i) => _mainFlightList[i]; + + Future> updateFlights({int? n}) async { + // final newFlights = LinkedHashMap(); + final newFlights = []; + // final downloadLimitPosition = n ?? loadedFlightCount;//loadedFromTop; + + final newFlightEntries = await fetchFlightEntries(); + + final newIds = newFlightEntries.toList(); + newIds.retainWhere((element) => + !_flightEntries.any((entry) => entry.flightID == element.flightID)); + + final updatedIds = newFlightEntries.toList(); + updatedIds + ..retainWhere((element) => + _flightEntries.any((entry) => entry.flightID == element.flightID)) + ..retainWhere((element) => element.lastUpdated.isAfter(_flightEntries + .firstWhere((entry) => entry.flightID == element.flightID) + .lastUpdated)); + + final updatedIdsIndexed = updatedIds + .map((e) => Tuple2( + newFlightEntries + .indexWhere((element) => element.flightID == e.flightID), + e.flightID)) + .toList(growable: false); + + updatedIdsIndexed.sort((e1, e2) => e1.item1.compareTo(e2.item1)); + + final newIdIndexed = newIds + .map((e) => Tuple2( + newFlightEntries + .indexWhere((element) => element.flightID == e.flightID), + e.flightID)) + .toList(growable: false); + + newIdIndexed.sort((e1, e2) => e1.item1.compareTo(e2.item1)); + + for (var entry in updatedIdsIndexed) { + final id = entry.item2; + if (flightIsLoaded(id)) { + // _flights[id] = await fetchFlight(id); + final newFlight = await getFlight(id); + + final index = entry.item1; + _mainFlightList[index] = newFlight; + // newFlights[index] = FlightChange.update; + } + } + + for (var pair in newIdIndexed) { + final index = pair.item1; + + // if (index > downloadLimitPosition) { + // break; + // } + + final id = pair.item2; + + final newFlight = await getFlight(id); + + _mainFlightList.insert(index, newFlight); + + newFlights.add(index); + + // newFlights[index] = FlightChange.inserted; + } + + _flightEntries = newFlightEntries; + + return newFlights; + } +} + +enum FlightChange { update, inserted } + +Future> fetchFlightEntries() async { + final url = UrlManager.shared.filteredListUrl; + + final String? authorization; + + if (SessionManager.shared.isLoggedIn) { + // print("SessionManager is logged in."); + authorization = "Token ${SessionManager.shared.session!.token}"; + } else { + // print("SessionManager is not logged in."); + authorization = null; + } + + final response = await http.get(url, + headers: {if (authorization != null) "Authorization": authorization}); + + final statusCode = response.statusCode; + + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode != 200) throw ReadException(statusCode); + + try { + final List results = jsonDecode(response.body) as List; + + final List flightEntries = + results.map((e) => FlightEntry.fromJson(e)).toList(); + + return flightEntries; + } catch (exception, stacktrace) { + // print(exception); + // print(stacktrace); + throw JsonException(); + } +} + +// void main() { + // final dummy = DummyObserver(); + // FlightList.shared.setReadObserver(dummy); + // FlightList.shared.read(); + // FlightList.shared.readNext(); + // FlightList.shared.printFlights(); + // var url = Uri.parse("url_goes_here"); + // var response = await http.get(url); + // print("Received response: ${response.body}"); + // print("Response has code: ${response.statusCode}"); + // + // var responseJson = jsonDecode(response.body); + // + // print("Response as JSON: $responseJson"); + // + // Frame frame = Frame.fromJson(responseJson); + // var flights = frame.results; + // + // // var flightsRaw = responseJson["results"] as List; + // // var flights = flightsRaw.map((f) => BaseFlight.fromJson(f)); + // + // for (final flight in flights) { + // print("We have a flight: $flight"); + // print(jsonEncode(flight)); + // } + // + // print("Previous url: ${frame.previous}"); + // print("Next url: ${frame.next}"); + // print("Total count: ${frame.count}"); + // + // print("Running on ${Platform.operatingSystem}"); +// } diff --git a/lib/flight_list.g.dart b/lib/flight_list.g.dart new file mode 100644 index 0000000..c4ea490 --- /dev/null +++ b/lib/flight_list.g.dart @@ -0,0 +1,43 @@ +/* + * flight_list.g.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'flight_list.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +// Frame _$FrameFromJson(Map json) { +// return Frame( +// json['count'] as int, +// json['next'] == null ? null : Uri.parse(json['next'] as String), +// json['previous'] == null ? null : Uri.parse(json['previous'] as String), +// (json['results'] as List).map(_Converter().fromJson).toList(), +// ); +// } +// +// Map _$FrameToJson(Frame instance) => { +// 'count': instance.count, +// 'next': instance.next?.toString(), +// 'previous': instance.previous?.toString(), +// 'results': instance.results.map(_Converter().toJson).toList(), +// }; diff --git a/lib/flights.dart b/lib/flights.dart new file mode 100644 index 0000000..38871bf --- /dev/null +++ b/lib/flights.dart @@ -0,0 +1,691 @@ +/* + * flights.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:core'; +import 'package:ant_nup_tracker/flight_detail.dart'; +import 'package:ant_nup_tracker/images.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:tuple/tuple.dart'; + +import 'exceptions.dart'; +import 'flight_database.dart'; +import 'users.dart'; + +import 'package:json_annotation/json_annotation.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:lat_lng_to_timezone/lat_lng_to_timezone.dart'; +import 'package:timezone/timezone.dart'; + +part 'flights.g.dart'; + +abstract class Nameable { + String get name; +} + +class Genus implements Nameable { + @override + final String name; + final int id; + + final Set _species = {}; + + List get species => List.unmodifiable(_species); + + static List getAll() => List.unmodifiable(_genusStore.values); + + /// Private constructor for the Genus class. + Genus._(this.id, this.name); + + @override + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; + if (identical(this, other)) return true; + + return other is Genus && other.name == name; + } + + @override + int get hashCode => name.hashCode; + + /// Flyweight store. + static final _genusStore = {}; + + /// Retrieval function for genus objects. + // static Genus get(String name) => + // _genusStore.firstWhere((g) => g.name == name, + // orElse: (){ + // var g = Genus._(name); + // _genusStore.add(g); + // return g; + // }); + // static Genus get(String name) => + // _genusStore.putIfAbsent(name, () => Genus._(name)); + + static Genus get(int id) => _genusStore[id]!; + // _genusStore.putIfAbsent(id, () => Genus._(name)); + + static Genus? getByName(String name) { + if (_genusStore.values.any((element) => element.name == name)) { + return _genusStore.values.firstWhere((element) => element.name == name); + } + + return null; + } + + static Iterable loadGeneraFromJson( + Iterable jsonList) => + jsonList.map((e) => Genus.fromJson(e)); + + factory Genus.fromJson(Map json) { + try { + var name = json["name"] as String; + var id = json["id"] as int; + + return Genus._(id, name); + + // return _genusStore.putIfAbsent(id, () => Genus._(id, name)); + + // return get(name); + } catch (err) { + throw 'Invalid JSON keys.'; + } + } + + Map toJson() => {"name": name}; + + @override + String toString() => name; +} + +class Species implements Nameable { + final int id; + final Genus genus; + @override + final String name; + + Species._(this.id, this.genus, this.name) { + genus._species.add(this); + } + + @override + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) return false; + if (identical(this, other)) return true; + + return other is Species && other.genus == genus && other.name == name; + } + + @override + int get hashCode => genus.hashCode + name.hashCode; + + @override + String toString() => "$genus $name"; + + /// Flyweight store. + // static final _speciesStore = >{}; + + static final _speciesStore = {}; + + /// Retrieval function for genus objects. + // static Species get(Genus genus, String name) => _speciesStore + // .putIfAbsent(genus, () => {}) + // .putIfAbsent(name, () => Species._(genus, name)); + + static Species get(int id) { + // print("Species store: $_speciesStore"); + return _speciesStore[id]!; + } + // _speciesStore.putIfAbsent(id, () => Species._(id, genus, name)); + + static Species? getByGenusAndName(Genus genus, String name) { + final speciesList = genus.species; + if (speciesList.any((element) => element.name == name)) { + return speciesList.firstWhere((element) => element.name == name); + } + + return null; + } + + static Iterable loadSpeciesFromJson( + Iterable jsonList) => + jsonList.map((e) => Species.fromJson(e)); + + factory Species.fromJson(Map json) { + try { + // var rawGenus = json["genus"] as Map; + // var genus = Genus.fromJson(rawGenus); + final genusId = json["genus"] as int; + final genus = Genus.get(genusId); + final name = json["name"] as String; + final id = json["id"] as int; + return Species._(id, genus, name); + // return _speciesStore.putIfAbsent(id, () => Species._(id, genus, name)); + } catch (err, stacktrace) { + // print("Error creating species from JSON!!!!"); + // print(stacktrace); + throw JsonException(); + } + } + + Map toJson() => {"genus": genus.toJson(), "name": name}; +} + +class TaxonomyProgress { + + TaxonomyProgress._(); + + static final shared = TaxonomyProgress._(); + + int _totalNumberOfGenera = 0; + int _totalNumberOfSpecies = 0; + + int get totalNumberOfGenera => _totalNumberOfGenera; + int get totalNumberOfSpecies => _totalNumberOfSpecies; + + double? get genusProgress => _totalNumberOfGenera > 0 ? Genus._genusStore.length / _totalNumberOfGenera : null; + double? get speciesProgress => _totalNumberOfSpecies > 0 ? Species._speciesStore.length / _totalNumberOfSpecies : null; + +} + +enum LoadingStage { + initial, credentials, taxonomy, filtering, flights, done +} + +class InitialLoadingProgress { + + LoadingStage loadingStage = LoadingStage.initial; + + // LoadingStage get loadingStage => _loadingStage; + + double? getProgress() { + switch (loadingStage) { + case LoadingStage.initial: + return null; + case LoadingStage.credentials: + return null; + case LoadingStage.taxonomy: + return null; + // return TaxonomyProgress.shared.speciesProgress; + case LoadingStage.flights: + return null; + case LoadingStage.done: + return null; + case LoadingStage.filtering: + return null; + } + } + + String getProgressCaption(BuildContext context) { + switch (loadingStage){ + case LoadingStage.initial: + return AppLocalizations.of(context)!.initialLoadingStage; + case LoadingStage.credentials: + return AppLocalizations.of(context)!.credentialLoadingStage; + case LoadingStage.taxonomy: + return AppLocalizations.of(context)!.taxonomyLoadingStage; + case LoadingStage.flights: + return AppLocalizations.of(context)!.flightLoadingStage; + case LoadingStage.done: + return AppLocalizations.of(context)!.doneLoadingStage; + case LoadingStage.filtering: + return AppLocalizations.of(context)!.filteringLoadingStage; + } + } +} + +Future> isNewTaxonomyAvailable() async { + final prefs = await SharedPreferences.getInstance(); + + final version = prefs.getInt("taxonomyVersion"); + + final taxonomyDetails = await loadTaxonomyDetails(); + + final latestVersion = taxonomyDetails.version; + + TaxonomyProgress.shared._totalNumberOfGenera = taxonomyDetails.genusCount; + TaxonomyProgress.shared._totalNumberOfSpecies = taxonomyDetails.speciesCount; + + if (version == null) return Tuple2(true, latestVersion); + + // print("Current taxonomy version: $version, Latest version $latestVersion"); + + return Tuple2(latestVersion > version, latestVersion); +} + +Future loadTaxonomy() async { + final newTaxonomyTuple = await isNewTaxonomyAvailable(); + final newTaxonomyAvailable = newTaxonomyTuple.item1; + + if (!newTaxonomyAvailable) { + // print("No new taxonomy available..."); + if (!FlightDatabase.shared.isInitialized) { + await FlightDatabase.shared.initializeDatabase(); + } + await loadTaxonomyFromDatabase(); + + if (Genus._genusStore.isNotEmpty && Species._speciesStore.isNotEmpty) return; + } + + // print("Updated Taxonomy Available!"); + + await FlightDatabase.shared.initializeDatabase(clear: true); + await loadTaxonomyFromServer(); + await FlightDatabase.shared.addGenera(Genus._genusStore.values); + await FlightDatabase.shared.addManySpecies(Species._speciesStore.values); + + final prefs = await SharedPreferences.getInstance(); + prefs.setInt("taxonomyVersion", newTaxonomyTuple.item2); +} + +Future loadTaxonomyFromServer() async { + final allGenera = await loadGenera(); + + final entries = allGenera.map((e) => MapEntry(e.id, e)); + Genus._genusStore.clear(); + Genus._genusStore.addEntries(entries); + + final allSpecies = []; + for (var genus in allGenera) { + allSpecies.addAll(await loadSpeciesForGenus(genus)); + } + + final speciesEntries = allSpecies.map((e) => MapEntry(e.id, e)); + Species._speciesStore.clear(); + Species._speciesStore.addEntries(speciesEntries); +} + +Future loadTaxonomyFromDatabase() async { + Genus._genusStore.clear(); + Species._speciesStore.clear(); + + final allGenera = await FlightDatabase.shared.readGenera(); + TaxonomyProgress.shared._totalNumberOfGenera = allGenera.length; + Genus._genusStore.addAll(allGenera); + + final allSpecies = await FlightDatabase.shared.readSpecies(); + TaxonomyProgress.shared._totalNumberOfSpecies = allSpecies.length; + Species._speciesStore.addAll(allSpecies); + +} + +// @JsonSerializable(explicitToJson: true) +// class BaseFlight { +// int flightID; +// Species taxonomy; +// DateTime dateOfFlight; +// double latitude; +// double longitude; +// DateTime lastUpdated; +// String owner; +// Role ownerRole; +// bool validated; +// +// Role get validationLevel { +// if (ownerRole == Role.flagged) { +// return Role.flagged; +// } else { +// return validated ? Role.professional : Role.citizen; +// } +// } +// +// BaseFlight( +// this.flightID, +// this.taxonomy, +// this.dateOfFlight, +// this.latitude, +// this.longitude, +// this.lastUpdated, +// this.owner, +// this.ownerRole, +// this.validated); +// +// factory BaseFlight.fromJson(Map json) => +// _$BaseFlightFromJson(json); +// +// Map toJson() => _$BaseFlightToJson(this); +// +// @override +// bool operator ==(Object other) { +// if (identical(this, other)) return true; +// if (other is! BaseFlight) return false; +// +// return flightID == other.flightID && +// taxonomy == other.taxonomy && +// dateOfFlight == other.dateOfFlight && +// latitude == other.latitude && +// longitude == other.longitude && +// lastUpdated == other.lastUpdated && +// owner == other.owner && +// ownerRole == other.ownerRole && +// validated == other.validated; +// } +// +// @override +// int get hashCode => +// flightID.hashCode + +// taxonomy.hashCode + +// dateOfFlight.hashCode + +// latitude.hashCode + +// longitude.hashCode + +// lastUpdated.hashCode + +// owner.hashCode + +// ownerRole.hashCode + +// validated.hashCode; +// +// static const flightKeys = { +// 'flightID', +// 'taxonomy', +// 'dateOfFlight', +// 'latitude', +// 'longitude', +// 'lastUpdated', +// 'owner', +// 'ownerRole', +// 'validated' +// }; +// +// @override +// String toString() { +// return "$flightID: $taxonomy flight, occurred at $dateOfFlight at location ($latitude, $longitude); recorded by $owner"; +// } +// } + +enum ConfidenceLevels { + @JsonValue(0) + low, + + @JsonValue(1) + high +} + +// extension ConfidenceNames on ConfidenceLevels { +// +// String confidenceName(BuildContext context) { +// switch (this) { +// case ConfidenceLevels.low: +// return AppLocalizations.of(context)!.lowConfidence; +// case ConfidenceLevels.high: +// return AppLocalizations.of(context)!.highConfidence; +// } +// } +// } + +enum FlightSize { + @JsonValue(0) + manyQueens, + + @JsonValue(1) + singleQueen +} + +@JsonSerializable(explicitToJson: true) +class Flight { + final int flightID; + final Species taxonomy; + final ConfidenceLevels confidence; + // final DateTime dateOfFlight; + final TZDateTime dateOfFlight; + + final double latitude; + final double longitude; + + final String owner; + final Role ownerRole; + final bool validated; + + Role get validationLevel { + if (ownerRole == Role.flagged) { + return Role.flagged; + } else { + return validated ? Role.professional : Role.citizen; + } + } + + final double radius; + final DateTime dateRecorded; + + @JsonKey(name: "weather") + final bool hasWeather; + + // @JsonKey(name: "image") + // Uri? imageUrl; + + @JsonKey(ignore: true) + late final List images; + + // bool get hasImage => imageUrl != null; + bool get hasImage => images.isNotEmpty; + + final FlightSize size; + + final String? validatedBy; + final DateTime? validatedAt; + // final List comments; + + factory Flight.fromJson(Map json) { + final latitude = (json['latitude'] as num).toDouble(); + final longitude = (json['longitude'] as num).toDouble(); + + final timezone = latLngToTimezoneString(latitude, longitude); + + final location = getLocation(timezone); + + final speciesId = json['taxonomy'] as int; + final species = Species.get(speciesId); + + return Flight( + json['flightID'] as int, + species, + _$enumDecode(_$ConfidenceLevelsEnumMap, json['confidence']), + TZDateTime.parse(location, json['dateOfFlight'] as String), + _$enumDecode(_$FlightSizeEnumMap, json['size']), + latitude, + longitude, + (json['radius'] as num).toDouble(), + DateTime.parse(json['dateRecorded'] as String), + json['owner'] as String, + _$enumDecode(_$RoleEnumMap, json['ownerRole']), + json['weather'] as bool, + // json['image'] == null ? null : Uri.parse(json['image'] as String), + json['validated'] as bool, + // (json['comments'] as List) + // .map((e) => Comment.fromJson(e as Map)) + // .toList(), + json['validatedBy'] as String?, + json['validatedAt'] == null + ? null + : DateTime.parse(json['validatedAt'] as String) + ); + } + // Map toJson() => _$FlightToJson(this); + + Flight( + this.flightID, + this.taxonomy, + this.confidence, + this.dateOfFlight, + this.size, + this.latitude, + this.longitude, + this.radius, + this.dateRecorded, + this.owner, + this.ownerRole, + this.hasWeather, + // this.imageUrl, + this.validated, + // this.comments, + [this.validatedBy, + this.validatedAt]){ + loadImages(); + } + + @JsonKey(ignore: true) + late Future> loadImagesFuture; + + Future loadImages() async { + loadImagesFuture = fetchImagesForFlight(flightID); + images = await loadImagesFuture; + } +} + +String stringFromCoordinates( + {required double latitude, required double longitude, int precision = 3}) { + final truncatedLat = latitude.abs().toStringAsFixed(precision); + final truncatedLong = longitude.abs().toStringAsFixed(precision); + + final directionLat = latitude >= 0 ? "N" : "S"; + final directionLong = longitude >= 0 ? "E" : "W"; + + return "($truncatedLat\u{00b0}$directionLat, $truncatedLong\u{00b0}$directionLong)"; +} + +String stringFromLocation({required LatLng location, int precision = 3}) => + stringFromCoordinates( + latitude: location.latitude, + longitude: location.longitude, + precision: precision, + ); + +// String getConfidenceString(ConfidenceLevels level, BuildContext context) { +// switch (level) { +// case ConfidenceLevels.low: +// return AppLocalizations.of(context)!.lowConfidence; +// case ConfidenceLevels.high: +// return AppLocalizations.of(context)!.highConfidence; +// } +// } +// +// String getSizeString(FlightSize size, BuildContext context) { +// switch (size) { +// case FlightSize.manyQueens: +// return AppLocalizations.of(context)!.manyQueens; +// case FlightSize.singleQueen: +// return AppLocalizations.of(context)!.singleQueen; +// } +// } + +// void main(){ +// const jsonRaw = """ +// { +// "flightID": 19, +// "taxonomy": { +// "genus": { +// "name": "Pheidole" +// }, +// "name": "dentata" +// }, +// "latitude": 37.33233141, +// "longitude": -122.0312186, +// "radius": 0.0, +// "dateOfFlight": "2020-06-10T16:18:43", +// "owner": "messor_rogers", +// "ownerRole": 0, +// "ownerProfessional": false, +// "ownerFlagged": false, +// "dateRecorded": "2020-06-10T16:18:43", +// "weather": true, +// "comments": [ +// { +// "flight": 19, +// "author": "dentata408", +// "role": 1, +// "text": "Test comment", +// "time": "2020-06-10T21:26:07" +// }, +// { +// "flight": 19, +// "author": "dentata408", +// "role": 1, +// "text": "Comment goes here...", +// "time": "2020-06-10T21:27:35" +// }, +// { +// "flight": 19, +// "author": "dentata408", +// "role": 1, +// "text": "Another comment here", +// "time": "2020-06-10T21:32:09" +// }, +// { +// "flight": 19, +// "author": "dentata408", +// "role": 1, +// "text": "Another comment", +// "time": "2020-06-10T21:37:37" +// }, +// { +// "flight": 19, +// "author": "dentata408", +// "role": 1, +// "text": "More comments", +// "time": "2020-06-10T21:38:36" +// }, +// { +// "flight": 19, +// "author": "dentata408", +// "role": 1, +// "text": "Commenty comments", +// "time": "2020-06-10T21:39:03" +// } +// ], +// "image": null, +// "confidence": 0, +// "size": 0, +// "validated": true, +// "validatedBy": "dentata408", +// "validatedAt": "2020-06-10T21:25:48" +// }"""; +// final json = jsonDecode(jsonRaw); +// var f = Flight.fromJson(json); +// print("We have created flight $f"); +// print("This flight has species: ${f.taxonomy}"); +// print("This flight has ${f.comments.length} comments, which read:"); +// f.comments.forEach((comment) => print(comment.text)); +// } + +class SpeciesManager { + + final Map _genera = {}; + final Map _species = {}; + + Map get genera => Map.unmodifiable(_genera); + Map get species => Map.unmodifiable(_species); + + Future loadTaxonomy() async { + final allGenera = await loadGenera(); + + final entries = allGenera.map((e) => MapEntry(e.id, e)); + _genera.clear(); + _genera.addEntries(entries); + + final allSpecies = []; + for (var genus in allGenera) { + allSpecies.addAll(await loadSpeciesForGenus(genus)); + } + + final speciesEntries = allSpecies.map((e) => MapEntry(e.id, e)); + _species.clear(); + _species.addEntries(speciesEntries); + } + +} diff --git a/lib/flights.g.dart b/lib/flights.g.dart new file mode 100644 index 0000000..6f889e6 --- /dev/null +++ b/lib/flights.g.dart @@ -0,0 +1,163 @@ +/* + * flights.g.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'flights.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +// BaseFlight _$BaseFlightFromJson(Map json) { +// +// final latitude = (json['latitude'] as num).toDouble(); +// final longitude = (json['longitude'] as num).toDouble(); +// +// final timezone = latLngToTimezoneString(latitude, longitude); +// +// return BaseFlight( +// json['flightID'] as int, +// Species.fromJson(json['taxonomy'] as Map), +// DateTime.parse(json['dateOfFlight'] as String), +// latitude, +// longitude, +// DateTime.parse(json['lastUpdated'] as String), +// json['owner'] as String, +// _$enumDecode(_$RoleEnumMap, json['ownerRole']), +// json['validated'] as bool, +// ); +// } + +// Map _$BaseFlightToJson(BaseFlight instance) => +// { +// 'flightID': instance.flightID, +// 'taxonomy': instance.taxonomy.toJson(), +// 'dateOfFlight': instance.dateOfFlight.toIso8601String(), +// 'latitude': instance.latitude, +// 'longitude': instance.longitude, +// 'lastUpdated': instance.lastUpdated.toIso8601String(), +// 'owner': instance.owner, +// 'ownerRole': _$RoleEnumMap[instance.ownerRole], +// 'validated': instance.validated, +// }; + +K _$enumDecode( + Map enumValues, + Object? source, { + K? unknownValue, +}) { + if (source == null) { + throw ArgumentError( + 'A value must be provided. Supported values: ' + '${enumValues.values.join(', ')}', + ); + } + + return enumValues.entries.singleWhere( + (e) => e.value == source, + orElse: () { + if (unknownValue == null) { + throw ArgumentError( + '`$source` is not one of the supported values: ' + '${enumValues.values.join(', ')}', + ); + } + return MapEntry(unknownValue, enumValues.values.first); + }, + ).key; +} + +const _$RoleEnumMap = { + Role.citizen: 0, + Role.professional: 1, + Role.flagged: -1, +}; + +Flight _$FlightFromJson(Map json) { + + final latitude = (json['latitude'] as num).toDouble(); + final longitude = (json['longitude'] as num).toDouble(); + + final timezone = latLngToTimezoneString(latitude, longitude); + + final location = getLocation(timezone); + + final speciesId = json['taxonomy'] as int; + final species = Species.get(speciesId); + + return Flight( + json['flightID'] as int, + species, + _$enumDecode(_$ConfidenceLevelsEnumMap, json['confidence']), + TZDateTime.parse(location, json['dateOfFlight'] as String), + _$enumDecode(_$FlightSizeEnumMap, json['size']), + latitude, + longitude, + (json['radius'] as num).toDouble(), + DateTime.parse(json['dateRecorded'] as String), + json['owner'] as String, + _$enumDecode(_$RoleEnumMap, json['ownerRole']), + json['weather'] as bool, + // json['image'] == null ? null : Uri.parse(json['image'] as String), + json['validated'] as bool, + // (json['comments'] as List) + // .map((e) => Comment.fromJson(e as Map)) + // .toList(), + json['validatedBy'] as String?, + json['validatedAt'] == null + ? null + : DateTime.parse(json['validatedAt'] as String) + ); + // ..validatedBy = json['validatedBy'] as String? + // ..validatedAt = json['validatedAt'] == null + // ? null + // : DateTime.parse(json['validatedAt'] as String); +} + +Map _$FlightToJson(Flight instance) => { + 'flightID': instance.flightID, + 'taxonomy': instance.taxonomy.toJson(), + 'confidence': _$ConfidenceLevelsEnumMap[instance.confidence], + 'dateOfFlight': instance.dateOfFlight.toIso8601String(), + 'latitude': instance.latitude, + 'longitude': instance.longitude, + 'owner': instance.owner, + 'ownerRole': _$RoleEnumMap[instance.ownerRole], + 'validated': instance.validated, + 'radius': instance.radius, + 'dateRecorded': instance.dateRecorded.toIso8601String(), + 'weather': instance.hasWeather, + // 'image': instance.imageUrl?.toString(), + 'size': _$FlightSizeEnumMap[instance.size], + 'validatedBy': instance.validatedBy, + 'validatedAt': instance.validatedAt?.toIso8601String(), + // 'comments': instance.comments.map((e) => e.toJson()).toList(), + }; + +const _$ConfidenceLevelsEnumMap = { + ConfidenceLevels.low: 0, + ConfidenceLevels.high: 1, +}; + +const _$FlightSizeEnumMap = { + FlightSize.manyQueens: 0, + FlightSize.singleQueen: 1, +}; diff --git a/lib/generated/intl/messages_all.dart b/lib/generated/intl/messages_all.dart new file mode 100644 index 0000000..cbf8185 --- /dev/null +++ b/lib/generated/intl/messages_all.dart @@ -0,0 +1,82 @@ +/* + * messages_all.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart +// This is a library that looks up messages for specific locales by +// delegating to the appropriate library. + +// Ignore issues from commonly used lints in this file. +// ignore_for_file:implementation_imports, file_names, unnecessary_new +// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering +// ignore_for_file:argument_type_not_assignable, invalid_assignment +// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases +// ignore_for_file:comment_references + +import 'dart:async'; + +import 'package:intl/intl.dart'; +import 'package:intl/message_lookup_by_library.dart'; +import 'package:intl/src/intl_helpers.dart'; + +import 'messages_en.dart' as messages_en; + +typedef Future LibraryLoader(); +Map _deferredLibraries = { + 'en': () => new Future.value(null), +}; + +MessageLookupByLibrary? _findExact(String localeName) { + switch (localeName) { + case 'en': + return messages_en.messages; + default: + return null; + } +} + +/// User programs should call this before using [localeName] for messages. +Future initializeMessages(String localeName) async { + var availableLocale = Intl.verifiedLocale( + localeName, (locale) => _deferredLibraries[locale] != null, + onFailure: (_) => null); + if (availableLocale == null) { + return new Future.value(false); + } + var lib = _deferredLibraries[availableLocale]; + await (lib == null ? new Future.value(false) : lib()); + initializeInternalMessageLookup(() => new CompositeMessageLookup()); + messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor); + return new Future.value(true); +} + +bool _messagesExistFor(String locale) { + try { + return _findExact(locale) != null; + } catch (e) { + return false; + } +} + +MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { + var actualLocale = + Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); + if (actualLocale == null) return null; + return _findExact(actualLocale); +} diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart new file mode 100644 index 0000000..f40c4a7 --- /dev/null +++ b/lib/generated/intl/messages_en.dart @@ -0,0 +1,44 @@ +/* + * messages_en.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart +// This is a library that provides messages for a en locale. All the +// messages from the main program should be duplicated here with the same +// function name. + +// Ignore issues from commonly used lints in this file. +// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new +// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering +// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases +// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes + +import 'package:intl/intl.dart'; +import 'package:intl/message_lookup_by_library.dart'; + +final messages = new MessageLookup(); + +typedef String MessageIfAbsent(String messageStr, List args); + +class MessageLookup extends MessageLookupByLibrary { + String get localeName => 'en'; + + final messages = _notInlinedMessages(_notInlinedMessages); + static Map _notInlinedMessages(_) => {}; +} diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart new file mode 100644 index 0000000..0f6cfb5 --- /dev/null +++ b/lib/generated/l10n.dart @@ -0,0 +1,98 @@ +/* + * l10n.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// GENERATED CODE - DO NOT MODIFY BY HAND +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'intl/messages_all.dart'; + +// ************************************************************************** +// Generator: Flutter Intl IDE plugin +// Made by Localizely +// ************************************************************************** + +// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars +// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each +// ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes + +class AppLocalizations { + AppLocalizations(); + + static AppLocalizations? _current; + + static AppLocalizations get current { + assert(_current != null, + 'No instance of AppLocalizations was loaded. Try to initialize the AppLocalizations delegate before accessing AppLocalizations.current.'); + return _current!; + } + + static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); + + static Future load(Locale locale) { + final name = (locale.countryCode?.isEmpty ?? false) + ? locale.languageCode + : locale.toString(); + final localeName = Intl.canonicalizedLocale(name); + return initializeMessages(localeName).then((_) { + Intl.defaultLocale = localeName; + final instance = AppLocalizations(); + AppLocalizations._current = instance; + + return instance; + }); + } + + static AppLocalizations of(BuildContext context) { + final instance = AppLocalizations.maybeOf(context); + assert(instance != null, + 'No instance of AppLocalizations present in the widget tree. Did you add AppLocalizations.delegate in localizationsDelegates?'); + return instance!; + } + + static AppLocalizations? maybeOf(BuildContext context) { + return Localizations.of(context, AppLocalizations); + } +} + +class AppLocalizationDelegate extends LocalizationsDelegate { + const AppLocalizationDelegate(); + + List get supportedLocales { + return const [ + Locale.fromSubtags(languageCode: 'en'), + ]; + } + + @override + bool isSupported(Locale locale) => _isSupported(locale); + @override + Future load(Locale locale) => AppLocalizations.load(locale); + @override + bool shouldReload(AppLocalizationDelegate old) => false; + + bool _isSupported(Locale locale) { + for (var supportedLocale in supportedLocales) { + if (supportedLocale.languageCode == locale.languageCode) { + return true; + } + } + return false; + } +} diff --git a/lib/images.dart b/lib/images.dart new file mode 100644 index 0000000..4e6daaf --- /dev/null +++ b/lib/images.dart @@ -0,0 +1,210 @@ +/* + * images.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; +import 'dart:io'; + +import 'package:ant_nup_tracker/exceptions.dart'; +import 'package:ant_nup_tracker/sessions.dart'; +import 'package:http/http.dart' as http; +import 'package:image_picker/image_picker.dart'; +// import 'package:path/path.dart'; +import 'package:mime/mime.dart'; +import 'package:ant_nup_tracker/url_manager.dart'; +import 'package:flutter_image_compress/flutter_image_compress.dart'; + +class FlightImage { + final Uri image; + final int id; + final int flight; + final String author; + final DateTime date; + + const FlightImage({ + required this.id, + required this.image, + required this.flight, + required this.author, + required this.date, + }); + + factory FlightImage.fromJson(Map json) { + final id = json["id"] as int; + final flight = json["flight"] as int; + final author = json["created_by"] as String; + final date = DateTime.parse(json["date_created"] as String); + final image = Uri.parse(json["image"] as String); + + return FlightImage( + id: id, + image: image, + flight: flight, + author: author, + date: date, + ); + } +} + +// Future addImageToFlight(int flightId, String imagePath) async { +// final url = UrlManager.shared.urlForFlightImages(flightId); +// +// final file = await http.MultipartFile.fromPath("file", imagePath); +// +// final request = http.MultipartRequest("POST", url); +// request.files.add(file); +// +// request.headers["Authorization"] = +// "Token ${SessionManager.shared.session!.token}"; +// +// request.headers["Content-Type"] = file.contentType.mimeType; +// +// try { +// final response = await request.send(); +// +// print(response.statusCode); +// +// final statusCode = response.statusCode; +// +// if (statusCode == 401) throw FailedAuthenticationException(); +// if (statusCode == 404) throw NoFlightException(flightId); +// if (statusCode != 201) throw ImageCreationException(statusCode); +// } on IOException { +// throw NoResponseException(); +// } +// } + +// // From: https://en.wikipedia.org/wiki/Media_type +// const validExtensions = [ +// ".png", +// ".jpg", +// ".jpeg", +// ".jfif", +// ".gif", +// ".pjpeg", +// ".pjp" +// ]; + +Future addImageToFlight(int flightId, XFile image) async { + final url = UrlManager.shared.urlForFlightImages(flightId); + + // final fileExtension = extension(imagePath); + + // final mimeType = image.mimeType;//lookupMimeType(imagePath); + + final mimeType = lookupMimeType(image.path); + + if (mimeType == null) { + throw InvalidImageTypeException(); + } + if (!mimeType.startsWith("image/")) { + throw InvalidImageTypeException(mimeType); + } + + // final filename = basename(imagePath); + // final file = File(imagePath); + // final fileBytes = file.readAsBytesSync(); + + final filename = image.name; + // final fileBytes = await image.readAsBytes(); + final fileBytes = + await FlutterImageCompress.compressWithFile(image.path, quality: 90); + + // final fileBytes = await http.MultipartFile.fromPath("file", imagePath); + + // final request = http.MultipartRequest("POST", url); + // request.files.add(fileBytes); + // + // request.headers["Authorization"] = + // "Token ${SessionManager.shared.session!.token}"; + // + // request.headers["Content-Type"] = fileBytes.contentType.mimeType; + + try { + final response = await http.post(url, + headers: { + "Authorization": "Token ${SessionManager.shared.session!.token}", + "Content-Type": mimeType, + "Content-Disposition": "attachment; filename=\"$filename\"" + }, + body: fileBytes); + + // print(response.statusCode); + + final statusCode = response.statusCode; + + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode == 404) throw NoFlightException(flightId); + if (statusCode != 201) throw ImageCreationException(statusCode); + } on IOException { + throw NoResponseException(); + } +} + +Future deleteImage(int flightId, int imageId) async { + final url = UrlManager.shared.urlForImage(flightId, imageId); + + try { + final response = await http.delete( + url, + headers: { + "Authorization": "Token ${SessionManager.shared.session!.token}" + }, + ); + + final statusCode = response.statusCode; + + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode == 404) throw NoImageException(imageId); + if (statusCode != 204) throw ImageDeletionException(statusCode); + } on IOException { + throw NoResponseException(); + } +} + +Future> fetchImagesForFlight(int id) async { + final url = UrlManager.shared.urlForFlightImages(id); + + try { + final response = await http.get(url, headers: SessionManager.shared.headers + // { + // if (SessionManager.shared.isLoggedIn) + // "Authorization": "Token ${SessionManager.shared.session!.token}" + // } + ); + + final statusCode = response.statusCode; + + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode == 404) throw NoFlightException(id); + if (statusCode != 200) throw ReadException(statusCode); + + try { + final rawList = jsonDecode(response.body) as List; + final convertedList = + rawList.map((e) => FlightImage.fromJson(e)).toList(); + + return convertedList; + } catch (error) { + throw JsonException(); + } + } on IOException { + throw NoResponseException(); + } +} diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb new file mode 100644 index 0000000..58e1793 --- /dev/null +++ b/lib/l10n/app_en.arb @@ -0,0 +1,1251 @@ +{ + "@@locale": "en", + "helloWorld": "Hello World!", + "@helloWorld": { + "description": "A greeting from beyond!" + }, + "lowConfidence": "Low", + "@lowConfidence": { + "description": "Used to indicate low confidence." + }, + "highConfidence": "High", + "@highConfidence": { + "description": "Used to indicate high confidence." + }, + "singleQueen": "Single queen", + "@singleQueen": { + "description": "Used to indicate flight with single queen." + }, + "manyQueens": "Many queens", + "@manyQueens": { + "description": "Used to indicate flight with many queens." + }, + "flightDetailHeader": "Flight {value}", + "@flightDetailHeader": { + "description": "Header for the detail screen.", + "placeholders": { + "value": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "basicInfo": "Basic Information", + "@basicInfo": { + "description": "Indicates the section for the basic information about the flight." + }, + "flightID": "Flight ID", + "@flightID": { + "description": "Unique identifier for a flight." + }, + "genus": "Genus", + "@genus": { + "description": "Genus from taxonomy." + }, + "species": "Species", + "@species": { + "description": "Species name from taxonomy." + }, + "speciesConfidence": "Species Confidence", + "@speciesConfidence": { + "description": "Label for confidence level for species identification." + }, + "flightSize": "Size", + "@flightSize": { + "description": "Label for size of flight." + }, + "dateAndTimeOfFlight": "Date and Time of Flight", + "@dateAndTimeOfFlight": { + "description": "Header for flight detail section describing date and time of flight." + }, + "dateOfFlight": "Date of Flight", + "@dateOfFlight": { + "description": "Label for date of flight." + }, + "timeOfFlight": "Time of Flight", + "@timeOfFlight": { + "description": "Label for time of flight." + }, + "flightLocationHeader": "Flight Location", + "@flightLocationHeader": { + "description": "Header for detail section describing flight location." + }, + "gpsCoordinatesLabel": "GPS Coordinates", + "@gpsCoordinatesLabel": { + "description": "Label in flight detail for the GPS coordinates." + }, + "radiusDetailLabel": "Within (\u00b1)", + "@radiusDetailLabel": { + "description": "Label in flight detail for the radius around the flight location." + }, + "radiusDistanceDetail": "{value} km", + "@radiusDistanceDetail": { + "description": "Radius from the location **in km**. This string is meant to be used to localise the symbol for km, such as ק\"מ in Hebrew", + "placeholders": { + "value": { + "type": "double", + "format": "decimalPattern" + } + } + }, + "recordingInformationHeader": "Recording Information", + "@recordingInformationHeader": { + "description": "Header for the recording information section of the flight detail." + }, + "recordedByLabel": "Recorded By", + "@recordedByLabel": { + "description": "Flight detail label for the user who recorded the flight." + }, + "dateRecordedDetailLabel": "Date Recorded", + "@dateRecordedDetailLabel": { + "description": "Label for date recorded in the flight detail." + }, + "timeRecordedDetailLabel": "Time Recorded (UTC)", + "@timeRecordedDetailLabel": { + "description": "Label for time recorded in the flight detail." + }, + "imagesHeader": "Flight Images", + "@imagesHeader": { + "description": "Header for the images section in the flight detail and form." + }, + "commentsHeader": "Comments", + "@commentsHeader": { + "description": "Header for the comments section of the flight detail screen." + }, + "noCommentsMessage": "No Comments", + "@noCommentsMessage": { + "description": "Message to show when no comments are present." + }, + "recordHistoryHeader": "Record History", + "@recordHistoryHeader": { + "description": "Header for the record history section of the flight detail screen." + }, + "recordHistoryLabel": "Record History", + "@recordHistoryLabel": { + "description": "Label for the record history button of the flight detail screen." + }, + "weatherHeader": "Weather", + "@weatherHeader": { + "description": "Header for the weather section of the flight detail screen." + }, + "weatherLabel": "Weather from OpenWeather Map", + "@weatherLabel": { + "description": "Label for the weather button of the flight detail screen." + }, + "verificationInformationHeader": "Verification Information", + "@verificationInformationHeader": { + "description": "Header for the verification information section of the flight detail." + }, + "verifiedByLabel": "Verified By", + "@verifiedByLabel": { + "description": "Flight detail label for the user who verified the flight." + }, + "dateVerifiedDetailLabel": "Date Verified", + "@dateVerifiedDetailLabel": { + "description": "Label for date verified in the flight detail." + }, + "timeVerifiedDetailLabel": "Time Verified", + "@timeVerifiedDetailLabel": { + "description": "Label for time verified in the flight detail." + }, + "imageHeaderDetail": "Flight Images", + "@imageHeaderDetail": { + "description": "Header for the images in the flight detail." + }, + "userDetailsAppBarHeader": "Details for {user}", + "@userDetailsAppBarHeader": { + "description": "Title for the app bar for the user detail page.", + "placeholders": { + "user": { + "type": "String", + "example": "dentata408" + } + } + }, + "usernameLabel": "Username", + "@usernameLabel": { + "description": "Label in the user detail screen for username." + }, + "userRoleLabel": "User Role", + "@userRoleLabel": { + "description": "Label in the user detail screen for user role." + }, + "institutionLabel": "Institution", + "@institutionLabel": { + "description": "Label in the user detail screen for user institution." + }, + "userDescriptionLabel": "Description", + "@userDescriptionLabel": { + "description": "Label in the user detail screen for user description." + }, + "citizenUser": "Citizen Scientist", + "@citizenUser": { + "description": "Label in user detail screen for citizen scientist role." + }, + "professionalUser": "Myrmecologist", + "@professionalUser": { + "description": "Label in user detail screen for professional myrmecologist role." + }, + "flaggedUser": "Flagged", + "@flaggedUser": { + "description": "Label in user detail screen for flagged user." + }, + "flightHistoryAppBarHeader": "History for Flight {id}", + "@flightHistoryAppBarHeader": { + "description": "App bar header for the flight record history screen.", + "placeholders": { + "id": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "readExceptionBody": "Error reading information from the server (response code {code}).", + "@readExceptionBody": { + "description": "Message to display on alert when a `ReadException` is caught.", + "placeholders": { + "code": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "readExceptionHeader": "Read Error", + "@readExceptionHeader": { + "description": "Header to display in alert when `ReadException` is thrown." + }, + "jsonExceptionBody": "Error parsing the response from the server. If the problem persists, please contact us.", + "@jsonExceptionBody": { + "description": "Message to display on alert when a `JsonException` is caught." + }, + "jsonExceptionHeader": "JSON Error", + "@jsonExceptionHeader": { + "description": "Header to display on alert when `JsonException` is caught." + }, + "getExceptionBody": "Error getting information from the server (response code {code}).", + "@getExceptionBody": { + "description": "Message to display on alert when a `GetException` is caught.", + "placeholders": { + "code": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "getExceptionHeader": "Read Error", + "@getExceptionHeader": { + "description": "Header to display in alert when `GetException` is caught." + }, + "invalidIdExceptionBody": "Invalid flight ID provided. If the problem persists, please contact us.", + "@invalidIdExceptionBody": { + "description": "Message to display on alert when an `InvalidIdException` is caught." + }, + "invalidIdExceptionHeader": "Invalid ID", + "@invalidIdExceptionHeader": { + "description": "Header to display on alert when `InvalidIdException` is caught." + }, + "noFlightExceptionBody": "The requested flight ({id}) does not exist. If you believe this is an error, please contact us.", + "@noFlightExceptionBody": { + "description": "Message to display on alert when a `NoFlightException` is caught.", + "placeholders": { + "id": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "noFlightExceptionHeader": "Flight Not Found", + "@noFlightExceptionHeader": { + "description": "Header to display in alert when `NoFlightException` is caught." + }, + "noImageExceptionBody": "The requested image ({id}) does not exist. If you believe this is an error, please contact us.", + "@noImageExceptionBody": { + "description": "Message to display on alert when a `NoImageException` is caught.", + "placeholders": { + "id": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "noImageExceptionHeader": "Image Not Found", + "@noImageExceptionHeader": { + "description": "Header to display in alert when `NoImageException` is caught." + }, + "noWeatherExceptionBody": "No weather could be found for flight {id}. If you believe this is an error, please contact us.", + "@noWeatherExceptionBody": { + "description": "Message to display on alert when a `NoWeatherException` is caught.", + "placeholders": { + "id": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "noWeatherExceptionHeader": "Weather Not Found", + "@noWeatherExceptionHeader": { + "description": "Header to display in alert when `NoWeatherException` is caught." + }, + "invalidImageTypeExceptionBody": "The image you are attempting to upload is not a valid image file (MIME type: {mime}). Please try again with a valid file.", + "@invalidImageTypeExceptionBody": { + "description": "Message to display on alert when a `InvalidImageTypeException` is caught.", + "placeholders": { + "mime": { + "type": "String", + "example": "application\/json" + } + } + }, + "invalidImageTypeExceptionHeader": "Invalid Image", + "@invalidImageTypeExceptionHeader": { + "description": "Header to display in alert when `InvalidImageTypeException` is caught." + }, + "noResponseExceptionBody": "No response was returned from the server. Please check your network and try again.", + "@noResponseExceptionBody": { + "description": "Message to display on alert when a `NoResponseException` is caught." + }, + "noResponseExceptionHeader": "Network Error", + "@noResponseExceptionHeader": { + "description": "Header to display on alert when `NoResponseException` is caught." + }, + "failedAuthenticationExceptionBody": "Your authentication was rejected by the server. This most likely means that your session has expired. Please log back in before continuing.", + "@failedAuthenticationExceptionBody": { + "description": "Message to display on alert when a `FailedAuthenticationException` is caught." + }, + "failedAuthenticationExceptionHeader": "Authentication Error", + "@failedAuthenticationExceptionHeader": { + "description": "Header to display on alert when `FailedAuthenticationException` is caught." + }, + "emptyUsernamePasswordExceptionBody": "Please enter your username and password before continuing.", + "@emptyUsernamePasswordExceptionBody": { + "description": "Message to display on alert when an `EmptyUsernamePasswordException` is caught." + }, + "emptyUsernamePasswordExceptionHeader": "Empty Username and/or Password", + "@emptyUsernamePasswordExceptionHeader": { + "description": "Header to display on alert when `EmptyUsernamePasswordException` is caught." + }, + "incorrectCredentialsExceptionBody": "Incorrect username or password entered. If you have forgotten your password, please reset it.", + "@incorrectCredentialsExceptionBody": { + "description": "Message to display on alert when an `IncorrectCredentialsException` is caught." + }, + "incorrectCredentialsExceptionHeader": "Incorrect Authentication", + "@incorrectCredentialsExceptionHeader": { + "description": "Header to display on alert when `IncorrectCredentialsException` is caught." + }, + "forbiddenAccessExceptionBody": "Your account is not active. This is probably the result of not activating your account when you created it or your account may be flagged. Please contact us to fix this problem.", + "@forbiddenAccessExceptionBody": { + "description": "Message to display on alert when a `ForbiddenAccessException` is caught." + }, + "forbiddenAccessExceptionHeader": "Forbidden", + "@forbiddenAccessExceptionHeader": { + "description": "Header to display on alert when `ForbiddenAccessException` is caught." + }, + "insufficientPrivilegesExceptionBody": "You do not have permission to perform this task. If you believe that this is an error, please contact us.", + "@insufficientPrivilegesExceptionBody": { + "description": "Message to display on alert when a `InsufficientPrivilegesException` is caught." + }, + "insufficientPrivilegesExceptionHeader": "Permission Error", + "@insufficientPrivilegesExceptionHeader": { + "description": "Header to display on alert when `InsufficientPrivilegesException` is caught." + }, + "loginExceptionBody": "Error logging in. The server returned code {value}. Please try again. If the problem persists, contact us.", + "@loginExceptionBody": { + "description": "Message to display on alert when a `LoginException` is caught.", + "placeholders": { + "value": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "loginExceptionHeader": "Login Error", + "@loginExceptionHeader": { + "description": "Header to display on alert when `LoginException` is caught." + }, + "logoutExceptionBody": "Error logging out. The server returned code {value}. Please try again. If the problem persists, contact us.", + "@logoutExceptionBody": { + "description": "Message to display on alert when a `LogoutException` is caught.", + "placeholders": { + "value": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "logoutExceptionHeader": "Logout Error", + "@logoutExceptionHeader": { + "description": "Header to display on alert when `LogoutException` is caught." + }, + "addFlightExceptionBody": "Error adding new flight. The server responded with an error code (response code {code}). Please try again. If the problem persists, please contact us.", + "@addFlightExceptionBody": { + "description": "Message to display on alert when a `AddFlightException` is caught.", + "placeholders": { + "code": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "addFlightExceptionHeader": "Error Adding Flight", + "@addFlightExceptionHeader": { + "description": "Header to display in alert when `AddFlightException` is thrown." + }, + "editFlightExceptionBody": "Error updating the flight. The server responded with an error code (response code {code}). Please try again. If the problem persists, please contact us.", + "@editFlightExceptionBody": { + "description": "Message to display on alert when a `EditFlightException` is caught.", + "placeholders": { + "code": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "editFlightExceptionHeader": "Error Editing Flight", + "@editFlightExceptionHeader": { + "description": "Header to display in alert when `EditFlightException` is thrown." + }, + "commentCreationExceptionBody": "Error creating the comment. The server responded with an error code (response code {code}). Please try again. If the problem persists, please contact us.", + "@commentCreationExceptionBody": { + "description": "Message to display on alert when a `CommentCreationException` is caught.", + "placeholders": { + "code": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "commentCreationExceptionHeader": "Error Creating Comment", + "@commentCreationExceptionHeader": { + "description": "Header to display in alert when `CommentCreationException` is thrown." + }, + "imageCreationExceptionBody": "Error uploading the image. The server responded with an error code (response code {code}). Please try again. If the problem persists, please contact us.", + "@imageCreationExceptionBody": { + "description": "Message to display on alert when a `ImageCreationException` is caught.", + "placeholders": { + "code": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "imageCreationExceptionHeader": "Image Upload Error", + "@imageCreationExceptionHeader": { + "description": "Header to display in alert when `ImageCreationException` is thrown." + }, + "imageDeletionExceptionBody": "Error deleting the image. The server responded with an error code (response code {code}). Please try again. If the problem persists, please contact us.", + "@imageDeletionExceptionBody": { + "description": "Message to display on alert when a `ImageDeletionException` is caught.", + "placeholders": { + "code": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "imageDeletionExceptionHeader": "Image Deletion Error", + "@imageDeletionExceptionHeader": { + "description": "Header to display in alert when `ImageDeletionException` is thrown." + }, + "flightVerificationExceptionBody": "Error verifying the flight. The server responded with an error code (response code {code}). Please try again. If the problem persists, please contact us.", + "@flightVerificationExceptionBody": { + "description": "Message to display on alert when a `FlightVerificationException` is caught.", + "placeholders": { + "code": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "flightVerificationExceptionHeader": "Error Verifying Flight", + "@flightVerificationExceptionHeader": { + "description": "Header to display in alert when `FlightVerificationException` is thrown." + }, + "notImageRowExceptionBody": "The row you attempted to delete is not an image row. If you believe this is an error, please contact us.", + "@notImageRowExceptionBody": { + "description": "Message to display on alert when a `NotImageException` is caught." + }, + "notImageRowExceptionHeader": "Illegal Row Operation", + "@notImageRowExceptionHeader": { + "description": "Header to display on alert when `NotImageException` is caught." + }, + "notificationUpdateExceptionBody": "Error updating notification settings (response code {code}). If the problem persists, please contact us.", + "@notificationUpdateExceptionBody": { + "description": "Message to display on alert when a `NotificationUpdateException` is caught.", + "placeholders": { + "code": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "notificationUpdateExceptionHeader": "Notification Settings Update Error", + "@notificationUpdateExceptionHeader": { + "description": "Header to display in alert when `NotificationUpdateException` is thrown." + }, + "tokenVerificationExceptionBody": "Error verifying session (response code {code}). If the problem persists, please contact us.", + "@tokenVerificationExceptionBody": { + "description": "Message to display on alert when a `TokenVerificationException` is caught.", + "placeholders": { + "code": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "tokenVerificationExceptionHeader": "Login Verification Error", + "@tokenVerificationExceptionHeader": { + "description": "Header to display in alert when `TokenVerificationException` is thrown." + }, + "genusNotFoundExceptionBody": "The requested genus ({id}) does not exist. If you believe this is an error, please contact us.", + "@genusNotFoundExceptionBody": { + "description": "Message to display on alert when a `GenusNotFoundException` is caught.", + "placeholders": { + "id": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "genusNotFoundExceptionHeader": "Genus Not Found", + "@genusNotFoundExceptionHeader": { + "description": "Header to display in alert when `GenusNotFoundException` is caught." + }, + "noFlightResultsExceptionBody": "No flights match your filtering parameters. Please adjust your filter settings and try again.", + "@noFlightResultsExceptionBody": { + "description": "Message to display on alert when a `NoFlightResultsException` is caught." + }, + "noFlightResultsExceptionHeader": "No Flights Found", + "@noFlightResultsExceptionHeader": { + "description": "Header to display on alert when `NoFlightResultsException` is caught." + }, + "tryAgainButton": "Try Again", + "@tryAgainButton": { + "description": "Label for 'try again' button on alert dialogs." + }, + "cancelButton": "Cancel", + "@cancelButton": { + "description": "Label for 'cancel' button on alert dialogs." + }, + "delete": "Delete", + "@delete": { + "description": "Label for 'delete' action." + }, + "flightWeatherAppBarHeader": "Weather for Flight {id}", + "@flightWeatherAppBarHeader": { + "description": "App bar header for the flight weather screen.", + "placeholders": { + "id": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "windSpeedLabel": "Wind Speed", + "@windSpeedLabel": { + "description": "Label in the weather detail screen for the wind speed." + }, + "windSpeedDetail": "{speed} m/s", + "@windSpeedDetail": { + "description": "Formats the wind speed for the weather detail screen. For translating, only change the representation of the units.", + "placeholders": { + "speed": { + "type": "double", + "format": "decimalPattern" + } + } + }, + "windDirectionLabel": "Wind Direction", + "@windDirectionLabel": { + "description": "Label in the weather detail screen for the wind direction." + }, + "windDirectionDetail": "{direction}\u00b0", + "@windDirectionDetail": { + "description": "Formats the wind direction for the weather detail screen. For translating, only change the representation of the units.", + "placeholders": { + "direction": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "weatherWindSectionHeader": "Wind Information", + "@weatherWindSectionHeader": { + "description": "Header for the wind section of the weather detail screen." + }, + "weatherTimeFetchedLabel": "Time Fetched", + "@weatherTimeFetchedLabel": { + "description": "Label for the time fetched row in the weather detail screen." + }, + "weatherTimeFetchedHeader": "Time Fetched", + "@weatherTimeFetchedHeader": { + "description": "Header for the time fetched section in the weather detail screen." + }, + "weatherDescriptionLabel": "Description", + "@weatherDescriptionLabel": { + "description": "Label for the description row in the weather detail screen." + }, + "weatherLongDescriptionLabel": "Long Description", + "@weatherLongDescriptionLabel": { + "description": "Label for the long description row in the weather detail screen." + }, + "weatherDescriptionHeader": "Weather Description", + "@weatherDescriptionHeader": { + "description": "Header for the description section in the weather detail screen." + }, + "weatherBasicDescriptionHeader": "Basic Weather Information", + "@weatherBasicDescriptionHeader": { + "description": "Header for the basic weather section in the weather detail screen." + }, + "degreesCelsius": "{value}\u00b0C", + "@degreesCelsius": { + "description": "Used to format temperatures. DO NOT change to Fahrenheit or Kelvin without adding conversion code. Changing this string only affects the label, not the actual temperature.", + "placeholders": { + "value": { + "type": "double", + "format": "decimalPattern" + } + } + }, + "hPaPressure": "{value} hPa", + "@hPaPressure": { + "description": "Used to format pressures in hPa. DO NOT change to PSI, atmospheres or mm Hg without adding conversion code. Changing this string only affects the label, not the actual pressure.", + "placeholders": { + "value": { + "type": "double", + "format": "decimalPattern" + } + } + }, + "percent": "{value}%", + "@percent": { + "description": "Used to format percentages.", + "placeholders": { + "value": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "weatherTemperatureLabel": "Temperature", + "@weatherTemperatureLabel": { + "description": "Label for the temperature row in the weather detail screen." + }, + "weatherPressureLabel": "Pressure", + "@weatherPressureLabel": { + "description": "Label for the pressure row in the weather detail screen." + }, + "weatherSeaPressureLabel": "Sea-level Pressure", + "@weatherSeaPressureLabel": { + "description": "Label for the sea-level pressure row in the weather detail screen." + }, + "weatherGroundPressureLabel": "Ground-level Pressure", + "@weatherGroundPressureLabel": { + "description": "Label for the ground-level pressure row in the weather detail screen." + }, + "weatherHumidityLabel": "Humidity", + "@weatherHumidityLabel": { + "description": "Label for the humidity row in the weather detail screen." + }, + "weatherCloudsLabel": "Clouds", + "@weatherCloudsLabel": { + "description": "Label for the clouds row in the weather detail screen." + }, + "weatherMinTemperatureLabel": "Minimum Temperature", + "@weatherMinTemperatureLabel": { + "description": "Label for the min temperature row in the weather detail screen." + }, + "weatherMaxTemperatureLabel": "Maximum Temperature", + "@weatherMaxTemperatureLabel": { + "description": "Label for the max temperature row in the weather detail screen." + }, + "weatherDayHeader": "Day Information", + "@weatherDayHeader": { + "description": "Header for the day section in the weather detail screen." + }, + "sunriseLabel": "Sunrise", + "@sunriseLabel": { + "description": "Label for the sunrise row in the weather detail screen." + }, + "sunsetLabel": "Sunset", + "@sunsetLabel": { + "description": "Label for the sunset row in the weather detail screen." + }, + "weatherRainHeader": "Rain Information", + "@weatherRainHeader": { + "description": "Header for the rain section in the weather detail screen." + }, + "millimetres": "{value} mm", + "@millimetres": { + "description": "Used to represent values in millimetres. DO NOT change the units to inches or centimetres without writing the proper conversion code first.", + "placeholders": { + "value": { + "type": "double", + "format": "decimalPattern" + } + } + }, + "weatherRainOneHourLabel": "Past 1 hour", + "@weatherRainOneHourLabel": { + "description": "Label for the rain one hour row in the weather detail screen." + }, + "weatherRainThreeHoursLabel": "Past 3 hours", + "@weatherRainThreeHoursLabel": { + "description": "Label for the rain three hours row in the weather detail screen." + }, + "creditsToOpenWeatherMap": "Weather information from OpenWeather\u2122 (https://openweathermap.org/), which is made available here under the Open Database License (ODbL) (https://opendatacommons.org/licenses/odbl/1-0/).", + "@creditsToOpenWeatherMap": { + "description": "Label for the bottom of the weather detail page to provide license information for the weather data from OpenWeather (TM)." + }, + "loginAppBarHeader": "Sign in", + "@loginAppBarHeader": { + "description": "AppBar title for the login screen." + }, + "loginButtonHeader": "Sign in", + "@loginButtonHeader": { + "description": "AppBar title for the login button." + }, + "loginScreenHeader": "Log into AntNupTracker", + "@loginScreenHeader": { + "description": "AppBar title for the login screen." + }, + "enterUsernameMessage": "Please enter your username.", + "@enterUsernameMessage": { + "description": "Error prompt on the login screen if username is not entered." + }, + "enterPasswordMessage": "Please enter your password.", + "@enterPasswordMessage": { + "description": "Error prompt on the login screen if password is not entered." + }, + "passwordLabel": "Password", + "@passwordLabel": { + "description": "Text hint for the password field." + }, + "loginButton": "Sign in", + "@loginButton": { + "description": "Text for the sign in button." + }, + "infoButton": "Info", + "@infoButton": { + "description": "Tooltip for the info button." + }, + "logoutButton": "Sign out", + "@logoutButton": { + "description": "Text for the sign out button." + }, + "edit": "Edit", + "@edit": { + "description": "Text for an edit button." + }, + "editingFlightAppBar" : "Edit Flight {id}", + "@editingFlightAppBar": { + "description" : "App bar header for flight editing form.", + "placeholders": { + "id": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "newFlightAppBar" : "New Flight Record", + "@newFlightAppBar": { + "description": "App bar header for flight editing form." + }, + "taxonomy": "Taxonomy", + "@taxonomy": { + "description": "Header for the taxonomy section of the flight form." + }, + "flightSizeHeader": "Flight Size", + "@flightSizeHeader": { + "description": "Header for the flight size section of the flight form." + }, + "changeLocationOnMap": "Change location on map", + "@changeLocationOnMap": { + "description": "Label for change location button." + }, + "uploadImage": "Upload Image", + "@uploadImage": { + "description": "Label for cell in flight form to toggle uploading of image." + }, + "addNewFlightButton": "New Flight", + "@addNewFlightButton": { + "description": "Tooltip text for FAB to add enter new flight record." + }, + "invalidGenus": "Please enter a valid genus.", + "@invalidGenus": { + "description": "Error message to show when invalid genus has been entered." + }, + "invalidSpecies": "Please enter a valid species.", + "@invalidSpecies": { + "description": "Error message to show when invalid species has been entered." + }, + "cancel": "Cancel", + "@cancel": { + "description": "Text for cancel button in alerts." + }, + "ok": "OK", + "@ok": { + "description": "Text to use for OK button." + }, + "latitude": "Latitude", + "@latitude": { + "description": "Label for latitude." + }, + "longitude": "Longitude", + "@longitude": { + "description": "Label for longitude." + }, + "invalidCoordinate": "Invalid coordinate", + "@invalidCoordinate": { + "description": "Error message to show when the user enters an incorrectly-formatted coordinate." + }, + "chooseImageSource": "Choose Image Source", + "@chooseImageSource": { + "description": "Header for alert to choose image source." + }, + "camera": "Camera", + "@camera": { + "description": "Label for device camera." + }, + "gallery": "Photo Library", + "@gallery": { + "description": "Label for choosing from device photos." + }, + "noImage": "No Image", + "@noImage": { + "description": "Label for choosing no image." + }, + "emptyGenus": "Please enter genus.", + "@emptyGenus": { + "description": "Message to display when genus field is empty." + }, + "emptySpecies": "Please enter species.", + "@emptySpecies": { + "description": "Message to display when species field is empty." + }, + "pleaseSelectImage": "Select an image.", + "@pleaseSelectImage": { + "description": "Error message when no image selected but switch is toggled on." + }, + "uploadingFlight": "Uploading Flight", + "@uploadingFlight": { + "description": "Alert title when a new flight is uploading." + }, + "uploadingComment": "Uploading Comment", + "@uploadingComment": { + "description": "Alert title when a new comment is uploading." + }, + "getCurrentLocation": "Current Location", + "@getCurrentLocation": { + "description": "Label for button to use current location in location picker." + }, + "update": "Update", + "@update": { + "description": "Tooltip text for updating a flight." + }, + "save": "Save", + "@save": { + "description": "Tooltip text for saving a new flight." + }, + "createComment": "New Comment", + "@createComment": { + "description": "Header and tooltip for comment creation." + }, + "editComment": "Edit Comment", + "@editComment": { + "description": "Header and tooltip for comment editing." + }, + "comment": "Comment", + "@comment": { + "description": "Label for comment input field." + }, + "emptyComment": "Please enter your comment.", + "@emptyComment": { + "description": "Error message if no comment is inputted." + }, + "verifyFlightHeader": "Verify Flight", + "@verifyFlightHeader": { + "description": "Header for prompt for verifying flight." + }, + "verifyFlightBody": "Please confirm that you wish to mark this flight as verified.", + "@verifyFlightBody": { + "description": "Body text for prompt for verifying the flight." + }, + "unVerifyFlightHeader": "Un-Verify Flight", + "@unVerifyFlightHeader": { + "description": "Header for prompt for un-verifying flight." + }, + "unVerifyFlightBody": "Please confirm that you wish to un-mark this flight as verified.", + "@unVerifyFlightBody": { + "description": "Body text for prompt for un-verifying the flight." + }, + "verifyingFlight": "Verifying Flight", + "@verifyingFlight": { + "description": "Header for loading alert while flight is being verified." + }, + "unVerifyingFlight": "Un-Verifying Flight", + "@unVerifyingFlight": { + "description": "Header for loading alert while flight is being un-verified." + }, + "addImage": "Add Image", + "@addImage": { + "description": "Tooltip for button to add more images." + }, + "filteringAndSorting": "Filtering and Sorting", + "@filteringAndSorting": { + "description": "Tooltip and header for filtering dialog." + }, + "filtering": "Filtering", + "@filtering": { + "description": "Label for the filtering section." + }, + "sorting": "Sorting", + "@sorting": { + "description": "Label for the sorting section." + }, + "sortBy": "Sort by", + "@sortBy": { + "description": "Label for the sorting choice." + }, + "distance": "Distance from", + "@distance": { + "description": "Label for sorting by distance option." + }, + "taxonomyFilter": "Filter by Taxonomy", + "@taxonomyFilter": { + "description": "Label for filtering by taxonomy." + }, + "ascending": "Ascending", + "@ascending": { + "description": "Indicate ascending." + }, + "descending": "Descending", + "@descending": { + "description": "Indicate descending." + }, + "fromLocation": "From {location}", + "@fromLocation": { + "description": "Label for location from which distance is measured.", + "placeholders" : { + "location": { + "type": "String", + "example": "(30.0\u00b0N, 74.0\u00b0W)" + } + } + }, + "filterByDate": "Filter by Date", + "@filterByDate": { + "description": "Header for choice to filter by date." + }, + "minDate": "After", + "@minDate": { + "description": "Label for date filtering after a certain date." + }, + "maxDate": "Before", + "@maxDate": { + "description": "Label for date filtering before a certain date." + }, + "clear": "Clear", + "@clear": { + "description": "Tooltip for icon to clear text." + }, + "filterByTaxonomy": "Filter by Taxonomy", + "@filterByTaxonomy": { + "description": "Header for choice to filter by taxonomy." + }, + "filteringByGenera": "{count,plural, =1{Filtering by {count} genus} other{Filtering by {count} genera}}", + "@filteringByGenera": { + "description": "Label for the number of genera currently used to filter.", + "placeholders": { + "count": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "filteringBySpecies": "Filtering by {count} species", + "@filteringBySpecies": { + "description": "Label for the number of species currently used to filter.", + "placeholders": { + "count": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "done": "Done", + "@done": { + "description": "Tooltip to indicate done button." + }, + "filteringGenera": "Filtering Genera", + "@filteringGenera": { + "description": "Header for section with filtering genera." + }, + "filteringSpecies": "Filtering Species", + "@filteringSpecies": { + "description": "Header for section with filtering species." + }, + "notifyingGenera": "Selected Genera", + "@notifyingGenera": { + "description": "Header for section with selected genera for notifications." + }, + "notifyingSpecies": "Selected Species", + "@notifyingSpecies": { + "description": "Header for section with selected species for notifications." + }, + "selectGenus": "Select Genus", + "@selectGenus": { + "description": "Header for genus selection screen." + }, + "selectSpecies": "Select Species", + "@selectSpecies": { + "description": "Header for species selection screen." + }, + "entireGenus": "Entire Genus", + "@entireGenus": { + "description": "Label to indicate selecting the entire genus (for filtering or notifications)." + }, + "filterByImages": "Filter for Flights with Images", + "@filterByImages": { + "description": "Header for choice to filter by images." + }, + "hasImages": "Has Images", + "@hasImages": { + "description": "Option for filtering to indicated that flight has images" + }, + "noImages": "No Images", + "@noImages": { + "description": "Option for filtering to indicated that flight has no images" + }, + "filterByVerification": "Filter by Verification Level", + "@filterByVerification" : { + "description": "Header for choice to filter by verification level." + }, + "filteringByUserRole": "User Role", + "@filteringByUserRole": { + "description": "Label for filtering by user role." + }, + "filteringByVerification": "Verification", + "@filteringByVerification": { + "description": "Label for filtering by verification." + }, + "verified": "Verified", + "@verified": { + "description": "Option for filtering only verified flights." + }, + "notVerified": "Not Verified", + "@notVerified": { + "description": "Option for filtering only not-verified flights." + }, + "welcomeHeader": "Welcome to AntNupTracker", + "@welcomeHeader": { + "description": "Header for the welcome screen." + }, + "viewFlightList": "View Flight List", + "@viewFlightList": { + "description": "Text for button to close welcome screen." + }, + "welcomeBullet1": "View ant nuptial flight records", + "@welcomeBullet1": { + "description": "First bullet point on welcome screen." + }, + "welcomeBullet2": "Record ant nuptial flight data", + "@welcomeBullet2": { + "description": "Second bullet point on welcome screen." + }, + "welcomeBullet3": "Comment on flight records", + "@welcomeBullet3": { + "description": "Third bullet point on welcome screen." + }, + "welcomeBodyText": "With your help, we are building an open and publicly-accessible database of ant nuptial flights to enable future research into the links between ant nuptial flight timing and environmental changes.", + "@welcomeBodyText": { + "description": "Body text beneath the bullet points." + }, + "welcomeBottomText": "Welcome to the community!", + "@welcomeBottomText": { + "description": "Welcome text below main purpose screen." + }, + "moreAboutUs": "More About Us", + "@moreAboutUs": { + "description": "Text for about us button on welcome screen." + }, + "privacyPolicy": "Privacy Policy", + "@privacyPolicy": { + "description": "Text for privacy policy button." + }, + "homePageButton": "AntNupTracker Homepage", + "@homePageButton": { + "description": "Header for button to go to homepage." + }, + "termsOfUse": "Terms of Use", + "@termsOfUser": { + "description": "Header for button linking to terms of use." + }, + "contactUs": "Contact Us", + "@contactUs": { + "description": "Header for button linking to send email." + }, + "moreInformation": "More Information", + "@moreInformation": { + "description": "Header for the More Information section of the user profile screen." + }, + "userInformation": "User Information", + "@userInformation": { + "description": "Header for the user info section in the profile screen." + }, + "forgotPassword": "Forgot Password?", + "@forgotPassword": { + "description": "Button text for forgotten password." + }, + "createNewUser": "Create Account", + "@createNewUser": { + "description": "Button text for create account." + }, + "notificationSettings": "Notification Settings", + "@notificationSettings": { + "description": "Header for user notification section." + }, + "updatingSettings": "Updating Settings", + "@updatingSettings": { + "description": "Header to indicate updating settings." + }, + "loadingNotificationSettings": "Loading Notification Settings", + "@loadingNotificationSettings": { + "description": "Text to indicate that notification settings are being loaded." + }, + "notifyingByGenera": "{count,plural, =1{Notifying about {count} genus} other{Notifying about {count} genera}}", + "@notifyingByGenera": { + "description": "Label for the number of genera currently used for notifications.", + "placeholders": { + "count": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "notifyingBySpecies": "Notifying about {count} species", + "@notifyingBySpecies": { + "description": "Label for the number of species currently used for notifications.", + "placeholders": { + "count": { + "type": "int", + "format": "decimalPattern" + } + } + }, + "notifications": "Notifications", + "@notifications": { + "description": "Header for notification preferences screen." + }, + "loadingComments": "Loading Comments...", + "@loadingComments": { + "description": "Text to show when loading comments." + }, + "initialLoadingStage": "Setting up...", + "@initialLoadingStage": { + "description": "Caption for initial loading." + }, + "credentialLoadingStage": "Loading Credentials...", + "@credentialLoadingStage": { + "description": "Caption for credential loading." + }, + "taxonomyLoadingStage": "Loading Taxonomy...", + "@taxonomyLoadingStage": { + "description": "Caption for taxonomy loading." + }, + "flightLoadingStage": "Loading Flights...", + "@flightLoadingStage": { + "description": "Caption for flight loading." + }, + "filteringLoadingStage": "Loading Filtering...", + "@filteringLoadingStage": { + "description": "Caption for filtering loading." + }, + "doneLoadingStage": "Finished Loading...", + "@doneLoadingStage": { + "description": "Caption for done loading." + }, + "gettingLocation": "Getting Current Location", + "@gettingLocation": { + "description": "Indicates that the app is getting the current location." + }, + "next": "Next", + "@next": { + "description": "Label for Next button." + }, + "previous": "Previous", + "@previous": { + "description": "Label for Previous button." + }, + "setUpSorting": "Set up Sorting", + "@setUpSorting" : { + "description": "Header for welcome section about sorting" + }, + "setUpFiltering": "Set up Filtering", + "@setUpFiltering" : { + "description": "Header for welcome section about filtering" + }, + "noImageSourcesHeader": "No Valid Image Sources", + "@noImageSourcesHeader": { + "description": "Header for alert when attempting to add image but no permissions granted." + }, + "noImageSourcesContent": "To upload images, please change your permissions to allow access to either your camera or photo library.", + "@noImageSourcesContent": { + "description": "Content for alert when attempting to add image but no permissions granted." + }, + "locationServicesDisabledHeader": "Location Services Disabled", + "@locationServicesDisabledHeader": { + "description": "Header for alert when attempting to get current location but no permissions granted." + }, + "locationServicesDisabledContent": "In order to use this feature, you must enable location services in your device's settings.", + "@locationServicesDisabledContent": { + "description": "Content for alert when attempting to get current location but no permissions granted." + }, + "appPermissionsHeader": "App Permissions", + "@appPermissionsHeader": { + "description": "Header for app permissions screen." + }, + "appPermissionsSubtitle": "Some features in our app require extra permissions. These are completely optional and can be enabled or disabled later in your device settings.", + "@appPermissionsSubtitle": { + "description": "Subtitle on app permissions screen." + }, + "location": "Location", + "@location": { + "description": "Header for the location section of the permissions screen" + }, + "locationPermissionDetails": "Your location can be used to help record nuptial flights from the field and filter existing flight records based on distance from your current location. If you do not accept, you can still manually select a location for both flight recording and filtering. If you share your location when uploading a recent flight, your location (rounded to three decimal places) will be shared with a third-party service (OpenWeather Map) in order to get the weather.", + "@locationPermissionDetails": { + "description": "Explanation of location permissions." + }, + "cameraPermissionDetails": "You can use your camera to upload images of nuptial flights. If you don't accept, you can still upload flights without images or with images from your gallery.", + "@cameraPermissionDetails": { + "description": "Explanation of camera permissions." + }, + "galleryPermissionDetails": "You can upload flight images from your device's image gallery. If you don't accept, you can still record flight information without images or upload images using your camera. This permission must be granted to be able to save pictures you take with the camera in our app.", + "@galleryPermissionDetails": { + "description": "Explanation of gallery permissions." + }, + "permissionsScreenBottomNote": "After you press 'Next', you will be prompted to accept each permission. Remember, you can always change your settings later.", + "@permissionsScreenBottomNote": { + "description": "Bottom text on permissions screen." + }, + "packagesInfo": "Package List and Licenses", + "@packagesInfo": { + "description": "Header for screen with package info." + }, + "openPackageSite": "Open Package Website", + "@openPackageSite": { + "description": "Text to direct user to package website." + }, + "applicationLegalese": "Copyright (c) 2020-2022, Abouheif Lab.", + "@applicationLegalese": { + "description": "Text to show on Licenses page." + }, + "loadingImages": "Loading Images...", + "@loadingImages": { + "description": "Text to show that images are loading." + }, + "updatingLocation": "Updating Location", + "@updatingLocation": { + "description": "Text to display while updating location in filtering screen." + } +} \ No newline at end of file diff --git a/lib/launch_url.dart b/lib/launch_url.dart new file mode 100644 index 0000000..6154797 --- /dev/null +++ b/lib/launch_url.dart @@ -0,0 +1,31 @@ +/* + * launch_url.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:url_launcher/url_launcher.dart'; + +Future launchUrl(String urlString) async { + if (await canLaunch(urlString)) { + return await launch(urlString); + } + else { + return false; + } +} + diff --git a/lib/location_picker.dart b/lib/location_picker.dart new file mode 100644 index 0000000..c2f9f48 --- /dev/null +++ b/lib/location_picker.dart @@ -0,0 +1,423 @@ +/* + * location_picker.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:async'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:location/location.dart'; +import 'package:tuple/tuple.dart'; + +enum LocationPickerMode { locationAndRadius, locationOnly } + +class LocationPickerView extends StatefulWidget { + const LocationPickerView( + {required this.locationPickerMode, + this.initialLocation, + this.initialRadius, + Key? key}) + : super(key: key); + + final LocationPickerMode locationPickerMode; + final LatLng? initialLocation; + final double? initialRadius; + + @override + _LocationPickerViewState createState() => _LocationPickerViewState(); +} + +class _LocationPickerViewState extends State { + var _location = const LatLng(0, 0); + var _radius = 0.0; + late LocationPickerMode _locationPickerMode; + late AppLocalizations _appLocalizations; + late CameraPosition _cameraPosition; + + final zoomLevel = 10.0; + + // Camera movement from: https://stackoverflow.com/questions/62722671/google-maps-camera-position-updating-issues-in-flutter + final _completer = Completer(); + + // final _mapController = MapController(); + + final _globalKey = GlobalKey(); + + bool _mapFocused = true; + + @override + void initState() { + if (widget.initialLocation != null) _location = widget.initialLocation!; + if (widget.initialRadius != null) _radius = widget.initialRadius!; + + _locationPickerMode = widget.locationPickerMode; + _cameraPosition = CameraPosition(target: _location, zoom: zoomLevel); + super.initState(); + } + + _LocationPickerViewState() { + // if (initialLocation != null) _location = initialLocation; + // if (initialRadius != null) _radius = initialRadius; + } + + // void _placeLocationMarker(GoogleMapController mapController) {} + + void _updateLocation(LatLng newLoc) async { + setState(() { + _location = newLoc; + }); + + final controller = await _completer.future; + // controller.animateCamera(CameraUpdate.newCameraPosition( + // CameraPosition(target: _location, zoom: zoomLevel))); + controller.animateCamera(CameraUpdate.newLatLng(_location)); + } + + Widget _buildMap() { + return Expanded( + child: Container( + margin: const EdgeInsets.only(bottom: 8.0), + child: Focus( + onFocusChange: (value) => _mapFocused = value, + child: GoogleMap( + // onMapCreated: _placeLocationMarker, + initialCameraPosition: _cameraPosition, + onMapCreated: (controller) { + _completer.complete(controller); + }, + gestureRecognizers: { + Factory(() => PanGestureRecognizer()), + Factory(() => ScaleGestureRecognizer()), + Factory( + () => LongPressGestureRecognizer()), + Factory(() => TapGestureRecognizer()) + }, + markers: { + Marker( + markerId: const MarkerId("location"), + position: _location, + ), + }, + circles: { + if (_locationPickerMode == LocationPickerMode.locationAndRadius) + Circle( + circleId: const CircleId("locationCircle"), + center: _location, + radius: _radius * 1000, + strokeWidth: 2, + strokeColor: Colors.red, + ) + }, + // onLongPress: _mapFocused ? null : _updateLocation, + // onTap: (newLocation) { + // if (_mapFocused) { + // _updateLocation(newLocation); + // } + // else { + // _updateLocationFromFields(); + // FocusManager.instance.primaryFocus?.unfocus(); + // } + // }, + onTap: _updateLocation, + onLongPress: (_) { + _updateLocationFromFields(); + FocusManager.instance.primaryFocus?.unfocus(); + }, + // mapType: MapType.terrain, + ), + ), + ), + ); + } + + final _latitudeController = TextEditingController(); + final _longitudeController = TextEditingController(); + final _longitudeFocusNode = FocusNode(); + final _latitudeFocusNode = FocusNode(); + + Widget _buildLatitudeLongitudeRadiusFields() { + _latitudeController.text = _location.latitude.toString(); + _longitudeController.text = _location.longitude.toString(); + + return LayoutBuilder( + builder: (context, constraints) { + double widgetWidth = constraints.maxWidth; + var widthFactor = 1.0; + + if (widgetWidth > 300) { + widgetWidth = widgetWidth / 2 - 8; + widthFactor = 0.45; + } + + return Wrap( + spacing: 8.0, + runSpacing: 8.0, + children: [ + FractionallySizedBox( + widthFactor: widthFactor, + child: SizedBox( + height: 80, + // margin: const EdgeInsets.symmetric(horizontal: 8.0), + child: TextFormField( + textInputAction: TextInputAction.next, + focusNode: _latitudeFocusNode, + keyboardType: const TextInputType.numberWithOptions( + signed: true, decimal: true), + decoration: InputDecoration( + labelText: _appLocalizations.latitude, filled: true), + inputFormatters: [ + FilteringTextInputFormatter(RegExp("[\\-\\d\\.]"), + allow: true) + ], + controller: _latitudeController, + onEditingComplete: () async { + final newLatitude = + double.tryParse(_latitudeController.text); + + if (newLatitude == null) return; + + _latitudeFocusNode.nextFocus(); + + // setState(() => _setLatitude(newLatitude)); + setState(_updateLocationFromFields); + + final controller = await _completer.future; + // controller.animateCamera(CameraUpdate.newCameraPosition( + // CameraPosition(target: _location, zoom: zoomLevel))); + controller.animateCamera(CameraUpdate.newLatLng(_location)); + }, + validator: (value) { + if (value == null) return null; + + return double.tryParse(value) == null + ? _appLocalizations.invalidCoordinate + : null; + }, + autovalidateMode: AutovalidateMode.onUserInteraction, + ), + ), + ), + FractionallySizedBox( + widthFactor: widthFactor, + child: SizedBox( + height: 80, + // margin: const EdgeInsets.symmetric(horizontal: 8.0), + child: TextFormField( + focusNode: _longitudeFocusNode, + keyboardType: const TextInputType.numberWithOptions( + signed: true, decimal: true), + decoration: InputDecoration( + labelText: _appLocalizations.longitude, filled: true), + inputFormatters: [ + FilteringTextInputFormatter(RegExp("[\\-\\d\\.]"), + allow: true) + ], + controller: _longitudeController, + onEditingComplete: () async { + final newLongitude = + double.tryParse(_longitudeController.text); + + if (newLongitude == null) return; + + // setState(() => _setLongitude(newLongitude)); + setState(_updateLocationFromFields); + + _longitudeFocusNode.unfocus(); + + final controller = await _completer.future; + // controller.moveCamera(CameraUpdate.newLatLng(_location)); + // controller.animateCamera(CameraUpdate.newCameraPosition( + // CameraPosition(target: _location, zoom: zoomLevel))); + controller.animateCamera(CameraUpdate.newLatLng(_location)); + }, + validator: (value) { + if (value == null) return null; + + return double.tryParse(value) == null + ? _appLocalizations.invalidCoordinate + : null; + }, + autovalidateMode: AutovalidateMode.onUserInteraction, + ), + ), + ) + ], + ); + }, + ); + } + + Widget _buildRadiusStepper() { + return Padding( + padding: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(_appLocalizations.radiusDistanceDetail(_radius)), + ToggleButtons( + children: const [ + Icon(Icons.remove), + Icon(Icons.add), + ], + isSelected: const [false, false], + onPressed: (int selectedIndex) { + setState(() { + if (selectedIndex == 0 && _radius > 0) { + _radius -= 0.5; + } else if (selectedIndex == 1) { + _radius += 0.5; + } + }); + }, + ) + ], + ), + ); + } + + Widget _buildCurrentLocationRow() { + return ElevatedButton( + onPressed: () async { + final currentLocation = await getCurrentLocation(); + + if (currentLocation != null) { + _updateLocation(currentLocation); + } else { + final messageDialog = AlertDialog( + title: Text(_appLocalizations.locationServicesDisabledHeader), + content: Text(_appLocalizations.locationServicesDisabledContent), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(_appLocalizations.ok), + ) + ], + ); + + showDialog(context: context, builder: (_) => messageDialog); + } + }, + child: Text(_appLocalizations.getCurrentLocation), + ); + } + + void _setCoordinates({double? latitude, double? longitude}) { + final newLatitude = latitude ?? _location.latitude; + final newLongitude = longitude ?? _location.longitude; + + _updateLocation(LatLng(newLatitude, newLongitude)); + } + + void _updateLocationFromFields() { + final latitude = double.parse(_latitudeController.text); + final longitude = double.parse(_longitudeController.text); + + setState(() => _setCoordinates(latitude: latitude, longitude: longitude)); + } + + // void _setLatitude(double newLatitude) { + // _location = LatLng(newLatitude, _location.longitude); + // } + // + // void _setLongitude(double newLongitude) { + // _location = LatLng(_location.latitude, newLongitude); + // } + + void _returnLocationAndRadius() { + final resultTuple = Tuple2(_location, _radius); + + Navigator.of(context).pop(resultTuple); + } + + void _returnLocation() { + Navigator.of(context).pop(_location); + } + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + + return GestureDetector( + onTap: () { + FocusManager.instance.primaryFocus?.unfocus(); + _updateLocationFromFields(); + }, + child: Scaffold( + appBar: AppBar( + title: Text(_appLocalizations.changeLocationOnMap), + actions: [ + IconButton( + onPressed: + _locationPickerMode == LocationPickerMode.locationAndRadius + ? _returnLocationAndRadius + : _returnLocation, + icon: const Icon(Icons.done)) + ], + ), + body: SafeArea( + // top: false, + // left: false, + // right: false, + child: Form( + key: _globalKey, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + _buildMap(), + _buildLatitudeLongitudeRadiusFields(), + if (_locationPickerMode == LocationPickerMode.locationAndRadius) + _buildRadiusStepper(), + _buildCurrentLocationRow() + ], + ), + ), + ), + ), + ); + } +} + +Future getCurrentLocation() async { + final _locationService = Location(); + var serviceEnabled = await _locationService.serviceEnabled(); + + if (!serviceEnabled) { + serviceEnabled = await _locationService.requestService(); + + if (!serviceEnabled) return null; + } + + var hasPermission = await _locationService.hasPermission(); + + if (hasPermission == PermissionStatus.denied) { + // hasPermission = await _locationService.requestPermission(); + // + // if (hasPermission != PermissionStatus.granted) return null; + return null; + } + + final currentLocation = await _locationService.getLocation(); + + return LatLng(currentLocation.latitude!, currentLocation.longitude!); +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..c48680e --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,872 @@ +/* + * main.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:ant_nup_tracker/exceptions.dart'; +import 'package:ant_nup_tracker/filtering.dart'; +import 'package:ant_nup_tracker/flight_detail_screen.dart'; +import 'package:ant_nup_tracker/flight_form.dart'; +import 'package:ant_nup_tracker/flight_list.dart'; +import 'package:ant_nup_tracker/flights.dart'; +import 'package:ant_nup_tracker/sessions.dart'; +import 'package:ant_nup_tracker/users.dart'; +import 'package:ant_nup_tracker/welcome_screen.dart'; +import 'package:firebase_core/firebase_core.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:timezone/data/latest.dart'; +import 'package:intl/intl.dart' as intl; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + +import 'location_picker.dart'; +import 'dark_mode_theme_ext.dart'; + +void main() => runApp(const AntNupTrackerApp()); + +class AntNupTrackerApp extends StatefulWidget { + const AntNupTrackerApp({Key? key}) : super(key: key); + + @override + _AntNupTrackerAppState createState() => _AntNupTrackerAppState(); +} + +class _AntNupTrackerAppState extends State { + final Future _firebaseInitialization = Firebase.initializeApp(); + + // Future _onReceivedBackgroundNotification(RemoteMessage message) async { + // final id = message.data["flight_id"] as int?; + // + // if (id != null) { + // + // } + // } + + @override + Widget build(BuildContext context) { + return MaterialApp( + theme: ThemeData( + colorScheme: ColorScheme.fromSwatch(backgroundColor: const Color(0xffbfedff)), + fontFamily: 'Open_Sans', + textTheme: const TextTheme( + subtitle2: + TextStyle(fontFamily: 'Open_Sans', fontWeight: FontWeight.w500), + subtitle1: + TextStyle(fontFamily: 'Open_Sans', fontWeight: FontWeight.w500), + headline1: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + headline2: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + headline3: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + headline4: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + headline5: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + headline6: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + overline: TextStyle(fontFamily: 'Open_Sans'), + bodyText1: TextStyle(fontFamily: 'Open_Sans'), + bodyText2: TextStyle(fontFamily: 'Open_Sans'), + caption: TextStyle(fontFamily: 'Open_Sans', fontWeight: FontWeight.w500), + button: TextStyle(fontFamily: 'Open_Sans', fontWeight: FontWeight.w500), + ), + ), + darkTheme: ThemeData.dark().copyWith( + textTheme: const TextTheme( + subtitle2: + TextStyle(fontFamily: 'Open_Sans', fontWeight: FontWeight.w500), + subtitle1: + TextStyle(fontFamily: 'Open_Sans', fontWeight: FontWeight.w500), + headline1: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + headline2: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + headline3: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + headline4: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + headline5: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + headline6: + TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w700), + overline: TextStyle(fontFamily: 'Open_Sans'), + bodyText1: TextStyle(fontFamily: 'Open_Sans'), + bodyText2: TextStyle(fontFamily: 'Open_Sans'), + caption: TextStyle(fontFamily: 'Open_Sans', fontWeight: FontWeight.w500), + button: TextStyle(fontFamily: 'Open_Sans', fontWeight: FontWeight.w500), + ), + ), + title: "AntNupTracker", + home: FutureBuilder( + future: _firebaseInitialization, + builder: (context, snapshot) { + if (snapshot.hasError) { + // print("Finished with error!!!!"); + // print(snapshot.error!); + // print(snapshot.stackTrace!); + return Center( + child: Image( + image: Theme.of(context).isDarkMode + ? const AssetImage( + "assets/cartoon_ant/dark/cartoon_ant.png") + : const AssetImage("assets/cartoon_ant/cartoon_ant.png"), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done) { + final messaging = FirebaseMessaging.instance; + messaging + .requestPermission( + alert: true, badge: true, provisional: false, sound: true) + .then((value) { + // print("User granted permission: ${value.authorizationStatus}"); + FirebaseMessaging.instance.getToken().then((token) { + SessionManager.shared.firebaseToken = token; + // print("Device token is $token"); + // print("It is ${token?.length ?? 0} characters long!"); + }); + }); + return const NewFlightListScreen(); + } + + return const Center( + child: CircularProgressIndicator(), + ); + }, + ), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + // locale: const Locale("fr"), + debugShowCheckedModeBanner: false, + // darkTheme: ThemeData.dark() + // .copyWith( + // accentColor: Colors.blue[700], + // primaryColor: Colors.blue[800], + // primaryColorDark: Colors.blue[900], + // backgroundColor: Colors.indigo[800], + // scaffoldBackgroundColor: Colors.indigo[900], + // dialogBackgroundColor: Colors.blue[900], + // buttonColor: Colors.deepPurple[800], + // highlightColor: Colors.deepPurple[800], + // cardColor: Colors.blue[700], + // ), + ); + // ; + } +} + +// class AntNupTrackerApp extends StatelessWidget { +// const AntNupTrackerApp({Key? key}) : super(key: key); +// +// @override +// Widget build(BuildContext context) { +// return MaterialApp( +// title: "AntNupTracker", +// home: const NewFlightListScreen(), +// localizationsDelegates: AppLocalizations.localizationsDelegates, +// supportedLocales: AppLocalizations.supportedLocales, +// // locale: const Locale("fr"), +// debugShowCheckedModeBanner: false, +// darkTheme: ThemeData.dark() +// // .copyWith( +// // accentColor: Colors.blue[700], +// // primaryColor: Colors.blue[800], +// // primaryColorDark: Colors.blue[900], +// // backgroundColor: Colors.indigo[800], +// // scaffoldBackgroundColor: Colors.indigo[900], +// // dialogBackgroundColor: Colors.blue[900], +// // buttonColor: Colors.deepPurple[800], +// // highlightColor: Colors.deepPurple[800], +// // cardColor: Colors.blue[700], +// // ), +// ); +// } +// } + +class NewFlightListScreen extends StatefulWidget { + const NewFlightListScreen({Key? key}) : super(key: key); + + @override + _NewFlightListScreenState createState() => _NewFlightListScreenState(); +} + +class _NewFlightListScreenState extends State { + late AppLocalizations _appLocalizations; + + final _animatedStateKey = GlobalKey(); + // var _animatedStateKey = GlobalKey(); + + // final _flightStore = FlightStore(); + final _flights = []; + + late Future _fetchFlightsFuture; + late InitialLoadingProgress _loadingProgress; + + Future _generateFlightReadFuture([bool loadTaxonomy = true]) async { + if (loadTaxonomy) { + // await TaxonomyManager.shared.loadSpecies(); + _loadingProgress.loadingStage = LoadingStage.taxonomy; + await loadTaxonomyFromServer(); + } + + _loadingProgress.loadingStage = LoadingStage.flights; + var flightsRead = await FlightStore.shared.load(); + + _loadingProgress.loadingStage = LoadingStage.done; + + return flightsRead; + + // if (loadTaxonomy){ + // return await TaxonomyManager.shared.loadTaxonomy().then((_) => FlightStore.shared.load()); + // } else { + // return await FlightStore.shared.load(); + // } + } + + void _triggerFlightListFetch([bool loadTaxonomy = true]) { + setState(() { + // _fetchFlightsFuture = _flightStore.load(); + _fetchFlightsFuture = _generateFlightReadFuture(loadTaxonomy); + }); + } + + // Future _checkForNewFlights() async { + // final changedFlights = + // await FlightStore.shared.updateFlights(loadedFlights: _flights.length); + // + // final newFlights = + // LinkedHashMap>.from(changedFlights); + // + // newFlights.removeWhere( + // (index, flightTuple) => flightTuple.item2 == FlightChange.update); + // + // for (var index in newFlights.keys) { + // print("Inserting new row!"); + // final newFlight = newFlights[index]!.item1; + // + // print("Inserted at index $index"); + // + // _flights.insert(index, newFlight); + // + // // _flightRows.insert( + // // index, + // // FlightRow( + // // newFlight, + // // key: UniqueKey(), + // // )); + // _animatedStateKey.currentState! + // .insertItem(index, duration: const Duration(milliseconds: 500)); + // } + // + // final updatedFlights = + // LinkedHashMap>.from(changedFlights); + // updatedFlights.removeWhere( + // (index, flightTuple) => flightTuple.item2 == FlightChange.inserted); + // + // for (var index in updatedFlights.keys) { + // final changedFlight = updatedFlights[index]!.item1; + // + // // setState(() => _flightRows[index] = FlightRow( + // // changedFlight, + // // key: UniqueKey(), + // // )); + // // } + // setState(() { + // _flights[index] = changedFlight; + // }); + // } + // } + + Future _checkForNewFlights() async { + // final changedFlights = + // await FlightStore.shared.updateFlights(loadedFlights: _flights.length); + + final newFlights = await FlightStore.shared.updateFlights(); + + for (var index in newFlights) { + _animatedStateKey.currentState! + .insertItem(index, duration: const Duration(milliseconds: 500)); + } + + setState(() {}); + } + + void _readMoreFlights([int n = 15]) { + if (!FlightStore.shared.canRead) return; + + _isLoading = true; + final flightsCount = FlightStore.shared.loadedFlightCount; + + // print( + // "Loading more flights... There are currently $flightsCount loaded flights."); + FlightStore.shared.getNextFlights(count: n).then((numLoaded) { + // print("Got $numLoaded more flights!"); + + for (var i = 0; i < numLoaded; i++) { + _animatedStateKey.currentState!.insertItem(flightsCount + i); + // print("Inserting item at ${flightsCount + i}"); + } + // print("Done loading"); + + // var totalRowCount = flightsCount + numLoaded; + + _isLoading = false; + + // print( + // "Done adding all the rows! There are now ${FlightStore.shared.loadedFlightCount} loaded flights."); + }); + } + + var _hasReloaded = false; + + Widget _buildFilteringButton() { + return IconButton( + icon: const Icon(Icons.filter_alt), + tooltip: _appLocalizations.filteringAndSorting, + onPressed: () async { + // final currentLocation = await getCurrentLocation(); + final didChangeFiltering = await Navigator.of(context).push( + MaterialPageRoute( + // builder: (context) => FilteringScreen(currentLocation: currentLocation), + builder: (context) => const FilteringScreen(), + fullscreenDialog: true), + ); + + if (didChangeFiltering ?? false) { + _flights.clear(); + // print("Flight list cleared"); + // while (_flights.isNotEmpty) { + // final flight = _flights.removeAt(0); + // + // _animatedStateKey.currentState! + // .removeItem(0, (context, animation) => FlightRow(flight)); + // } + _hasReloaded = true; + _isLoading = true; + // setState(() { + // _animatedStateKey = GlobalKey(); + // }); + _triggerFlightListFetch(false); + } + }, + ); + } + + Future loadTaxonomyData() async { + _loadingProgress.loadingStage = LoadingStage.taxonomy; + + await loadTaxonomy(); + } + + Future loadCredentialsAndFiltering() async { + // await loadTaxonomyFromServer(); + + _loadingProgress.loadingStage = LoadingStage.credentials; + try { + final didLoadCredentials = + await SessionManager.shared.loadAndVerifyCredentials(); + if (didLoadCredentials) { + setState(() {}); + } else { + await showLoginScreen(context); + } + } on LocalisableException catch (error, stacktrace) { + // final localisableException = error as LocalisableException; + final title = error.getLocalisedName(context); + final body = error.getLocalisedDescription(context); + + showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text(title), + content: Text(body), + ), + ); + } + + // _loadingProgress.loadingStage = LoadingStage.taxonomy; + // + // await loadTaxonomy(); + + _loadingProgress.loadingStage = LoadingStage.filtering; + await FilteringManager.shared.loadFilters(); + } + + @override + void initState() { + super.initState(); + initializeTimeZones(); + _loadingProgress = InitialLoadingProgress(); + _fetchFlightsFuture = + resetWelcomeScreen(shouldReset: false) + .then((_) => LicenseRegistry.addLicense(() async* { + final ofl = await rootBundle.loadString("fonts/Dosis/OFL.txt"); + yield LicenseEntryWithLineBreaks(['Dosis'], ofl); + + final apache = await rootBundle.loadString("fonts/Open_Sans/LICENSE.txt"); + yield LicenseEntryWithLineBreaks(['Open Sans'], apache); + })) + .then((_) async { + // print("At stage: Loading taxonomy"); + await loadTaxonomyData(); + }) + .then((_) async { + // print("At stage: Showing Welcome Screen"); + await showWelcomeScreen(context); + }) + .then((_) async { + // print("At stage: Loading credentials and filtering"); + await loadCredentialsAndFiltering(); + }) + // loadTaxonomyAndCredentialsAndFiltering() + .then((_) async { + // print("At stage: reading flight list"); + return await _generateFlightReadFuture(false); + }); + // SessionManager.shared.loadAndVerifyCredentials().then((value) { + // print("Credentials loaded $value"); + // if (value) setState(() {}); + // }).catchError((error) { + // final localisableException = error as LocalisableException; + // final title = localisableException.getLocalisedName(context); + // final body = localisableException.getLocalisedDescription(context); + // + // showDialog( + // context: context, + // builder: (context) => AlertDialog( + // title: Text(title), + // content: Text(body), + // ), + // ); + // }, test: (error) => error is LocalisableException); + // _fetchFlightsFuture = _flightStore.getTopFlights(); + } + + Future showLoginScreen(BuildContext context) async { + if (!kIsWeb && + MediaQuery.of(context).orientation == + Orientation.landscape && + MediaQuery.of(context).size.height < 500) { + final didLogIn = + await Navigator.of(context).push(MaterialPageRoute( + builder: (context) => Scaffold( + appBar: AppBar(), + body: Container( + alignment: Alignment.center, + padding: const EdgeInsets.all(8.0), + child: const LoginForm()), + ), + fullscreenDialog: true)); + if (didLogIn ?? false) { + setState(() {}); + } + } else { + final didLogIn = await showDialog( + context: context, + builder: (BuildContext context) => const Dialog( + // title: Text( + // AppLocalizations.of(context)!.loginAppBarHeader), + child: Padding( + padding: EdgeInsets.all(8.0), + child: LoginForm(), + ), + ), + barrierDismissible: false + ); + + if (didLogIn ?? false) { + setState(() {}); + } + } + } + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + // print("There are ${_flights.length} flights."); + + final labelStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontSizeDelta: 4.0); + + return Scaffold( + appBar: AppBar( + title: const Text( + "AntNupTracker", + // style: TextStyle(fontFamily: 'Dosis', fontWeight: FontWeight.w800), + ), + // bottom: _isLoading ? const AppBarProgressIndicator(appBarHeight: 8) : null, + // primary: true, + leading: IconButton( + icon: const Icon(Icons.info), + tooltip: AppLocalizations.of(context)!.infoButton, + // onPressed: ()=>showDialog(context: context, builder: (context) => const Dialog(child: WelcomeScreen()),), + onPressed: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const WelcomeScreen(), + fullscreenDialog: true), + ), + ), + actions: [ + _buildFilteringButton(), + if (!SessionManager.shared.isLoggedIn) + IconButton( + // onPressed: () => Navigator.of(context).push( + // MaterialPageRoute( + // builder: (context) => LoginScreen(), + // fullscreenDialog: true, + // ), + // ), + // onPressed: () => showLoginScreen(context), + onPressed: null, + icon: const Icon(Icons.login), + tooltip: AppLocalizations.of(context)!.loginButtonHeader, + // child: Text( + // AppLocalizations.of(context)!.loginButtonHeader, + // style: + // TextStyle(color: Theme.of(context).colorScheme.onPrimary), + // ), + ), + if (SessionManager.shared.isLoggedIn) + IconButton( + icon: const Icon(Icons.account_circle), + onPressed: () async { + var didLogOut = await Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const UserProfileScreen(), + fullscreenDialog: true, + ), + ); + + // print("Did log out is $didLogOut"); + + if (didLogOut ?? false) { + _flights.clear(); + setState(() {}); + showLoginScreen(context); + } + // SessionManager.shared.logout(); + }, + tooltip: SessionManager.shared.session!.username, + ) + ], + ), + body: SafeArea( + child: Center( + child: FutureBuilder( + future: _fetchFlightsFuture, + builder: (BuildContext context, AsyncSnapshot snapshot) { + _isLoading = true; + + if (snapshot.connectionState != ConnectionState.done) { + final progress = _loadingProgress.getProgress(); + // print("Progress is currently: $progress"); + final caption = _loadingProgress.getProgressCaption(context); + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + CircularProgressIndicator(value: progress), + const SizedBox( + height: 24, + ), + Text( + caption, + style: labelStyle, + ) + ], + ), + ); + } + + if (snapshot.hasData) { + // final newFlights = snapshot.data!; + // print("Loaded ${newFlights.length} flights!!!"); + // print("Loaded IDs: ${newFlights.map((e) => e.flightID)}"); + // print( + // "Current flights: ${_flights.take(15).map((e) => e.flightID)}"); + // _updateFlights(_currentFrame.results); + // _flights + // ..clear() + // ..addAll(_currentFrame.results); + _isLoading = false; + + if (_hasReloaded) { + // _flights.clear(); + _hasReloaded = false; + // _flights.clear(); + } + + // if (_flights.isEmpty) { + // _flights.addAll(newFlights); + // } + + // print( + // "There are ${FlightStore.shared.loadedFlightCount} loaded flights"); + + if (snapshot.data! == 0) { + return ExceptionWidget( + NoFlightResultsException(), + null, + icon: Icons.info, + ); + } + + return _buildFlightListTable(); + } else if (snapshot.hasError) { + // print("Error!!!!"); + // print(snapshot.error); + // print(snapshot.stackTrace); + if (snapshot.error! is! LocalisableException) { + // print(snapshot.error!); + // print(snapshot.stackTrace!); + return Image( + image: Theme.of(context).isDarkMode + ? const AssetImage( + "assets/cartoon_ant/dark/cartoon_ant.png") + : const AssetImage( + "assets/cartoon_ant/cartoon_ant.png"), + ); + } + final error = snapshot.error as LocalisableException; + return ExceptionWidget(error, () => _triggerFlightListFetch()); + } else { + return const CircularProgressIndicator(); + } + }, + ), + ), + ), + floatingActionButton: _buildAddFlightButton(), + ); + } + + Widget? _buildAddFlightButton() { + if (SessionManager.shared.isLoggedIn) { + return FloatingActionButton( + child: const Icon(Icons.add), + onPressed: () async { + showDialog( + context: context, + builder: (_) => AlertDialog( + title: Text(AppLocalizations.of(context)!.gettingLocation), + content: const LinearProgressIndicator(), + ), + barrierDismissible: false); + final currentLocation = await getCurrentLocation(); + Navigator.of(context).pop(); + var shouldReload = await Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => + FlightFormScreen(currentLocation: currentLocation), + // const FlightFormScreen(), + fullscreenDialog: true)); + + // print("There are currently ${_flights.length} rows"); + // print(_flights.map((e) => e.flightID)); + if (shouldReload ?? false) await _checkForNewFlights(); + // print("There are currently ${_flights.length} rows"); + // print(_flights.map((e) => e.flightID)); + }, + tooltip: AppLocalizations.of(context)!.addNewFlightButton, + ); + // return FloatingActionButton( + // child: Icon(Icons.add), + // onPressed: () => showDialog( + // context: context, + // builder: (context) => Dialog(child: FlightFormScreen())), + // tooltip: AppLocalizations.of(context)!.addNewFlightButton, + // ); + } + + return null; + } + + bool _isLoading = false; + + Widget _buildFlightListTable() { + // _flightRows.addAll(flights.map((e) => FlightRow( + // e, + // key: UniqueKey(), + // ))); + + // _flights.addAll(flights); + + // print( + // "First 15 flights have indices: ${_flights.take(15).map((e) => e.flightID)}"); + + // print( + // "There are now ${FlightStore.shared.loadedFlightCount} loaded flights"); + + _isLoading = false; + + return RefreshIndicator( + onRefresh: _checkForNewFlights, + child: Scrollbar( + child: AnimatedList( + primary: true, + key: _animatedStateKey, + physics: const AlwaysScrollableScrollPhysics(), + // initialItemCount: _flights.length, + initialItemCount: FlightStore.shared.loadedFlightCount, + padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 16.0), + itemBuilder: (context, index, animation) { + // print("Building at index $index"); + // print("The initial item count is ${FlightStore.shared.loadedFlightCount}"); + // print("There are ${_flightRows.length} rows loaded"); + if (!_isLoading && + index >= FlightStore.shared.loadedFlightCount - 3) { + _readMoreFlights(); + } + + // if (_isLoading && index == FlightStore.shared.loadedFlightCount) { + // const SizedBox(height: 48, child: CircularProgressIndicator(),); + // } + + // return _flightRows[index]; + + final flight = FlightStore.shared.getFlightAtIndex(index); + + return SizeTransition( + sizeFactor: animation.drive(CurveTween(curve: Curves.easeIn)), + // child: FlightRow(_flights[index])); + child: FlightRow( + flight, + key: ValueKey(flight.flightID), + )); + + // return SlideTransition( + // position: animation.drive( + // Tween( + // begin: const Offset(-1, 0), + // end: Offset.zero, + // ), + // ), + // child: FlightRow(_flights[index])); + }, + ), + ), + ); + } +} + +class FlightRow extends StatelessWidget { + const FlightRow(this.flight, {Key? key}) : super(key: key); + + final Flight flight; + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + final currentLocale = appLocalizations.localeName; + return InkWell( + onTap: () => Navigator.of(context) + .push(MaterialPageRoute(builder: (BuildContext context) { + return FlightDetailScreen(flight.flightID, initialValue: null); + })), + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0, vertical: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + // child: (flight.validationLevel == Role.professional) ? Icon(Icons.check_circle, size: 32.0) : Icon(null, size: 32.0) + child: _getFlightIcon()), + Expanded( + child: Column( + children: [ + Text("${flight.taxonomy} (#${flight.flightID})", + style: Theme.of(context).textTheme.headline6), + Text( + stringFromCoordinates( + latitude: flight.latitude, longitude: flight.longitude), + // style: const TextStyle(fontFamily: 'Open_Sans'), + ), + Text( + intl.DateFormat.yMMMd(currentLocale) + .add_jm() + .format(flight.dateOfFlight), + // style: const TextStyle(fontFamily: 'Open_Sans'), + ), + Row( + children: [ + // TextButton( + // child: Text(flight.owner), + // onPressed: null, + // ), + Text( + flight.owner, + // style: const TextStyle(fontFamily: 'Open_Sans'), + ), + if (flight.ownerRole == Role.flagged) + // const Icon(Icons.warning, color: Colors.red), + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: const Image( + image: AssetImage("assets/ant_circles/red_ant.png"), + width: 16.0, + ), + ), + if (flight.ownerRole == Role.professional) + // const Icon(Icons.verified, color: Colors.green) + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: const Image( + image: + AssetImage("assets/ant_circles/green_ant.png"), + width: 16.0, + ), + ) + ], + ), + ], + crossAxisAlignment: CrossAxisAlignment.start, + ), + ), + ], + ), + ), + ); + } + + Icon _getFlightIcon() { + IconData? icon; + Color? colour; + switch (flight.validationLevel) { + case Role.citizen: + icon = null; + colour = null; + break; + case Role.professional: + icon = Icons.verified; + colour = Colors.green; + break; + case Role.flagged: + icon = Icons.warning; + colour = Colors.red; + break; + } + + return Icon(icon, size: 32.0, color: colour); + } +} diff --git a/lib/oss_licenses.dart b/lib/oss_licenses.dart new file mode 100644 index 0000000..329e611 --- /dev/null +++ b/lib/oss_licenses.dart @@ -0,0 +1,6557 @@ +/* + * oss_licenses.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// cSpell:disable + +/// This code was generated by flutter_oss_licenses +/// https://pub.dev/packages/flutter_oss_licenses +const ossLicenses = [ + Package( + name: '_fe_analyzer_shared', + description: 'Logic that is shared between the front_end and analyzer packages.', + homepage: 'https://github.com/dart-lang/sdk/tree/master/pkg/_fe_analyzer_shared', + authors: [], + version: '22.0.0', + license: '''Copyright 2019, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'analyzer', + description: 'This package provides a library that performs static analysis of Dart code.', + homepage: 'https://github.com/dart-lang/sdk/tree/master/pkg/analyzer', + authors: [], + version: '1.7.2', + license: '''Copyright 2013, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'args', + description: 'Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options.', + homepage: 'https://github.com/dart-lang/args', + authors: [], + version: '2.3.0', + license: '''Copyright 2013, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'async', + description: 'Utility functions and classes related to the \'dart:async\' library.', + repository: 'https://github.com/dart-lang/async', + authors: [], + version: '2.8.2', + license: '''Copyright 2015, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'boolean_selector', + description: 'A flexible syntax for boolean expressions, based on a simplified version of Dart\'s expression syntax.', + homepage: 'https://github.com/dart-lang/boolean_selector', + authors: [], + version: '2.1.0', + license: '''Copyright 2016, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'build', + description: 'A package for authoring build_runner compatible code generators.', + repository: 'https://github.com/dart-lang/build/tree/master/build', + authors: [], + version: '2.2.1', + license: '''Copyright 2016, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'build_config', + description: 'Support for parsing `build.yaml` configuration.', + repository: 'https://github.com/dart-lang/build/tree/master/build_config', + authors: [], + version: '1.0.0', + license: '''Copyright 2017, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'build_daemon', + description: 'A daemon for running Dart builds.', + repository: 'https://github.com/dart-lang/build/tree/master/build_daemon', + authors: [], + version: '3.0.1', + license: '''Copyright 2019, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'build_resolvers', + description: 'Resolve Dart code in a Builder', + repository: 'https://github.com/dart-lang/build/tree/master/build_resolvers', + authors: [], + version: '2.0.4', + license: '''Copyright 2018, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'build_runner', + description: 'A build system for Dart code generation and modular compilation.', + repository: 'https://github.com/dart-lang/build/tree/master/build_runner', + authors: [], + version: '2.1.7', + license: '''Copyright 2016, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'build_runner_core', + description: 'Core tools to write binaries that run builders.', + repository: 'https://github.com/dart-lang/build/tree/master/build_runner_core', + authors: [], + version: '7.2.2', + license: '''Copyright 2018, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'built_collection', + description: '''Immutable collections based on the SDK collections. Each SDK collection class is split into a new immutable collection class and a corresponding mutable builder class. +''', + homepage: 'https://github.com/google/built_collection.dart', + authors: [], + version: '5.1.1', + license: '''Copyright 2015, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'built_value', + description: '''Value types with builders, Dart classes as enums, and serialization. This library is the runtime dependency. +''', + homepage: 'https://github.com/google/built_value.dart', + authors: [], + version: '8.1.4', + license: '''Copyright 2015, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'cached_network_image', + description: 'Flutter library to load and cache network images. Can also be used with placeholder and error widgets.', + homepage: 'https://github.com/Baseflow/flutter_cached_network_image', + authors: [], + version: '3.2.0', + license: '''The MIT License (MIT) + +Copyright (c) 2018 Rene Floor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'cached_network_image_platform_interface', + description: 'Platform interface for CachedNetworkImage', + homepage: 'https://github.com/Baseflow/flutter_cached_network_image', + authors: [], + version: '1.0.0', + license: '''The MIT License (MIT) + +Copyright (c) 2018 Rene Floor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'cached_network_image_web', + description: 'Web implementation of CachedNetworkImage', + homepage: 'https://github.com/Baseflow/flutter_cached_network_image', + authors: [], + version: '1.0.1', + license: '''The MIT License (MIT) + +Copyright (c) 2018 Rene Floor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'characters', + description: 'String replacement with operations that are Unicode/grapheme cluster aware.', + repository: 'https://www.github.com/dart-lang/characters', + authors: [], + version: '1.2.0', + license: '''Copyright 2019, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'charcode', + description: 'Constants for ASCII and common non-ASCII character codes. Integer constants corresponding to the code points of individual characters.', + repository: 'https://github.com/lrhn/charcode', + authors: [], + version: '1.3.1', + license: '''Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'checked_yaml', + description: 'Generate more helpful exceptions when decoding YAML documents using package:json_serializable and package:yaml.', + repository: 'https://github.com/google/json_serializable.dart/tree/master/checked_yaml', + authors: [], + version: '2.0.1', + license: '''Copyright 2019, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'cli_util', + description: 'A library to help in building Dart command-line apps.', + repository: 'https://github.com/dart-lang/cli_util', + authors: [], + version: '0.3.5', + license: '''Copyright 2015, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'clock', + description: 'A fakeable wrapper for dart:core clock APIs', + homepage: 'https://github.com/dart-lang/clock', + authors: [], + version: '1.1.0', + license: '''Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'code_builder', + description: 'A fluent, builder-based library for generating valid Dart code', + homepage: 'https://github.com/dart-lang/code_builder', + authors: [], + version: '4.1.0', + license: '''Copyright 2016, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'collection', + description: 'Collections and utilities functions and classes related to collections.', + homepage: 'https://github.com/dart-lang/collection', + authors: [], + version: '1.15.0', + license: '''Copyright 2015, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'convert', + description: 'Utilities for converting between data representations. Provides a number of Sink, Codec, Decoder, and Encoder types.', + repository: 'https://github.com/dart-lang/convert', + authors: [], + version: '3.0.1', + license: '''Copyright 2015, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'cross_file', + description: 'An abstraction to allow working with files across multiple platforms.', + repository: 'https://github.com/flutter/packages/tree/master/packages/cross_file', + authors: [], + version: '0.3.2', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'crypto', + description: 'Implementations of SHA, MD5, and HMAC cryptographic functions', + repository: 'https://www.github.com/dart-lang/crypto', + authors: [], + version: '3.0.1', + license: '''Copyright 2015, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'csslib', + description: 'A library for parsing and analyzing CSS (Cascading Style Sheets)', + repository: 'https://github.com/dart-lang/csslib', + authors: [], + version: '0.17.1', + license: '''Copyright 2013, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'cupertino_icons', + description: 'Default icons asset for Cupertino widgets based on Apple styled icons', + repository: 'https://github.com/flutter/packages/tree/master/third_party/packages/cupertino_icons', + authors: [], + version: '1.0.4', + license: '''The MIT License (MIT) + +Copyright (c) 2016 Vladimir Kharlampidi + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'dart_pubspec_licenses', + description: 'A library to make it easy to extract OSS license information from Dart packages using pubspec.yaml', + homepage: 'https://github.com/espresso3389/flutter_oss_licenses/tree/master/packages/dart_pubspec_licenses', + repository: 'https://github.com/espresso3389/flutter_oss_licenses', + authors: [], + version: '2.0.1', + license: '''MIT License + +Copyright (c) 2019 Takashi Kawasaki + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'dart_style', + description: 'Opinionated, automatic Dart source code formatter. Provides an API and a CLI tool.', + repository: 'https://github.com/dart-lang/dart_style', + authors: [], + version: '2.1.1', + license: '''Copyright 2014, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'fake_async', + description: 'Fake asynchronous events such as timers and microtasks for deterministic testing.', + homepage: 'https://github.com/dart-lang/fake_async', + authors: [], + version: '1.2.0', + license: '''Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'ffi', + description: 'Utilities for working with Foreign Function Interface (FFI) code.', + homepage: 'https://github.com/dart-lang/ffi', + authors: [], + version: '1.1.2', + license: '''Copyright 2019, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'file', + description: 'A pluggable, mockable file system abstraction for Dart. Supports local file system access, as well as in-memory file systems, record-replay file systems, and chroot file systems.', + homepage: 'https://github.com/google/file.dart', + authors: [], + version: '6.1.2', + license: '''Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'firebase_core', + description: 'Flutter plugin for Firebase Core, enabling connecting to multiple Firebase apps.', + homepage: 'https://firebase.flutter.dev/docs/core/usage', + repository: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_core/firebase_core', + authors: [], + version: '1.13.1', + license: '''// Copyright 2017 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'firebase_core_platform_interface', + description: 'A common platform interface for the firebase_core plugin.', + homepage: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_core/firebase_core_platform_interface', + repository: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_core/firebase_core_platform_interface', + authors: [], + version: '4.2.5', + license: '''// Copyright 2017 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'firebase_core_web', + description: 'The web implementation of firebase_core', + homepage: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_core/firebase_core_web', + repository: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_core/firebase_core_web', + authors: [], + version: '1.6.1', + license: '''// Copyright 2020 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'firebase_messaging', + description: 'Flutter plugin for Firebase Cloud Messaging, a cross-platform messaging solution that lets you reliably deliver messages on Android and iOS.', + homepage: 'https://firebase.flutter.dev/docs/messaging/overview', + repository: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging/firebase_messaging', + authors: [], + version: '11.2.10', + license: '''// Copyright 2017 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'firebase_messaging_platform_interface', + description: 'A common platform interface for the firebase_messaging plugin.', + homepage: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging/firebase_messaging_platform_interface', + repository: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging/firebase_messaging_platform_interface', + authors: [], + version: '3.2.1', + license: '''Copyright 2020, the Chromium project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'firebase_messaging_web', + description: 'The web implementation of firebase_messaging', + homepage: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging/firebase_messaging_web', + repository: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging/firebase_messaging_web', + authors: [], + version: '2.2.9', + license: '''// Copyright 2020 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'fixnum', + description: 'Library for 32- and 64-bit signed fixed-width integers with consistent behavior between native and JS runtimes.', + homepage: 'https://github.com/dart-lang/fixnum', + authors: [], + version: '1.0.0', + license: '''Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'flutter', + description: 'A framework for writing Flutter applications', + homepage: 'http://flutter.dev', + authors: [], + version: '2.10.5', + license: '''Copyright 2014 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: true, + isDirectDependency: true, + ), + Package( + name: 'flutter_blurhash', + description: 'Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium', + homepage: 'https://github.com/fluttercommunity/flutter_blurhash', + authors: [], + version: '0.6.4', + license: '''MIT License + +Copyright (c) 2019 Robert Felker + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'flutter_cache_manager', + description: 'Generic cache manager for flutter. Saves web files on the storages of the device and saves the cache info using sqflite.', + homepage: 'https://github.com/Baseflow/flutter_cache_manager/tree/master/flutter_cache_manager', + authors: [], + version: '3.3.0', + license: '''The MIT License (MIT) + +Copyright (c) 2017 Rene Floor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'flutter_image_compress', + description: 'Compress image with native (Objective-C/Kotlin) with faster speed. Support Android/iOS.', + homepage: 'https://github.com/OpenFlutter/flutter_image_compress', + authors: [], + version: '1.1.0', + license: '''MIT License + +Copyright (c) 2018 caijinglong + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'flutter_lints', + description: 'Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.', + repository: 'https://github.com/flutter/packages/tree/master/packages/flutter_lints', + authors: [], + version: '1.0.4', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'flutter_oss_licenses', + description: 'A tool to generate detail and better OSS license list using pubspec.yaml/lock files.', + homepage: 'https://github.com/espresso3389/flutter_oss_licenses/tree/master/packages/flutter_oss_licenses', + repository: 'https://github.com/espresso3389/flutter_oss_licenses', + authors: [], + version: '2.0.0+1', + license: '''MIT License + +Copyright (c) 2019 Takashi Kawasaki + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'flutter_plugin_android_lifecycle', + description: 'Flutter plugin for accessing an Android Lifecycle within other plugins.', + repository: 'https://github.com/flutter/plugins/tree/master/packages/flutter_plugin_android_lifecycle', + authors: [], + version: '2.0.5', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'flutter_secure_storage', + description: 'Flutter Secure Storage provides API to store data in secure storage. Keychain is used in iOS, KeyStore based solution is used in Android.', + homepage: 'https://github.com/mogol/flutter_secure_storage', + authors: [], + version: '4.2.1', + license: '''BSD 3-Clause License + +Copyright 2017 German Saprykin +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'frontend_server_client', + description: 'Client code to start and interact with the frontend_server compiler from the Dart SDK.', + homepage: 'https://github.com/dart-lang/webdev/tree/master/frontend_server_client', + repository: 'https://github.com/dart-lang/webdev', + authors: [], + version: '2.1.2', + license: '''Copyright 2020, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'gallery_saver', + description: 'Saves images and videos from network or temporary file to external storage. Both images and videos will be visible in Android Gallery and iOS Photos.', + homepage: 'https://github.com/CarnegieTechnologies/gallery_saver', + authors: [], + version: '2.3.2', + license: '''Copyright (c) 2019 Carnegie Technologies d.o.o + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'glob', + description: 'Bash-style filename globbing.', + repository: 'https://github.com/dart-lang/glob', + authors: [], + version: '2.0.2', + license: '''Copyright 2014, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'google_maps', + description: '''With that package you will be able to use Google Maps JavaScript API from Dart scripts. +''', + homepage: 'https://github.com/a14n/dart-google-maps', + authors: [], + version: '5.3.0', + license: '''Copyright (c) 2012, Alexandre Ardhuin + +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 + + http://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.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'google_maps_flutter', + description: 'A Flutter plugin for integrating Google Maps in iOS and Android applications.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/google_maps_flutter/google_maps_flutter', + authors: [], + version: '2.1.2', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'google_maps_flutter_platform_interface', + description: 'A common platform interface for the google_maps_flutter plugin.', + repository: 'https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter_platform_interface', + authors: [], + version: '2.1.5', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'google_maps_flutter_web', + description: 'Web platform implementation of google_maps_flutter', + repository: 'https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter_web', + authors: [], + version: '0.3.2+1', + license: '''google_maps_flutter_web + +Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +to_screen_location + +The MIT License (MIT) + +Copyright (c) 2008 Krasimir Tsonev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'graphs', + description: 'Graph algorithms that operate on graphs in any representation', + repository: 'https://github.com/dart-lang/graphs', + authors: [], + version: '2.1.0', + license: '''Copyright 2017, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'html', + description: 'APIs for parsing and manipulating HTML content outside the browser.', + repository: 'https://github.com/dart-lang/html', + authors: [], + version: '0.15.0', + license: '''Copyright (c) 2006-2012 The Authors + +Contributors: +James Graham - jg307@cam.ac.uk +Anne van Kesteren - annevankesteren@gmail.com +Lachlan Hunt - lachlan.hunt@lachy.id.au +Matt McDonald - kanashii@kanashii.ca +Sam Ruby - rubys@intertwingly.net +Ian Hickson (Google) - ian@hixie.ch +Thomas Broyer - t.broyer@ltgt.net +Jacques Distler - distler@golem.ph.utexas.edu +Henri Sivonen - hsivonen@iki.fi +Adam Barth - abarth@webkit.org +Eric Seidel - eric@webkit.org +The Mozilla Foundation (contributions from Henri Sivonen since 2008) +David Flanagan (Mozilla) - dflanagan@mozilla.com +Google Inc. (contributed the Dart port) - misc@dartlang.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'http', + description: 'A composable, multi-platform, Future-based API for HTTP requests.', + homepage: 'https://github.com/dart-lang/http', + authors: [], + version: '0.13.4', + license: '''Copyright 2014, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'http_multi_server', + description: 'A dart:io HttpServer wrapper that handles requests from multiple servers.', + homepage: 'https://github.com/dart-lang/http_multi_server', + authors: [], + version: '3.2.0', + license: '''Copyright 2014, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'http_parser', + description: 'A platform-independent package for parsing and serializing HTTP formats.', + homepage: 'https://github.com/dart-lang/http_parser', + authors: [], + version: '4.0.0', + license: '''Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'image_picker', + description: 'Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/image_picker/image_picker', + authors: [], + version: '0.8.4+11', + license: '''image_picker + +Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +aFileChooser + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2011 - 2013 Paul Burke + + 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 + + http://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.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'image_picker_for_web', + description: 'Web platform implementation of image_picker', + repository: 'https://github.com/flutter/plugins/tree/main/packages/image_picker/image_picker_for_web', + authors: [], + version: '2.1.6', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'image_picker_platform_interface', + description: 'A common platform interface for the image_picker plugin.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/image_picker/image_picker_platform_interface', + authors: [], + version: '2.4.4', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'intl', + description: 'Contains code to deal with internationalized/localized messages, date and number formatting and parsing, bi-directional text, and other internationalization issues.', + homepage: 'https://github.com/dart-lang/intl', + authors: [], + version: '0.17.0', + license: '''Copyright 2013, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'io', + description: 'Utilities for the Dart VM Runtime including support for ANSI colors, file copying, and standard exit code values.', + repository: 'https://github.com/dart-lang/io', + authors: [], + version: '1.0.3', + license: '''Copyright 2017, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'js', + description: 'Annotations to create static Dart interfaces for JavaScript APIs.', + homepage: 'https://github.com/dart-lang/sdk/tree/master/pkg/js', + authors: [], + version: '0.6.3', + license: '''Copyright 2012, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'js_wrapping', + description: 'That package contains elements to easilly wrap JS library in Dart.', + homepage: 'https://github.com/a14n/dart-js-wrapping', + authors: [], + version: '0.7.4', + license: '''Copyright (c) 2015, Alexandre Ardhuin. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'json_annotation', + description: 'Classes and helper functions that support JSON code generation via the `json_serializable` package.', + repository: 'https://github.com/google/json_serializable.dart', + authors: [], + version: '4.1.0', + license: '''Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'json_serializable', + description: 'Automatically generate code for converting to and from JSON by annotating Dart classes.', + repository: 'https://github.com/google/json_serializable.dart/tree/master/json_serializable', + authors: [], + version: '4.1.4', + license: '''Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'lat_lng_to_timezone', + description: 'Lat/long to timezone mapper in Dart. Does not require web services or data files', + homepage: 'https://github.com/shawnlauzon/latLngToTimezone', + authors: [], + version: '0.2.0', + license: '''MIT License + +Copyright (c) 2020 Shawn Lauzon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'latlong2', + description: 'Lightweight library for common latitude and longitude calculation', + homepage: 'https://github.com/jifalops/dart-latlong', + authors: [], + version: '0.8.1', + license: '''Copyright 2015 Michael Mitterer (office@mikemitterer.at), +IT-Consulting and Development Limited, Austrian Branch + +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 + + http://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.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'lints', + description: 'Official Dart lint rules. Defines the \'core\' and \'recommended\' set of lints suggested by the Dart team.', + homepage: 'https://github.com/dart-lang/lints', + repository: 'https://github.com/dart-lang/lints', + authors: [], + version: '1.0.1', + license: '''Copyright 2021, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'location', + description: 'A Flutter plugin to easily handle realtime location in iOS and Android. Provides settings for optimizing performance or battery.', + homepage: 'https://github.com/Lyokone/flutterlocation', + authors: [], + version: '4.3.0', + license: '''Copyright (c) 2017, Guillaume Bernos. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'location_platform_interface', + description: 'A common platform interface for the location plugin.', + homepage: 'https://github.com/Lyokone/flutterlocation', + authors: [], + version: '2.3.0', + license: '''Copyright (c) 2017, Guillaume Bernos. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'location_web', + description: 'The web implementation of the location plugin.', + homepage: 'https://github.com/Lyokone/flutterlocation', + authors: [], + version: '3.1.1', + license: '''Copyright (c) 2017, Guillaume Bernos. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'logging', + description: 'Provides APIs for debugging and error logging, similar to loggers in other languages, such as the Closure JS Logger and java.util.logging.Logger.', + repository: 'https://github.com/dart-lang/logging', + authors: [], + version: '1.0.2', + license: '''Copyright 2013, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'matcher', + description: 'Support for specifying test expectations via an extensible Matcher class. Also includes a number of built-in Matcher implementations for common cases.', + homepage: 'https://github.com/dart-lang/matcher', + authors: [], + version: '0.12.11', + license: '''Copyright 2014, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'material_color_utilities', + description: 'Algorithms and utilities that power the Material Design 3 (M3) color system, including choosing theme colors from images and creating tones of colors; all in a new color space.', + repository: 'https://github.com/material-foundation/material-color-utilities', + authors: [], + version: '0.1.3', + license: '''Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'meta', + description: 'Annotations that developers can use to express the intentions that otherwise can\'t be deduced by statically analyzing the source code. These annotations are intended to be used by tools to provide a better user experience.', + homepage: 'https://github.com/dart-lang/sdk/tree/master/pkg/meta', + authors: [], + version: '1.7.0', + license: '''Copyright 2016, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'mime', + description: 'Utilities for handling media (MIME) types, including determining a type from a file extension and file contents.', + homepage: 'https://github.com/dart-lang/mime', + authors: [], + version: '1.0.1', + license: '''Copyright 2015, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'octo_image', + description: 'A multifunctional Flutter image widget. Supports placeholders, error widgets and image transformers with fading.', + homepage: 'https://github.com/Baseflow/octo_image', + authors: [], + version: '1.0.1', + license: '''MIT License + +Copyright (c) 2020 Baseflow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'package_config', + description: 'Support for reading and writing Dart Package Configuration files.', + homepage: 'https://github.com/dart-lang/package_config', + authors: [], + version: '2.0.2', + license: '''Copyright 2019, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'path', + description: 'A string-based path manipulation library. All of the path operations you know and love, with solid support for Windows, POSIX (Linux and Mac OS X), and the web.', + homepage: 'https://github.com/dart-lang/path', + authors: [], + version: '1.8.0', + license: '''Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'path_provider', + description: 'Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider', + authors: [], + version: '2.0.9', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'path_provider_android', + description: 'Android implementation of the path_provider plugin.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_android', + authors: [], + version: '2.0.12', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'path_provider_ios', + description: 'iOS implementation of the path_provider plugin.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/path_provider/path_provider_ios', + authors: [], + version: '2.0.8', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'path_provider_linux', + description: 'Linux implementation of the path_provider plugin', + repository: 'https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_linux', + authors: [], + version: '2.1.5', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'path_provider_macos', + description: 'macOS implementation of the path_provider plugin', + repository: 'https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_macos', + authors: [], + version: '2.0.5', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'path_provider_platform_interface', + description: 'A common platform interface for the path_provider plugin.', + repository: 'https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_platform_interface', + authors: [], + version: '2.0.3', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'path_provider_windows', + description: 'Windows implementation of the path_provider plugin', + repository: 'https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_windows', + authors: [], + version: '2.0.5', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'pedantic', + description: 'The Dart analyzer settings and best practices used internally at Google.', + homepage: 'https://github.com/google/pedantic', + authors: [], + version: '1.11.1', + license: '''Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'permission_handler', + description: 'Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.', + homepage: 'https://github.com/baseflow/flutter-permission-handler', + authors: [], + version: '9.2.0', + license: '''MIT License + +Copyright (c) 2018 Baseflow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'permission_handler_android', + description: 'Permission plugin for Flutter. This plugin provides the Android API to request and check permissions.', + homepage: 'https://github.com/baseflow/flutter-permission-handler', + authors: [], + version: '9.0.2+1', + license: '''MIT License + +Copyright (c) 2018 Baseflow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'permission_handler_apple', + description: 'Permission plugin for Flutter. This plugin provides the iOS API to request and check permissions.', + homepage: 'https://github.com/baseflow/flutter-permission-handler', + authors: [], + version: '9.0.4', + license: '''MIT License + +Copyright (c) 2018 Baseflow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'permission_handler_platform_interface', + description: 'A common platform interface for the permission_handler plugin.', + homepage: 'https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface', + authors: [], + version: '3.7.0', + license: '''MIT License + +Copyright (c) 2018 Baseflow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'permission_handler_windows', + description: 'Permission plugin for Flutter. This plugin provides the Windows API to request and check permissions.', + homepage: 'https://github.com/baseflow/flutter-permission-handler', + authors: [], + version: '0.1.0', + license: '''MIT License + +Copyright (c) 2018 Baseflow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'platform', + description: 'A pluggable, mockable platform abstraction for Dart.', + homepage: 'https://github.com/google/platform.dart', + authors: [], + version: '3.1.0', + license: '''Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'plugin_platform_interface', + description: 'Reusable base class for platform interfaces of Flutter federated plugins, to help enforce best practices.', + repository: 'https://github.com/flutter/plugins/tree/master/packages/plugin_platform_interface', + authors: [], + version: '2.1.2', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'pool', + description: 'Manage a finite pool of resources. Useful for controlling concurrent file system or network requests.', + homepage: 'https://github.com/dart-lang/pool', + authors: [], + version: '1.5.0', + license: '''Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'process', + description: 'A pluggable, mockable process invocation abstraction for Dart.', + homepage: 'https://github.com/google/process.dart', + authors: [], + version: '4.2.4', + license: '''Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'pub_semver', + description: 'Versions and version constraints implementing pub\'s versioning policy. This is very similar to vanilla semver, with a few corner cases.', + repository: 'https://github.com/dart-lang/pub_semver', + authors: [], + version: '2.1.1', + license: '''Copyright 2014, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'pubspec_parse', + description: 'Simple package for parsing pubspec.yaml files with a type-safe API and rich error reporting.', + repository: 'https://github.com/dart-lang/pubspec_parse', + authors: [], + version: '1.1.0', + license: '''Copyright 2018, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'quiver', + description: 'Quiver is a set of utility libraries for Dart that makes using many Dart libraries easier and more convenient, or adds additional functionality.', + repository: 'https://github.com/google/quiver-dart', + authors: [], + version: '3.0.1+1', + license: '''Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'recase', + description: 'Changes the case of the input text to the desire case convention.', + homepage: 'https://github.com/techniboogie-dart/recase', + authors: [], + version: '4.0.0', + license: '''Copyright 2017 Keith Elliott + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'rxdart', + description: '''RxDart is an implementation of the popular reactiveX api for asynchronous programming, leveraging the native Dart Streams api. +''', + repository: 'https://github.com/ReactiveX/rxdart', + authors: [], + version: '0.27.3', + license: '''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 + +http://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.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'sanitize_html', + description: '''Function for sanitizing HTML to prevent XSS by restrict elements and +attributes to a safe subset of allowed values. +''', + homepage: 'https://github.com/google/dart-neats/tree/master/sanitize_html', + repository: 'https://github.com/google/dart-neats.git', + authors: [], + version: '2.0.0', + license: '''Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'scrollable_positioned_list', + description: '''A list with helper methods to programmatically scroll to an item. +''', + homepage: 'https://github.com/google/flutter.widgets/tree/master/packages/scrollable_positioned_list', + authors: [], + version: '0.2.3', + license: '''Copyright 2018 the Dart project authors, Inc. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'shared_preferences', + description: 'Flutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/shared_preferences/shared_preferences', + authors: [], + version: '2.0.13', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'shared_preferences_android', + description: 'Android implementation of the shared_preferences plugin', + repository: 'https://github.com/flutter/plugins/tree/main/packages/shared_preferences/shared_preferences_android', + authors: [], + version: '2.0.11', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'shared_preferences_ios', + description: 'iOS implementation of the shared_preferences plugin', + repository: 'https://github.com/flutter/plugins/tree/main/packages/shared_preferences/shared_preferences_ios', + authors: [], + version: '2.1.0', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'shared_preferences_linux', + description: 'Linux implementation of the shared_preferences plugin', + repository: 'https://github.com/flutter/plugins/tree/main/packages/shared_preferences/shared_preferences_linux', + authors: [], + version: '2.1.0', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'shared_preferences_macos', + description: 'macOS implementation of the shared_preferences plugin.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/shared_preferences/shared_preferences_macos', + authors: [], + version: '2.0.3', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'shared_preferences_platform_interface', + description: 'A common platform interface for the shared_preferences plugin.', + homepage: 'https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_platform_interface', + authors: [], + version: '2.0.0', + license: '''Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'shared_preferences_web', + description: 'Web platform implementation of shared_preferences', + repository: 'https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_web', + authors: [], + version: '2.0.3', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'shared_preferences_windows', + description: 'Windows implementation of shared_preferences', + repository: 'https://github.com/flutter/plugins/tree/main/packages/shared_preferences/shared_preferences_windows', + authors: [], + version: '2.1.0', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'shelf', + description: 'A model for web server middleware that encourages composition and easy reuse', + repository: 'https://github.com/dart-lang/shelf', + authors: [], + version: '1.2.0', + license: '''Copyright 2014, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'shelf_web_socket', + description: 'A shelf handler that wires up a listener for every connection.', + repository: 'https://github.com/dart-lang/shelf_web_socket', + authors: [], + version: '1.0.1', + license: '''Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'source_gen', + description: 'Source code generation builders and utilities for the Dart build system', + repository: 'https://github.com/dart-lang/source_gen', + authors: [], + version: '1.0.3', + license: '''Copyright 2015, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'source_span', + description: 'A library for identifying source spans and locations.', + homepage: 'https://github.com/dart-lang/source_span', + authors: [], + version: '1.8.1', + license: '''Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'sqflite', + description: 'Flutter plugin for SQLite, a self-contained, high-reliability, embedded, SQL database engine.', + homepage: 'https://github.com/tekartik/sqflite/tree/master/sqflite', + authors: [], + version: '2.0.2', + license: '''BSD 2-Clause License + +Copyright (c) 2019, Tekartik +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'sqflite_common', + description: 'Dart wrapper on SQLite, a self-contained, high-reliability, embedded, SQL database engine.', + homepage: 'https://github.com/tekartik/sqflite/tree/master/sqflite_common', + authors: [], + version: '2.2.0', + license: '''BSD 2-Clause License + +Copyright (c) 2019, Tekartik +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'stack_trace', + description: 'A package for manipulating stack traces and printing them readably.', + homepage: 'https://github.com/dart-lang/stack_trace', + authors: [], + version: '1.10.0', + license: '''Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'stream_channel', + description: 'An abstraction for two-way communication channels based on the Dart Stream class.', + homepage: 'https://github.com/dart-lang/stream_channel', + authors: [], + version: '2.1.0', + license: '''Copyright 2015, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'stream_transform', + description: 'A collection of utilities to transform and manipulate streams.', + repository: 'https://github.com/dart-lang/stream_transform', + authors: [], + version: '2.0.0', + license: '''Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'string_scanner', + description: 'A class for parsing strings using a sequence of patterns.', + homepage: 'https://github.com/dart-lang/string_scanner', + authors: [], + version: '1.1.0', + license: '''Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'synchronized', + description: 'Lock mechanism to prevent concurrent access to asynchronous code.', + homepage: 'https://github.com/tekartik/synchronized.dart/tree/master/synchronized', + authors: [], + version: '3.0.0', + license: '''Copyright (c) 2016, Alexandre Roux Tekartik. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Tekartik nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'term_glyph', + description: 'Useful Unicode glyphs and ASCII substitutes.', + homepage: 'https://github.com/dart-lang/term_glyph', + authors: [], + version: '1.2.0', + license: '''Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'test_api', + description: 'A library for writing Dart tests.', + homepage: 'https://github.com/dart-lang/test/blob/master/pkgs/test_api', + authors: [], + version: '0.4.8', + license: '''Copyright 2018, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'timezone', + description: 'Time zone database and time zone aware DateTime.', + repository: 'https://github.com/srawlins/timezone', + authors: [], + version: '0.8.0', + license: '''Copyright (c) 2014, timezone project authors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'timing', + description: 'A simple package for tracking the performance of synchronous and asynchronous actions.', + repository: 'https://github.com/dart-lang/timing', + authors: [], + version: '1.0.0', + license: '''Copyright 2018, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'tuple', + description: 'Tuple data structure', + repository: 'https://github.com/google/tuple.dart', + authors: [], + version: '2.0.0', + license: '''Copyright (c) 2014, the tuple project authors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'typed_data', + description: 'Utility functions and classes related to the dart:typed_data library.', + homepage: 'https://github.com/dart-lang/typed_data', + authors: [], + version: '1.3.0', + license: '''Copyright 2015, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'url_launcher', + description: 'Flutter plugin for launching a URL. Supports web, phone, SMS, and email schemes.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher', + authors: [], + version: '6.0.20', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: true, + ), + Package( + name: 'url_launcher_android', + description: 'Android implementation of the url_launcher plugin.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_android', + authors: [], + version: '6.0.15', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'url_launcher_ios', + description: 'iOS implementation of the url_launcher plugin.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_ios', + authors: [], + version: '6.0.15', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'url_launcher_linux', + description: 'Linux implementation of the url_launcher plugin.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_linux', + authors: [], + version: '3.0.0', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'url_launcher_macos', + description: 'macOS implementation of the url_launcher plugin.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_macos', + authors: [], + version: '3.0.0', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'url_launcher_platform_interface', + description: 'A common platform interface for the url_launcher plugin.', + repository: 'https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_platform_interface', + authors: [], + version: '2.0.5', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'url_launcher_web', + description: 'Web platform implementation of url_launcher', + repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_web', + authors: [], + version: '2.0.9', + license: '''url_launcher_web + +Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +platform_detect + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017 Workiva Inc. + + 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 + + http://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.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'url_launcher_windows', + description: 'Windows implementation of the url_launcher plugin.', + repository: 'https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_windows', + authors: [], + version: '3.0.0', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'uuid', + description: '''RFC4122 (v1, v4, v5) UUID Generator and Parser for all Dart platforms (Web, VM, Flutter) +''', + homepage: 'https://github.com/Daegalus/dart-uuid', + authors: [], + version: '3.0.6', + license: '''Copyright (c) 2021 Yulian Kuncheff + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'vector_math', + description: 'A Vector Math library for 2D and 3D applications.', + repository: 'https://github.com/google/vector_math.dart', + authors: [], + version: '2.1.1', + license: '''Copyright 2015, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Copyright (C) 2013 Andrew Magill + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'watcher', + description: 'A file system watcher. It monitors changes to contents of directories and sends notifications when files have been added, removed, or modified.', + repository: 'https://github.com/dart-lang/watcher', + authors: [], + version: '1.0.1', + license: '''Copyright 2014, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'web_socket_channel', + description: 'StreamChannel wrappers for WebSockets. Provides a cross-platform WebSocketChannel API, a cross-platform implementation of that API that communicates over an underlying StreamChannel.', + repository: 'https://github.com/dart-lang/web_socket_channel', + authors: [], + version: '2.1.0', + license: '''Copyright 2016, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'win32', + description: 'A Dart library for accessing common Win32 APIs using FFI. No C required!', + homepage: 'https://win32.pub', + repository: 'https://github.com/timsneath/win32', + authors: [], + version: '2.4.1', + license: '''Copyright 2019, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'xdg_directories', + description: 'A Dart package for reading XDG directory configuration information on Linux.', + repository: 'https://github.com/flutter/packages/tree/main/packages/xdg_directories', + authors: [], + version: '0.2.0+1', + license: '''Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + Package( + name: 'yaml', + description: 'A parser for YAML, a human-friendly data serialization standard', + homepage: 'https://github.com/dart-lang/yaml', + authors: [], + version: '3.1.0', + license: '''Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''', + isMarkdown: false, + isSdk: false, + isDirectDependency: false, + ), + +]; + +/// Package license definition. +class Package { + /// Package name + final String name; + /// Description + final String description; + /// Website URL + final String? homepage; + /// Repository URL + final String? repository; + /// Authors + final List authors; + /// Version + final String version; + /// License + final String? license; + /// Whether the license is in markdown format or not (plain text). + final bool isMarkdown; + /// Whether the package is included in the SDK or not. + final bool isSdk; + /// Whether the package is direct dependency or not. + final bool isDirectDependency; + + const Package({ + required this.name, + required this.description, + this.homepage, + this.repository, + required this.authors, + required this.version, + this.license, + required this.isMarkdown, + required this.isSdk, + required this.isDirectDependency, + }); +} diff --git a/lib/packages_screen.dart b/lib/packages_screen.dart new file mode 100644 index 0000000..3ef460d --- /dev/null +++ b/lib/packages_screen.dart @@ -0,0 +1,226 @@ +/* + * packages_screen.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'oss_licenses.dart'; + +class PackageRowInfo { + PackageRowInfo({required this.package, this.showFullDetails = false}); + + final Package package; + bool showFullDetails; +} + +class PackagesScreen extends StatefulWidget { + const PackagesScreen({Key? key}) : super(key: key); + + @override + State createState() => _PackagesScreenState(); +} + +class _PackagesScreenState extends State { + + final _packageInfo = []; + + @override + void initState() { + _packageInfo.clear(); + _packageInfo.addAll(ossLicenses.map((e) => PackageRowInfo(package: e))); + super.initState(); + } + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + + return Scaffold( + appBar: AppBar( + title: Text(appLocalizations.packagesInfo), + ), + body: SafeArea( + child: Scrollbar( + child: ListView.separated( + primary: true, + itemBuilder: (context, index) => PackageRow( + packageRowInfo: _packageInfo[index], + ), + itemCount: _packageInfo.length, + padding: const EdgeInsets.all(8.0), + separatorBuilder: (BuildContext context, int index) => + const Divider(), + ), + ), + ), + ); + } +} + + +// class PackagesScreen extends StatelessWidget { +// const PackagesScreen({Key? key}) : super(key: key); +// +// @override +// Widget build(BuildContext context) { +// final appLocalizations = AppLocalizations.of(context)!; +// +// return Scaffold( +// appBar: AppBar( +// title: Text(appLocalizations.packagesInfo), +// ), +// body: SafeArea( +// child: Scrollbar( +// child: ListView.separated( +// primary: true, +// itemBuilder: (context, index) => PackageRow( +// package: ossLicenses[index], +// ), +// itemCount: ossLicenses.length, +// padding: const EdgeInsets.all(8.0), +// separatorBuilder: (BuildContext context, int index) => +// const Divider(), +// ), +// ), +// ), +// ); +// } +// } + +class PackageRow extends StatefulWidget { + const PackageRow({ + Key? key, + required this.packageRowInfo, + this.duration = const Duration(milliseconds: 250), + }) : super(key: key); + + final PackageRowInfo packageRowInfo; + final Duration duration; + + @override + State createState() => _PackageRowState(); +} + +class _PackageRowState extends State with TickerProviderStateMixin { + // bool showFullDetails = false; + + late final AnimationController _animationController; + late final _package = widget.packageRowInfo.package; + + @override + void initState() { + _animationController = + AnimationController(vsync: this, duration: widget.duration); + super.initState(); + } + + @override + Widget build(BuildContext context) { + final textStyle = + Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 14); + var headingStyle = + textStyle.copyWith(fontWeight: FontWeight.bold, fontSize: 18); + + // final appLocalizations = AppLocalizations.of(context)!; + + return AnimatedSize( + duration: widget.duration, + alignment: Alignment.topCenter, + child: InkWell( + onTap: () { + setState(() { + widget.packageRowInfo.showFullDetails = !widget.packageRowInfo.showFullDetails; + }); + if (widget.packageRowInfo.showFullDetails) { + _animationController.forward(); + } else { + _animationController.reverse(); + } + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AnimatedRotation(turns: !widget.packageRowInfo.showFullDetails ? -0.25 : 0, duration: widget.duration, child: const Icon(Icons.expand_more),), + // AnimatedIcon( + // icon: AnimatedIcons.menu_close, + // progress: _animationController, size: 32,), + const SizedBox(width: 8.0,), + Expanded( + child: Text( + "${_package.name} ${_package.version}", + style: headingStyle, + )), + if (_package.homepage != null) + IconButton( + onPressed: () => launch(_package.homepage!), + icon: const Icon(Icons.open_in_new), tooltip: AppLocalizations.of(context)!.openPackageSite,) + ], + ), + if (widget.packageRowInfo.showFullDetails) Padding( + padding: const EdgeInsets.only(left: 32.0), + child: Row( + children: [ + Expanded( + child: Text( + _package.description, + style: textStyle, + )), + ], + ), + ), + // if (widget.package.homepage != null) + // Row( + // children: [ + // GestureDetector( + // child: Expanded(child: Text(appLocalizations.openPackageSite)), + // onTap: () => launch(widget.package.homepage!), + // ), + // ], + // ), + if (widget.packageRowInfo.showFullDetails && _package.license != null) + Padding( + padding: const EdgeInsets.only(left: 32), + child: Row( + children: [ + Expanded( + child: Text( "\n" + + _package.license!, + style: textStyle, + )), + ], + ), + ) + ], + ), + ), + ), + ); + } + + @override + void dispose() { + _animationController.dispose(); + super.dispose(); + } + +} diff --git a/lib/playground.dart b/lib/playground.dart new file mode 100644 index 0000000..aa41649 --- /dev/null +++ b/lib/playground.dart @@ -0,0 +1,93 @@ +/* + * playground.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// import 'dart:convert'; +// import 'flights.dart'; +// import 'users.dart'; +// +// void testTaxonomy(){ +// print("Hello, World!"); +// +// var x = Genus.get("Pheidole"); +// var xJson = jsonEncode(x); +// +// print(xJson); +// +// var y = Species.get(x, "dentata"); +// var yJson = jsonEncode(y); +// +// print(yJson); +// +// var jParse = jsonDecode(xJson); +// var kParse = jsonDecode(yJson); +// +// var j = Genus.fromJson(jParse); +// var k = Species.fromJson(kParse); +// +// print(j); +// print(k); +// +// var future = DateTime(2021, 5, 14, 15, 23, 00, 00, 00); +// var now = DateTime.now(); +// +// var f = BaseFlight(12, y, now, -35.1, 13.4, future, "dentata408", Role.flagged, true); +// +// var fJson = jsonEncode(f); +// print(fJson); +// print("Flight is valid: ${f.validationLevel}"); +// } + +import 'package:flutter/foundation.dart'; + +var a = 0; + +Future futureTest() async { + return Future.delayed(const Duration(seconds: 2), (){ + a++; + + if ((a-1).isOdd) { + throw 'a was odd!'; + } else { + return a; + } + }); +} + +Future numberPrinter() async { + int b = await futureTest(); + if (kDebugMode) { + print(b); + } +} + +Future main() async { + for (var i=0; i<10; i++) { + try { + await numberPrinter(); + if (kDebugMode) { + print("No exception occurred! 🎉🎉🎉🎉🎉"); + } + } catch (e) { + if (kDebugMode) { + print(e); + } + } + } +} \ No newline at end of file diff --git a/lib/sessions.dart b/lib/sessions.dart new file mode 100644 index 0000000..affc073 --- /dev/null +++ b/lib/sessions.dart @@ -0,0 +1,1137 @@ +/* + * sessions.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; +import 'dart:io'; +import 'package:ant_nup_tracker/common_ui_elements.dart'; +import 'package:ant_nup_tracker/exceptions.dart'; +import 'package:ant_nup_tracker/filtering.dart'; +import 'package:ant_nup_tracker/flights.dart'; +import 'package:ant_nup_tracker/launch_url.dart'; +import 'package:ant_nup_tracker/url_manager.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter/material.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; +import 'package:http/http.dart' as http; +import 'user.dart'; +import 'users.dart'; +import 'dark_mode_theme_ext.dart'; + +part 'sessions.g.dart'; +// +// abstract class LoginObserver { +// void loggedIn(); +// } +// +// abstract class LogoutObserver { +// void loggedOut(); +// } + +class SessionManager { + SessionManager._(); + + static final shared = SessionManager._(); + + // LoginObserver? loginObserver; + // LogoutObserver? logoutObserver; + + Session? _session; + String? firebaseToken; + bool get isLoggedIn => _session != null; + Session? get session => _session; + + Map get headers => + {if (isLoggedIn) "Authorization": "Token ${_session!.token}"}; + + final secureStorage = const FlutterSecureStorage(); + + Future login(BuildContext context, + {required String username, required String password}) async { + // print("Device token: $firebaseToken"); + _session = await _login(context, + username: username, + password: password, + notificationToken: firebaseToken); + _session!.loadNotificationSettings(); + saveCredentials(); + // loginObserver?.loggedIn(); + } + + Future logout() async { + if (_session != null) { + await _logout(_session!); + _session = null; + clearCredentials(); + } + // logoutObserver?.loggedOut(); + } + + Future saveCredentials() async { + if (!isLoggedIn) { + return true; + } + + final credentials = jsonEncode({ + "username": _session!.username, + "token": _session!.token, + "deviceId": _session!.deviceId + }); + + try { + await secureStorage.write(key: "credentials", value: credentials); + // print("Saved credentials"); + return true; + } on PlatformException catch (error, stacktrace) { + // print(error); + // print(stacktrace); + return false; + } + } + + Future loadAndVerifyCredentials() async { + try { + // await clearCredentials(); + final credentials = await secureStorage.read(key: "credentials"); + + // print("Loaded credentials: $credentials"); + + if (credentials == null) return false; + + final decodedCredentials = + jsonDecode(credentials) as Map; + final username = decodedCredentials["username"] as String; + final token = decodedCredentials["token"] as String; + final deviceId = decodedCredentials["deviceId"] as int; + + _session = await verifyToken(username, token, deviceId); + + if (_session != null) { + _session!.loadNotificationSettings(); + return true; + } + + return false; + } on PlatformException catch (error, stacktrace) { + // print(error); + // print(stacktrace); + return false; + } on LocalisableException { + rethrow; + } on Exception { + throw JsonException(); + } + } + + Future clearCredentials() async { + try { + await secureStorage.deleteAll(); + return true; + } on PlatformException catch (error, stacktrace) { + // print(error); + // print(stacktrace); + return false; + } + } +} + +@JsonSerializable(createToJson: false, explicitToJson: true) +class Session { + final String token; + + @JsonKey(name: "deviceID") + final int deviceId; + + @JsonKey(name: "user") + final User user; + + Role get role => user.role; + String get username => user.username; + String get institution => user.institution; + String get description => user.description; + + Session(this.token, this.deviceId, this.user); + + @JsonKey(ignore: true) + TaxonomyFilter? _notificationSettings; + + bool get hasNotificationSettingsLoaded => _notificationSettings != null; + TaxonomyFilter get notificationSettings => _notificationSettings!; + + // late Future _loadNotificationSettingsFuture; + // + // Future get loadNotificationSettingsFuture => + // _loadNotificationSettingsFuture; + + Future loadNotificationSettings( + {bool forceReload = false}) async { + // _notificationSettings = await _getNotificationSettings(); + // _loadNotificationSettingsFuture = _getNotificationSettings() + // .then((settings) { + // print("Loaded ${settings.genera.length} genera and ${settings.species.length} species"); + // return _notificationSettings = settings; + // }) + // .onError((error, stackTrace) { + // print(error); + // print(stackTrace); + // throw Exception("Error loading notification settings."); + // }); + + if (!forceReload && hasNotificationSettingsLoaded) { + return notificationSettings; + } + + _notificationSettings = await _getNotificationSettings(); + // print( + // "Loaded ${_notificationSettings!.genera.length} genera and ${_notificationSettings!.species.length} species"); + return _notificationSettings!; + } + + Future updateNotificationSettings({ + Set addedGenera = const {}, + Set addedSpecies = const {}, + Set removedGenera = const {}, + Set removedSpecies = const {}, + }) async { + final generaUrl = UrlManager.shared.myGeneraUrl; + final speciesUrl = UrlManager.shared.mySpeciesUrl; + + final headers = { + "Authorization": "Token $token", + "Content-Type": "application/json" + }; + + List? newGenera; + List? newSpecies; + + try { + if (addedGenera.isNotEmpty) { + final body = jsonEncode(addedGenera.map((e) => {"id": e.id}).toList()); + + // print("Sending $body"); + + final response = + await http.post(generaUrl, body: body, headers: headers); + + final statusCode = response.statusCode; + + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode != 200) throw NotificationUpdateException(statusCode); + + try { + final results = jsonDecode(response.body) as List; + newGenera = results.map((e) => Genus.get(e["id"] as int)).toList(); + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } + + if (addedSpecies.isNotEmpty) { + final body = jsonEncode(addedSpecies.map((e) => {"id": e.id}).toList()); + + final response = + await http.post(speciesUrl, body: body, headers: headers); + + final statusCode = response.statusCode; + + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode != 200) throw NotificationUpdateException(statusCode); + + try { + final results = jsonDecode(response.body) as List; + newSpecies = results.map((e) => Species.get(e["id"] as int)).toList(); + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } + if (removedGenera.isNotEmpty) { + final body = + jsonEncode(removedGenera.map((e) => {"id": e.id}).toList()); + + final response = + await http.delete(generaUrl, body: body, headers: headers); + + final statusCode = response.statusCode; + + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode != 200) throw NotificationUpdateException(statusCode); + + try { + final results = jsonDecode(response.body) as List; + newGenera = results.map((e) => Genus.get(e["id"] as int)).toList(); + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } + + if (removedSpecies.isNotEmpty) { + final body = + jsonEncode(removedSpecies.map((e) => {"id": e.id}).toList()); + + final response = + await http.delete(speciesUrl, body: body, headers: headers); + + final statusCode = response.statusCode; + + if (statusCode == 401) throw FailedAuthenticationException(); + if (statusCode != 200) throw NotificationUpdateException(statusCode); + + try { + final results = jsonDecode(response.body) as List; + newSpecies = results.map((e) => Species.get(e["id"] as int)).toList(); + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } + + final newSettings = TaxonomyFilter( + species: newSpecies ?? notificationSettings.species, + genera: newGenera ?? notificationSettings.genera, + ); + + _notificationSettings = newSettings; + } on IOException { + throw NoResponseException(); + } + } + + factory Session.fromJson(Map json) => + _$SessionFromJson(json); +} + +Future _getNotificationSettings() async { + assert(SessionManager.shared.isLoggedIn); + + final mySpeciesUrl = UrlManager.shared.mySpeciesUrl; + final myGeneraUrl = UrlManager.shared.myGeneraUrl; + + try { + final requestHeaders = { + "Authorization": "Token ${SessionManager.shared.session!.token}" + }; + final generaResponse = await http.get(myGeneraUrl, headers: requestHeaders); + + final generaStatus = generaResponse.statusCode; + + // print(generaResponse.body); + + if (generaStatus == 401) throw FailedAuthenticationException(); + if (generaStatus != 200) throw ReadException(generaStatus); + + final Iterable genera; + + try { + final rawGeneraList = jsonDecode(generaResponse.body) as List; + final generaIds = rawGeneraList.map((jsonRow) => jsonRow["id"] as int); + genera = generaIds.map((id) => Genus.get(id)); + // genera = rawGeneraList.map((e) => Genus.fromJson(e)); + // print("Loaded genera: $genera"); + } catch (e) { + throw JsonException(); + } + + final speciesResponse = + await http.get(mySpeciesUrl, headers: requestHeaders); + + // print(speciesResponse.body); + + final speciesStatus = generaResponse.statusCode; + + if (speciesStatus == 401) throw FailedAuthenticationException(); + if (speciesStatus != 200) throw ReadException(speciesStatus); + + final Iterable species; + + try { + final rawSpeciesList = jsonDecode(speciesResponse.body) as List; + final speciesIds = rawSpeciesList.map((jsonRow) => jsonRow["id"] as int); + species = speciesIds.map((id) => Species.get(id)); + // species = rawSpeciesList.map((e) => Species.fromJson(e)); + // print("Loaded species: $species"); + } catch (e, stacktrace) { + // print(e); + // print(stacktrace); + throw JsonException(); + } + + return TaxonomyFilter(genera: genera, species: species); + } on IOException catch (error, stacktrace) { + // print("Error!: $error"); + // print(stacktrace); + throw NoResponseException(); + } +} + +Future verifyToken( + String username, String token, int deviceId) async { + final verificationUrl = UrlManager.shared.verifyUrl; + + final body = jsonEncode({ + "deviceID": deviceId, + "deviceToken": SessionManager.shared.firebaseToken + }); + + try { + final response = await http.post(verificationUrl, body: body, headers: { + "Authorization": "Token $token", + "Content-Type": "application/json" + }); + + final status = response.statusCode; + + // print("Response: ${response.body}"); + + if (status == 401) return null; + if (status != 200) throw TokenVerificationException(status); + + try { + final user = User.fromJson(jsonDecode(response.body)); + return Session(token, deviceId, user); + } on Exception catch (error, stacktrace) { + // print(error); + // print(stacktrace); + + throw JsonException(); + } + } on IOException { + throw NoResponseException(); + } +} + +Map getDeviceInfo(BuildContext context, + [String? notificationToken]) { + final deviceInfo = {}; + + final platform = Theme.of(context).platform; + + final String platformName; + + switch (platform) { + case TargetPlatform.android: + platformName = "ANDROID"; + break; + case TargetPlatform.fuchsia: + platformName = "FUCHSIA"; + break; + case TargetPlatform.iOS: + platformName = "IOS"; + break; + case TargetPlatform.linux: + platformName = "LINUX"; + break; + case TargetPlatform.macOS: + platformName = "MACOS"; + break; + case TargetPlatform.windows: + platformName = "WINDOWS"; + break; + } + + // deviceInfo["platform"] = Platform.operatingSystem; + deviceInfo["platform"] = platformName; + deviceInfo["model"] = "device"; + if (notificationToken != null) deviceInfo["deviceToken"] = notificationToken; + + return deviceInfo; +} + +Future _login(BuildContext context, + {required String username, + required String password, + String? notificationToken}) async { + if (username.isEmpty || password.isEmpty) { + throw EmptyUsernamePasswordException(); + } + + final deviceInfo = getDeviceInfo(context, notificationToken); + final loginUrl = UrlManager.shared.loginUrl; + + var rawAuthorization = "$username:$password"; + var authorizationBytes = rawAuthorization.codeUnits; + final authorization = base64Encode(authorizationBytes); + + try { + final response = await http.post( + loginUrl, + headers: { + "Authorization": "Basic $authorization", + "Content-Type": "application/json", + }, + body: jsonEncode(deviceInfo), + ); + + final status = response.statusCode; + + if (status == 401) throw IncorrectCredentialsException(); + if (status == 403) throw ForbiddenAccessException(); + + if (status != 200) throw LoginException(status); + + try { + return Session.fromJson(jsonDecode(response.body)); + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } on IOException catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw NoResponseException(); + } +} + +Future _logout(Session session) async { + final logoutUrl = UrlManager.shared.logoutUrl; + + try { + final response = await http.post( + logoutUrl, + headers: { + "Authorization": "Token ${session.token}", + "Content-Type": "application/json" + }, + ); + + final status = response.statusCode; + + if (status != 200 && status != 204) throw LogoutException(status); + } on IOException { + throw NoResponseException(); + } +} + +class LoginScreen extends StatelessWidget { + const LoginScreen({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(AppLocalizations.of(context)!.loginAppBarHeader), + ), + body: const LoginForm(), + ); + } +} + +class LoginForm extends StatefulWidget { + const LoginForm({Key? key}) : super(key: key); + + @override + _LoginFormState createState() => _LoginFormState(); +} + +class _LoginFormState extends State { + final _globalKey = GlobalKey(); + final _usernameController = TextEditingController(); + final _passwordController = TextEditingController(); + var _isLoading = false; + + void _triggerLogin({required String username, required String password}) { + // print("Triggering login!!!"); + SessionManager.shared + .login(context, username: username, password: password) + .then((_) { + Navigator.of(context).pop(true); + }).catchError( + (error, stacktrace) { + // print(error); + // print(stacktrace); + final loginException = error as LocalisableException; + showDialog( + context: context, + builder: (BuildContext context) => AlertDialog( + title: Text(loginException.getLocalisedName(context)), + content: + Text(loginException.getLocalisedDescription(context)), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + + setState(() { + _isLoading = false; + }); + }, + child: Text(AppLocalizations.of(context)!.cancelButton), + ) + ], + ), + barrierDismissible: false); + }, + test: (error) => error is LocalisableException, + ); + } + + @override + Widget build(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + + return ListView( + shrinkWrap: true, + primary: true, + // mainAxisAlignment: MainAxisAlignment.center, + // mainAxisSize: MainAxisSize.min, + // physics: ClampingScrollPhysics(), + children: [ + Text( + appLocalization.loginScreenHeader, + style: Theme.of(context).textTheme.headline4, + textAlign: TextAlign.center, + ), + Image( + image: Theme.of(context).isDarkMode ? const AssetImage("assets/cartoon_ant/dark/cartoon_ant.png") : const AssetImage("assets/cartoon_ant/cartoon_ant.png"), + height: 128, + ), + // Image.asset(name), + Form( + key: _globalKey, + child: Column( + children: [ + SizedBox( + height: 80, + child: TextFormField( + decoration: InputDecoration( + hintText: appLocalization.usernameLabel, + filled: true, + icon: const Icon(Icons.person)), + controller: _usernameController, + validator: (value) { + if (value == null || value.isEmpty) { + return appLocalization.enterUsernameMessage; + } + return null; + }, + ), + ), + // SizedBox(), + SizedBox( + height: 80, + child: TextFormField( + obscureText: true, + decoration: InputDecoration( + hintText: appLocalization.passwordLabel, + filled: true, + icon: const Icon(Icons.lock)), + controller: _passwordController, + validator: (value) { + if (value == null || value.isEmpty) { + return appLocalization.enterPasswordMessage; + } + return null; + }, + onFieldSubmitted: (_) => _submitForm(), + ), + ), + const SizedBox(height: 8), + if (_isLoading) const LinearProgressIndicator(), + const SizedBox(height: 8), + ElevatedButton( + onPressed: _submitForm, + child: Text(appLocalization.loginButton), + ), + ], + ), + ), + ElevatedButton.icon( + label: Text(appLocalization.forgotPassword), + icon: const Icon(Icons.open_in_new), + onPressed: () async { + final urlString = UrlManager.shared.passwordResetUrl.toString(); + await launchUrl(urlString); + }, + ), + ElevatedButton.icon( + label: Text(appLocalization.createNewUser), + icon: const Icon(Icons.open_in_new), + onPressed: () async { + final urlString = UrlManager.shared.createAccountUrl.toString(); + await launchUrl(urlString); + }, + ) + ], + ); + } + + void _submitForm() { + if (_globalKey.currentState!.validate()) { + setState(() { + _isLoading = true; + }); + _triggerLogin( + username: _usernameController.text, + password: _passwordController.text, + ); + } + } + + @override + void dispose() { + _usernameController.dispose(); + _passwordController.dispose(); + + super.dispose(); + } +} + +class UserProfileScreen extends StatefulWidget { + const UserProfileScreen({Key? key}) : super(key: key); + + @override + _UserProfileScreenState createState() => _UserProfileScreenState(); +} + +class _UserProfileScreenState extends State { + late TextStyle _labelStyle; + late TextStyle _headerStyle; + + Widget _buildTextLabelDetailRow({ + required String label, + String? detail, + TextStyle? detailStyle, + }) { + var textStyle = detailStyle ?? _labelStyle.apply(fontWeightDelta: 2); + + return Container( + margin: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Text(label, style: _labelStyle)), + if (detail != null) + Expanded( + child: Text( + detail, + style: textStyle, + textAlign: TextAlign.end, + )), + ], + ), + ); + } + + Widget _buildTextLabelLongDetailRow({ + required String label, + String? detail, + TextStyle? detailStyle, + }) { + var textStyle = detailStyle ?? _labelStyle.apply(fontWeightDelta: 2); + + return Container( + margin: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: const EdgeInsets.only(bottom: 8.0), + child: Row( + children: [ + Expanded(child: Text(label, style: _labelStyle)), + ], + ), + ), + if (detail != null) + Row( + children: [ + Expanded( + child: Text( + detail, + style: textStyle, + textAlign: TextAlign.start, + )), + ], + ), + ], + ), + ); + } + + String getUserRoleString(Role role) { + switch (role) { + case Role.citizen: + return AppLocalizations.of(context)!.citizenUser; + case Role.professional: + return AppLocalizations.of(context)!.professionalUser; + case Role.flagged: + return AppLocalizations.of(context)!.flaggedUser; + } + } + + Widget _buildUserRoleRow({required String label, required Role userRole}) { + var textStyle = _labelStyle.apply(fontWeightDelta: 2); + return Container( + margin: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Text(label, style: _labelStyle)), + Container( + constraints: + BoxConstraints(maxWidth: MediaQuery.of(context).size.width / 2), + child: Row( + children: [ + Expanded( + child: Text( + getUserRoleString(userRole), + style: textStyle, + textAlign: TextAlign.end, + ), + ), + if (userRole == Role.professional) + // const Icon(Icons.verified, color: Colors.green), + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: const Image( + image: AssetImage("assets/ant_circles/green_ant.png"), + width: 32.0, + ), + ), + if (userRole == Role.flagged) + // const Icon(Icons.warning, color: Colors.red) + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: const Image( + image: AssetImage("assets/ant_circles/red_ant.png"), + width: 32.0, + ), + ), + ], + ), + ), + ], + ), + ); + } + + Future logout() async { + await SessionManager.shared.logout(); + Navigator.of(context).pop(true); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(SessionManager.shared.session!.username), + actions: [ + IconButton( + onPressed: logout, + icon: const Icon(Icons.logout), + tooltip: AppLocalizations.of(context)!.logoutButton, + ) + ], + ), + body: SafeArea(child: _buildUserTable(SessionManager.shared.session!.user)), + ); + } + + Widget _buildUserTable(User user) { + final appLocalization = AppLocalizations.of(context)!; + // final currentLocale = appLocalization.localeName; + _labelStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontSizeDelta: 4.0); + _headerStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontWeightDelta: 2); + + final buttonStyle = ElevatedButton.styleFrom( + padding: const EdgeInsets.all(16), + textStyle: _headerStyle, + primary: Colors.red, + ); + + return RefreshIndicator( + onRefresh: () async { + SessionManager.shared.session! + .loadNotificationSettings(forceReload: true); + setState(() {}); + }, + child: ListView( + primary: true, + padding: const EdgeInsets.all(16.0), + children: [ + HeaderRow(label: appLocalization.userInformation), + _buildTextLabelDetailRow( + label: appLocalization.usernameLabel, detail: user.username), + _buildUserRoleRow( + label: appLocalization.userRoleLabel, userRole: user.role), + if (user.institution.isNotEmpty) + _buildTextLabelDetailRow( + label: appLocalization.institutionLabel, + detail: user.institution), + if (user.description.isNotEmpty) + _buildTextLabelLongDetailRow( + label: appLocalization.userDescriptionLabel, + detail: user.description), + const SizedBox(height: 16), + HeaderRow(label: appLocalization.notificationSettings), + TaxonomyNotificationRow( + onNotificationSettingsChanged: (newFilter) { + SessionManager.shared.session!.loadNotificationSettings(); + setState(() {}); + }, + ), + const SizedBox(height: 16), + Padding( + padding: const EdgeInsets.all(8.0), + child: ElevatedButton.icon( + onPressed: logout, + label: Text(appLocalization.logoutButton), + icon: const Icon(Icons.logout), + style: buttonStyle, + ), + ), + HeaderRow(label: appLocalization.moreInformation), + ListTile( + title: Text(appLocalization.homePageButton), + trailing: const Icon(Icons.open_in_new), + onTap: () async { + final urlString = UrlManager.shared.homeUrl.toString(); + await launchUrl(urlString); + }, + ), + ListTile( + title: Text(appLocalization.privacyPolicy), + trailing: const Icon(Icons.open_in_new), + onTap: () async { + final urlString = UrlManager.shared.privacyUrl.toString(); + await launchUrl(urlString); + }, + ), + ListTile( + title: Text(appLocalization.termsOfUse), + trailing: const Icon(Icons.open_in_new), + onTap: () async { + final urlString = UrlManager.shared.termsUrl.toString(); + await launchUrl(urlString); + }, + ), + ListTile( + title: Text(appLocalization.contactUs), + trailing: const Icon(Icons.email), + onTap: () async { + final urlString = UrlManager.shared.contactUrl.toString(); + await launchUrl(urlString); + }, + ), + ListTile( + title: Text(appLocalization.packagesInfo), + trailing: const Icon(Icons.code), + onTap: () async { + // Navigator.of(context).push(MaterialPageRoute(builder: (_) => const PackagesScreen())); + showLicensePage(context: context, applicationLegalese: appLocalization.applicationLegalese, applicationIcon: Image( + image: Theme.of(context).isDarkMode ? const AssetImage("assets/cartoon_ant/dark/cartoon_ant.png") : const AssetImage("assets/cartoon_ant/cartoon_ant.png"), + height: 80, + matchTextDirection: true, + )); + }, + ), + ], + ), + ); + } +} + +class TaxonomyNotificationRow extends StatefulWidget { + const TaxonomyNotificationRow({ + Key? key, + // required this.future, + required this.onNotificationSettingsChanged, + }) : super(key: key); + + // final Future future; + final void Function(TaxonomyFilter) onNotificationSettingsChanged; + + @override + _TaxonomyNotificationRowState createState() => + _TaxonomyNotificationRowState(); +} + +class _TaxonomyNotificationRowState extends State { + late AppLocalizations _appLocalizations; + + Future future = + SessionManager.shared.session!.loadNotificationSettings(); + + final _genera = {}; + final _species = {}; + + // @override + // void initState() { + // // future = widget.future; + // super.initState(); + // } + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + var labelTheme = Theme.of(context).textTheme.subtitle1; + + return FutureBuilder( + future: future, + builder: (BuildContext context, AsyncSnapshot snapshot) { + // print("Future has state: ${snapshot.connectionState}"); + // print("Future has data: ${snapshot.data}"); + + if (snapshot.hasError) { + final error = snapshot.error as LocalisableException; + return ExceptionWidget(error, () { + SessionManager.shared.session!.loadNotificationSettings(); + setState(() => future = + SessionManager.shared.session!.loadNotificationSettings()); + }); + } + + if (snapshot.connectionState == ConnectionState.done) { + final notificationSettings = snapshot.data!; + _genera + ..clear() + ..addAll(notificationSettings.genera); + _species + ..clear() + ..addAll(notificationSettings.species); + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: Text( + _appLocalizations.notifyingByGenera(_genera.length), + style: labelTheme, + ), + ), + Padding( + padding: const EdgeInsets.all(16.0), + child: Text( + _appLocalizations.notifyingBySpecies(_species.length), + style: labelTheme, + ), + ) + ], + ), + IconButton( + icon: const Icon(Icons.edit), + tooltip: _appLocalizations.edit, + onPressed: () async { + // final newFilter = await Navigator.of(context) + // .push(MaterialPageRoute( + // builder: (context) => TaxonomyFilteringScreen( + // selectedGenera: _genera, + // selectedSpecies: _species, + // ), + // )); + + final newFilter = await Navigator.of(context) + .push(MaterialPageRoute( + builder: (context) => TaxonomyFilteringScreen( + selectedGenera: List.of(_genera), + selectedSpecies: List.of(_species), + taxonomySelectionScreenType: + TaxonomySelectionScreenType.notifications, + onFilteringSaved: (newFilter) async { + if (newFilter == null) return; + + final newGenera = newFilter.genera.toSet(); + final newSpecies = newFilter.species.toSet(); + + final addedGenera = + newGenera.difference(_genera); + final addedSpecies = + newSpecies.difference(_species); + + final removedGenera = + _genera.difference(newGenera); + final removedSpecies = + _species.difference(newSpecies); + + await SessionManager.shared.session! + .updateNotificationSettings( + addedGenera: addedGenera, + addedSpecies: addedSpecies, + removedGenera: removedGenera, + removedSpecies: removedSpecies); + }, + ), + fullscreenDialog: true)); + + if (newFilter == null) { + // print("No new filter"); + return; + } + + // print("Reloading"); + + setState(() { + // _genera + // ..clear() + // ..addAll(newFilter.genera); + // _species + // ..clear() + // ..addAll(newFilter.species); + + future = Future(() => + SessionManager.shared.session!.notificationSettings); + + // future = SessionManager.shared.session! + // .loadNotificationSettings(forceReload: true); + }); + + // widget.onNotificationSettingsChanged(newFilter); + + // SessionManager.shared.session!.loadNotificationSettings(); + // setState(() => future = SessionManager + // .shared.session!.loadNotificationSettings(forceReload: true)); + + // if (newFilter != null) { + // setState(() { + // _genera = newFilter.genera; + // _species = newFilter.species; + // }); + // } + }, + ) + ], + ); + } else { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const CircularProgressIndicator(), + Text(_appLocalizations.loadingNotificationSettings) + ], + ); + } + }, + ); + } +} diff --git a/lib/sessions.g.dart b/lib/sessions.g.dart new file mode 100644 index 0000000..b3ea8c2 --- /dev/null +++ b/lib/sessions.g.dart @@ -0,0 +1,35 @@ +/* + * sessions.g.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'sessions.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Session _$SessionFromJson(Map json) { + return Session( + json['token'] as String, + json['deviceID'] as int, + User.fromJson(json['user'] as Map), + ); +} diff --git a/lib/taxonomy_manager.dart b/lib/taxonomy_manager.dart new file mode 100644 index 0000000..dc2d36b --- /dev/null +++ b/lib/taxonomy_manager.dart @@ -0,0 +1,149 @@ +/* + * taxonomy_manager.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; +import 'dart:io'; + +import 'package:ant_nup_tracker/sessions.dart'; +import 'package:ant_nup_tracker/url_manager.dart'; +import 'exceptions.dart'; +import 'package:http/http.dart' as http; + +import 'flights.dart'; + +class TaxonomyManager { + TaxonomyManager._(); + + static final shared = TaxonomyManager._(); + + Map> _speciesStore = {}; + + bool get _isLoaded => _speciesStore.isNotEmpty; + + List get genera { + assert (_isLoaded); + return List.unmodifiable(_speciesStore.keys); + } + + List speciesForGenus(String genus) { + assert (_isLoaded); + assert (_speciesStore.keys.contains(genus)); + return List.unmodifiable(_speciesStore[genus]!); + } + + Future loadSpeciesForGenus(Genus g) async { + final speciesUrl = UrlManager.shared.urlForSpeciesList(g); + final headers = SessionManager.shared.headers; + + try { + final response = await http.get(speciesUrl, headers: headers); + final status = response.statusCode; + + if (status == 401) throw FailedAuthenticationException(); + if (status == 404) throw GenusNotFoundException(g.id); + if (status != 200) throw ReadException(status); + + try { + final results = jsonDecode(response.body) as List; + + final species = + Species.loadSpeciesFromJson(results); + // print("Loaded species $species"); + return; + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + + } on IOException { + throw NoResponseException(); + } + } + + Future loadTaxonomy() async { + final generaUrl = UrlManager.shared.generaUrl; + final headers = SessionManager.shared.headers; + + try { + final response = await http.get(generaUrl, headers: headers); + final status = response.statusCode; + + if (status == 401) throw FailedAuthenticationException(); + if (status != 200) throw ReadException(status); + + try { + final jsonList = jsonDecode(response.body) as List; + final genera = Genus.loadGeneraFromJson(jsonList); + + // print("Loaded genera $genera"); + + for (var genus in genera) { + await loadSpeciesForGenus(genus); + } + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } on IOException { + throw NoResponseException(); + } + } + + Future loadSpecies() async { + final url = UrlManager.shared.loadTaxonomyUrl; + + try { + final response = await http.get(url); + final status = response.statusCode; + + if (status == 401) throw FailedAuthenticationException(); + if (status != 200) throw ReadException(status); + + try { + final Map decodedDict = jsonDecode(response.body); + + final casted = decodedDict + .map((key, value) => MapEntry(key, List.from(value))); + + _speciesStore = casted; + + // print("Species store now has ${_speciesStore.keys.length} genera"); + // print( + // "Species store now has ${_speciesStore.values.fold(0, (int previousValue, element) => previousValue + element.length)} species"); + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } on IOException catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw NoResponseException(); + } + } + + // List getGenera() +} + +Future main() async { + await TaxonomyManager.shared.loadSpecies(); +} diff --git a/lib/url_manager.dart b/lib/url_manager.dart new file mode 100644 index 0000000..60022c1 --- /dev/null +++ b/lib/url_manager.dart @@ -0,0 +1,198 @@ +/* + * url_manager.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:ant_nup_tracker/flights.dart'; + +import 'filtering.dart'; + +/// Singleton class for managing all the URLs in the app. +/// +/// All http requests should involve a URL obtained using +/// the methods in this class. All urls should end with a slash. +/// +/// **Naming Conventions:** +/// - Getters: purposeUrl +/// - Methods: urlForPurpose +class UrlManager { + final Uri _baseUrl; + + /// Private constructor. + /// + /// For custom servers, the [base] defines the url for the server. + UrlManager._(String base) : + _baseUrl = Uri.parse(base); + + static final shared = UrlManager._("https://www.antnuptialflights.com/"); + + final _apiUrl = "api"; + final _loginUrl = "login"; + final _verifyUrl = "verify"; + final _logoutDeviceUrl = "logout"; + final _flightsUrl = "flights"; + final _createUrl = "create"; + final _createAccountUrl = "create-account"; + final _commentsUrl = "comments"; + final _mySpeciesUrl = "my-species"; + final _myGeneraUrl = "my-genera"; + final _historyUrl = "history"; + final _weatherUrl = "weather"; + final _imagesUrl = "images"; + final _usersUrl = "users"; + final _resetPassUrl = "reset-password"; + final _validateUrl = "verify"; + final _loadTaxonomyUrl = "latest-taxonomy"; + final _taxonomyVersionUrl = "taxonomy-version"; + final _generaUrl = "genera"; + final _speciesUrl = "species"; + final _aboutUrl = "about"; + final _privacyUrl = "privacy-policy"; + final _termsUrl = "terms-and-conditions"; + final _emailAddress = "mailto:nuptialtracker@gmail.com"; + + Uri get homeUrl => _baseUrl; + Uri get listUrl => _baseUrl.resolve("$_apiUrl/$_flightsUrl/"); + Uri get filteredListUrl { + // var url = _baseUrl.resolve("$_apiUrl/$_flightsUrl/"); + + final queryParameters = { + "ordering": FilteringManager.shared.ordering + .urlEntry(FilteringManager.shared.direction), + for (var filter in FilteringManager.shared.filters) + ...filter.queryParameters + }; + + final url = listUrl.replace(queryParameters: queryParameters); + + // print(url); + + return url; + } + + Uri get apiUrl => _baseUrl.resolve("$_apiUrl/"); + Uri get createUrl => apiUrl.resolve("$_createUrl/"); + Uri get commentsUrl => apiUrl.resolve("$_commentsUrl/"); + Uri get loginUrl => apiUrl.resolve("$_loginUrl/"); + Uri get verifyUrl => loginUrl.resolve("$_verifyUrl/"); + Uri get logoutUrl => apiUrl.resolve("$_logoutDeviceUrl/"); + Uri get mySpeciesUrl => apiUrl.resolve("$_mySpeciesUrl/"); + Uri get myGeneraUrl => apiUrl.resolve("$_myGeneraUrl/"); + Uri get loadTaxonomyUrl => apiUrl.resolve("$_loadTaxonomyUrl/"); + Uri get taxonomyVersionUrl => apiUrl.resolve("$_taxonomyVersionUrl/"); + Uri get generaUrl => apiUrl.resolve("$_generaUrl/"); + Uri get createAccountUrl => _baseUrl.resolve("$_createAccountUrl/"); + Uri get usersUrl => apiUrl.resolve("$_usersUrl/"); + Uri get passwordResetUrl => _baseUrl.resolve("$_resetPassUrl/"); + Uri get aboutUrl => _baseUrl.resolve("$_aboutUrl/"); + Uri get privacyUrl => _baseUrl.resolve("$_privacyUrl/"); + Uri get termsUrl => _baseUrl.resolve("$_termsUrl/"); + Uri get contactUrl => Uri.parse(_emailAddress); + + Uri urlForFlight(int id) { + return listUrl.resolve("$id/"); + } + + Uri urlForFlightImages(int id) { + return urlForFlight(id).resolve("$_imagesUrl/"); + } + + Uri urlForImage(int flightId, int imageId) { + return urlForFlightImages(flightId).resolve("$imageId/"); + } + + Uri urlForWeather(int id) { + return urlForFlight(id).resolve(_weatherUrl); + } + + Uri urlForComments(int id) { + return urlForFlight(id).resolve("$_commentsUrl/"); + } + + Uri urlForCommentEdit(int id, int commentId) { + return urlForComments(id).resolve("$commentId/"); + } + + Uri urlForHistory(int id) { + return urlForFlight(id).resolve(_historyUrl); + } + + Uri urlForValidate(int id) { + return urlForFlight(id).resolve("$_validateUrl/"); + } + + Uri urlForUser(String username) { + return usersUrl.resolve("$username/"); + } + + Uri urlForGenus(Genus genus) { + return generaUrl.resolve("${genus.id}/"); + } + + Uri urlForSpeciesList(Genus genus) { + return urlForGenus(genus).resolve("$_speciesUrl/"); + } + + // Uri urlForFilteredFlights({Genus? genus, Species? species}) { + // if (species != null) { + // var queryParams = {"genus": species.genus.name, "species": species.name}; + // return listUrl.replace(queryParameters: queryParams); + // } else if (genus != null) { + // var queryParams = {"genus": genus.name}; + // return listUrl.replace(queryParameters: queryParams); + // } + // + // return listUrl; + // } +} + +extension UrlName on ListOrdering { + String urlEntry([SortingDirection direction = SortingDirection.descending]) { + final directionString = direction == SortingDirection.descending ? "-" : ""; + + switch (this) { + case ListOrdering.flightId: + return "${directionString}flightID"; + case ListOrdering.dateOfFlight: + return "${directionString}dateOfFlight"; + case ListOrdering.dateRecorded: + return "${directionString}dateRecorded"; + // case ListOrdering.lastUpdated: + // return "${directionString}lastUpdated"; + case ListOrdering.location: + return "${directionString}location"; + } + } +} + +// void main() { +// var id = 34; +// // var genus = Genus.get("Pheidole"); +// // var species = Species.get(genus, "dentata"); +// +// print(UrlManager.shared.homeUrl); +// print(UrlManager.shared.filteredListUrl); +// +// print(UrlManager.shared.urlForFlight(id)); +// print(UrlManager.shared.urlForWeather(id)); +// +// // print(UrlManager.shared.urlForFilteredFlights(genus: genus)); +// // print(UrlManager.shared.urlForFilteredFlights(species: species)); +// print(UrlManager.shared.urlForHistory(id)); +// print(UrlManager.shared.contactUrl); +// } diff --git a/lib/user.dart b/lib/user.dart new file mode 100644 index 0000000..9fc3c40 --- /dev/null +++ b/lib/user.dart @@ -0,0 +1,81 @@ +/* + * user.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; + +import 'package:ant_nup_tracker/sessions.dart'; +import 'package:ant_nup_tracker/url_manager.dart'; +import 'package:ant_nup_tracker/users.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:http/http.dart' as http; + +import 'exceptions.dart'; + +part 'user.g.dart'; + +@JsonSerializable() +class User { + final String username; + + @JsonKey(name: "professional") + final bool isProfessional; + + @JsonKey(name: "flagged") + final bool isFlagged; + + final String institution; + final String description; + + User( + this.username, + this.isProfessional, + this.isFlagged, + this.institution, + this.description, + ); + + factory User.fromJson(Map json) => _$UserFromJson(json); + Map toJson() => _$UserToJson(this); + + Role get role { + if (isFlagged) return Role.flagged; + if (isProfessional) return Role.professional; + return Role.citizen; + } +} + +Future fetchDetailsForUser(String username) async { + final userUrl = UrlManager.shared.urlForUser(username); + final response = await http.get(userUrl, headers: SessionManager.shared.headers); + + if (response.statusCode == 401) throw FailedAuthenticationException(); + if (response.statusCode != 200) throw GetException(response.statusCode); + + final User user; + + try { + user = User.fromJson(jsonDecode(response.body)); + return user; + } catch (err, stack) { + // print(err); + // print(stack); + throw JsonException(); + } +} diff --git a/lib/user.g.dart b/lib/user.g.dart new file mode 100644 index 0000000..5cde0d9 --- /dev/null +++ b/lib/user.g.dart @@ -0,0 +1,45 @@ +/* + * user.g.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +User _$UserFromJson(Map json) { + return User( + json['username'] as String, + json['professional'] as bool, + json['flagged'] as bool, + json['institution'] as String, + json['description'] as String, + ); +} + +Map _$UserToJson(User instance) => { + 'username': instance.username, + 'professional': instance.isProfessional, + 'flagged': instance.isFlagged, + 'institution': instance.institution, + 'description': instance.description, + }; diff --git a/lib/user_detail_screen.dart b/lib/user_detail_screen.dart new file mode 100644 index 0000000..d53db1a --- /dev/null +++ b/lib/user_detail_screen.dart @@ -0,0 +1,233 @@ +/* + * user_detail_screen.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:ant_nup_tracker/detail_screen.dart'; +import 'package:ant_nup_tracker/user.dart'; +import 'package:ant_nup_tracker/users.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + +class UserDetailScreen extends DetailScreen { + // final String _username; + + const UserDetailScreen(String username, {User? initialValue, Key? key}) + : super(username, initialValue: initialValue, key: key); + + @override + _UserDetailScreenState createState() => _UserDetailScreenState(); +} + +class _UserDetailScreenState extends DetailScreenState { + // final String _username; + + late TextStyle _labelStyle; + // late TextStyle _headerStyle; + late AppLocalizations _appLocalizations; + + _UserDetailScreenState() : super(); + + Widget _buildTextLabelDetailRow({ + required String label, + String? detail, + TextStyle? detailStyle, + }) { + var textStyle = detailStyle ?? _labelStyle.apply(fontWeightDelta: 2); + + return Container( + margin: const EdgeInsets.symmetric(vertical: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Text(label, style: _labelStyle)), + if (detail != null) + Expanded( + child: Text( + detail, + style: textStyle, + textAlign: TextAlign.end, + )), + ], + ), + ); + } + + Widget _buildTextLabelLongDetailRow({ + required String label, + String? detail, + TextStyle? detailStyle, + }) { + var textStyle = detailStyle ?? _labelStyle.apply(fontWeightDelta: 2); + + return Container( + margin: const EdgeInsets.symmetric(vertical: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: const EdgeInsets.only(bottom: 8.0), + child: Row( + children: [ + Expanded(child: Text(label, style: _labelStyle)), + ], + ), + ), + if (detail != null) + Row( + children: [ + Expanded( + child: Text( + detail, + style: textStyle, + textAlign: TextAlign.start, + )), + ], + ), + ], + ), + ); + } + + String getUserRoleString(Role role) { + switch (role) { + case Role.citizen: + return AppLocalizations.of(context)!.citizenUser; + case Role.professional: + return AppLocalizations.of(context)!.professionalUser; + case Role.flagged: + return AppLocalizations.of(context)!.flaggedUser; + } + } + + Widget _buildUserRoleRow({required String label, required Role userRole}) { + var textStyle = _labelStyle.apply(fontWeightDelta: 2); + return Container( + margin: const EdgeInsets.symmetric(vertical: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Text(label, style: _labelStyle)), + Container( + constraints: + BoxConstraints(maxWidth: MediaQuery.of(context).size.width / 2), + child: Row( + children: [ + Expanded( + child: Text( + getUserRoleString(userRole), + style: textStyle, + textAlign: TextAlign.end, + ), + ), + if (userRole == Role.professional) + // const Icon(Icons.verified, color: Colors.green), + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: const Image( + image: + AssetImage("assets/ant_circles/green_ant.png"), + width: 32.0, + ), + ), + if (userRole == Role.flagged) + // const Icon(Icons.warning, color: Colors.red) + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: const Image( + image: + AssetImage("assets/ant_circles/red_ant.png"), + width: 32.0, + ), + ), + ], + ), + ), + ], + ), + ); + } + + @override + Widget buildDetailScreen(User user) { + // final _appLocalizations = AppLocalizations.of(context)!; + // final currentLocale = _appLocalizations.localeName; + + _labelStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontSizeDelta: 4.0); + // _headerStyle = + // Theme.of(context).textTheme.bodyText2!.apply(fontWeightDelta: 2); + + return ListView( + padding: const EdgeInsets.all(8.0), + children: [ + _buildTextLabelDetailRow( + label: _appLocalizations.usernameLabel, detail: user.username), + _buildUserRoleRow( + label: _appLocalizations.userRoleLabel, userRole: user.role), + if (user.institution.isNotEmpty) + _buildTextLabelDetailRow( + label: _appLocalizations.institutionLabel, + detail: user.institution), + if (user.description.isNotEmpty) + _buildTextLabelLongDetailRow( + label: _appLocalizations.userDescriptionLabel, + detail: user.description) + ], + ); + } + + @override + String get appBarHeader => + AppLocalizations.of(context)!.userDetailsAppBarHeader(id); + + @override + void loadDetailFuture(String id, {bool forceReload = false}) { + setState(() { + detailFuture = fetchDetailsForUser(id); + }); + } + + @override + Widget build(BuildContext context) { + _appLocalizations = AppLocalizations.of(context)!; + // final currentLocale = AppLocalizations.of(context)!.localeName; + _labelStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontSizeDelta: 4.0); + // _headerStyle = + // Theme.of(context).textTheme.bodyText2!.apply(fontWeightDelta: 2); + + return super.build(context); + + // return Scaffold( + // appBar: AppBar( + // title: Text(), + // ), + // body: FutureBuilder( + // future: fetchDetailsForUser(_username), + // builder: (BuildContext context, AsyncSnapshot snapshot) { + // if (snapshot.hasData) { + // return _buildUserTable(snapshot.data!); + // } else { + // return CircularProgressIndicator(); + // } + // }, + // ), + // ); + } +} diff --git a/lib/users.dart b/lib/users.dart new file mode 100644 index 0000000..50e6468 --- /dev/null +++ b/lib/users.dart @@ -0,0 +1,32 @@ +/* + * users.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:json_annotation/json_annotation.dart'; + +enum Role { + @JsonValue(0) + citizen, + + @JsonValue(1) + professional, + + @JsonValue(-1) + flagged +} \ No newline at end of file diff --git a/lib/weather.dart b/lib/weather.dart new file mode 100644 index 0000000..6d0b6fa --- /dev/null +++ b/lib/weather.dart @@ -0,0 +1,317 @@ +/* + * weather.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'dart:convert'; +import 'dart:io'; + +import 'package:ant_nup_tracker/exceptions.dart'; +import 'package:ant_nup_tracker/sessions.dart'; +import 'package:ant_nup_tracker/url_manager.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:intl/intl.dart'; +import 'package:lat_lng_to_timezone/lat_lng_to_timezone.dart'; +import 'package:recase/recase.dart'; +import 'package:http/http.dart' as http; +import 'package:timezone/timezone.dart'; + +part 'weather.g.dart'; + +abstract class ConvertibleToWeatherSection { + WeatherSection toWeatherSection(BuildContext context); +} + +@JsonSerializable(explicitToJson: true, createToJson: false) +class Weather { + final int flightID; + final WeatherDescription description; + final WeatherBasic weather; + final WeatherDay day; + final WeatherRain? rain; + final WeatherWind? wind; + final DateTime timeFetched; + + const Weather(this.flightID, this.description, this.weather, this.day, + this.rain, this.wind, this.timeFetched); + + factory Weather.fromJson(Map json, {required double latitude, required double longitude}) { + + final timezone = latLngToTimezoneString(latitude, longitude); + final location = getLocation(timezone); + + return Weather( + json['flightID'] as int, + WeatherDescription.fromJson(json['description'] as Map), + WeatherBasic.fromJson(json['weather'] as Map), + WeatherDay.fromJson(json['day'] as Map, latitude: latitude, longitude: longitude), + json['rain'] == null + ? null + : WeatherRain.fromJson(json['rain'] as Map), + json['wind'] == null + ? null + : WeatherWind.fromJson(json['wind'] as Map), + TZDateTime.parse(location, json['timeFetched'] as String), + ); + } + + WeatherSection _createTimeFetchedSection(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + final locale = appLocalization.localeName; + + final rows = [ + WeatherRow(appLocalization.weatherTimeFetchedLabel, + DateFormat.yMMMd(locale).add_jm().format(timeFetched)) + ]; + + return WeatherSection(appLocalization.weatherTimeFetchedHeader, rows); + } + + List toWeatherSectionList(BuildContext context) { + return [ + description.toWeatherSection(context), + weather.toWeatherSection(context), + day.toWeatherSection(context), + if (rain != null) rain!.toWeatherSection(context), + if (wind != null) wind!.toWeatherSection(context), + _createTimeFetchedSection(context) + ]; + } +} + +@JsonSerializable(createToJson: false) +class WeatherDescription implements ConvertibleToWeatherSection { + @JsonKey(name: "desc") + final String description; + + @JsonKey(name: "longDesc") + final String longDescription; + + const WeatherDescription(this.description, this.longDescription); + + factory WeatherDescription.fromJson(Map json) => + _$WeatherDescriptionFromJson(json); + + @override + WeatherSection toWeatherSection(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + final rows = [ + WeatherRow(appLocalization.weatherDescriptionLabel, description), + WeatherRow(appLocalization.weatherLongDescriptionLabel, + longDescription.sentenceCase), + ]; + + return WeatherSection(appLocalization.weatherDescriptionHeader, rows); + } +} + +@JsonSerializable(createToJson: false) +class WeatherBasic implements ConvertibleToWeatherSection { + final double temperature; + final double pressure; + final double? pressureSea; + final double? pressureGround; + final int humidity; + + @JsonKey(name: "tempMin") + final double? minTemperature; + + @JsonKey(name: "tempMax") + final double? maxTemperature; + final int clouds; + + const WeatherBasic( + this.temperature, + this.pressure, + this.pressureSea, + this.pressureGround, + this.humidity, + this.minTemperature, + this.maxTemperature, + this.clouds, + ); + + factory WeatherBasic.fromJson(Map json) => + _$WeatherBasicFromJson(json); + + @override + WeatherSection toWeatherSection(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + final rows = [ + WeatherRow(appLocalization.weatherTemperatureLabel, + appLocalization.degreesCelsius(temperature)), + WeatherRow(appLocalization.weatherPressureLabel, + appLocalization.hPaPressure(pressure)), + if (pressureSea != null) + WeatherRow(appLocalization.weatherSeaPressureLabel, + appLocalization.hPaPressure(pressureSea!)), + if (pressureGround != null) + WeatherRow(appLocalization.weatherGroundPressureLabel, + appLocalization.hPaPressure(pressureGround!)), + WeatherRow(appLocalization.weatherHumidityLabel, + appLocalization.percent(humidity)), + WeatherRow( + appLocalization.weatherCloudsLabel, appLocalization.percent(clouds)), + if (maxTemperature != null) + WeatherRow(appLocalization.weatherMaxTemperatureLabel, + appLocalization.degreesCelsius(maxTemperature!)), + if (minTemperature != null) + WeatherRow(appLocalization.weatherMinTemperatureLabel, + appLocalization.degreesCelsius(minTemperature!)), + ]; + + return WeatherSection(appLocalization.weatherBasicDescriptionHeader, rows); + } +} + +@JsonSerializable(createToJson: false) +class WeatherDay implements ConvertibleToWeatherSection { + final DateTime sunrise; + final DateTime sunset; + + const WeatherDay(this.sunrise, this.sunset); + + factory WeatherDay.fromJson(Map json, {required double latitude, required double longitude}) { + final timezone = latLngToTimezoneString(latitude, longitude); + final location = getLocation(timezone); + + return WeatherDay( + TZDateTime.parse(location, json['sunrise'] as String), + TZDateTime.parse(location, json['sunset'] as String), + ); + } + + @override + WeatherSection toWeatherSection(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + final locale = appLocalization.localeName; + + final rows = [ + WeatherRow(appLocalization.sunriseLabel, + DateFormat.jm(locale).add_yMMMd().format(sunrise)), + WeatherRow(appLocalization.sunsetLabel, + DateFormat.jm(locale).add_yMMMd().format(sunset)), + ]; + + return WeatherSection(appLocalization.weatherDayHeader, rows); + } +} + +@JsonSerializable(createToJson: false) +class WeatherRain implements ConvertibleToWeatherSection { + @JsonKey(name: "rain1") + final double? rainOneHour; + + @JsonKey(name: "rain3") + final double? rainThreeHours; + + const WeatherRain(this.rainOneHour, this.rainThreeHours); + + factory WeatherRain.fromJson(Map json) => + _$WeatherRainFromJson(json); + + @override + WeatherSection toWeatherSection(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + + final rows = [ + if (rainOneHour != null) + WeatherRow(appLocalization.weatherRainOneHourLabel, + appLocalization.millimetres(rainOneHour!)), + if (rainThreeHours != null) + WeatherRow(appLocalization.weatherRainThreeHoursLabel, + appLocalization.millimetres(rainThreeHours!)), + ]; + + return WeatherSection(appLocalization.weatherRainHeader, rows); + } +} + +@JsonSerializable(createToJson: false) +class WeatherWind implements ConvertibleToWeatherSection { + final double? windSpeed; + + @JsonKey(name: "windDegree") + final int? windDirection; + + const WeatherWind(this.windSpeed, this.windDirection); + + factory WeatherWind.fromJson(Map json) => + _$WeatherWindFromJson(json); + + @override + WeatherSection toWeatherSection(BuildContext context) { + final appLocalization = AppLocalizations.of(context)!; + final rows = [ + if (windSpeed != null) + WeatherRow( + appLocalization.windSpeedLabel, + appLocalization.windSpeedDetail(windSpeed!), + ), + if (windDirection != null) + WeatherRow( + appLocalization.windDirectionLabel, + appLocalization.windDirectionDetail(windDirection!), + ) + ]; + + return WeatherSection(appLocalization.weatherWindSectionHeader, rows); + } +} + +Future fetchWeather(int id, {required double latitude, required double longitude}) async { + if (id < 0) throw InvalidIdException(); + + final weatherUrl = UrlManager.shared.urlForWeather(id); + + try { + final response = await http.get(weatherUrl, headers: SessionManager.shared.headers); + final status = response.statusCode; + + if (status == 401) throw FailedAuthenticationException(); + if (status == 404) throw NoWeatherException(id); + + if (status != 200) throw ReadException(status); + + try { + return Weather.fromJson(jsonDecode(response.body), latitude: latitude, longitude: longitude); + } catch (err, stacktrace) { + // print(err); + // print(stacktrace); + throw JsonException(); + } + } on IOException { + throw NoResponseException(); + } +} + +class WeatherRow { + final String header; + final String detail; + + const WeatherRow(this.header, this.detail); +} + +class WeatherSection { + final String header; + final List rows; + + const WeatherSection(this.header, this.rows); +} diff --git a/lib/weather.g.dart b/lib/weather.g.dart new file mode 100644 index 0000000..b7cb516 --- /dev/null +++ b/lib/weather.g.dart @@ -0,0 +1,84 @@ +/* + * weather.g.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'weather.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +// Weather _$WeatherFromJson(Map json) { +// return Weather( +// json['flightID'] as int, +// WeatherDescription.fromJson(json['description'] as Map), +// WeatherBasic.fromJson(json['weather'] as Map), +// WeatherDay.fromJson(json['day'] as Map), +// json['rain'] == null +// ? null +// : WeatherRain.fromJson(json['rain'] as Map), +// json['wind'] == null +// ? null +// : WeatherWind.fromJson(json['wind'] as Map), +// DateTime.parse(json['timeFetched'] as String), +// ); +// } + +WeatherDescription _$WeatherDescriptionFromJson(Map json) { + return WeatherDescription( + json['desc'] as String, + json['longDesc'] as String, + ); +} + +WeatherBasic _$WeatherBasicFromJson(Map json) { + return WeatherBasic( + (json['temperature'] as num).toDouble(), + (json['pressure'] as num).toDouble(), + (json['pressureSea'] as num?)?.toDouble(), + (json['pressureGround'] as num?)?.toDouble(), + json['humidity'] as int, + (json['tempMin'] as num?)?.toDouble(), + (json['tempMax'] as num?)?.toDouble(), + json['clouds'] as int, + ); +} + +// WeatherDay _$WeatherDayFromJson(Map json) { +// return WeatherDay( +// DateTime.parse(json['sunrise'] as String), +// DateTime.parse(json['sunset'] as String), +// ); +// } + +WeatherRain _$WeatherRainFromJson(Map json) { + return WeatherRain( + (json['rain1'] as num?)?.toDouble(), + (json['rain3'] as num?)?.toDouble(), + ); +} + +WeatherWind _$WeatherWindFromJson(Map json) { + return WeatherWind( + (json['windSpeed'] as num?)?.toDouble(), + json['windDegree'] as int?, + ); +} diff --git a/lib/weather_detail_screen.dart b/lib/weather_detail_screen.dart new file mode 100644 index 0000000..65b5297 --- /dev/null +++ b/lib/weather_detail_screen.dart @@ -0,0 +1,177 @@ +/* + * weather_detail_screen.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:ant_nup_tracker/detail_screen.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + +import 'common_ui_elements.dart'; +import 'flights.dart'; +import 'weather.dart'; + +class WeatherDetailScreen extends DetailScreen { + const WeatherDetailScreen(int id, + {required this.flight, Weather? initialValue, Key? key}) + : super(id, initialValue: initialValue, key: key); + + final Flight flight; + + @override + _WeatherDetailScreenState createState() => _WeatherDetailScreenState(); +} + +class _WeatherDetailScreenState extends DetailScreenState { + _WeatherDetailScreenState() : super(); + + late TextStyle _labelStyle; + late TextStyle _headerStyle; + late TextStyle _textStyle; + final _widgets = []; + + @override + Widget buildDetailScreen(Weather weather) { + // final appLocalization = AppLocalizations.of(context)!; + final weatherSections = weather.toWeatherSectionList(context); + final weatherWidgets = weatherSections.map((section) { + final rowsForSection = []; + rowsForSection.add(HeaderRow(label: section.header)); + rowsForSection.addAll(section.rows.map((row) => + _buildTextLabelDetailRow(label: row.header, detail: row.detail))); + return rowsForSection; + }); + + _widgets.clear(); + + for (final section in weatherWidgets) { + _widgets.addAll(section); + } + + _widgets.add(_buildCreditRow( + label: AppLocalizations.of(context)!.creditsToOpenWeatherMap)); + + // return Text( + // "Weather Goes Here", + // style: Theme.of(context).textTheme.headline2, + // ); + return ListView.builder( + itemBuilder: (_, i) => _widgets[i], + itemCount: _widgets.length, + padding: const EdgeInsets.all(8.0), + ); + } + + @override + String get appBarHeader { + final appLocalization = AppLocalizations.of(context)!; + return appLocalization.flightWeatherAppBarHeader(id); + } + + @override + void loadDetailFuture(int id, {bool forceReload = false}) { + setState(() { + detailFuture = fetchWeather( + id, + latitude: (widget as WeatherDetailScreen).flight.latitude, + longitude: (widget as WeatherDetailScreen).flight.longitude, + ); + }); + } + + @override + Widget build(BuildContext context) { + _labelStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontSizeDelta: 4.0); + _headerStyle = + Theme.of(context).textTheme.bodyText2!.apply(fontWeightDelta: 2); + _textStyle = _labelStyle.apply(fontWeightDelta: 2); + return super.build(context); + } + + // Widget _buildHeaderRow({required String label}) { + // return Column( + // children: [ + // const Divider( + // thickness: 2, + // ), + // Padding( + // padding: const EdgeInsets.only(top: 8.0), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Expanded(child: Text(label, style: _headerStyle)), + // ], + // ), + // ), + // const Divider( + // thickness: 2, + // ) + // ], + // ); + // } + + Widget _buildTextLabelDetailRow({ + required String label, + required String detail, + }) { + return Container( + margin: const EdgeInsets.symmetric(vertical: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Text(label, style: _labelStyle)), + Expanded( + child: Text( + detail, + style: _textStyle, + textAlign: TextAlign.end, + )), + ], + ), + ); + } + + Widget _buildCreditRow({required String label}) { + return Column( + children: [ + const Divider( + thickness: 2, + ), + Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + label, + style: _headerStyle, + textAlign: TextAlign.center, + ), + ), + ], + ), + ), + const Divider( + thickness: 2, + ) + ], + ); + } +} diff --git a/lib/welcome_screen.dart b/lib/welcome_screen.dart new file mode 100644 index 0000000..23dc4ef --- /dev/null +++ b/lib/welcome_screen.dart @@ -0,0 +1,197 @@ +/* + * welcome_screen.dart + * Copyright (c) 2020-2022, Abouheif Lab. + * + * AntNupTracker, mobile app for recording and managing ant nuptial flight data + * + * 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 . + */ + +import 'package:ant_nup_tracker/first_time_screen.dart'; +import 'package:ant_nup_tracker/launch_url.dart'; +import 'package:ant_nup_tracker/url_manager.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'dark_mode_theme_ext.dart'; + +class WelcomeScreen extends StatelessWidget { + const WelcomeScreen({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final appLocalizations = AppLocalizations.of(context)!; + return Scaffold( + appBar: AppBar(), + body: SafeArea( + child: ListView( + padding: const EdgeInsets.all(16.0), + children: [ + Text( + appLocalizations.welcomeHeader, + style: Theme.of(context).textTheme.headline5, + textAlign: TextAlign.center, + ), + Image( + image: Theme.of(context).isDarkMode ? const AssetImage("assets/cartoon_ant/dark/cartoon_ant.png") : const AssetImage("assets/cartoon_ant/cartoon_ant.png"), + height: 200, + matchTextDirection: true, + ), + ElevatedButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(appLocalizations.viewFlightList), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image( + image: + const AssetImage("assets/ant_circles/white_ant.png"), + color: Theme.of(context).textTheme.headline6!.color, + colorBlendMode: BlendMode.srcATop, + ), + ), + Expanded( + child: Text( + appLocalizations.welcomeBullet1, + style: Theme.of(context).textTheme.headline6, + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image( + image: + const AssetImage("assets/ant_circles/white_ant.png"), + color: Theme.of(context).textTheme.headline6!.color, + colorBlendMode: BlendMode.srcATop, + ), + ), + Expanded( + child: Text( + appLocalizations.welcomeBullet2, + style: Theme.of(context).textTheme.headline6, + )), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image( + image: + const AssetImage("assets/ant_circles/white_ant.png"), + color: Theme.of(context).textTheme.headline6!.color, + colorBlendMode: BlendMode.srcATop, + ), + ), + Expanded( + child: Text( + appLocalizations.welcomeBullet3, + style: Theme.of(context).textTheme.headline6, + )), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(4.0), + child: Text( + appLocalizations.welcomeBodyText, + style: Theme.of(context).textTheme.headline5, + textAlign: TextAlign.center, + ), + ), + const SizedBox( + height: 32, + ), + Padding( + padding: const EdgeInsets.all(4.0), + child: Text( + appLocalizations.welcomeBottomText, + style: Theme.of(context).textTheme.headline5, + textAlign: TextAlign.center, + ), + ), + ElevatedButton.icon( + onPressed: () async { + final urlString = UrlManager.shared.aboutUrl.toString(); + await launchUrl(urlString); + }, + label: Text(appLocalizations.moreAboutUs), + icon: const Icon(Icons.open_in_new), + ), + ElevatedButton.icon( + onPressed: () async { + final urlString = UrlManager.shared.privacyUrl.toString(); + await launchUrl(urlString); + }, + label: Text(appLocalizations.privacyPolicy), + icon: const Icon(Icons.open_in_new), + ), + ElevatedButton( + onPressed: () { + // Navigator.of(context).push(MaterialPageRoute( + // builder: (context) => const PackagesScreen(), + // )); + showLicensePage(context: context, applicationLegalese: appLocalizations.applicationLegalese, applicationIcon: Image( + image: Theme.of(context).isDarkMode ? const AssetImage("assets/cartoon_ant/dark/cartoon_ant.png") : const AssetImage("assets/cartoon_ant/cartoon_ant.png"), + height: 80, + matchTextDirection: true, + )); + }, + child: Text(appLocalizations.packagesInfo), + ) + ], + ), + ), + ); + } +} + +Future showWelcomeScreen(BuildContext context) async { + final prefs = await SharedPreferences.getInstance(); + + // prefs.remove('hasLoadedWelcome'); + // print("Preparing to show welcome screen."); + + if (!(prefs.getBool("hasLoadedWelcome") ?? false)) { + // await Navigator.of(context).push(MaterialPageRoute( + // fullscreenDialog: true, builder: (_) => const WelcomeScreen())); + + await Navigator.of(context).push(MaterialPageRoute( + fullscreenDialog: true, builder: (_) => const FirstTimeScreen())); + + prefs.setBool("hasLoadedWelcome", true); + } +} + +Future resetWelcomeScreen({bool shouldReset = true}) async { + if (!shouldReset) return; + + final prefs = await SharedPreferences.getInstance(); + + prefs.setBool('hasLoadedWelcome', false); +} diff --git a/linux/.gitignore b/linux/.gitignore new file mode 100644 index 0000000..d3896c9 --- /dev/null +++ b/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt new file mode 100644 index 0000000..c37331e --- /dev/null +++ b/linux/CMakeLists.txt @@ -0,0 +1,106 @@ +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +set(BINARY_NAME "ant_nup_tracker") +set(APPLICATION_ID "com.bzrudski.ant_nup_tracker") + +cmake_policy(SET CMP0063 NEW) + +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Configure build options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") + +# Flutter library and tool build rules. +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Application build +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) +apply_standard_settings(${BINARY_NAME}) +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +add_dependencies(${BINARY_NAME} flutter_assemble) +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/linux/flutter/CMakeLists.txt b/linux/flutter/CMakeLists.txt new file mode 100644 index 0000000..a1da1b9 --- /dev/null +++ b/linux/flutter/CMakeLists.txt @@ -0,0 +1,91 @@ +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) +pkg_check_modules(BLKID REQUIRED IMPORTED_TARGET blkid) +pkg_check_modules(LZMA REQUIRED IMPORTED_TARGET liblzma) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO + PkgConfig::BLKID + PkgConfig::LZMA +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + linux-x64 ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..80f0c37 --- /dev/null +++ b/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,19 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) flutter_secure_storage_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStoragePlugin"); + flutter_secure_storage_plugin_register_with_registrar(flutter_secure_storage_registrar); + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); +} diff --git a/linux/flutter/generated_plugin_registrant.h b/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..332d017 --- /dev/null +++ b/linux/flutter/generated_plugins.cmake @@ -0,0 +1,17 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + flutter_secure_storage + url_launcher_linux +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) diff --git a/linux/main.cc b/linux/main.cc new file mode 100644 index 0000000..e7c5c54 --- /dev/null +++ b/linux/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/linux/my_application.cc b/linux/my_application.cc new file mode 100644 index 0000000..3293623 --- /dev/null +++ b/linux/my_application.cc @@ -0,0 +1,104 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen *screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "ant_nup_tracker"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } + else { + gtk_window_set_title(window, "ant_nup_tracker"); + } + + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, gchar ***arguments, int *exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject *object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, + nullptr)); +} diff --git a/linux/my_application.h b/linux/my_application.h new file mode 100644 index 0000000..72271d5 --- /dev/null +++ b/linux/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/macos/.gitignore b/macos/.gitignore new file mode 100644 index 0000000..6c9fda8 --- /dev/null +++ b/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/xcuserdata/ +/Runner/Assets.xcassets/AppIcon.appiconset/ diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..4b81f9b --- /dev/null +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..5caa9d1 --- /dev/null +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..c4a86d9 --- /dev/null +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,24 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import firebase_core +import firebase_messaging +import location +import path_provider_macos +import shared_preferences_macos +import sqflite +import url_launcher_macos + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) + FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) + LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) + SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) +} diff --git a/macos/Podfile b/macos/Podfile new file mode 100644 index 0000000..dade8df --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,40 @@ +platform :osx, '10.11' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/macos/Podfile.lock b/macos/Podfile.lock new file mode 100644 index 0000000..495a30d --- /dev/null +++ b/macos/Podfile.lock @@ -0,0 +1,16 @@ +PODS: + - FlutterMacOS (1.0.0) + +DEPENDENCIES: + - FlutterMacOS (from `Flutter/ephemeral`) + +EXTERNAL SOURCES: + FlutterMacOS: + :path: Flutter/ephemeral + +SPEC CHECKSUMS: + FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 + +PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c + +COCOAPODS: 1.10.1 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5ea4cc1 --- /dev/null +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,614 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + B638C5DE1D97DE0BB76E3D4C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7229E754AD40FCF339A73F5F /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0BB9AC0CE64254A3EEB5A3C5 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* ant_nup_tracker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ant_nup_tracker.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 560904274D9C1E51938B0768 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 7229E754AD40FCF339A73F5F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + DB4DF2FF4A917F13B0748C82 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B638C5DE1D97DE0BB76E3D4C /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 21D54558DEB5EECBE2124A0D /* Pods */ = { + isa = PBXGroup; + children = ( + 560904274D9C1E51938B0768 /* Pods-Runner.debug.xcconfig */, + DB4DF2FF4A917F13B0748C82 /* Pods-Runner.release.xcconfig */, + 0BB9AC0CE64254A3EEB5A3C5 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 21D54558DEB5EECBE2124A0D /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* ant_nup_tracker.app */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7229E754AD40FCF339A73F5F /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 7B38794EC435685247CD15C1 /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* ant_nup_tracker.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + 7B38794EC435685247CD15C1 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + 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_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + 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_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + 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_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + 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_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + 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_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + 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_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..2857ffd --- /dev/null +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner/AppDelegate.swift b/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..d53ef64 --- /dev/null +++ b/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/macos/Runner/Base.lproj/MainMenu.xib b/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..537341a --- /dev/null +++ b/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..e3c759c --- /dev/null +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = ant_nup_tracker + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.bzrudski.antNupTracker + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2021 com.bzrudski. All rights reserved. diff --git a/macos/Runner/Configs/Debug.xcconfig b/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..36b0fd9 --- /dev/null +++ b/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Release.xcconfig b/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..dff4f49 --- /dev/null +++ b/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Warnings.xcconfig b/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..42bcbf4 --- /dev/null +++ b/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..c946719 --- /dev/null +++ b/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,14 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + com.apple.security.network.client + + + diff --git a/macos/Runner/Info.plist b/macos/Runner/Info.plist new file mode 100644 index 0000000..af75a3b --- /dev/null +++ b/macos/Runner/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + 192.168.2.31 + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + + + + + diff --git a/macos/Runner/MainFlutterWindow.swift b/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..2722837 --- /dev/null +++ b/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController.init() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..cfd71fb --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,1074 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "22.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.2" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.1" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.11" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.2" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: "direct main" + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.4.0" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.0" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "4.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: "3.0.2" + cross_file: + dependency: transitive + description: + name: cross_file + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3+1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + dart_pubspec_licenses: + dependency: transitive + description: + name: dart_pubspec_licenses + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + 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.2.1" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "1.19.2" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.4.3" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + url: "https://pub.dartlang.org" + source: hosted + version: "11.4.4" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.5.4" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.4" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + url: "https://pub.dartlang.org" + source: hosted + version: "3.3.0" + flutter_image_compress: + dependency: "direct main" + description: + name: flutter_image_compress + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + flutter_lints: + dependency: "direct main" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_oss_licenses: + dependency: "direct main" + description: + name: flutter_oss_licenses + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0+1" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" + flutter_secure_storage: + dependency: "direct main" + description: + name: flutter_secure_storage + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.1" + 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" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + gallery_saver: + dependency: "direct main" + description: + name: gallery_saver + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.2" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + google_maps: + dependency: transitive + description: + name: google_maps + url: "https://pub.dartlang.org" + source: hosted + version: "6.2.0" + google_maps_flutter: + dependency: "direct main" + description: + name: google_maps_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.8" + google_maps_flutter_platform_interface: + dependency: transitive + description: + name: google_maps_flutter_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + google_maps_flutter_web: + dependency: "direct main" + description: + name: google_maps_flutter_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.15.0" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.4" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + image_picker: + dependency: "direct main" + description: + name: image_picker + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.5+3" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.5+1" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.8" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.5+6" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + js_wrapping: + dependency: transitive + description: + name: js_wrapping + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.4" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.4" + lat_lng_to_timezone: + dependency: "direct main" + description: + name: lat_lng_to_timezone + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + latlong2: + dependency: "direct main" + description: + name: latlong2 + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.1" + lints: + dependency: "direct main" + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + location: + dependency: "direct main" + description: + name: location + url: "https://pub.dartlang.org" + source: hosted + version: "4.4.0" + location_platform_interface: + dependency: transitive + description: + name: location_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + location_web: + dependency: transitive + description: + name: location_web + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + mime: + dependency: "direct main" + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + octo_image: + dependency: transitive + description: + name: octo_image + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + path: + dependency: "direct main" + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + path_provider: + dependency: "direct main" + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.14" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.7" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + url: "https://pub.dartlang.org" + source: hosted + version: "9.2.0" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + url: "https://pub.dartlang.org" + source: hosted + version: "9.0.2+1" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + url: "https://pub.dartlang.org" + source: hosted + version: "9.0.4" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.7.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.4" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + recase: + dependency: "direct main" + description: + name: recase + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + rxdart: + dependency: transitive + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.27.5" + sanitize_html: + dependency: transitive + description: + name: sanitize_html + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + scrollable_positioned_list: + dependency: "direct main" + description: + name: scrollable_positioned_list + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.3" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.15" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.12" + shared_preferences_ios: + dependency: transitive + description: + name: shared_preferences_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + sqflite: + dependency: "direct main" + description: + name: sqflite + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2+1" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1+1" + 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" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0+2" + 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.4.8" + timezone: + dependency: "direct main" + description: + name: timezone + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.0" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + tuple: + dependency: "direct main" + description: + name: tuple + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.5" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.17" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.17" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.12" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.6" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.2" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+1" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" +sdks: + dart: ">=2.16.0 <3.0.0" + flutter: ">=2.10.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..ee49384 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,170 @@ +name: ant_nup_tracker +description: Citizen science tool for recording ant nuptial flights. + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 2.0.0+6 + +environment: + sdk: ">=2.12.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_localizations: + sdk: flutter + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + json_annotation: ^4.0.1 + http: ^0.13.3 + built_value: ^8.0.6 + intl: ^0.17.0 + latlong2: ^0.8.0 + recase: ^4.0.0 + image_picker: ^0.8.2 + tuple: ^2.0.0 +# flutter_map: ^0.13.1 + url_launcher: ^6.0.9 + google_maps_flutter: ^2.0.6 + google_maps_flutter_web: ^0.3.0+2 + location: ^4.3.0 + path: ^1.8.0 + mime: ^1.0.0 + lints: ^1.0.1 + flutter_lints: ^1.0.4 + cached_network_image: ^3.1.0 + scrollable_positioned_list: ^0.2.0-nullsafety.0 + firebase_core: ^1.10.0 + firebase_messaging: ^11.1.0 + shared_preferences: ^2.0.6 + flutter_secure_storage: ^4.2.1 + sqflite: ^2.0.0+4 + flutter_image_compress: ^1.1.0 + timezone: ^0.8.0 + lat_lng_to_timezone: ^0.2.0 + path_provider: ^2.0.8 + permission_handler: ^9.2.0 + flutter_oss_licenses: ^2.0.0+1 + gallery_saver: ^2.3.2 + google_fonts: ^3.0.0 + + +dev_dependencies: + flutter_test: + sdk: flutter + + json_serializable: ^4.1.1 + build_runner: ^2.0.3 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + generate: true + +# To add assets to your application, add an assets section, like this: + assets: + - assets/cartoon_ant/ + - assets/ant_circles/ + - fonts/Dosis/OFL.txt + - fonts/Open_Sans/LICENSE.txt +# - images/a_dot_burr.jpeg +# - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + fonts: + - family: Dosis + fonts: + - asset: fonts/Dosis/static/Dosis-Regular.ttf + - asset: fonts/Dosis/static/Dosis-ExtraLight.ttf + weight: 200 + - asset: fonts/Dosis/static/Dosis-Light.ttf + weight: 300 + - asset: fonts/Dosis/static/Dosis-Medium.ttf + weight: 500 + - asset: fonts/Dosis/static/Dosis-SemiBold.ttf + weight: 600 + - asset: fonts/Dosis/static/Dosis-Bold.ttf + weight: 700 + - asset: fonts/Dosis/static/Dosis-ExtraBold.ttf + weight: 800 + - family: Open_Sans + fonts: + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-Regular.ttf + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-Bold.ttf + weight: 700 + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-BoldItalic.ttf + weight: 700 + style: italic + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-ExtraBold.ttf + weight: 800 + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-ExtraBoldItalic.ttf + weight: 800 + style: italic + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-Italic.ttf + style: italic + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-Light.ttf + weight: 300 + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-LightItalic.ttf + weight: 300 + style: italic + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-Medium.ttf + weight: 500 + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-MediumItalic.ttf + weight: 500 + style: italic + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-SemiBold.ttf + weight: 600 + - asset: fonts/Open_Sans/static/OpenSans/OpenSans-SemiBoldItalic.ttf + weight: 600 + style: italic + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages +flutter_intl: + enabled: false +# class_name: AppLocalizations +# main_locale: en diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..b5c62ea --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:ant_nup_tracker/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const AntNupTrackerApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/untranslated_messages.txt b/untranslated_messages.txt new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/untranslated_messages.txt @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..a4af015 --- /dev/null +++ b/web/index.html @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + ant_nup_tracker + + + + + + + + diff --git a/web/manifest.json b/web/manifest.json new file mode 100644 index 0000000..36da118 --- /dev/null +++ b/web/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "ant_nup_tracker", + "short_name": "ant_nup_tracker", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/windows/.gitignore b/windows/.gitignore new file mode 100644 index 0000000..d492d0d --- /dev/null +++ b/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt new file mode 100644 index 0000000..176b224 --- /dev/null +++ b/windows/CMakeLists.txt @@ -0,0 +1,95 @@ +cmake_minimum_required(VERSION 3.15) +project(ant_nup_tracker LANGUAGES CXX) + +set(BINARY_NAME "ant_nup_tracker") + +cmake_policy(SET CMP0063 NEW) + +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Configure build options. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() + +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") + +# Flutter library and tool build rules. +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build +add_subdirectory("runner") + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/windows/flutter/CMakeLists.txt b/windows/flutter/CMakeLists.txt new file mode 100644 index 0000000..b02c548 --- /dev/null +++ b/windows/flutter/CMakeLists.txt @@ -0,0 +1,103 @@ +cmake_minimum_required(VERSION 3.15) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + windows-x64 $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..a0d0bbe --- /dev/null +++ b/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,17 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + PermissionHandlerWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); +} diff --git a/windows/flutter/generated_plugin_registrant.h b/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..ca38d21 --- /dev/null +++ b/windows/flutter/generated_plugins.cmake @@ -0,0 +1,17 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + permission_handler_windows + url_launcher_windows +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) diff --git a/windows/runner/CMakeLists.txt b/windows/runner/CMakeLists.txt new file mode 100644 index 0000000..977e38b --- /dev/null +++ b/windows/runner/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.15) +project(runner LANGUAGES CXX) + +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "run_loop.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) +apply_standard_settings(${BINARY_NAME}) +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc new file mode 100644 index 0000000..5bf8452 --- /dev/null +++ b/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#ifdef FLUTTER_BUILD_NUMBER +#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER +#else +#define VERSION_AS_NUMBER 1,0,0 +#endif + +#ifdef FLUTTER_BUILD_NAME +#define VERSION_AS_STRING #FLUTTER_BUILD_NAME +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.bzrudski" "\0" + VALUE "FileDescription", "A new Flutter project." "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "ant_nup_tracker" "\0" + VALUE "LegalCopyright", "Copyright (C) 2021 com.bzrudski. All rights reserved." "\0" + VALUE "OriginalFilename", "ant_nup_tracker.exe" "\0" + VALUE "ProductName", "ant_nup_tracker" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/windows/runner/flutter_window.cpp b/windows/runner/flutter_window.cpp new file mode 100644 index 0000000..c422723 --- /dev/null +++ b/windows/runner/flutter_window.cpp @@ -0,0 +1,64 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(RunLoop* run_loop, + const flutter::DartProject& project) + : run_loop_(run_loop), project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + run_loop_->RegisterFlutterInstance(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + run_loop_->UnregisterFlutterInstance(flutter_controller_->engine()); + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opporutunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/windows/runner/flutter_window.h b/windows/runner/flutter_window.h new file mode 100644 index 0000000..b663ddd --- /dev/null +++ b/windows/runner/flutter_window.h @@ -0,0 +1,39 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "run_loop.h" +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow driven by the |run_loop|, hosting a + // Flutter view running |project|. + explicit FlutterWindow(RunLoop* run_loop, + const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The run loop driving events for this window. + RunLoop* run_loop_; + + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp new file mode 100644 index 0000000..7dc1784 --- /dev/null +++ b/windows/runner/main.cpp @@ -0,0 +1,42 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "run_loop.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + RunLoop run_loop; + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(&run_loop, project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.CreateAndShow(L"ant_nup_tracker", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + run_loop.Run(); + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/windows/runner/resource.h b/windows/runner/resource.h new file mode 100644 index 0000000..66a65d1 --- /dev/null +++ b/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/windows/runner/run_loop.cpp b/windows/runner/run_loop.cpp new file mode 100644 index 0000000..2d6636a --- /dev/null +++ b/windows/runner/run_loop.cpp @@ -0,0 +1,66 @@ +#include "run_loop.h" + +#include + +#include + +RunLoop::RunLoop() {} + +RunLoop::~RunLoop() {} + +void RunLoop::Run() { + bool keep_running = true; + TimePoint next_flutter_event_time = TimePoint::clock::now(); + while (keep_running) { + std::chrono::nanoseconds wait_duration = + std::max(std::chrono::nanoseconds(0), + next_flutter_event_time - TimePoint::clock::now()); + ::MsgWaitForMultipleObjects( + 0, nullptr, FALSE, static_cast(wait_duration.count() / 1000), + QS_ALLINPUT); + bool processed_events = false; + MSG message; + // All pending Windows messages must be processed; MsgWaitForMultipleObjects + // won't return again for items left in the queue after PeekMessage. + while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { + processed_events = true; + if (message.message == WM_QUIT) { + keep_running = false; + break; + } + ::TranslateMessage(&message); + ::DispatchMessage(&message); + // Allow Flutter to process messages each time a Windows message is + // processed, to prevent starvation. + next_flutter_event_time = + std::min(next_flutter_event_time, ProcessFlutterMessages()); + } + // If the PeekMessage loop didn't run, process Flutter messages. + if (!processed_events) { + next_flutter_event_time = + std::min(next_flutter_event_time, ProcessFlutterMessages()); + } + } +} + +void RunLoop::RegisterFlutterInstance( + flutter::FlutterEngine* flutter_instance) { + flutter_instances_.insert(flutter_instance); +} + +void RunLoop::UnregisterFlutterInstance( + flutter::FlutterEngine* flutter_instance) { + flutter_instances_.erase(flutter_instance); +} + +RunLoop::TimePoint RunLoop::ProcessFlutterMessages() { + TimePoint next_event_time = TimePoint::max(); + for (auto instance : flutter_instances_) { + std::chrono::nanoseconds wait_duration = instance->ProcessMessages(); + if (wait_duration != std::chrono::nanoseconds::max()) { + next_event_time = + std::min(next_event_time, TimePoint::clock::now() + wait_duration); + } + } + return next_event_time; +} diff --git a/windows/runner/run_loop.h b/windows/runner/run_loop.h new file mode 100644 index 0000000..000d362 --- /dev/null +++ b/windows/runner/run_loop.h @@ -0,0 +1,40 @@ +#ifndef RUNNER_RUN_LOOP_H_ +#define RUNNER_RUN_LOOP_H_ + +#include + +#include +#include + +// A runloop that will service events for Flutter instances as well +// as native messages. +class RunLoop { + public: + RunLoop(); + ~RunLoop(); + + // Prevent copying + RunLoop(RunLoop const&) = delete; + RunLoop& operator=(RunLoop const&) = delete; + + // Runs the run loop until the application quits. + void Run(); + + // Registers the given Flutter instance for event servicing. + void RegisterFlutterInstance( + flutter::FlutterEngine* flutter_instance); + + // Unregisters the given Flutter instance from event servicing. + void UnregisterFlutterInstance( + flutter::FlutterEngine* flutter_instance); + + private: + using TimePoint = std::chrono::steady_clock::time_point; + + // Processes all currently pending messages for registered Flutter instances. + TimePoint ProcessFlutterMessages(); + + std::set flutter_instances_; +}; + +#endif // RUNNER_RUN_LOOP_H_ diff --git a/windows/runner/runner.exe.manifest b/windows/runner/runner.exe.manifest new file mode 100644 index 0000000..c977c4a --- /dev/null +++ b/windows/runner/runner.exe.manifest @@ -0,0 +1,20 @@ + + + + + PerMonitorV2 + + + + + + + + + + + + + + + diff --git a/windows/runner/utils.cpp b/windows/runner/utils.cpp new file mode 100644 index 0000000..d19bdbb --- /dev/null +++ b/windows/runner/utils.cpp @@ -0,0 +1,64 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr); + if (target_length == 0) { + return std::string(); + } + std::string utf8_string; + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, utf8_string.data(), + target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/windows/runner/utils.h b/windows/runner/utils.h new file mode 100644 index 0000000..3879d54 --- /dev/null +++ b/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/windows/runner/win32_window.cpp b/windows/runner/win32_window.cpp new file mode 100644 index 0000000..c10f08d --- /dev/null +++ b/windows/runner/win32_window.cpp @@ -0,0 +1,245 @@ +#include "win32_window.h" + +#include + +#include "resource.h" + +namespace { + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + FreeLibrary(user32_module); + } +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::CreateAndShow(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + return OnCreate(); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} diff --git a/windows/runner/win32_window.h b/windows/runner/win32_window.h new file mode 100644 index 0000000..17ba431 --- /dev/null +++ b/windows/runner/win32_window.h @@ -0,0 +1,98 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates and shows a win32 window with |title| and position and size using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size to will treat the width height passed in to this function + // as logical pixels and scale to appropriate for the default monitor. Returns + // true if the window was created successfully. + bool CreateAndShow(const std::wstring& title, + const Point& origin, + const Size& size); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responsponds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_