├── .gitignore ├── LICENSE ├── README.md ├── android.iml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ ├── com │ │ │ └── yourcompany │ │ │ │ └── lime_flutter │ │ │ │ └── MainActivity.java │ │ └── io │ │ │ └── flutter │ │ │ └── plugins │ │ │ └── GeneratedPluginRegistrant.java │ │ └── res │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ └── mipmap-xxxhdpi │ │ └── ic_launcher.png ├── build.gradle ├── gradle.properties └── settings.gradle ├── flutter_01.png ├── fonts └── materialdesignicons-webfont.ttf ├── img ├── fire.png ├── fire.svg ├── font_black.png └── ghost_like_white.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── GeneratedPluginRegistrant.h │ ├── GeneratedPluginRegistrant.m │ ├── Info.plist │ └── main.m ├── lib ├── lime │ ├── api.dart │ ├── lime.dart │ └── model.dart ├── main.dart ├── misc │ ├── functions.dart │ ├── notifications.dart │ ├── site.dart │ └── utils.dart └── widgets │ ├── DismissibleWrapper.dart │ ├── circular_clip.dart │ ├── common.dart │ ├── community.dart │ ├── feed.dart │ ├── frosted_glas.dart │ ├── loading_list_view.dart │ ├── page_post.dart │ ├── post.dart │ ├── post_create.dart │ └── trends.dart ├── lime.iml └── pubspec.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .idea 4 | .packages 5 | .pub/ 6 | build/ 7 | ios/.generated/ 8 | packages 9 | pubspec.lock 10 | .flutter-plugins 11 | ### Dart template 12 | # See https://www.dartlang.org/tools/private-files.html 13 | 14 | # Files and directories created by pub 15 | 16 | # SDK 1.20 and later (no longer creates packages directories) 17 | 18 | # Older SDK versions 19 | # (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20) 20 | .project 21 | .buildlog 22 | **/packages/ 23 | 24 | 25 | # Files created by dart2js 26 | # (Most Dart developers will use pub build to compile Dart, use/modify these 27 | # rules if you intend to use dart2js directly 28 | # Convention is to use extension '.dart.js' for Dart compiled to Javascript to 29 | # differentiate from explicit Javascript files) 30 | *.dart.js 31 | *.part.js 32 | *.js.deps 33 | *.js.map 34 | *.info.json 35 | 36 | # Directory created by dartdoc 37 | doc/api/ 38 | 39 | # Don't commit pubspec lock file 40 | # (Library packages only! Remove pattern if developing an application package) 41 | ### JetBrains template 42 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 43 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 44 | 45 | # User-specific stuff: 46 | .idea/**/workspace.xml 47 | .idea/**/tasks.xml 48 | .idea/dictionaries 49 | 50 | # Sensitive or high-churn files: 51 | .idea/**/dataSources/ 52 | .idea/**/dataSources.ids 53 | .idea/**/dataSources.xml 54 | .idea/**/dataSources.local.xml 55 | .idea/**/sqlDataSources.xml 56 | .idea/**/dynamic.xml 57 | .idea/**/uiDesigner.xml 58 | 59 | # Gradle: 60 | .idea/**/gradle.xml 61 | .idea/**/libraries 62 | 63 | # Mongo Explorer plugin: 64 | .idea/**/mongoSettings.xml 65 | 66 | ## File-based project format: 67 | *.iws 68 | 69 | ## Plugin-specific files: 70 | 71 | # IntelliJ 72 | /out/ 73 | 74 | # mpeltonen/sbt-idea plugin 75 | .idea_modules/ 76 | 77 | # JIRA plugin 78 | atlassian-ide-plugin.xml 79 | 80 | # Crashlytics plugin (for Android Studio and IntelliJ) 81 | com_crashlytics_export_strings.xml 82 | crashlytics.properties 83 | crashlytics-build.properties 84 | fabric.properties 85 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | Lime - localized social netork and messenger 635 | Copyright (C) 2017 Sebastian Sellmair 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Lime Copyright (C) 2017 Sebastian Sellmair 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ** This project ist OUT OF DATE and I am currently not able to maintain it ** 2 | 3 |
4 | 5 | 6 |
7 | 8 | ## What we are building 9 | Lime is a social media app, which allows you to post images and text messages 10 | which will be visible inside a certain area. Lime was originally built in java 11 | as a native android app. In Order to provide an iOS version as well the app gets 12 | rebuilt using Flutter. We will release the iOS Flutter version soon all basic 13 | features are working and the plan is to replace the native app as soon as the 14 | flutter version becomes more powerful to provide an unified experience using one 15 | codebase. We will also build a web-version which also uses Dart as primary 16 | language. 17 | 18 | ### GIF: Lime native android app 19 |
20 | 21 | 22 |
23 | 24 | ## Getting Started 25 | 26 | Lime is built using Dart and the amazing Flutter :heart:
27 | For help getting started with Flutter, view our online 28 | [documentation](http://flutter.io/). 29 | 30 | I have also written an article about how Lime is built using Flutter (25.05.2017) 31 | here: [How lime is built](https://github.com/fablue/building-a-social-network-with-flutter). 32 | This should help you getting started into Lime development :relaxed: 33 | 34 | We encourage you to use all best practices provided by the flutter team. 35 | 36 | Looking forward to your contribution :+1: 37 | 38 | 39 | Feel free to file bug reports or feature requests! 40 | -------------------------------------------------------------------------------- /android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | PluginRegistry.java 10 | 11 | /gradle 12 | /gradlew 13 | /gradlew.bat 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withInputStream { stream -> 5 | localProperties.load(stream) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 27 19 | buildToolsVersion '27.0.3' 20 | 21 | lintOptions { 22 | disable 'InvalidPackage' 23 | } 24 | 25 | defaultConfig { 26 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 27 | 28 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 29 | applicationId "org.fablue.lime_flutter" 30 | } 31 | 32 | buildTypes { 33 | release { 34 | // TODO: Add your own signing config for the release build. 35 | // Signing with the debug keys for now, so `flutter run --release` works. 36 | signingConfig signingConfigs.debug 37 | } 38 | } 39 | } 40 | 41 | flutter { 42 | source '../..' 43 | } 44 | 45 | dependencies { 46 | testImplementation 'junit:junit:4.12' 47 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 48 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 49 | } 50 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 19 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/yourcompany/lime_flutter/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.yourcompany.lime_flutter; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | GeneratedPluginRegistrant.registerWith(this); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins; 2 | 3 | import io.flutter.plugin.common.PluginRegistry; 4 | import io.flutter.plugins.imagepicker.ImagePickerPlugin; 5 | import io.flutter.plugins.pathprovider.PathProviderPlugin; 6 | 7 | /** 8 | * Generated file. Do not edit. 9 | */ 10 | public final class GeneratedPluginRegistrant { 11 | public static void registerWith(PluginRegistry registry) { 12 | if (alreadyRegisteredWith(registry)) { 13 | return; 14 | } 15 | ImagePickerPlugin.registerWith(registry.registrarFor("io.flutter.plugins.imagepicker.ImagePickerPlugin")); 16 | PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin")); 17 | } 18 | 19 | private static boolean alreadyRegisteredWith(PluginRegistry registry) { 20 | final String key = GeneratedPluginRegistrant.class.getCanonicalName(); 21 | if (registry.hasPlugin(key)) { 22 | return true; 23 | } 24 | registry.registrarFor(key); 25 | return false; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.0.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | 31 | task wrapper(type: Wrapper) { 32 | gradleVersion = '2.14.1' 33 | } 34 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withInputStream { stream -> plugins.load(stream) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /flutter_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/flutter_01.png -------------------------------------------------------------------------------- /fonts/materialdesignicons-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/fonts/materialdesignicons-webfont.ttf -------------------------------------------------------------------------------- /img/fire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/img/fire.png -------------------------------------------------------------------------------- /img/fire.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/font_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/img/font_black.png -------------------------------------------------------------------------------- /img/ghost_like_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/img/ghost_like_white.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | PluginRegistry.h 13 | PluginRegistry.m 14 | 15 | *.pbxuser 16 | *.mode1v3 17 | *.mode2v3 18 | *.perspectivev3 19 | 20 | !default.pbxuser 21 | !default.mode1v3 22 | !default.mode2v3 23 | !default.perspectivev3 24 | 25 | xcuserdata 26 | 27 | *.moved-aside 28 | 29 | *.pyc 30 | *sync/ 31 | Icon? 32 | .tags* 33 | 34 | /Flutter/app.flx 35 | /Flutter/app.zip 36 | /Flutter/App.framework 37 | /Flutter/Flutter.framework 38 | /Flutter/Generated.xcconfig 39 | /ServiceDefinitions.json 40 | 41 | Pods/ 42 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | UIRequiredDeviceCapabilities 24 | 25 | arm64 26 | 27 | MinimumOSVersion 28 | 8.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | if ENV['FLUTTER_FRAMEWORK_DIR'] == nil 5 | abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework') 6 | end 7 | 8 | target 'Runner' do 9 | use_frameworks! 10 | 11 | # Pods for Runner 12 | 13 | # Flutter Pods 14 | pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR'] 15 | 16 | if File.exists? '../.flutter-plugins' 17 | flutter_root = File.expand_path('..') 18 | File.foreach('../.flutter-plugins') { |line| 19 | plugin = line.split(pattern='=') 20 | if plugin.length == 2 21 | name = plugin[0].strip() 22 | path = plugin[1].strip() 23 | resolved_path = File.expand_path("#{path}/ios", flutter_root) 24 | pod name, :path => resolved_path 25 | else 26 | puts "Invalid plugin specification: #{line}" 27 | end 28 | } 29 | end 30 | end 31 | 32 | post_install do |installer| 33 | installer.pods_project.targets.each do |target| 34 | target.build_configurations.each do |config| 35 | config.build_settings['ENABLE_BITCODE'] = 'NO' 36 | end 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - image_picker (0.0.1): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `/Users/Sebastian/flutter/bin/cache/artifacts/engine/ios-release`) 8 | - image_picker (from `/Users/Sebastian/.pub-cache/hosted/pub.dartlang.org/image_picker-0.0.2+2/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: /Users/Sebastian/flutter/bin/cache/artifacts/engine/ios-release 13 | image_picker: 14 | :path: /Users/Sebastian/.pub-cache/hosted/pub.dartlang.org/image_picker-0.0.2+2/ios 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: d674e78c937094a75ac71dd77e921e840bea3dbf 18 | image_picker: a211f28b95a560433c00f5cd3773f4710a20404d 19 | 20 | PODFILE CHECKSUM: cc70c01bca487bebd110b87397f017f3b76a89f1 21 | 22 | COCOAPODS: 1.2.1 23 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 18 | 9740EEBB1CF902C7004384FC /* app.flx in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB71CF902C7004384FC /* app.flx */; }; 19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 24 | 9D392772F9E5EFFBF10E87E1 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A39889610326EDF812869B0C /* Pods_Runner.framework */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXCopyFilesBuildPhase section */ 28 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 29 | isa = PBXCopyFilesBuildPhase; 30 | buildActionMask = 2147483647; 31 | dstPath = ""; 32 | dstSubfolderSpec = 10; 33 | files = ( 34 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 35 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 36 | ); 37 | name = "Embed Frameworks"; 38 | runOnlyForDeploymentPostprocessing = 0; 39 | }; 40 | /* End PBXCopyFilesBuildPhase section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 44 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 46 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 47 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 48 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 52 | 9740EEB71CF902C7004384FC /* app.flx */ = {isa = PBXFileReference; lastKnownFileType = file; name = app.flx; path = Flutter/app.flx; sourceTree = ""; }; 53 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 54 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 56 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 57 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 58 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 59 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | A39889610326EDF812869B0C /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 69 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 70 | 9D392772F9E5EFFBF10E87E1 /* Pods_Runner.framework in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 4E17C3C1D248A325600A0314 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | A39889610326EDF812869B0C /* Pods_Runner.framework */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | 9740EEB11CF90186004384FC /* Flutter */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 9740EEB71CF902C7004384FC /* app.flx */, 89 | 3B80C3931E831B6300D905FE /* App.framework */, 90 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 91 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 92 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 93 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 94 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 95 | ); 96 | name = Flutter; 97 | sourceTree = ""; 98 | }; 99 | 97C146E51CF9000F007C117D = { 100 | isa = PBXGroup; 101 | children = ( 102 | 9740EEB11CF90186004384FC /* Flutter */, 103 | 97C146F01CF9000F007C117D /* Runner */, 104 | 97C146EF1CF9000F007C117D /* Products */, 105 | F3574303D393F2D6EE5832F0 /* Pods */, 106 | 4E17C3C1D248A325600A0314 /* Frameworks */, 107 | ); 108 | sourceTree = ""; 109 | }; 110 | 97C146EF1CF9000F007C117D /* Products */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 97C146EE1CF9000F007C117D /* Runner.app */, 114 | ); 115 | name = Products; 116 | sourceTree = ""; 117 | }; 118 | 97C146F01CF9000F007C117D /* Runner */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 122 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 123 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 124 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 125 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 126 | 97C147021CF9000F007C117D /* Info.plist */, 127 | 97C146F11CF9000F007C117D /* Supporting Files */, 128 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 129 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 130 | ); 131 | path = Runner; 132 | sourceTree = ""; 133 | }; 134 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 97C146F21CF9000F007C117D /* main.m */, 138 | ); 139 | name = "Supporting Files"; 140 | sourceTree = ""; 141 | }; 142 | F3574303D393F2D6EE5832F0 /* Pods */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | ); 146 | name = Pods; 147 | sourceTree = ""; 148 | }; 149 | /* End PBXGroup section */ 150 | 151 | /* Begin PBXNativeTarget section */ 152 | 97C146ED1CF9000F007C117D /* Runner */ = { 153 | isa = PBXNativeTarget; 154 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 155 | buildPhases = ( 156 | 57B3E8D824DC2746EE98C189 /* [CP] Check Pods Manifest.lock */, 157 | 9740EEB61CF901F6004384FC /* Run Script */, 158 | 97C146EA1CF9000F007C117D /* Sources */, 159 | 97C146EB1CF9000F007C117D /* Frameworks */, 160 | 97C146EC1CF9000F007C117D /* Resources */, 161 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 162 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 163 | E81733FFC733B1959F2A72D6 /* [CP] Embed Pods Frameworks */, 164 | 165C63233B3919E82FBA533F /* [CP] Copy Pods Resources */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | ); 170 | name = Runner; 171 | productName = Runner; 172 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 173 | productType = "com.apple.product-type.application"; 174 | }; 175 | /* End PBXNativeTarget section */ 176 | 177 | /* Begin PBXProject section */ 178 | 97C146E61CF9000F007C117D /* Project object */ = { 179 | isa = PBXProject; 180 | attributes = { 181 | LastUpgradeCheck = 0830; 182 | ORGANIZATIONNAME = "The Chromium Authors"; 183 | TargetAttributes = { 184 | 97C146ED1CF9000F007C117D = { 185 | CreatedOnToolsVersion = 7.3.1; 186 | DevelopmentTeam = R58Q77NDGL; 187 | }; 188 | }; 189 | }; 190 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 191 | compatibilityVersion = "Xcode 3.2"; 192 | developmentRegion = English; 193 | hasScannedForEncodings = 0; 194 | knownRegions = ( 195 | en, 196 | Base, 197 | ); 198 | mainGroup = 97C146E51CF9000F007C117D; 199 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 200 | projectDirPath = ""; 201 | projectRoot = ""; 202 | targets = ( 203 | 97C146ED1CF9000F007C117D /* Runner */, 204 | ); 205 | }; 206 | /* End PBXProject section */ 207 | 208 | /* Begin PBXResourcesBuildPhase section */ 209 | 97C146EC1CF9000F007C117D /* Resources */ = { 210 | isa = PBXResourcesBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | 9740EEBB1CF902C7004384FC /* app.flx in Resources */, 214 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 215 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 216 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 217 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 218 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 219 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXResourcesBuildPhase section */ 224 | 225 | /* Begin PBXShellScriptBuildPhase section */ 226 | 165C63233B3919E82FBA533F /* [CP] Copy Pods Resources */ = { 227 | isa = PBXShellScriptBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | inputPaths = ( 232 | ); 233 | name = "[CP] Copy Pods Resources"; 234 | outputPaths = ( 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | shellPath = /bin/sh; 238 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; 239 | showEnvVarsInLog = 0; 240 | }; 241 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 242 | isa = PBXShellScriptBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | ); 246 | inputPaths = ( 247 | ); 248 | name = "Thin Binary"; 249 | outputPaths = ( 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | shellPath = /bin/sh; 253 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 254 | }; 255 | 57B3E8D824DC2746EE98C189 /* [CP] Check Pods Manifest.lock */ = { 256 | isa = PBXShellScriptBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | ); 260 | inputPaths = ( 261 | ); 262 | name = "[CP] Check Pods Manifest.lock"; 263 | outputPaths = ( 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | shellPath = /bin/sh; 267 | 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"; 268 | showEnvVarsInLog = 0; 269 | }; 270 | 9740EEB61CF901F6004384FC /* Run Script */ = { 271 | isa = PBXShellScriptBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | ); 275 | inputPaths = ( 276 | ); 277 | name = "Run Script"; 278 | outputPaths = ( 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | shellPath = /bin/sh; 282 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 283 | }; 284 | E81733FFC733B1959F2A72D6 /* [CP] Embed Pods Frameworks */ = { 285 | isa = PBXShellScriptBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | ); 289 | inputPaths = ( 290 | ); 291 | name = "[CP] Embed Pods Frameworks"; 292 | outputPaths = ( 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | shellPath = /bin/sh; 296 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 297 | showEnvVarsInLog = 0; 298 | }; 299 | /* End PBXShellScriptBuildPhase section */ 300 | 301 | /* Begin PBXSourcesBuildPhase section */ 302 | 97C146EA1CF9000F007C117D /* Sources */ = { 303 | isa = PBXSourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 307 | 97C146F31CF9000F007C117D /* main.m in Sources */, 308 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | }; 312 | /* End PBXSourcesBuildPhase section */ 313 | 314 | /* Begin PBXVariantGroup section */ 315 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 316 | isa = PBXVariantGroup; 317 | children = ( 318 | 97C146FB1CF9000F007C117D /* Base */, 319 | ); 320 | name = Main.storyboard; 321 | sourceTree = ""; 322 | }; 323 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 324 | isa = PBXVariantGroup; 325 | children = ( 326 | 97C147001CF9000F007C117D /* Base */, 327 | ); 328 | name = LaunchScreen.storyboard; 329 | sourceTree = ""; 330 | }; 331 | /* End PBXVariantGroup section */ 332 | 333 | /* Begin XCBuildConfiguration section */ 334 | 97C147031CF9000F007C117D /* Debug */ = { 335 | isa = XCBuildConfiguration; 336 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 337 | buildSettings = { 338 | ALWAYS_SEARCH_USER_PATHS = NO; 339 | CLANG_ANALYZER_NONNULL = YES; 340 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 341 | CLANG_CXX_LIBRARY = "libc++"; 342 | CLANG_ENABLE_MODULES = YES; 343 | CLANG_ENABLE_OBJC_ARC = YES; 344 | CLANG_WARN_BOOL_CONVERSION = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 352 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 353 | CLANG_WARN_UNREACHABLE_CODE = YES; 354 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 355 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 356 | COPY_PHASE_STRIP = NO; 357 | DEBUG_INFORMATION_FORMAT = dwarf; 358 | ENABLE_STRICT_OBJC_MSGSEND = YES; 359 | ENABLE_TESTABILITY = YES; 360 | GCC_C_LANGUAGE_STANDARD = gnu99; 361 | GCC_DYNAMIC_NO_PIC = NO; 362 | GCC_NO_COMMON_BLOCKS = YES; 363 | GCC_OPTIMIZATION_LEVEL = 0; 364 | GCC_PREPROCESSOR_DEFINITIONS = ( 365 | "DEBUG=1", 366 | "$(inherited)", 367 | ); 368 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 369 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 370 | GCC_WARN_UNDECLARED_SELECTOR = YES; 371 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 372 | GCC_WARN_UNUSED_FUNCTION = YES; 373 | GCC_WARN_UNUSED_VARIABLE = YES; 374 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 375 | MTL_ENABLE_DEBUG_INFO = YES; 376 | ONLY_ACTIVE_ARCH = YES; 377 | SDKROOT = iphoneos; 378 | TARGETED_DEVICE_FAMILY = "1,2"; 379 | }; 380 | name = Debug; 381 | }; 382 | 97C147041CF9000F007C117D /* Release */ = { 383 | isa = XCBuildConfiguration; 384 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 385 | buildSettings = { 386 | ALWAYS_SEARCH_USER_PATHS = NO; 387 | CLANG_ANALYZER_NONNULL = YES; 388 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 389 | CLANG_CXX_LIBRARY = "libc++"; 390 | CLANG_ENABLE_MODULES = YES; 391 | CLANG_ENABLE_OBJC_ARC = YES; 392 | CLANG_WARN_BOOL_CONVERSION = YES; 393 | CLANG_WARN_CONSTANT_CONVERSION = YES; 394 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 395 | CLANG_WARN_EMPTY_BODY = YES; 396 | CLANG_WARN_ENUM_CONVERSION = YES; 397 | CLANG_WARN_INFINITE_RECURSION = YES; 398 | CLANG_WARN_INT_CONVERSION = YES; 399 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 400 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 401 | CLANG_WARN_UNREACHABLE_CODE = YES; 402 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 403 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 404 | COPY_PHASE_STRIP = NO; 405 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 406 | ENABLE_NS_ASSERTIONS = NO; 407 | ENABLE_STRICT_OBJC_MSGSEND = YES; 408 | GCC_C_LANGUAGE_STANDARD = gnu99; 409 | GCC_NO_COMMON_BLOCKS = YES; 410 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 411 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 412 | GCC_WARN_UNDECLARED_SELECTOR = YES; 413 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 414 | GCC_WARN_UNUSED_FUNCTION = YES; 415 | GCC_WARN_UNUSED_VARIABLE = YES; 416 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 417 | MTL_ENABLE_DEBUG_INFO = NO; 418 | SDKROOT = iphoneos; 419 | TARGETED_DEVICE_FAMILY = "1,2"; 420 | VALIDATE_PRODUCT = YES; 421 | }; 422 | name = Release; 423 | }; 424 | 97C147061CF9000F007C117D /* Debug */ = { 425 | isa = XCBuildConfiguration; 426 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 427 | buildSettings = { 428 | ARCHS = arm64; 429 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 430 | DEVELOPMENT_TEAM = R58Q77NDGL; 431 | ENABLE_BITCODE = NO; 432 | FRAMEWORK_SEARCH_PATHS = ( 433 | "$(inherited)", 434 | "$(PROJECT_DIR)/Flutter", 435 | ); 436 | INFOPLIST_FILE = Runner/Info.plist; 437 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 438 | LIBRARY_SEARCH_PATHS = ( 439 | "$(inherited)", 440 | "$(PROJECT_DIR)/Flutter", 441 | ); 442 | PRODUCT_BUNDLE_IDENTIFIER = org.fablue.lime; 443 | PRODUCT_NAME = "$(TARGET_NAME)"; 444 | }; 445 | name = Debug; 446 | }; 447 | 97C147071CF9000F007C117D /* Release */ = { 448 | isa = XCBuildConfiguration; 449 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 450 | buildSettings = { 451 | ARCHS = arm64; 452 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 453 | DEVELOPMENT_TEAM = R58Q77NDGL; 454 | ENABLE_BITCODE = NO; 455 | FRAMEWORK_SEARCH_PATHS = ( 456 | "$(inherited)", 457 | "$(PROJECT_DIR)/Flutter", 458 | ); 459 | INFOPLIST_FILE = Runner/Info.plist; 460 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 461 | LIBRARY_SEARCH_PATHS = ( 462 | "$(inherited)", 463 | "$(PROJECT_DIR)/Flutter", 464 | ); 465 | PRODUCT_BUNDLE_IDENTIFIER = org.fablue.lime; 466 | PRODUCT_NAME = "$(TARGET_NAME)"; 467 | }; 468 | name = Release; 469 | }; 470 | /* End XCBuildConfiguration section */ 471 | 472 | /* Begin XCConfigurationList section */ 473 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 474 | isa = XCConfigurationList; 475 | buildConfigurations = ( 476 | 97C147031CF9000F007C117D /* Debug */, 477 | 97C147041CF9000F007C117D /* Release */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147061CF9000F007C117D /* Debug */, 486 | 97C147071CF9000F007C117D /* Release */, 487 | ); 488 | defaultConfigurationIsVisible = 0; 489 | defaultConfigurationName = Release; 490 | }; 491 | /* End XCConfigurationList section */ 492 | }; 493 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 494 | } 495 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 7 | [GeneratedPluginRegistrant registerWithRegistry:self]; 8 | // Override point for customization after application launch. 9 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 10 | } 11 | 12 | - (void)applicationWillResignActive:(UIApplication *)application { 13 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 14 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 15 | [super applicationWillResignActive:application]; 16 | } 17 | 18 | - (void)applicationDidEnterBackground:(UIApplication *)application { 19 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 20 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 21 | [super applicationDidEnterBackground:application]; 22 | } 23 | 24 | - (void)applicationWillEnterForeground:(UIApplication *)application { 25 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 26 | [super applicationWillEnterForeground:application]; 27 | } 28 | 29 | - (void)applicationDidBecomeActive:(UIApplication *)application { 30 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 31 | [super applicationDidBecomeActive:application]; 32 | } 33 | 34 | - (void)applicationWillTerminate:(UIApplication *)application { 35 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 36 | [super applicationWillTerminate:application]; 37 | } 38 | 39 | - (BOOL)application:(UIApplication*)application 40 | openURL:(NSURL*)url 41 | sourceApplication:(NSString*)sourceApplication 42 | annotation:(id)annotation { 43 | // Called when the application is asked to open a resource specified by a URL. 44 | return [super application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; 45 | } 46 | @end 47 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | } 111 | ], 112 | "info" : { 113 | "version" : 1, 114 | "author" : "xcode" 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fablue/lime-flutter/3b8f5baf98bc5ba6ce1525ccfbd6d001d809da61/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/GeneratedPluginRegistrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GeneratedPluginRegistrant_h 6 | #define GeneratedPluginRegistrant_h 7 | 8 | #import 9 | 10 | @interface GeneratedPluginRegistrant : NSObject 11 | + (void)registerWithRegistry:(NSObject*)registry; 12 | @end 13 | 14 | #endif /* GeneratedPluginRegistrant_h */ 15 | -------------------------------------------------------------------------------- /ios/Runner/GeneratedPluginRegistrant.m: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #import "GeneratedPluginRegistrant.h" 6 | #import 7 | #import 8 | 9 | @implementation GeneratedPluginRegistrant 10 | 11 | + (void)registerWithRegistry:(NSObject*)registry { 12 | [FLTImagePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTImagePickerPlugin"]]; 13 | [FLTPathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTPathProviderPlugin"]]; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Lime 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | lime_flutter 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | arm64 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UIViewControllerBasedStatusBarAppearance 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, 8 | NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/lime/api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | import 'package:http/http.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:http_parser/http_parser.dart'; 6 | 7 | 8 | class LimeApi { 9 | final Client client = createHttpClient(); 10 | final String server = "https://lime.fablue.org"; 11 | // final String server = "http://192.168.0.98:8080"; 12 | 13 | Future >> getTrends() async { 14 | String url = "$server/trend?latitude=$latitude&longitude=$longitude"; 15 | url = Uri.encodeFull(url); 16 | Response response = await client.get( 17 | url, headers: {"token": token} 18 | ); 19 | 20 | print("[API getTrends] ${response.statusCode}"); 21 | List> objects = JSON.decode(response.body); 22 | return objects.reversed.toList(); 23 | } 24 | 25 | /// Get all posts nearby 26 | Future >> getFeed({ 27 | String channel: null, 28 | int paginationIndex: 0, 29 | int paginationSize: 50, 30 | int parentId: null, 31 | bool onlyImages: false, 32 | bool onlyFriends: false 33 | }) async { 34 | String url = "$server/message?latitude=$latitude" 35 | "&longitude=$longitude&distance=$distance" 36 | "&pagination_index=$paginationIndex" 37 | "&pagination_size=$paginationSize" 38 | + (channel != null ? "&channel=$channel" : "") 39 | + (parentId != null ? "&parentId=$parentId" : "") 40 | + (onlyImages ? "&only_images=$onlyImages" : "") 41 | + (onlyFriends ? "&only_follows=$onlyFriends" : ""); 42 | 43 | print(url); 44 | 45 | url = Uri.encodeFull(url); 46 | Response response = await client.get(url, 47 | headers: { 48 | "token": token 49 | } 50 | ); 51 | 52 | print("[API getFeed] ${response.statusCode} | pageIndex: $paginationIndex"); 53 | List> objects = JSON.decode(response.body); 54 | return objects.reversed.toList(); 55 | } 56 | 57 | 58 | Future getMessage(int messageId) async { 59 | String url = "$server/message/$messageId"; 60 | url = Uri.encodeFull(url); 61 | Response response = await client.get(url, 62 | headers: {"token": token}); 63 | 64 | //print("[API getMessage] ${response.statusCode} | id: $messageId"); 65 | Map post = JSON.decode(response.body); 66 | return post; 67 | } 68 | 69 | Future putVote(int messageId) async { 70 | String url = "$server/message/$messageId/vote"; 71 | url = Uri.encodeFull(url); 72 | Response response = await client.put( 73 | url, 74 | headers: {"token": token} 75 | ); 76 | 77 | print("[API putVote] ${response.statusCode} | id: $messageId"); 78 | return response; 79 | } 80 | 81 | Future deleteVote(int messageId) async { 82 | String url = "$server/message/$messageId/vote"; 83 | url = Uri.encodeFull(url); 84 | Response response = await client.delete(url, 85 | headers: {"token": token} 86 | ); 87 | 88 | print("[API deleteVote] ${response.statusCode} | id: $messageId"); 89 | return response; 90 | } 91 | 92 | 93 | Future> getChannels({int page: 0, int pageSize: 50}) async { 94 | String url = "$server/channels?latitude=$latitude&longitude=$longitude&distance=$distance" 95 | "&pagination_index=$page&pagination_size=$pageSize"; 96 | url = Uri.encodeFull(url); 97 | Response response = await client.get(url, 98 | headers: {"token": token}); 99 | print("[API getChannels] ${response 100 | .statusCode} page: $page, pageSize: $pageSize"); 101 | return JSON.decode(response.body); 102 | } 103 | 104 | 105 | Future postMessage( 106 | {String text, List compressedImage, int parentId}) async { 107 | if (compressedImage != null) { 108 | return _postFile( 109 | text: text, compressedImage: compressedImage, parentId: parentId); 110 | } 111 | 112 | else 113 | return null; 114 | } 115 | 116 | Future _postFile( 117 | {String text, List compressedImage, int parentId}) async { 118 | var message = { 119 | "message": text, 120 | "timestamp": new DateTime.now().millisecondsSinceEpoch, 121 | "color": color, 122 | "latitude": latitude, 123 | "longitude": longitude, 124 | "parentId": parentId, 125 | }; 126 | 127 | String messageJson = new JsonEncoder().convert(message); 128 | print(messageJson); 129 | List messageBinary = new Utf8Encoder().convert(messageJson); 130 | 131 | 132 | MultipartRequest multipartRequest = new MultipartRequest("post", 133 | Uri.parse(Uri.encodeFull("$server/media"))) 134 | ..headers.putIfAbsent("token", () => token) 135 | ..files.add( 136 | new MultipartFile.fromBytes( 137 | "file", compressedImage, 138 | contentType: new MediaType.parse("multipart/form-data"), 139 | filename: "file" 140 | ) 141 | ) 142 | ..files.add( 143 | new MultipartFile.fromBytes( 144 | "message", messageBinary, 145 | contentType: new MediaType.parse("application/json"), 146 | filename: "message" 147 | ) 148 | ); 149 | 150 | 151 | StreamedResponse streamedResponse = await client.send(multipartRequest); 152 | Response response = await Response.fromStream(streamedResponse); 153 | return new JsonCodec().decode(response.body); 154 | } 155 | 156 | String getMediaUrl(String url, {int inScale: null}) { 157 | return Uri.encodeFull("$server/media/$url"); 158 | } 159 | 160 | String getChannelImage(String channel) { 161 | return Uri.encodeFull("$server/channel/$channel/image?token=$token"); 162 | } 163 | 164 | String getLatestImage(String channel) { 165 | return Uri.encodeFull( 166 | "$server/channel/$channel/latest?distance=$distance&latitude=$latitude" 167 | "&longitude=$longitude"); 168 | } 169 | 170 | double get latitude { 171 | return 50.0; 172 | } 173 | 174 | double get longitude { 175 | return 13.0; 176 | } 177 | 178 | double get distance { 179 | return 9.0; 180 | } 181 | 182 | String get token { 183 | return "fluttertesttoken"; 184 | } 185 | 186 | String get channel { 187 | return "fablue"; 188 | } 189 | 190 | String get name { 191 | return "Sebastian Sellmair"; 192 | } 193 | 194 | String get lastImage { 195 | return null; 196 | } 197 | 198 | int get color { 199 | return 0; 200 | } 201 | } -------------------------------------------------------------------------------- /lib/lime/lime.dart: -------------------------------------------------------------------------------- 1 | import 'package:lime/lime/api.dart'; 2 | import 'package:lime/misc/site.dart'; 3 | import 'package:pool/pool.dart'; 4 | 5 | Lime lime = new Lime(); 6 | 7 | class Lime { 8 | final LimeApi api = new LimeApi(); 9 | final Site site = new Site(SiteSetting.STANDARD); 10 | static final Lime _lime = new Lime._internal(); 11 | 12 | factory Lime(){ 13 | return _lime; 14 | } 15 | 16 | Lime._internal(); 17 | 18 | double distanceToKm(double distance) { 19 | return distance * 100; 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /lib/lime/model.dart: -------------------------------------------------------------------------------- 1 | class JsonModel{ 2 | final Map _map; 3 | JsonModel(this._map); 4 | } -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lime/lime//lime.dart'; 3 | import 'package:lime/widgets/community.dart'; 4 | import 'package:lime/widgets/feed.dart'; 5 | import 'package:lime/widgets/trends.dart'; 6 | 7 | 8 | void main() { 9 | runApp(new LimeApp()); 10 | } 11 | 12 | /// Returns the color scheme used by lime 13 | MaterialColor limeColor() { 14 | return new MaterialColor(0xFF0498C1, { 15 | 50: new Color(0xFFE1F3F8), 16 | 100: new Color(0xFFB4E0EC), 17 | 200: new Color(0xFF82CCE0), 18 | 300: new Color(0xFF4FB7D4), 19 | 400: new Color(0xFF2AA7CA), 20 | 500: new Color(0xFF0498C1), 21 | 600: new Color(0xFF0390BB), 22 | 700: new Color(0xFF0385B3), 23 | 800: new Color(0xFF027BAB), 24 | 900: new Color(0xFF016A9E) 25 | }); 26 | } 27 | 28 | class LimeApp extends StatelessWidget { 29 | @override 30 | Widget build(BuildContext context) { 31 | Lime lime = new Lime(); 32 | return new MaterialApp( 33 | title: 'Lime', 34 | theme: new ThemeData( 35 | primarySwatch: limeColor(), 36 | scaffoldBackgroundColor: Colors.white, 37 | primaryColor: limeColor(), backgroundColor: Colors.white), 38 | home: new MainPage(lime), 39 | showPerformanceOverlay: false, 40 | ); 41 | } 42 | } 43 | 44 | class MainPage extends StatefulWidget { 45 | final Lime lime; 46 | 47 | MainPage(this.lime); 48 | 49 | 50 | @override 51 | State createState() { 52 | return new _MainPageState(); 53 | } 54 | } 55 | 56 | class _MainPageState extends State { 57 | 58 | PageController pageController; 59 | int page = 1; 60 | 61 | @override 62 | Widget build(BuildContext context) { 63 | 64 | return new Scaffold( 65 | backgroundColor: Colors.white, 66 | body: new PageView( 67 | children: [ 68 | new Trends(key: new Key("TRENDS")), 69 | new Feed(key: new Key("FEED")), 70 | new Community() 71 | ], 72 | controller: pageController, 73 | onPageChanged: onPageChanged 74 | ), 75 | bottomNavigationBar: new BottomNavigationBar( 76 | items: [ 77 | new BottomNavigationBarItem( 78 | icon: new Icon(new IconData(62008, fontFamily: "mdi")), 79 | title: new Text("trends"), 80 | ), 81 | new BottomNavigationBarItem( 82 | icon: new Icon(Icons.location_on), title: new Text("feed")), 83 | new BottomNavigationBarItem( 84 | icon: new Icon(Icons.people), title: new Text("community")) 85 | ], 86 | onTap: onTap, 87 | currentIndex: page 88 | ) 89 | ); 90 | } 91 | 92 | @override 93 | void initState() { 94 | super.initState(); 95 | pageController = new PageController(initialPage: this.page); 96 | } 97 | 98 | 99 | void onTap(int index) { 100 | pageController.animateToPage( 101 | index, duration: const Duration(milliseconds: 300), 102 | curve: Curves.ease); 103 | } 104 | 105 | void onPageChanged(int page) { 106 | setState(() { 107 | this.page = page; 108 | }); 109 | } 110 | 111 | 112 | } 113 | -------------------------------------------------------------------------------- /lib/misc/functions.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/widgets.dart'; 4 | 5 | 6 | typedef Future> PageRequest (int page, int pageSize); 7 | typedef Future> ApiPageRequest(int page, int pageSize); 8 | typedef void PaginationThresholdCallback(); 9 | typedef Widget WidgetAdapter(T t); 10 | typedef int Indexer(T t); 11 | -------------------------------------------------------------------------------- /lib/misc/notifications.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | class ListElementUpdate extends Notification{ 4 | final int key; 5 | final T instance; 6 | 7 | ListElementUpdate(this.key, this.instance); 8 | } -------------------------------------------------------------------------------- /lib/misc/site.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:collection'; 3 | import 'dart:isolate'; 4 | 5 | /// Easy and convenient to use, thread-pool-like implementation for delegating 6 | /// expensive tasks to a pool of isolates 7 | /// 8 | /// Just pass the function and the desired params to [commission] and let 9 | /// the site handle everything for you by returning a really parallel computed [Future] object. 10 | /// If the [Site] currently holds a reference to an idle Isolate, then the requested computation 11 | /// wil be delegated to it immediately. Otherwise a new [Isolate] is spawned, if it would 12 | /// not exceed [SiteSetting.workersMax]. If this limit is exceeded has the task to wait 13 | /// until any [Isolate] finishes its work on any other task. 14 | /// 15 | /// Idle [Isolates] will die after [SiteSetting.workerTimeout]. 16 | class Site { 17 | 18 | /// Controls the whole behaviour of this Site and all its Isolates 19 | /// 20 | /// The site will not spawn more Isolates than defined by [SiteSetting.workersMax] 21 | /// and an idling [Isolate] will die after [SiteSetting.workerTimeout] 22 | final SiteSetting settings; 23 | 24 | /// Holds a reference to all workers currently alive 25 | final List<_Worker> _workers = []; 26 | 27 | /// Holds a reference to all jobs waiting for delegation to any 28 | /// [Isolate] 29 | final Queue<_Job> _jobs = new Queue(); 30 | 31 | /// This controller is used to notify when a [_Job] was finished 32 | /// ignore: close_sinks 33 | StreamController streamController = new StreamController.broadcast(); 34 | 35 | Site(this.settings); 36 | 37 | /// This will execute the [function] inside another Isolate and conveniently 38 | /// return a easy to handle [Future] 39 | /// 40 | /// Be careful: Isolates are not sharing any memory with each other, 41 | /// therefore try to pass immutable objects as arguments, because any 42 | /// transformation by [function] won't be reflected in the calling isolate. 43 | /// 44 | /// Spawns a new Isolate if all current Isolates are busy and 45 | /// [SiteSetting.workersMax] is not yet exceeded. 46 | /// 47 | /// Will wait for current working Isolates if [SiteSettings.workersMax] is indeed 48 | /// exceeded and all other Isolates are busy. 49 | Future commission(Function function, 50 | {List positionalArgs: const [], Map namedArgs: const{}}) async { 51 | BackgroundFunction backgroundFunction = new BackgroundFunction(function, 52 | positionalArguments: positionalArgs, namedArguments: namedArgs); 53 | 54 | _Job job = new _Job(this, backgroundFunction); 55 | _jobs.add(job); 56 | patrol(); 57 | 58 | await for (dynamic finished in streamController.stream) { 59 | if (finished == job) { 60 | return job.result; 61 | } 62 | } 63 | } 64 | 65 | /// Encourages idle [Isolate]s to take a [_Job] from 66 | /// the Queue and will spawn new a new [Isolate] if necessary 67 | /// 68 | /// This method is automatically called. 69 | /// I cannot easily image a reason why this should 70 | /// be called manually! 71 | patrol() { 72 | _workers.forEach((worker) => worker.incite()); 73 | if (_jobs.isNotEmpty) { 74 | if (_workers.length < settings.workersMax) { 75 | this._workers.add( 76 | new _Worker(this) 77 | ..start() 78 | ..incite()); 79 | print("Site: Spawning worker. Total ${_workers.length}"); 80 | } 81 | } 82 | } 83 | 84 | 85 | void _reportDeathOf(_Worker worker) { 86 | this._workers.remove(worker); 87 | print("Site: Worker $worker died. Left: ${_workers.length}"); 88 | } 89 | 90 | 91 | /// Will shut down this [Site] and kill all 92 | /// open resources/[Isolate]s 93 | /// 94 | /// You should not use this Site ever again after 95 | /// calling this method. 96 | /// 97 | /// Also make sure to call this method after 98 | /// the [Site] is not needed anymore. 99 | void close() { 100 | this.streamController?.close(); 101 | this.streamController = null; 102 | this._workers.forEach((worker) => worker.close()); 103 | this._workers.clear(); 104 | } 105 | 106 | finalize() { 107 | this.close(); 108 | } 109 | } 110 | 111 | /// All preferences for a [Site] 112 | class SiteSetting { 113 | 114 | /// How many worker [Isolates] can be spawned at max? 115 | final int workersMax; 116 | 117 | /// How long is an [Isolate] allowed to idle, before it is killed? 118 | final Duration workerTimeout; 119 | 120 | /// Will allow a maximum of 2 background [Isolate]s while 121 | /// killing idle [Isolate]s after 30 seconds 122 | static const SiteSetting STANDARD = const SiteSetting(2, const Duration(seconds: 30)); 123 | 124 | /// Will allow a maximum of 16 background [Isolate]s while 125 | /// killing idle [Isolate]s after 5 minutes. 126 | /// 127 | /// This is only for heavy multitasking applications. 128 | /// Not quite sure if Dart is the right language here! 129 | static const SiteSetting HEAVY = const SiteSetting(16, const Duration(minutes: 5)); 130 | 131 | /// Will allow a maximum of 2 background [Isolate] while 132 | /// killing idle [Isolate]s after 1 second. 133 | static const SiteSetting LIGHT = const SiteSetting(2, const Duration(seconds: 1)); 134 | 135 | 136 | const SiteSetting(this.workersMax, this.workerTimeout); 137 | } 138 | 139 | 140 | 141 | /// Manages the connection to a dedicated [Isolate]. 142 | /// 143 | /// Manages its own [Isolate] and is able 144 | /// to work on [_Job] objects. 145 | class _Worker { 146 | 147 | /// The site this worker belongs to 148 | Site site; 149 | 150 | /// The workers own [Isolate] 151 | Isolate _isolate; 152 | 153 | /// Will be used for receiving messages 154 | /// from [_isolate] 155 | ReceivePort _receivePort; 156 | 157 | /// Will be used to send messages to 158 | /// [_isolate] 159 | /// 160 | /// This should be null-checked, since 161 | /// the port is received from the [_isolate] 162 | /// once it is running 163 | SendPort _sendPort; 164 | 165 | /// The current job, this Worker is working on, 166 | /// or null if the Worker is idle. 167 | _Job _currentJob; 168 | 169 | _Worker(this.site); 170 | 171 | /// Tells whether an [Isolate] is currently attached. 172 | /// Does NOT tell whether its IDLE or not! 173 | bool get running { 174 | return _isolate != null; 175 | } 176 | 177 | /// Will make this Worker start working on an available job 178 | /// if it is currently idle! 179 | void incite() { 180 | if (_currentJob == null && site._jobs.isNotEmpty) { 181 | _currentJob = site._jobs.removeFirst(); 182 | print("Worker: start workiing on $_currentJob"); 183 | _startWorking(); 184 | } 185 | } 186 | 187 | 188 | /// Send the [_Job] object [_currentJob] to the Isolate, 189 | /// which will start working on it. 190 | void _startWorking() { 191 | assert(_currentJob != null); 192 | if(_sendPort!=null){ 193 | print("Worker: delegating to isolate"); 194 | _sendPort.send(_currentJob.function); 195 | print("Worker: waiting for isolate to finish"); 196 | } 197 | } 198 | 199 | /// receives the result for the computation associated with 200 | /// [_currentJob] and will "finish" the associated future 201 | /// by assigning the result [x] to it. 202 | void _receive(dynamic x) { 203 | assert (_currentJob != null); 204 | _currentJob.result = x; 205 | _currentJob = null; 206 | incite(); 207 | } 208 | 209 | /// Starting the Worker will 210 | /// spawn the [_isolate] and retrieve the [_sendPort]. 211 | /// 212 | /// This will also lead in a call to [_startWorking] if 213 | /// a job is currently assigned. 214 | Future start() async { 215 | ReceivePort exitReceiver = new ReceivePort(); 216 | exitReceiver.first.then((x) { 217 | this.close(); 218 | site._reportDeathOf(this); 219 | }); 220 | 221 | _receivePort = new ReceivePort(); 222 | 223 | _WorkDay _workDay = new _WorkDay(site.settings, _receivePort.sendPort); 224 | _isolate = 225 | await Isolate.spawn(_entryPoint, _workDay, onExit: exitReceiver.sendPort); 226 | 227 | int counter = 0; 228 | _receivePort.listen((x) { 229 | if(counter == 0){ 230 | _sendPort = x; 231 | if(_currentJob!=null) _startWorking(); 232 | } 233 | else _receive(x); 234 | counter ++; 235 | }); 236 | 237 | 238 | } 239 | 240 | 241 | /// Will kill the [Isolate] and this Worker should 242 | /// never be used again! 243 | void close() { 244 | _isolate?.kill(); 245 | _isolate = null; 246 | _receivePort?.close(); 247 | _receivePort = null; 248 | _sendPort = null; 249 | _currentJob = null; 250 | } 251 | 252 | 253 | /// The entry point of [_isolate]. 254 | static void _entryPoint(_WorkDay workDay) { 255 | ReceivePort receivePort = new ReceivePort(); 256 | Stream receiveStream = receivePort.timeout(workDay.settings.workerTimeout, 257 | onTimeout: (EventSink sink) { 258 | print("Worker: timed out..."); 259 | receivePort.close(); 260 | }); 261 | 262 | receiveStream.listen((BackgroundFunction backgroundFunction) { 263 | print("Worker: working"); 264 | var result = backgroundFunction(); 265 | workDay.sendPort.send(result); 266 | print("Worker: idle"); 267 | }); 268 | 269 | workDay.sendPort.send(receivePort.sendPort); 270 | } 271 | } 272 | 273 | 274 | /// The initial object sent to a [Isolate] by a [_Worker] 275 | class _WorkDay { 276 | final SiteSetting settings; 277 | final SendPort sendPort; 278 | 279 | _WorkDay(this.settings, this.sendPort); 280 | } 281 | 282 | 283 | 284 | class _Job { 285 | final Site _site; 286 | final BackgroundFunction function; 287 | bool finished = false; 288 | dynamic _result; 289 | 290 | set result(dynamic result) { 291 | this._result = result; 292 | this.finished = true; 293 | this._site.streamController.add(this); 294 | } 295 | 296 | dynamic get result { 297 | return _result; 298 | } 299 | 300 | _Job(this._site, this.function); 301 | } 302 | 303 | class BackgroundFunction { 304 | final Function function; 305 | final List positionalArguments; 306 | final Map namedArguments; 307 | 308 | BackgroundFunction(this.function, 309 | {this.positionalArguments: const[], 310 | this.namedArguments: const{}}); 311 | 312 | dynamic call() { 313 | return Function.apply(function, positionalArguments, namedArguments); 314 | } 315 | } 316 | 317 | 318 | 319 | 320 | -------------------------------------------------------------------------------- /lib/misc/utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | import 'dart:isolate'; 4 | import 'package:image/image.dart' as img; 5 | import 'package:dart_image/dart_image.dart' as dimg; 6 | import 'dart:math' as math; 7 | 8 | 9 | class _ImageCompressionMessage { 10 | SendPort sendPort; 11 | File file; 12 | } 13 | 14 | class ImageUtil { 15 | static const int MAX = 1920; 16 | 17 | static List compressImage(File file) { 18 | return __compressImage(file); 19 | } 20 | 21 | static Future _compressImage(_ImageCompressionMessage message) async { 22 | message.sendPort.send(__compressImage(message.file)); 23 | } 24 | 25 | static List __compressImage(File file){ 26 | print("Compressing image $file"); 27 | print("Decoding image..."); 28 | img.Image image = img.decodeImage(file.readAsBytesSync()); 29 | if (image.width > ImageUtil.MAX || image.height > ImageUtil.MAX) { 30 | print("Resizing..."); 31 | image = img.copyResize(image, targetWidth(image)); 32 | print("Resized to ${image.width}x${image.height}"); 33 | } 34 | 35 | print("Encoding..."); 36 | List compressed = img.encodeJpg(image, quality: 50); 37 | print("Returning..."); 38 | return compressed; 39 | } 40 | 41 | static Future _dCompressImage(_ImageCompressionMessage message) async { 42 | print("Compressing image ${message.file}"); 43 | print("Reading file..."); 44 | message.file.openSync(); 45 | List data = message.file.readAsBytesSync(); 46 | 47 | print("Decoding image..."); 48 | dimg.Decoder decoder = new dimg.JpegDecoder(); 49 | dimg.Image image = decoder.decode(data); 50 | if (image.height > ImageUtil.MAX || image.width > ImageUtil.MAX) { 51 | print("Resizing image..."); 52 | double max = math.max(image.height, image.width).toDouble(); 53 | double factor = ImageUtil.MAX / max; 54 | image = image.resized((image.width.toDouble() * factor).round(), 55 | (image.height.toDouble() * factor).round()); 56 | 57 | print("New image format: ${image.width}x${image.height}"); 58 | } 59 | 60 | print("Encoding image... ${image.width}x${image.height}"); 61 | dimg.Encoder encoder = new dimg.JpegEncoder(40); 62 | List compressed = encoder.encode(image); 63 | 64 | print("Returning image"); 65 | message.sendPort.send(compressed); 66 | } 67 | 68 | static int targetWidth(img.Image image) { 69 | if (image.width > image.height) { 70 | if (image.width > ImageUtil.MAX) { 71 | return ImageUtil.MAX; 72 | } else { 73 | return image.width; 74 | } 75 | } 76 | else { 77 | if (image.height > ImageUtil.MAX) { 78 | double shrinkage = ImageUtil.MAX.toDouble() / image.height.toDouble(); 79 | return (image.width.toDouble() * shrinkage).floor(); 80 | } else { 81 | return image.width; 82 | } 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /lib/widgets/DismissibleWrapper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | /// This will automatically remove the dismissible 4 | /// from the tree once it dismisses. 5 | /// 6 | /// This is just a convenience wrapper around [Dismissible] 7 | class DismissibleWrapper extends StatefulWidget { 8 | 9 | ///[Dismissible.key] 10 | final Key key; 11 | 12 | ///[Dismissible.child] 13 | final Widget child; 14 | 15 | ////[Dismissible.onDismissed] 16 | final DismissDirectionCallback onDismissed; 17 | 18 | ///[Dismissible.direction] 19 | final DismissDirection direction; 20 | 21 | DismissibleWrapper( 22 | {this.key, this.child, this.onDismissed, this.direction: DismissDirection 23 | .horizontal}); 24 | 25 | @override 26 | State createState() { 27 | return new _State(); 28 | } 29 | } 30 | 31 | class _State extends State { 32 | 33 | bool dismissed = false; 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | Widget w; 38 | if (!dismissed) w = new Dismissible(key: widget.key, child: widget.child, 39 | direction: widget.direction, 40 | onDismissed: (x) { 41 | setState(() => dismissed = true); 42 | if (widget.onDismissed != null) widget.onDismissed(x); 43 | }); 44 | 45 | w = new Container(child: w); 46 | return w; 47 | } 48 | } -------------------------------------------------------------------------------- /lib/widgets/circular_clip.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'package:flutter/widgets.dart'; 3 | 4 | class CircularClip extends StatelessWidget{ 5 | 6 | final Widget child; 7 | final double clip; 8 | 9 | CircularClip({this.child, this.clip}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | Widget w = new ClipOval(clipper: new _CustomClipper()..status =clip,child: child,); 14 | return w; 15 | } 16 | } 17 | class _CustomClipper extends CustomClipper { 18 | 19 | double status = 1.0; 20 | 21 | @override 22 | Rect getClip(Size size) { 23 | Rect rect = new Rect.fromCircle( 24 | center: new Offset(size.width, size.height), 25 | radius: status * (sqrt(pow(size.width, 2) + pow(size.height, 2))) 26 | ); 27 | 28 | return rect; 29 | } 30 | 31 | @override 32 | bool shouldReclip(CustomClipper oldClipper) { 33 | return true; 34 | } 35 | } -------------------------------------------------------------------------------- /lib/widgets/common.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'dart:typed_data'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:flutter/widgets.dart'; 6 | import 'package:meta/meta.dart'; 7 | 8 | ImageConfiguration createLocalImageConfiguration(BuildContext context, { Size size }) { 9 | return new ImageConfiguration( 10 | bundle: DefaultAssetBundle.of(context), 11 | devicePixelRatio: MediaQuery.of(context, nullOk: true)?.devicePixelRatio ?? 1.0, 12 | // TODO(ianh): provide the locale 13 | size: size, 14 | platform: TargetPlatform.android, 15 | ); 16 | } 17 | 18 | /// A widget that displays an image. 19 | /// 20 | /// Several constructors are provided for the various ways that an image can be 21 | /// specified: 22 | /// 23 | /// * [new Image], for obtaining an image from an [ImageProvider]. 24 | /// * [new FadingImage.asset], for obtaining an image from an [AssetBundle] 25 | /// using a key. 26 | /// * [new FadingImage.network], for obtaining an image from a URL. 27 | /// * [new FadingImage.file], for obtaining an image from a [File]. 28 | /// * [new FadingImage.memory], for obtaining an image from a [Uint8List]. 29 | /// 30 | /// To automatically perform pixel-density-aware asset resolution, specify the 31 | /// image using an [AssetImage] and make sure that a [MaterialApp], [WidgetsApp], 32 | /// or [MediaQuery] widget exists above the [FadingImage] widget in the widget tree. 33 | /// 34 | /// The image is painted using [paintImage], which describes the meanings of the 35 | /// various fields on this class in more detail. 36 | /// 37 | /// See also: 38 | /// 39 | /// * [Icon] 40 | class FadingImage extends StatefulWidget { 41 | /// Creates a widget that displays an image. 42 | /// 43 | /// To show an image from the network or from an asset bundle, consider using 44 | /// [new FadingImage.network] and [new FadingImage.asset] respectively. 45 | /// 46 | /// The [image] and [repeat] arguments must not be null. 47 | const FadingImage({ 48 | Key key, 49 | @required this.image, 50 | this.width, 51 | this.height, 52 | this.color, 53 | this.colorBlendMode, 54 | this.fit, 55 | this.alignment, 56 | this.repeat: ImageRepeat.noRepeat, 57 | this.centerSlice, 58 | this.gaplessPlayback: false 59 | }) : assert(image != null), 60 | super(key: key); 61 | 62 | /// Creates a widget that displays an [ImageStream] obtained from the network. 63 | /// 64 | /// The [src], [scale], and [repeat] arguments must not be null. 65 | FadingImage.network(String src, { 66 | Key key, 67 | double scale: 1.0, 68 | this.width, 69 | this.height, 70 | this.color, 71 | this.colorBlendMode, 72 | this.fit, 73 | this.alignment, 74 | this.repeat: ImageRepeat.noRepeat, 75 | this.centerSlice, 76 | this.gaplessPlayback: false 77 | }) : image = new NetworkImage(src, scale: scale), 78 | super(key: key); 79 | 80 | /// Creates a widget that displays an [ImageStream] obtained from a [File]. 81 | /// 82 | /// The [file], [scale], and [repeat] arguments must not be null. 83 | /// 84 | /// On Android, this may require the 85 | /// `android.permission.READ_EXTERNAL_STORAGE` permission. 86 | FadingImage.file(File file, { 87 | Key key, 88 | double scale: 1.0, 89 | this.width, 90 | this.height, 91 | this.color, 92 | this.colorBlendMode, 93 | this.fit, 94 | this.alignment, 95 | this.repeat: ImageRepeat.noRepeat, 96 | this.centerSlice, 97 | this.gaplessPlayback: false 98 | }) : image = new FileImage(file, scale: scale), 99 | super(key: key); 100 | 101 | /// Creates a widget that displays an [ImageStream] obtained from an asset 102 | /// bundle. The key for the image is given by the `name` argument. 103 | /// 104 | /// If the `bundle` argument is omitted or null, then the 105 | /// [DefaultAssetBundle] will be used. 106 | /// 107 | /// If the `scale` argument is omitted or null, then pixel-density-aware asset 108 | /// resolution will be attempted. 109 | /// 110 | /// If [width] and [height] are both specified, and [scale] is not, then 111 | /// size-aware asset resolution will be attempted also. 112 | /// 113 | /// The [name] and [repeat] arguments must not be null. 114 | FadingImage.asset(String name, { 115 | Key key, 116 | AssetBundle bundle, 117 | double scale, 118 | this.width, 119 | this.height, 120 | this.color, 121 | this.colorBlendMode, 122 | this.fit, 123 | this.alignment, 124 | this.repeat: ImageRepeat.noRepeat, 125 | this.centerSlice, 126 | this.gaplessPlayback: false 127 | }) : image = scale != null ? new ExactAssetImage(name, bundle: bundle, scale: scale) 128 | : new AssetImage(name, bundle: bundle), 129 | super(key: key); 130 | 131 | /// Creates a widget that displays an [ImageStream] obtained from a [Uint8List]. 132 | /// 133 | /// The [bytes], [scale], and [repeat] arguments must not be null. 134 | FadingImage.memory(Uint8List bytes, { 135 | Key key, 136 | double scale: 1.0, 137 | this.width, 138 | this.height, 139 | this.color, 140 | this.colorBlendMode, 141 | this.fit, 142 | this.alignment, 143 | this.repeat: ImageRepeat.noRepeat, 144 | this.centerSlice, 145 | this.gaplessPlayback: false 146 | }) : image = new MemoryImage(bytes, scale: scale), 147 | super(key: key); 148 | 149 | /// The image to display. 150 | final ImageProvider image; 151 | 152 | /// If non-null, require the image to have this width. 153 | /// 154 | /// If null, the image will pick a size that best preserves its intrinsic 155 | /// aspect ratio. 156 | final double width; 157 | 158 | /// If non-null, require the image to have this height. 159 | /// 160 | /// If null, the image will pick a size that best preserves its intrinsic 161 | /// aspect ratio. 162 | final double height; 163 | 164 | /// If non-null, this color is blended with each image pixel using [colorBlendMode]. 165 | final Color color; 166 | 167 | /// Used to combine [color] with this image. 168 | /// 169 | /// The default is [BlendMode.srcIn]. In terms of the blend mode, [color] is 170 | /// the source and this image is the destination. 171 | /// 172 | /// See also: 173 | /// 174 | /// * [BlendMode], which includes an illustration of the effect of each blend mode. 175 | final BlendMode colorBlendMode; 176 | 177 | /// How to inscribe the image into the space allocated during layout. 178 | /// 179 | /// The default varies based on the other fields. See the discussion at 180 | /// [paintImage]. 181 | final BoxFit fit; 182 | 183 | /// How to align the image within its bounds. 184 | /// 185 | /// An alignment of (0.0, 0.0) aligns the image to the top-left corner of its 186 | /// layout bounds. An alignment of (1.0, 0.5) aligns the image to the middle 187 | /// of the right edge of its layout bounds. 188 | final FractionalOffset alignment; 189 | 190 | /// How to paint any portions of the layout bounds not covered by the image. 191 | final ImageRepeat repeat; 192 | 193 | /// The center slice for a nine-patch image. 194 | /// 195 | /// The region of the image inside the center slice will be stretched both 196 | /// horizontally and vertically to fit the image into its destination. The 197 | /// region of the image above and below the center slice will be stretched 198 | /// only horizontally and the region of the image to the left and right of 199 | /// the center slice will be stretched only vertically. 200 | final Rect centerSlice; 201 | 202 | /// Whether to continue showing the old image (true), or briefly show nothing 203 | /// (false), when the image provider changes. 204 | final bool gaplessPlayback; 205 | 206 | 207 | 208 | @override 209 | _ImageState createState() => new _ImageState(); 210 | 211 | @override 212 | void debugFillDescription(List description) { 213 | //super.debugFillDescription(description); 214 | description.add('image: $image'); 215 | if (width != null) 216 | description.add('width: $width'); 217 | if (height != null) 218 | description.add('height: $height'); 219 | if (color != null) 220 | description.add('color: $color'); 221 | if (colorBlendMode != null) 222 | description.add('colorBlendMode: $colorBlendMode'); 223 | if (fit != null) 224 | description.add('fit: $fit'); 225 | if (alignment != null) 226 | description.add('alignment: $alignment'); 227 | if (repeat != ImageRepeat.noRepeat) 228 | description.add('repeat: $repeat'); 229 | if (centerSlice != null) 230 | description.add('centerSlice: $centerSlice'); 231 | } 232 | } 233 | 234 | 235 | 236 | 237 | 238 | class _ImageState extends State with SingleTickerProviderStateMixin{ 239 | ImageStream _imageStream; 240 | ImageInfo _imageInfo; 241 | 242 | double _alpha = 0.0; 243 | AnimationController _controller; 244 | 245 | @override 246 | void initState(){ 247 | super.initState(); 248 | _controller = new AnimationController(vsync: this, duration: 249 | const Duration(milliseconds: 500)) 250 | ..addListener((){ 251 | setState((){ 252 | _alpha = _controller.value; 253 | }); 254 | }); 255 | } 256 | 257 | @override 258 | void didChangeDependencies() { 259 | _resolveImage(); 260 | super.didChangeDependencies(); 261 | } 262 | 263 | @override 264 | void didUpdateWidget(FadingImage oldWidget) { 265 | super.didUpdateWidget(oldWidget); 266 | if (widget.image != oldWidget.image) 267 | _resolveImage(); 268 | } 269 | 270 | @override 271 | void reassemble() { 272 | _resolveImage(); // in case the image cache was flushed 273 | super.reassemble(); 274 | } 275 | 276 | void _resolveImage() { 277 | final ImageStream oldImageStream = _imageStream; 278 | _imageStream = widget.image.resolve(createLocalImageConfiguration( 279 | context, 280 | size: widget.width != null && widget.height != null ? new Size(widget.width, widget.height) : null 281 | )); 282 | assert(_imageStream != null); 283 | if (_imageStream.key != oldImageStream?.key) { 284 | oldImageStream?.removeListener(_handleImageChanged); 285 | if (!widget.gaplessPlayback) 286 | setState(() { _imageInfo = null; }); 287 | _imageStream.addListener(_handleImageChanged); 288 | } 289 | } 290 | 291 | void _handleImageChanged(ImageInfo imageInfo, bool synchronousCall) { 292 | setState(() { 293 | _imageInfo = imageInfo; 294 | 295 | if(!synchronousCall) { 296 | _controller.stop(); 297 | _controller.forward(); 298 | } else _controller.value = 1.0; 299 | }); 300 | } 301 | 302 | @override 303 | void dispose() { 304 | _controller.dispose(); 305 | assert(_imageStream != null); 306 | _imageStream.removeListener(_handleImageChanged); 307 | super.dispose(); 308 | } 309 | 310 | @override 311 | Widget build(BuildContext context) { 312 | 313 | return new RawImage( 314 | image: _imageInfo?.image, 315 | width: widget.width, 316 | height: widget.height, 317 | scale: _imageInfo?.scale ?? 1.0, 318 | color: Color.lerp(Colors.white, Colors.transparent , _alpha), 319 | colorBlendMode: BlendMode.srcOver, 320 | fit: widget.fit, 321 | alignment: Alignment.center, 322 | repeat: widget.repeat, 323 | centerSlice: widget.centerSlice, 324 | ); 325 | 326 | 327 | } 328 | 329 | @override 330 | void debugFillDescription(List description) { 331 | //super.debugFillDescription(description); 332 | description.add('stream: $_imageStream'); 333 | description.add('pixels: $_imageInfo'); 334 | } 335 | } 336 | 337 | 338 | class BoomerangCurve extends Curve { 339 | 340 | final Curve child; 341 | final double boomBack; 342 | final double overshoot; 343 | 344 | BoomerangCurve({ 345 | this.child: Curves.linear, 346 | this.boomBack: 0.5, 347 | this.overshoot: 1.0 348 | }); 349 | 350 | @override 351 | double transform(double t) { 352 | if (t < boomBack) { 353 | double value = t / boomBack; 354 | return 1 + overshoot * child.transform(value); 355 | } else { 356 | double value = 1 - (t - boomBack) / (1 - boomBack); 357 | return 1 + overshoot * child.transform(value); 358 | } 359 | } 360 | } 361 | 362 | -------------------------------------------------------------------------------- /lib/widgets/community.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:lime/lime/lime.dart'; 5 | import 'package:lime/widgets/common.dart'; 6 | import 'package:lime/widgets/loading_list_view.dart'; 7 | 8 | class Community extends StatefulWidget { 9 | 10 | @override 11 | State createState() { 12 | return new _CommunityState(); 13 | } 14 | } 15 | 16 | class _CommunityState extends State { 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return new LoadingListView( 21 | request, 22 | widgetAdapter: adapt 23 | 24 | ); 25 | } 26 | 27 | Future> request(int page, int pageSize) async { 28 | return lime.api.getChannels(page: page, pageSize: pageSize); 29 | } 30 | 31 | Widget adapt(Map map) { 32 | return new CommunityMember(map); 33 | } 34 | } 35 | 36 | class CommunityMember extends StatelessWidget { 37 | 38 | final Map member; 39 | 40 | CommunityMember(this.member); 41 | 42 | @override 43 | Widget build(BuildContext context) { 44 | String channel = member["pseudo"]; 45 | String name = member["realname"]; 46 | int likes = member["likes"]; 47 | 48 | Widget layer0; 49 | Widget layer2; 50 | 51 | print(lime.api.getLatestImage(channel)); 52 | layer0 = new FadingImage.network( 53 | lime.api.getLatestImage(channel), 54 | fit: BoxFit.cover 55 | ); 56 | 57 | 58 | Row row = new Row( 59 | mainAxisAlignment: MainAxisAlignment.start, 60 | crossAxisAlignment: CrossAxisAlignment.start, 61 | children: [ 62 | new ClipOval( 63 | child: new FadingImage.network( 64 | lime.api.getChannelImage(channel), 65 | height: 75.0, 66 | width: 75.0, 67 | fit: BoxFit.cover 68 | ) 69 | ), 70 | 71 | new Container( 72 | padding: new EdgeInsets.symmetric(horizontal: 12.0), 73 | child: new Column( 74 | crossAxisAlignment: CrossAxisAlignment.start, 75 | mainAxisAlignment: MainAxisAlignment.start, 76 | mainAxisSize: MainAxisSize.min, 77 | children: [ 78 | new Text( 79 | channel, 80 | style: new TextStyle( 81 | color: Colors.white, 82 | fontSize: 20.0, 83 | fontWeight: FontWeight.w600 84 | ) 85 | ), 86 | new Text( 87 | name, 88 | style: new TextStyle( 89 | color: Colors.white, 90 | fontSize: 14.0, 91 | fontWeight: FontWeight.w400 92 | ) 93 | ), 94 | new Row( 95 | children: [ 96 | new Container( 97 | padding: new EdgeInsets.only(right: 8.0), 98 | child: 99 | new Image.asset( 100 | "img/ghost_like_white.png", 101 | width: 10.0, 102 | ) 103 | ), 104 | new Text( 105 | member["likes"].toString(), 106 | style: new TextStyle( 107 | color: Colors.white, 108 | fontWeight: FontWeight.w400 109 | ) 110 | ) 111 | ] 112 | 113 | ) 114 | ] 115 | ) 116 | ) 117 | ] 118 | ); 119 | 120 | 121 | layer2 = new Container( 122 | padding: new EdgeInsets.symmetric(vertical: 8.0, horizontal: 8.0), 123 | child: row, 124 | decoration: new BoxDecoration( 125 | gradient: new LinearGradient( 126 | begin: FractionalOffset.topCenter, 127 | end: FractionalOffset.bottomCenter, 128 | colors: [ 129 | Color.lerp(Colors.transparent, Colors.black, 0.2), 130 | Colors.transparent 131 | ] 132 | ) 133 | ) 134 | ); 135 | 136 | Widget stack = new Stack( 137 | children: [ 138 | layer0, 139 | layer2 140 | ], 141 | fit: StackFit.expand 142 | ); 143 | 144 | Widget sizedBox = new SizedBox.fromSize( 145 | child: stack, 146 | size: new Size.fromHeight(300.0) 147 | ); 148 | 149 | 150 | Container container = new Container( 151 | child: sizedBox, 152 | margin: new EdgeInsets.symmetric(vertical: 1.0) 153 | ); 154 | 155 | Card card = new Card( 156 | child: container 157 | ); 158 | 159 | return card; 160 | } 161 | } -------------------------------------------------------------------------------- /lib/widgets/feed.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:math'; 3 | import 'dart:ui'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/widgets.dart'; 6 | import 'package:lime/lime/lime.dart'; 7 | import 'package:lime/widgets/DismissibleWrapper.dart'; 8 | import 'package:lime/widgets/circular_clip.dart'; 9 | import 'package:lime/widgets/frosted_glas.dart'; 10 | import 'package:lime/widgets/loading_list_view.dart'; 11 | import 'package:lime/widgets/post.dart'; 12 | import 'package:lime/widgets/post_create.dart'; 13 | 14 | class Feed extends StatefulWidget { 15 | 16 | final int pageSize; 17 | final int pageThreshold; 18 | 19 | Feed({ 20 | Key key, 21 | this.pageSize: 50, 22 | this.pageThreshold: 10 23 | }) :super(key: key); 24 | 25 | 26 | @override 27 | State createState() { 28 | return new _FeedState(); 29 | } 30 | 31 | 32 | } 33 | 34 | class _FeedState extends State { 35 | 36 | BuildContext _buildContext; 37 | StreamController _postStreamController; 38 | 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | 43 | _buildContext = context; 44 | 45 | Widget w; 46 | w = new LoadingListView( 47 | request, widgetAdapter: adapt, pageSize: widget.pageSize, 48 | pageThreshold: widget.pageThreshold, topStream: _postStreamController.stream,); 49 | 50 | 51 | Widget fab = new FeedActionButton(onPosted: onPosted,); 52 | 53 | 54 | w = new Scaffold( 55 | body: w, 56 | floatingActionButton: fab, 57 | ); 58 | 59 | 60 | return w; 61 | } 62 | 63 | void onPosted(Map post){ 64 | _postStreamController.add(post); 65 | } 66 | 67 | 68 | @override 69 | void initState() { 70 | super.initState(); 71 | _postStreamController = new StreamController(); 72 | } 73 | 74 | Future> request(int page, int pageSize) async { 75 | return lime.api.getFeed(paginationIndex: page, paginationSize: pageSize); 76 | } 77 | 78 | Widget adapt(Map map) { 79 | return new Post(map); 80 | } 81 | 82 | 83 | } 84 | 85 | class FeedActionButton extends StatefulWidget { 86 | 87 | final PostedCallback onPosted; 88 | 89 | FeedActionButton({this.onPosted}); 90 | 91 | @override 92 | State createState() { 93 | return new _FeedActionButtonState(); 94 | } 95 | } 96 | 97 | class _FeedActionButtonState extends State { 98 | 99 | BuildContext _context; 100 | 101 | @override 102 | Widget build(BuildContext context) { 103 | _context = context; 104 | return new FloatingActionButton( 105 | child: new Icon( 106 | Icons.add, 107 | color: Theme 108 | .of(context) 109 | .iconTheme 110 | .color 111 | ), 112 | onPressed: onPressed, 113 | backgroundColor: Colors.white 114 | ); 115 | } 116 | 117 | onPressed() async { 118 | Map post = await Navigator.of(_context).push(new _PostCreateRoute(_context)); 119 | if(post != null && widget.onPosted!=null){ 120 | this.widget.onPosted(post); 121 | } 122 | } 123 | } 124 | 125 | class _PostCreateRoute extends TransitionRoute with LocalHistoryRoute { 126 | 127 | final BuildContext context; 128 | 129 | bool dismissed = false; 130 | 131 | _PostCreateRoute(this.context); 132 | 133 | 134 | @override 135 | Iterable createOverlayEntries() { 136 | var overlay = new OverlayEntry(builder: (context) { 137 | Widget w; 138 | w = new AnimatedBuilder(animation: animation, builder: (context, widget) { 139 | Widget w = new PostCreate(onDismiss: onDismissed, onPosted: onPosted,); 140 | print("animation ${animation.value}"); 141 | w = new Material(child: w, color: Colors.white.withOpacity(0.5),); 142 | w = new CircularClip(child: w, clip: animation.value,); 143 | w = 144 | new FrostedGlass(child: w, sigma: animation.value * 5.0, opacity: 0.0,); 145 | 146 | w = new DismissibleWrapper(child: w, direction: DismissDirection.down, 147 | onDismissed: (x) => onDismissed(), 148 | key: new Key("POST_CREATE"),); 149 | 150 | 151 | return w; 152 | }); 153 | return w; 154 | }, 155 | opaque: false, 156 | maintainState: true); 157 | 158 | return [overlay]; 159 | } 160 | 161 | void onPosted(Map post){ 162 | Navigator.of(context).pop(post); 163 | } 164 | 165 | void onDismissed() { 166 | this.controller.value=0.0; 167 | Navigator.of(context).pop(); 168 | } 169 | 170 | // TODO: implement opaque 171 | @override 172 | bool get opaque => false; 173 | 174 | // TODO: implement transitionDuration 175 | @override 176 | Duration get transitionDuration => const Duration(milliseconds: 400); 177 | } 178 | 179 | -------------------------------------------------------------------------------- /lib/widgets/frosted_glas.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | 5 | class FrostedGlass extends StatelessWidget{ 6 | 7 | final Widget child; 8 | final double sigma; 9 | final double opacity; 10 | 11 | FrostedGlass({this.child, this.sigma: 5.0, this.opacity: 0.5}); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | Widget w = new Container( 16 | child: new BackdropFilter( 17 | filter: new ImageFilter.blur(sigmaX: sigma , sigmaY: sigma), 18 | child: new Container( 19 | decoration: new BoxDecoration( 20 | color: Colors.white.withOpacity(opacity) 21 | ), 22 | child: new Center( 23 | child: child 24 | ), 25 | ), 26 | ), 27 | ); 28 | 29 | return w; 30 | } 31 | } -------------------------------------------------------------------------------- /lib/widgets/loading_list_view.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:lime/misc/functions.dart'; 5 | import 'package:lime/misc/notifications.dart'; 6 | import 'package:meta/meta.dart'; 7 | 8 | class LoadingListView extends StatefulWidget { 9 | 10 | final PageRequest pageRequest; 11 | final int pageSize; 12 | final int pageThreshold; 13 | final WidgetAdapter widgetAdapter; 14 | final bool reverse; 15 | final Indexer indexer; 16 | 17 | /// New elements will appear at the start 18 | final Stream topStream; 19 | 20 | LoadingListView(this.pageRequest, { 21 | this.pageSize: 50, 22 | this.pageThreshold:10, 23 | @required this.widgetAdapter: null, 24 | this.reverse: false, 25 | this.indexer, 26 | this.topStream 27 | }); 28 | 29 | @override 30 | State createState() { 31 | return new _LoadingListViewState(); 32 | } 33 | } 34 | 35 | 36 | class _LoadingListViewState extends State> { 37 | 38 | List objects = []; 39 | Map index = {}; 40 | Future request; 41 | 42 | @override 43 | Widget build(BuildContext context) { 44 | ListView listView = new ListView.builder( 45 | itemBuilder: itemBuilder, 46 | itemCount: objects.length, 47 | reverse: widget.reverse 48 | ); 49 | 50 | RefreshIndicator refreshIndicator = new RefreshIndicator( 51 | onRefresh: onRefresh, 52 | child: listView 53 | ); 54 | 55 | return new NotificationListener>( 56 | child: refreshIndicator, 57 | onNotification: onUpdate); 58 | } 59 | 60 | @override 61 | void initState() { 62 | super.initState(); 63 | this.lockedLoadNext(); 64 | if(widget.topStream!=null){ 65 | widget.topStream.listen((T t){ 66 | setState((){ 67 | this.objects.insert(0, t); 68 | this.reIndex(); 69 | }); 70 | }); 71 | } 72 | } 73 | 74 | Widget itemBuilder(BuildContext context, int index) { 75 | if (index + widget.pageThreshold > objects.length) { 76 | notifyThreshold(); 77 | } 78 | 79 | return widget.widgetAdapter != null ? widget.widgetAdapter(objects[index]) 80 | : new Container(); 81 | } 82 | 83 | 84 | void notifyThreshold() { 85 | lockedLoadNext(); 86 | } 87 | 88 | bool onUpdate(ListElementUpdate update) { 89 | if (widget.indexer == null) { 90 | debugPrint("ListElementUpdate on un-indexed list"); 91 | return false; 92 | } 93 | 94 | int index = this.index[update.key]; 95 | if (index == null) { 96 | debugPrint("ListElementUpdate index not found"); 97 | return false; 98 | } 99 | 100 | setState(() { 101 | this.objects[index] = update.instance; 102 | }); 103 | return true; 104 | } 105 | 106 | Future onRefresh() async { 107 | this.request?.timeout(const Duration()); 108 | List fetched = await widget.pageRequest(0, widget.pageSize); 109 | setState(() { 110 | this.objects.clear(); 111 | this.index.clear(); 112 | this.addObjects(fetched); 113 | }); 114 | 115 | return true; 116 | } 117 | 118 | void lockedLoadNext() { 119 | if (this.request == null) { 120 | this.request = loadNext().then((x) { 121 | this.request = null; 122 | }); 123 | } 124 | } 125 | 126 | Future loadNext() async { 127 | int page = (objects.length / widget.pageSize).floor(); 128 | List fetched = await widget.pageRequest(page, widget.pageSize); 129 | 130 | if(mounted) { 131 | this.setState(() { 132 | addObjects(fetched); 133 | }); 134 | } 135 | } 136 | 137 | 138 | void addObjects(Iterable objects) { 139 | objects.forEach((T object) { 140 | int index = this.objects.length; 141 | this.objects.add(object); 142 | if (widget.indexer != null) { 143 | this.index[widget.indexer(object)] = index; 144 | } 145 | }); 146 | } 147 | 148 | void reIndex(){ 149 | this.index .clear(); 150 | if(widget.indexer!=null){ 151 | int i = 0; 152 | this.objects.forEach((object){ 153 | index[widget.indexer(object)] == i; 154 | i++; 155 | }); 156 | } 157 | } 158 | } 159 | 160 | 161 | -------------------------------------------------------------------------------- /lib/widgets/page_post.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | import 'package:image_picker/image_picker.dart'; 6 | 7 | class PagePost extends StatefulWidget { 8 | 9 | @override 10 | State createState() { 11 | return new _PagePostState(); 12 | } 13 | } 14 | 15 | class _PagePostState extends State { 16 | 17 | File imageFile; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return new Container( 22 | padding: const EdgeInsets.all(16.0), 23 | child: new Column( 24 | mainAxisAlignment: MainAxisAlignment.end, 25 | children: [ 26 | new ImagePreview(imageFile), 27 | new Row( 28 | children: [ 29 | new IconButton( 30 | icon: new Icon(Icons.image), onPressed: selectImage) 31 | , 32 | new Expanded( 33 | child: new TextField( 34 | maxLines: 7, 35 | keyboardType: TextInputType.text 36 | ) 37 | ), 38 | 39 | new IconButton( 40 | icon: new Icon(Icons.done), 41 | onPressed: () => print("sending..")) 42 | ] 43 | ) 44 | ] 45 | ) 46 | ); 47 | } 48 | 49 | Future selectImage() async { 50 | File file = await ImagePicker.pickImage(); 51 | mounted ? this.setState(() => this.imageFile = file) : null; 52 | } 53 | } 54 | 55 | class ImagePreview extends StatelessWidget { 56 | 57 | final File imageFile; 58 | 59 | ImagePreview(this.imageFile); 60 | 61 | @override 62 | Widget build(BuildContext context) { 63 | if (this.imageFile == null) return new Container(); 64 | 65 | return new Expanded( 66 | child: new Container( 67 | padding: const EdgeInsets.all(8.0), 68 | child: new Image.file(this.imageFile) 69 | ) 70 | ); 71 | } 72 | } -------------------------------------------------------------------------------- /lib/widgets/post.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:lime/lime/lime.dart'; 5 | import 'package:lime/misc/notifications.dart'; 6 | import 'package:lime/widgets/common.dart'; 7 | 8 | class Post extends StatefulWidget { 9 | final Map post; 10 | final double paddingH = 8.0; 11 | final Duration queryInterval; 12 | 13 | Post(this.post, { 14 | Key key, 15 | this.queryInterval: const Duration(seconds: 2) 16 | }) : super(key: new Key(post["id"].toString())); 17 | 18 | @override 19 | State createState() { 20 | return new PostState(); 21 | } 22 | 23 | 24 | } 25 | 26 | class PostState extends State { 27 | 28 | Timer timer; 29 | BuildContext buildContext; 30 | 31 | 32 | @override 33 | void initState() { 34 | super.initState(); 35 | startTimer(); 36 | } 37 | 38 | @override 39 | void dispose() { 40 | timer?.cancel(); 41 | timer = null; 42 | super.dispose(); 43 | } 44 | 45 | void startTimer() { 46 | if (!mounted) return; 47 | if (timer != null) timer.cancel(); 48 | timer = new Timer(widget.queryInterval, query); 49 | } 50 | 51 | Future query() async { 52 | if (!mounted) return; 53 | 54 | Map post = await lime.api.getMessage(widget.post["id"]).catchError((error) { 55 | return null; 56 | }); 57 | 58 | if (post != null) { 59 | if (mounted) { 60 | new ListElementUpdate(widget.post["id"], post); 61 | } 62 | } 63 | 64 | startTimer(); 65 | } 66 | 67 | bool contains(String key) { 68 | return widget.post[key] != null; 69 | } 70 | 71 | bool notNull(Object o) => o != null; 72 | 73 | @override 74 | Widget build(BuildContext context) { 75 | buildContext = context; 76 | 77 | 78 | Container container = new Container( 79 | margin: new EdgeInsets.symmetric(vertical: 4.0, horizontal: 4.0), 80 | padding: const EdgeInsets.symmetric( 81 | horizontal: 2.0, vertical: 6.0), 82 | child: new Column( 83 | mainAxisAlignment: MainAxisAlignment.start, 84 | crossAxisAlignment: CrossAxisAlignment.start, 85 | children: [ 86 | new Container( 87 | padding: new EdgeInsets.symmetric( 88 | horizontal: widget.paddingH), 89 | child: new PostHeaderWidget(widget.post) 90 | ), 91 | contains("mediaUrl") 92 | ? new PostImageWidget(widget.post) 93 | : null, 94 | new Container( 95 | padding: new EdgeInsets.symmetric( 96 | vertical: 8.0, horizontal: widget.paddingH), 97 | child: new Text(widget.post["message"] != null 98 | ? widget.post["message"] 99 | : "")), 100 | 101 | new PostInteraction(widget.post), 102 | new LastComments(widget.post) 103 | 104 | ].where(notNull).toList() 105 | 106 | ) 107 | 108 | ); 109 | 110 | Card card = new Card( 111 | color: Colors.white, 112 | child: container 113 | ); 114 | 115 | return card; 116 | } 117 | } 118 | 119 | 120 | class PostHeaderWidget extends StatelessWidget { 121 | final Map post; 122 | 123 | PostHeaderWidget(this.post); 124 | 125 | String getChannelImage() { 126 | String imageRaw = post["channelImage"]; 127 | return imageRaw != null ? lime.api.getMediaUrl(imageRaw) : null; 128 | } 129 | 130 | bool notNull(Object o) => o != null; 131 | 132 | @override 133 | Widget build(BuildContext context) { 134 | return new Row( 135 | mainAxisSize: MainAxisSize.max, 136 | children: [ 137 | post["channelImage"] != null 138 | ? new ClipOval( 139 | child: new Container( 140 | width: 50.0, 141 | height: 50.0, 142 | child: new FadingImage.network( 143 | lime.api.getChannelImage(post["channel"]), 144 | fit: BoxFit.cover))) 145 | : null, 146 | new Expanded( 147 | child: new Container( 148 | padding: new EdgeInsets.symmetric(horizontal: 12.0), 149 | child: new Column( 150 | children: [ 151 | new Text(post["channel"] ?? "", 152 | style: new TextStyle(fontWeight: FontWeight.bold)), 153 | new Text(post["realName"] ?? "", 154 | style: new TextStyle(fontSize: 12.0)), 155 | 156 | new PostLocationWidget(post) 157 | ], 158 | mainAxisAlignment: MainAxisAlignment.start, 159 | crossAxisAlignment: CrossAxisAlignment.start))), 160 | new Container( 161 | alignment: FractionalOffset.centerRight, 162 | padding: new EdgeInsets.symmetric(horizontal: 8.0), 163 | child: new Column(children: [ 164 | new Text("16:09", 165 | style: new TextStyle( 166 | fontSize: 12.0, fontWeight: FontWeight.w300)), 167 | new Text("05.05", 168 | style: new TextStyle( 169 | fontSize: 10.0, fontWeight: FontWeight.w300)) 170 | ])), 171 | new FractionalTranslation( 172 | child: new PopupMenuButton( 173 | itemBuilder: (_) => 174 | >[ 175 | new PopupMenuItem( 176 | child: const Text('löschen'), value: 'delete'), 177 | new PopupMenuItem( 178 | child: const Text('melden'), value: 'report'), 179 | ], 180 | elevation: 8.0), 181 | translation: new Offset(0.0, -0.25)) 182 | ].where(notNull).toList(), 183 | crossAxisAlignment: CrossAxisAlignment.start, 184 | mainAxisAlignment: MainAxisAlignment.start, 185 | ); 186 | } 187 | } 188 | 189 | 190 | class PostLocationWidget extends StatelessWidget { 191 | 192 | final Map post; 193 | 194 | PostLocationWidget(this.post); 195 | 196 | @override 197 | Widget build(BuildContext context) { 198 | double distance = post["distance"]; 199 | String city = post["city"]; 200 | 201 | if (distance == null && city == null) { 202 | return new Container(); 203 | } 204 | 205 | double km = distance != null ? lime.distanceToKm(distance) : null; 206 | 207 | 208 | String display; 209 | 210 | if (km == null || (km > 30.0 && city != null)) { 211 | display = city; 212 | } else { 213 | display = "${km.toStringAsFixed(1)} km"; 214 | } 215 | 216 | return new Text( 217 | display, 218 | style: new TextStyle( 219 | fontSize: 10.0, 220 | fontWeight: FontWeight.w300 221 | ) 222 | ); 223 | } 224 | } 225 | 226 | class PostImageWidget extends StatelessWidget { 227 | final Map post; 228 | 229 | double getAspectRatio() { 230 | var arRaw = post["aspectRatio"]; 231 | if (arRaw != null) { 232 | double ratio = arRaw; 233 | if (ratio > 1.2) return 1 / 1.2; 234 | if (ratio < 0.2) return 1 / 0.2; 235 | return 1 / ratio; 236 | } 237 | return 1.0; 238 | } 239 | 240 | String getImage() { 241 | String imageRaw = post["mediaUrl"]; 242 | return imageRaw != null ? lime.api.getMediaUrl(imageRaw) : null; 243 | } 244 | 245 | PostImageWidget(this.post); 246 | 247 | @override 248 | Widget build(BuildContext context) { 249 | return new AspectRatio( 250 | aspectRatio: getAspectRatio(), 251 | child: new Container( 252 | padding: new EdgeInsets.symmetric(vertical: 8.0, horizontal: 0.0), 253 | child: new FadingImage.network(getImage(), fit: BoxFit.cover) 254 | )); 255 | } 256 | 257 | } 258 | 259 | 260 | class PostInteraction extends StatefulWidget { 261 | 262 | 263 | final Map post; 264 | 265 | PostInteraction(this.post); 266 | 267 | @override 268 | State createState() { 269 | return new _PostInteractionState(); 270 | } 271 | } 272 | 273 | 274 | class _PostInteractionState extends State { 275 | 276 | @override 277 | Widget build(BuildContext context) { 278 | return new Container( 279 | padding: new EdgeInsets.symmetric(horizontal: 8.0), 280 | child: 281 | new Row( 282 | children: [ 283 | new GhostLike( 284 | like: widget.post["liked"], 285 | limeLikeCallback: likeCallback 286 | ), 287 | new Expanded( 288 | child: new LikingChannels(widget.post["channelsLiking"]) 289 | ), 290 | new IconButton( 291 | icon: new Icon( 292 | Icons.chat_bubble_outline, 293 | size: 25.0, 294 | color: Colors.grey 295 | ), 296 | onPressed: () { 297 | print("Chat pressed"); 298 | } 299 | ) 300 | ] 301 | ) 302 | ); 303 | } 304 | 305 | void likeCallback(bool like) { 306 | like ? lime.api.putVote(widget.post["id"]) : 307 | lime.api.deleteVote(widget.post["id"]); 308 | setState(() { 309 | List channels = widget.post["channelsLiking"]; 310 | channels.remove(lime.api.channel); 311 | if (like) channels.insert(0, lime.api.channel); 312 | widget.post["liked"] = like; 313 | }); 314 | } 315 | } 316 | 317 | 318 | class GhostLike extends StatefulWidget { 319 | 320 | 321 | final bool like; 322 | final LimeLikeCallback limeLikeCallback; 323 | 324 | GhostLike({ 325 | this.like: false, 326 | this.limeLikeCallback: null 327 | }); 328 | 329 | 330 | @override 331 | State createState() { 332 | return new _GhostLikeState(); 333 | } 334 | } 335 | 336 | class _GhostLikeState extends State 337 | with SingleTickerProviderStateMixin { 338 | 339 | AnimationController controller; 340 | Curve scaleCurve; 341 | double likeAlpha = 0.0; 342 | double scale = 1.0; 343 | 344 | 345 | @override 346 | Widget build(BuildContext context) { 347 | return new ConstrainedBox( 348 | child: new InkResponse( 349 | child: new FractionallySizedBox( 350 | child: buildGhost(context), 351 | heightFactor: scale 352 | ), 353 | onTap: onTap 354 | ), 355 | constraints: new BoxConstraints( 356 | maxHeight: 25.0 357 | ) 358 | ); 359 | } 360 | 361 | Widget buildGhost(BuildContext context) { 362 | return new FractionallySizedBox( 363 | child: new Image.asset 364 | ( 365 | "img/ghost_like_white.png", 366 | color: Color.lerp(Colors.grey, Theme 367 | .of(context) 368 | .primaryColor, likeAlpha), 369 | colorBlendMode: BlendMode.srcATop, 370 | ), 371 | 372 | ); 373 | } 374 | 375 | 376 | void onTap() { 377 | if (widget.limeLikeCallback != null) { 378 | widget.limeLikeCallback(controller.value < 0.5); 379 | } 380 | } 381 | 382 | 383 | @override 384 | void initState() { 385 | super.initState(); 386 | 387 | scaleCurve = new BoomerangCurve(child: Curves.bounceInOut); 388 | controller = new AnimationController( 389 | vsync: this, 390 | duration: const Duration(milliseconds: 500), 391 | ) 392 | ..addListener(() { 393 | setState(() { 394 | scale = scaleCurve.transform(controller.value); 395 | likeAlpha = controller.value; 396 | }); 397 | }); 398 | 399 | controller.value = widget.like ? 1.0 : 0.0; 400 | } 401 | 402 | 403 | @override 404 | void didUpdateWidget(GhostLike oldWidget) { 405 | super.didUpdateWidget(oldWidget); 406 | if (widget.like) { 407 | controller.forward(); 408 | } else { 409 | controller.reverse(); 410 | } 411 | } 412 | 413 | @override 414 | void dispose() { 415 | super.dispose(); 416 | controller.dispose(); 417 | } 418 | 419 | 420 | } 421 | 422 | 423 | typedef LimeLikeCallback(bool like); 424 | 425 | 426 | class LikingChannels extends StatefulWidget { 427 | 428 | final List channels; 429 | 430 | LikingChannels(this.channels); 431 | 432 | @override 433 | State createState() { 434 | return new _LikingChannelsState(); 435 | } 436 | } 437 | 438 | 439 | class _LikingChannelsState extends State { 440 | 441 | @override 442 | Widget build(BuildContext context) { 443 | return new Row( 444 | children: [ 445 | new Container( 446 | padding: new EdgeInsets.only(left: 8.0, right: 4.0), 447 | child: new Text( 448 | widget.channels!=null?(widget.channels?.length.toString()) ?? "" : 0.toString(), 449 | style: new TextStyle( 450 | fontWeight: FontWeight.w300 451 | ) 452 | ) 453 | ), 454 | 455 | new Container( 456 | child: new Text( 457 | buildDisplayString(), 458 | style: new TextStyle( 459 | fontWeight: FontWeight.w500 460 | ), 461 | overflow: TextOverflow.ellipsis 462 | ), 463 | padding: new EdgeInsets.only(right: 8.0) 464 | ) 465 | ] 466 | ); 467 | } 468 | 469 | String buildDisplayString() { 470 | String build = ""; 471 | bool first = true; 472 | widget.channels?.forEach((String channel) { 473 | build = "$build${!first ? "," : ""} $channel"; 474 | first = false; 475 | }); 476 | return build; 477 | } 478 | 479 | @override 480 | void didUpdateWidget(LikingChannels oldWidget) { 481 | super.didUpdateWidget(oldWidget); 482 | } 483 | } 484 | 485 | 486 | class LastComments extends StatefulWidget { 487 | 488 | final Map post; 489 | final List> lastComments; 490 | final int comments; 491 | 492 | LastComments(this.post) 493 | : lastComments = post["lastComments"], 494 | comments = post["comments"]; 495 | 496 | @override 497 | State createState() { 498 | return new _LastCommentsState(); 499 | } 500 | } 501 | 502 | class _LastCommentsState extends State { 503 | 504 | @override 505 | Widget build(BuildContext context) { 506 | return new Container( 507 | padding: new EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0), 508 | child: new RichText(text: getCommentsSpan(context)) 509 | ); 510 | } 511 | 512 | TextSpan getCommentsSpan(BuildContext context) { 513 | var innerF = () { 514 | List list = new List(); 515 | 516 | int furtherComments = widget.comments??0 - widget.lastComments?.length??0; 517 | if (furtherComments > 0) { 518 | list.add( 519 | new TextSpan( 520 | text: "... $furtherComments previous answers\n", 521 | style: new TextStyle( 522 | fontStyle: FontStyle.italic, 523 | fontWeight: FontWeight.w300 524 | ) 525 | ) 526 | ); 527 | } 528 | 529 | widget.lastComments?.forEach( 530 | (comment) { 531 | list.add( 532 | new TextSpan( 533 | text: "${comment["channel"]} ", 534 | style: new TextStyle( 535 | fontWeight: FontWeight.w400 536 | ) 537 | ) 538 | ); 539 | 540 | list.add( 541 | new TextSpan( 542 | text: "${comment["message"]}\n", 543 | style: new TextStyle( 544 | fontWeight: FontWeight.w300 545 | ) 546 | ) 547 | ); 548 | } 549 | ); 550 | 551 | return list; 552 | }; 553 | 554 | return new TextSpan( 555 | children: innerF(), 556 | style: Theme 557 | .of(context) 558 | .textTheme 559 | .body2 560 | ); 561 | } 562 | 563 | List comments(BuildContext context) { 564 | List list = new List(); 565 | widget.lastComments.forEach((comment) { 566 | TextSpan channelSpan = new TextSpan( 567 | text: "${comment["channel"]} ", 568 | style: new TextStyle( 569 | fontWeight: FontWeight.w400, 570 | ) 571 | ); 572 | 573 | TextSpan messageSpan = new TextSpan( 574 | text: comment["message"], 575 | style: new TextStyle( 576 | fontWeight: FontWeight.w300 577 | ) 578 | ); 579 | 580 | TextSpan finalSpan = new TextSpan( 581 | children: [ 582 | channelSpan, 583 | messageSpan 584 | ], 585 | style: Theme 586 | .of(context) 587 | .textTheme 588 | .body2 589 | ); 590 | 591 | list.add( 592 | new RichText( 593 | text: finalSpan, 594 | textAlign: TextAlign.left 595 | ) 596 | ); 597 | }); 598 | 599 | return list; 600 | } 601 | } 602 | 603 | -------------------------------------------------------------------------------- /lib/widgets/post_create.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | import 'package:image_picker/image_picker.dart'; 6 | import 'package:lime/lime/lime.dart'; 7 | import 'package:lime/misc/utils.dart'; 8 | import 'package:lime/widgets/frosted_glas.dart'; 9 | 10 | typedef void PostedCallback(Map posting); 11 | 12 | class PostCreate extends StatefulWidget { 13 | 14 | final VoidCallback onDismiss; 15 | final PostedCallback onPosted; 16 | 17 | PostCreate({ 18 | this.onDismiss, 19 | this.onPosted 20 | }); 21 | 22 | @override 23 | State createState() { 24 | return new _PostCreateState(); 25 | } 26 | } 27 | 28 | class _PostCreateState extends State 29 | with SingleTickerProviderStateMixin { 30 | 31 | /// Any currently picked image file to display 32 | File _file; 33 | 34 | /// The text currently entered 35 | String _text; 36 | 37 | /// Indicating whether or not the 38 | /// user is currently sending the post 39 | /// to the server and is waiting for any 40 | /// response. 41 | bool _posting = false; 42 | 43 | /// Animation which should display 44 | /// a transition from normal state (=0) 45 | /// to posting state (=1) 46 | Animation _postingAnimation; 47 | AnimationController _postingAnimationController; 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | Widget w = new Column( 52 | children: [ 53 | new _Header(this), 54 | new _Body(this), 55 | new _Footer(this) 56 | ], 57 | mainAxisAlignment: MainAxisAlignment.spaceBetween 58 | ); 59 | 60 | w = new IgnorePointer(ignoring: _posting, child: w,); 61 | return w; 62 | } 63 | 64 | set image(File file) { 65 | this._file = file; 66 | } 67 | 68 | set text(String text) { 69 | this._text = text; 70 | } 71 | 72 | Future onPost() async { 73 | this.setState(() => this._posting = true); 74 | this._postingAnimationController.forward(); 75 | 76 | try { 77 | print("Postinng image: $_file with text: $_text"); 78 | List image; 79 | if (_file != null) { 80 | int size = await _file.length(); 81 | image = await lime.site.commission( 82 | ImageUtil.compressImage, 83 | positionalArgs: [_file] 84 | ); 85 | print("Compression done: first $size then ${image.length}"); 86 | } 87 | 88 | Map response = await lime.api.postMessage( 89 | text: _text, compressedImage: image); 90 | 91 | if(widget.onPosted!=null){ 92 | widget.onPosted(response); 93 | } 94 | 95 | } catch (e) { 96 | print("Posting failed: $e"); 97 | this._postingAnimationController.reverse(); 98 | } 99 | finally { 100 | this.setState(() => this._posting = false); 101 | } 102 | } 103 | 104 | 105 | @override 106 | void initState() { 107 | super.initState(); 108 | _postingAnimationController = 109 | new AnimationController( 110 | vsync: this, duration: const Duration(seconds: 1), value: 0.0); 111 | _postingAnimation = new CurvedAnimation( 112 | parent: _postingAnimationController, curve: Curves.ease); 113 | _postingAnimation.addListener(() => this.setState(() {})); 114 | } 115 | 116 | } 117 | 118 | 119 | class _Header extends StatelessWidget { 120 | 121 | final _PostCreateState _postCreateState; 122 | 123 | _Header(this._postCreateState); 124 | 125 | @override 126 | Widget build(BuildContext context) { 127 | Widget w; 128 | w = new Row( 129 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 130 | children: [ 131 | new IconButton( 132 | icon: new Icon( 133 | Icons.arrow_drop_down, 134 | color: Theme 135 | .of(context) 136 | .iconTheme 137 | .color 138 | ), 139 | onPressed: null 140 | ), 141 | new FlatButton( 142 | onPressed: _postCreateState.onPost, 143 | child: new Text( 144 | "POST", 145 | style: new TextStyle( 146 | color: Theme 147 | .of(context) 148 | .primaryColor 149 | ) 150 | ), 151 | splashColor: Theme 152 | .of(context) 153 | .primaryColor, 154 | 155 | ) 156 | ] 157 | ); 158 | 159 | w = new Stack( 160 | alignment: FractionalOffset.center, 161 | children: [ 162 | w, 163 | new Center( 164 | child: new Icon(Icons.drag_handle) 165 | ) 166 | ] 167 | ); 168 | 169 | w = new Container( 170 | margin: const EdgeInsets.only(top: 25.0), 171 | child: w, 172 | ); 173 | 174 | return new FractionalTranslation(translation: new Offset( 175 | 0.0, -_postCreateState._postingAnimation.value), child: w,); 176 | } 177 | 178 | 179 | } 180 | 181 | class _Body extends StatefulWidget { 182 | 183 | final _PostCreateState _postCreateState; 184 | 185 | _Body(this._postCreateState); 186 | 187 | @override 188 | State createState() { 189 | return new _BodyState(); 190 | } 191 | } 192 | 193 | class _BodyState extends State<_Body> { 194 | 195 | File image; 196 | 197 | @override 198 | Widget build(BuildContext context) { 199 | Widget child; 200 | if (image == null) { 201 | child = new Row( 202 | mainAxisAlignment: MainAxisAlignment.center, 203 | children: [ 204 | new IconButton( 205 | icon: new Icon(Icons.photo_camera), 206 | onPressed: pickImage 207 | ), 208 | new SizedBox(width: 50.0), 209 | new IconButton( 210 | icon: new Icon(Icons.photo), 211 | onPressed: pickImage 212 | ) 213 | ] 214 | ); 215 | } else { 216 | child = new Image.file(image); 217 | child = new Material( 218 | child: child, 219 | borderRadius: new BorderRadius.all(new Radius.circular(5.0)), 220 | elevation: 5.0 221 | 222 | ); 223 | 224 | 225 | child = new Dismissible( 226 | key: new ObjectKey(image), 227 | child: child, 228 | direction: DismissDirection.up, 229 | onDismissed: (direction) { 230 | setState(() => this.image = null); 231 | }, 232 | resizeDuration: const Duration(milliseconds: 1) 233 | ); 234 | 235 | 236 | List stacked = []; 237 | stacked.add(child); 238 | 239 | 240 | if (widget._postCreateState._posting) { 241 | Widget w; 242 | w = new LinearProgressIndicator(); 243 | stacked.add(w); 244 | } 245 | 246 | child = new Stack( 247 | children: stacked, 248 | alignment: FractionalOffset.bottomCenter, 249 | fit: StackFit.loose, 250 | ); 251 | 252 | child = new Container( 253 | child: child, 254 | margin: const EdgeInsets.all(10.0) 255 | ); 256 | } 257 | 258 | return new Flexible(child: child); 259 | } 260 | 261 | @override 262 | void initState() { 263 | super.initState(); 264 | this.widget._postCreateState._postingAnimation.addListener(() => 265 | this.setState(() {})); 266 | } 267 | 268 | Future pickImage() async { 269 | var image = await ImagePicker.pickImage(); 270 | widget._postCreateState.image = image; 271 | setState(() { 272 | this.image = image; 273 | }); 274 | } 275 | } 276 | 277 | class _Footer extends StatelessWidget { 278 | 279 | final _PostCreateState _postCreateState; 280 | 281 | _Footer(this._postCreateState); 282 | 283 | @override 284 | Widget build(BuildContext context) { 285 | Widget w = new Container( 286 | padding: const EdgeInsets.all(16.0), 287 | child: new Row( 288 | children: [ 289 | new Expanded( 290 | child: new TextField( 291 | maxLines: 7, 292 | decoration: new InputDecoration( 293 | labelText: "Message" 294 | ), 295 | onChanged: (String text) => _postCreateState.text = text 296 | ) 297 | ) 298 | ] 299 | ) 300 | ); 301 | 302 | w = new FractionalTranslation(translation: new Offset( 303 | 0.0, _postCreateState._postingAnimation.value), child: w,); 304 | 305 | return w; 306 | } 307 | } -------------------------------------------------------------------------------- /lib/widgets/trends.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:lime/lime/lime.dart'; 5 | import 'package:lime/widgets/loading_list_view.dart'; 6 | import 'package:lime/widgets/post.dart'; 7 | 8 | class Trends extends StatefulWidget { 9 | Trends({ 10 | Key key 11 | }) : super(key:key) { 12 | print("new Trends"); 13 | } 14 | 15 | 16 | @override 17 | State createState() { 18 | print("Creating new TrendsState"); 19 | return new _TrendsState(); 20 | } 21 | 22 | } 23 | 24 | class _TrendsState extends State { 25 | 26 | List > posts = []; 27 | 28 | 29 | _TrendsState() { 30 | print("new TrendsState"); 31 | } 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | return new LoadingListView(request, 36 | pageSize: -1, pageThreshold: -1, 37 | widgetAdapter: adapt); 38 | } 39 | 40 | 41 | Future> request(int page, int pageSize) async { 42 | if (page > 0) 43 | return []; 44 | else 45 | return await lime.api.getTrends(); 46 | } 47 | 48 | 49 | Widget adapt(Map map){ 50 | return new Post(map); 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /lime.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: lime 2 | description: A new flutter project. 3 | 4 | dependencies: 5 | flutter: 6 | sdk: flutter 7 | image_picker: 8 | path_provider: 9 | image: "^1.1.27" 10 | dart_image: "^1.0.2" 11 | pool: "^1.3.1" 12 | 13 | 14 | 15 | 16 | # For information on the generic Dart part of this file, see the 17 | # following page: https://www.dartlang.org/tools/pub/pubspec 18 | 19 | # The following section is specific to Flutter. 20 | flutter: 21 | 22 | # The following line ensures that the Material Icons font is 23 | # included with your application, so that you can use the icons in 24 | # the Icons class. 25 | uses-material-design: true 26 | 27 | # To add assets to your application, add an assets section here, in 28 | # this "flutter" section, as in: 29 | # assets: 30 | # - images/a_dot_burr.jpeg 31 | # - images/a_dot_ham.jpeg 32 | 33 | # To add assets from package dependencies, first ensure the asset 34 | # is in the lib/ directory of the dependency. Then, 35 | # refer to the asset with a path prefixed with 36 | # `packages/PACKAGE_NAME/`. Note: the `lib/` is implied, do not 37 | # include `lib/` in the asset path. 38 | # 39 | # Here is an example: 40 | # 41 | # assets: 42 | # - packages/PACKAGE_NAME/path/to/asset 43 | assets: 44 | - img/fire.png 45 | - img/ghost_like_white.png 46 | - img/font_black.png 47 | # To add custom fonts to your application, add a fonts section here, 48 | # in this "flutter" section. Each entry in this list should have a 49 | # "family" key with the font family name, and a "fonts" key with a 50 | # list giving the asset and other descriptors for the font. For 51 | # example: 52 | # fonts: 53 | # - family: Schyler 54 | # fonts: 55 | # - asset: fonts/Schyler-Regular.ttf 56 | # - asset: fonts/Schyler-Italic.ttf 57 | # style: italic 58 | # - family: Trajan Pro 59 | # fonts: 60 | # - asset: fonts/TrajanPro.ttf 61 | # - asset: fonts/TrajanPro_Bold.ttf 62 | # weight: 700 63 | fonts: 64 | - family: mdi 65 | fonts: 66 | - asset: fonts/materialdesignicons-webfont.ttf 67 | --------------------------------------------------------------------------------