├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── anvil_effect ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── assets │ └── images │ │ ├── wenzi0000.png │ │ ├── wenzi0001.png │ │ ├── wenzi0002.png │ │ ├── wenzi0003.png │ │ ├── wenzi0004.png │ │ ├── wenzi0005.png │ │ ├── wenzi0006.png │ │ ├── wenzi0007.png │ │ ├── wenzi0008.png │ │ ├── wenzi0009.png │ │ ├── wenzi0010.png │ │ ├── wenzi0011.png │ │ ├── wenzi0012.png │ │ ├── wenzi0013.png │ │ ├── wenzi0014.png │ │ ├── wenzi0015.png │ │ ├── wenzi0016.png │ │ ├── wenzi0017.png │ │ ├── wenzi0018.png │ │ ├── wenzi0019.png │ │ ├── wenzi0020.png │ │ ├── wenzi0021.png │ │ ├── wenzi0022.png │ │ ├── wenzi0023.png │ │ ├── wenzi0024.png │ │ ├── wenzi0025.png │ │ ├── wenzi0026.png │ │ ├── wenzi0027.png │ │ ├── wenzi0028.png │ │ ├── wenzi0029.png │ │ ├── wenzi0030.png │ │ ├── wenzi0031.png │ │ ├── wenzi0032.png │ │ ├── wenzi0033.png │ │ ├── wenzi0034.png │ │ ├── wenzi0035.png │ │ ├── wenzi0036.png │ │ ├── wenzi0037.png │ │ ├── wenzi0038.png │ │ ├── wenzi0039.png │ │ ├── wenzi0040.png │ │ ├── wenzi0041.png │ │ ├── wenzi0042.png │ │ ├── wenzi0043.png │ │ ├── wenzi0044.png │ │ ├── wenzi0045.png │ │ ├── wenzi0046.png │ │ ├── wenzi0047.png │ │ ├── wenzi0048.png │ │ ├── wenzi0049.png │ │ ├── wenzi0050.png │ │ └── wenzi0051.png ├── lib │ ├── anvil_effect.dart │ ├── anvil_effect_widget.dart │ ├── explosion_effect_widget.dart │ └── pixel_utils.dart ├── pubspec.yaml └── test │ └── anvil_effect_test.dart ├── lib ├── flutter_text_effect.dart └── src │ └── text │ ├── diff_scale_text.dart │ ├── line_border_text.dart │ └── rainbow_text.dart ├── pubspec.yaml ├── sample ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── flutter_effects │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── 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 │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── assets │ └── images │ │ ├── bg_gift_bag_bottom.png │ │ └── icon_sm_sigin_status_three.png ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── 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 │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ ├── demo │ │ └── main.dart │ ├── main.dart │ ├── scratch_card_widget.dart │ └── utils.dart ├── pubspec.yaml └── test │ └── widget_test.dart └── test └── flutter_package_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | ios/.generated/ 9 | ios/Flutter/Generated.xcconfig 10 | ios/Runner/GeneratedPluginRegistrant.* 11 | pubspec.lock 12 | 13 | # Miscellaneous 14 | *.class 15 | *.log 16 | *.pyc 17 | *.swp 18 | .DS_Store 19 | .atom/ 20 | .buildlog/ 21 | .history 22 | .svn/ 23 | 24 | # IntelliJ related 25 | *.iml 26 | *.ipr 27 | *.iws 28 | .idea/ 29 | 30 | # Visual Studio Code related 31 | .vscode/ 32 | .settings 33 | .classpath 34 | .project 35 | 36 | # Flutter/Dart/Pub related 37 | **/doc/api/ 38 | .dart_tool/ 39 | .flutter-plugins 40 | .packages 41 | .pub-cache/ 42 | .pub/ 43 | /build/ 44 | 45 | # Android related 46 | **/android/**/gradle-wrapper.jar 47 | **/android/.gradle 48 | **/android/captures/ 49 | **/android/gradlew 50 | **/android/gradlew.bat 51 | **/android/local.properties 52 | **/android/**/GeneratedPluginRegistrant.java 53 | 54 | # iOS/XCode related 55 | **/ios/**/*.mode1v3 56 | **/ios/**/*.mode2v3 57 | **/ios/**/*.moved-aside 58 | **/ios/**/*.pbxuser 59 | **/ios/**/*.perspectivev3 60 | **/ios/**/*sync/ 61 | **/ios/**/.sconsign.dblite 62 | **/ios/**/.tags* 63 | **/ios/**/.vagrant/ 64 | **/ios/**/DerivedData/ 65 | **/ios/**/Icon? 66 | **/ios/**/Pods/ 67 | **/ios/**/.symlinks/ 68 | **/ios/**/profile 69 | **/ios/**/xcuserdata 70 | **/ios/.generated/ 71 | **/ios/Flutter/App.framework 72 | **/ios/Flutter/Flutter.framework 73 | **/ios/Flutter/Generated.xcconfig 74 | **/ios/Flutter/app.flx 75 | **/ios/Flutter/app.zip 76 | **/ios/Flutter/flutter_assets/ 77 | **/ios/ServiceDefinitions.json 78 | **/ios/Runner/GeneratedPluginRegistrant.* 79 | 80 | # Exceptions to above rules. 81 | !**/ios/**/default.mode1v3 82 | !**/ios/**/default.mode2v3 83 | !**/ios/**/default.pbxuser 84 | !**/ios/**/default.perspectivev3 85 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 86 | 87 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.0.1] - TODO: Add release date. 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter effects 2 | 3 | A flutter package which contains a collection of some cool and beautiful effects; support `android` and `ios` . 4 | 5 | ## Screenshot 6 | 7 | | type | support child | screenshot | 8 | | :--: | :--: | :--: | 9 | | diffscale | text | | 10 | | borderline | any | | 11 | | rainbow | text | | 12 | | explosion | any | | 13 | | anvil | any | | 14 | | scratchcard | any | | 15 | | more | more | waiting | 16 | 17 | 18 | ## Usage 19 | 20 | ### diffscale 21 | 22 | ```dart 23 | 24 | void initState() { 25 | super.initState(); 26 | sentences = [ 27 | "What is design?", 28 | "Design is not just", 29 | "what it looks like and feels like.", 30 | "Design is how it works. \n- Steve Jobs", 31 | "Older people", 32 | "sit down and ask,", 33 | "'What is it?'", 34 | "but the boy asks,", 35 | "What can I do with it?. \n- Steve Jobs", 36 | "Swift", 37 | "Objective-C", 38 | "iPhone", 39 | "iPad", 40 | "Mac Mini", 41 | "MacBook Pro", 42 | "Mac Pro", 43 | "爱老婆", 44 | "老婆和女儿" 45 | ]; 46 | } 47 | 48 | DiffScaleText( 49 | text: sentences[diffScaleNext % sentences.length], 50 | textStyle: TextStyle(fontSize: 20, color: Colors.blue), 51 | ) 52 | 53 | ``` 54 | Note:the variable `diffScaleNext` control next position; 55 | 56 | ### borderline 57 | 58 | ```dart 59 | LineBorderText( 60 | child: Text( 61 | "Border Effect", 62 | style: TextStyle(fontSize: 20), 63 | ), 64 | autoAnim: true) 65 | ``` 66 | 67 | ### rainbow 68 | 69 | ```dart 70 | RainbowText(colors: [ 71 | Color(0xFFFF2B22), 72 | Color(0xFFFF7F22), 73 | Color(0xFFEDFF22), 74 | Color(0xFF22FF22), 75 | Color(0xFF22F4FF), 76 | Color(0xFF5400F7), 77 | ], text: "Welcome to BBT", loop: true) 78 | 79 | ``` 80 | 81 | ### explosion 82 | 83 | ```dart 84 | ExplosionWidget( 85 | tag: "Explosion Text", 86 | child: Container( 87 | alignment: Alignment.center, 88 | color: Colors.blueAccent, 89 | child: Text( 90 | "Explosion Text", 91 | style: TextStyle( 92 | fontSize: 20, 93 | color: Colors.red, 94 | fontWeight: FontWeight.bold), 95 | ))) 96 | ``` 97 | 98 | ### anvil 99 | 100 | ```dart 101 | 102 | AnvilEffectWidget(child: Text( 103 | "👉AnvilEffect👈", 104 | style: TextStyle(color: Colors.white, fontSize: 20), 105 | ) 106 | 107 | ``` 108 | 109 | ### scratchcard 110 | 111 | ```dart 112 | ScratchCardWidget( 113 | strokeWidth: 20, 114 | threshold: 0.5, 115 | foreground: (canvas, size, offset) { 116 | if (_image != null) { 117 | double scale; 118 | double dx = 0; 119 | double dy = 0; 120 | if (_image.width * size.height > 121 | size.width * _image.height) { 122 | scale = size.height / _image.height; 123 | dx = (size.width - _image.width * scale) / 2; 124 | } else { 125 | scale = size.width / _image.width; 126 | dy = (size.height - _image.height * scale) / 2; 127 | } 128 | canvas.save(); 129 | canvas.translate(dx, dy); 130 | canvas.scale(scale, scale); 131 | canvas.drawImage(_image, Offset(0, 0), new Paint()); 132 | canvas.restore(); 133 | } else { 134 | canvas.drawRect( 135 | Rect.fromLTWH(0, 0, size.width, size.height), 136 | Paint() 137 | ..color = Colors.grey); 138 | } 139 | }, 140 | child: Container( 141 | color: Colors.blueAccent, 142 | alignment: Alignment.center, 143 | child: Image.asset( 144 | "assets/images/icon_sm_sigin_status_three.png", 145 | fit: BoxFit.scaleDown, height: 20,), 146 | )) 147 | 148 | ``` 149 | - strokeWidth : paint's strokewidth 150 | - threshold : the threshold to clear the foreground covering 151 | - foreground : draw foreground covering 152 | - child : draw child 153 | 154 | ##
More flutter effects are under development, so stay tuned! please follow me.

155 | 156 | # Author 157 | - Name: Hiten 158 | - Blog: https://juejin.im/user/595a16125188250d944c6997 159 | - Email: zzdxit@gmail.com 160 | 161 | # License 162 | 163 | This project is licensed under the [Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0). 164 | 165 | See [`LICENSE`](LICENSE) for full of the license text. 166 | -------------------------------------------------------------------------------- /anvil_effect/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | pubspec.lock 7 | build/ 8 | ios/.generated/ 9 | ios/Flutter/Generated.xcconfig 10 | ios/Runner/GeneratedPluginRegistrant.* 11 | 12 | # Miscellaneous 13 | *.class 14 | *.log 15 | *.pyc 16 | *.swp 17 | .DS_Store 18 | .atom/ 19 | .buildlog/ 20 | .history 21 | .svn/ 22 | 23 | # IntelliJ related 24 | *.iml 25 | *.ipr 26 | *.iws 27 | .idea/ 28 | 29 | # Visual Studio Code related 30 | .vscode/ 31 | .settings 32 | .classpath 33 | .project 34 | 35 | # Flutter/Dart/Pub related 36 | **/doc/api/ 37 | .dart_tool/ 38 | .flutter-plugins 39 | .packages 40 | .pub-cache/ 41 | .pub/ 42 | /build/ 43 | 44 | # Android related 45 | **/android/**/gradle-wrapper.jar 46 | **/android/.gradle 47 | **/android/captures/ 48 | **/android/gradlew 49 | **/android/gradlew.bat 50 | **/android/local.properties 51 | **/android/**/GeneratedPluginRegistrant.java 52 | 53 | # iOS/XCode related 54 | **/ios/**/*.mode1v3 55 | **/ios/**/*.mode2v3 56 | **/ios/**/*.moved-aside 57 | **/ios/**/*.pbxuser 58 | **/ios/**/*.perspectivev3 59 | **/ios/**/*sync/ 60 | **/ios/**/.sconsign.dblite 61 | **/ios/**/.tags* 62 | **/ios/**/.vagrant/ 63 | **/ios/**/DerivedData/ 64 | **/ios/**/Icon? 65 | **/ios/**/Pods/ 66 | **/ios/**/.symlinks/ 67 | **/ios/**/profile 68 | **/ios/**/xcuserdata 69 | **/ios/.generated/ 70 | **/ios/Flutter/App.framework 71 | **/ios/Flutter/Flutter.framework 72 | **/ios/Flutter/Generated.xcconfig 73 | **/ios/Flutter/app.flx 74 | **/ios/Flutter/app.zip 75 | **/ios/Flutter/flutter_assets/ 76 | **/ios/ServiceDefinitions.json 77 | **/ios/Runner/GeneratedPluginRegistrant.* 78 | 79 | # Exceptions to above rules. 80 | !**/ios/**/default.mode1v3 81 | !**/ios/**/default.mode2v3 82 | !**/ios/**/default.pbxuser 83 | !**/ios/**/default.perspectivev3 84 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 85 | 86 | -------------------------------------------------------------------------------- /anvil_effect/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /anvil_effect/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.0.1] - TODO: Add release date. 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /anvil_effect/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /anvil_effect/README.md: -------------------------------------------------------------------------------- 1 | # anvil_effect 2 | 3 | A new Flutter package. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Dart 8 | [package](https://flutter.io/developing-packages/), 9 | a library module containing code that can be shared easily across 10 | multiple Flutter or Dart projects. 11 | 12 | For help getting started with Flutter, view our 13 | [online documentation](https://flutter.io/docs), which offers tutorials, 14 | samples, guidance on mobile development, and a full API reference. 15 | -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0000.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0001.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0002.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0003.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0004.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0005.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0006.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0007.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0008.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0009.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0010.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0011.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0012.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0013.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0014.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0015.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0016.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0017.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0018.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0019.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0020.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0021.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0022.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0023.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0024.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0025.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0026.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0027.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0028.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0029.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0030.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0031.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0032.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0033.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0034.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0035.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0036.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0037.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0038.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0038.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0039.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0040.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0041.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0042.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0043.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0044.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0045.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0046.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0046.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0047.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0048.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0049.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0050.png -------------------------------------------------------------------------------- /anvil_effect/assets/images/wenzi0051.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/anvil_effect/assets/images/wenzi0051.png -------------------------------------------------------------------------------- /anvil_effect/lib/anvil_effect.dart: -------------------------------------------------------------------------------- 1 | library anvil_effect; 2 | 3 | export 'anvil_effect_widget.dart'; 4 | export 'explosion_effect_widget.dart'; 5 | -------------------------------------------------------------------------------- /anvil_effect/lib/anvil_effect_widget.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | 6 | class AnvilEffectWidget extends StatefulWidget { 7 | 8 | final Widget child; 9 | 10 | const AnvilEffectWidget({Key key, this.child}) : assert(child!=null),super(key: key); 11 | 12 | 13 | 14 | @override 15 | _AnvilEffectWidgetState createState() => _AnvilEffectWidgetState(); 16 | } 17 | 18 | class _AnvilEffectWidgetState extends State 19 | with SingleTickerProviderStateMixin { 20 | List _effectImages; 21 | 22 | AnimationController _animationController; 23 | 24 | @override 25 | void initState() { 26 | super.initState(); 27 | _effectImages = List(); 28 | for (int i = 0; i <= 51; i++) { 29 | var str = i.toString(); 30 | if (str.length == 1) { 31 | str = "0$str"; 32 | } 33 | _effectImages.add(Image.asset( 34 | "assets/images/wenzi00$str.png", 35 | package: "anvil_effect", 36 | )); 37 | } 38 | _animationController = 39 | AnimationController(duration: Duration(milliseconds: 600), vsync: this); 40 | _animationController.addStatusListener((status) { 41 | if (status == AnimationStatus.completed) { 42 | Timer.periodic(Duration(seconds: 1), (timer) { 43 | _animationController.value = 0; 44 | _animationController.forward(); 45 | timer.cancel(); 46 | }); 47 | } 48 | }); 49 | _animationController.forward(); 50 | } 51 | 52 | @override 53 | void dispose() { 54 | _animationController.dispose(); 55 | super.dispose(); 56 | } 57 | 58 | @override 59 | Widget build(BuildContext context) { 60 | return Container( 61 | child: AnimatedBuilder( 62 | animation: _animationController, 63 | child: widget.child, 64 | builder: (BuildContext context, Widget child) { 65 | double tr = _animationController.value < 0.7 66 | ? Curves.bounceOut.transform(_animationController.value / 0.7) 67 | : 1.0; 68 | Offset transform = Offset(0, -50 * (1 - tr)); 69 | int _imageIndex = _animationController.value >= 0.3 70 | ? 51 * (_animationController.value - 0.3) ~/ 0.7 71 | : -1; 72 | return Stack(alignment: Alignment.center, children: [ 73 | Opacity( 74 | opacity: tr, 75 | child: Transform.translate(offset: transform, child: child)), 76 | _imageIndex < 0 ? Container() : _effectImages[_imageIndex] 77 | ]); 78 | }, 79 | ), 80 | ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /anvil_effect/lib/explosion_effect_widget.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as Math; 2 | import 'dart:typed_data'; 3 | import 'dart:ui'; 4 | 5 | import 'package:anvil_effect/pixel_utils.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter/widgets.dart'; 9 | 10 | class ExplosionWidget extends StatefulWidget { 11 | final Widget child; 12 | final Rect bound; 13 | final String tag; 14 | 15 | const ExplosionWidget({Key key, this.child, this.bound, this.tag}) 16 | : super(key: key); 17 | 18 | @override 19 | _ExplosionWidgetState createState() => _ExplosionWidgetState(); 20 | } 21 | 22 | class _ExplosionWidgetState extends State 23 | with SingleTickerProviderStateMixin { 24 | ByteData _byteData; 25 | Size _imageSize; 26 | 27 | AnimationController _animationController; 28 | 29 | GlobalObjectKey globalKey; 30 | 31 | @override 32 | void initState() { 33 | super.initState(); 34 | globalKey = GlobalObjectKey(widget.tag); 35 | _animationController = 36 | AnimationController(duration: Duration(milliseconds: 600), vsync: this); 37 | } 38 | 39 | @override 40 | void dispose() { 41 | super.dispose(); 42 | _animationController.dispose(); 43 | } 44 | 45 | void onTap() { 46 | if (_byteData == null || _imageSize == null) { 47 | RenderRepaintBoundary boundary = 48 | globalKey.currentContext.findRenderObject(); 49 | boundary.toImage().then((image) { 50 | _imageSize = Size(image.width.toDouble(), image.height.toDouble()); 51 | image.toByteData().then((byteData) { 52 | _byteData = byteData; 53 | _animationController.value = 0; 54 | _animationController.forward(); 55 | setState(() {}); 56 | }); 57 | }); 58 | } else { 59 | _animationController.value = 0; 60 | _animationController.forward(); 61 | setState(() {}); 62 | } 63 | } 64 | 65 | @override 66 | void didUpdateWidget(ExplosionWidget oldWidget) { 67 | super.didUpdateWidget(oldWidget); 68 | if (widget.tag != oldWidget.tag) { 69 | _byteData = null; 70 | _imageSize = null; 71 | globalKey = GlobalObjectKey(widget.tag); 72 | } 73 | } 74 | 75 | @override 76 | Widget build(BuildContext context) { 77 | return Container( 78 | alignment: Alignment.center, 79 | child: GestureDetector( 80 | onTap: onTap, 81 | child: AnimatedBuilder( 82 | animation: _animationController, 83 | builder: (context, child) { 84 | return ExplosionRenderObjectWidget( 85 | key: globalKey, 86 | child: widget.child, 87 | byteData: _byteData, 88 | imageSize: _imageSize, 89 | progress: _animationController.value, 90 | ); 91 | }), 92 | )); 93 | } 94 | } 95 | 96 | class ExplosionRenderObjectWidget extends RepaintBoundary { 97 | final ByteData byteData; 98 | final Size imageSize; 99 | final double progress; 100 | final Rect bound; 101 | 102 | const ExplosionRenderObjectWidget( 103 | {Key key, 104 | Widget child, 105 | this.byteData, 106 | this.imageSize, 107 | this.progress, 108 | this.bound}) 109 | : super(key: key, child: child); 110 | 111 | @override 112 | _ExplosionRenderObject createRenderObject(BuildContext context) => 113 | _ExplosionRenderObject( 114 | byteData: byteData, imageSize: imageSize, bound: bound); 115 | 116 | @override 117 | void updateRenderObject( 118 | BuildContext context, _ExplosionRenderObject renderObject) { 119 | renderObject.update(byteData, imageSize, progress); 120 | } 121 | } 122 | 123 | class _ExplosionRenderObject extends RenderRepaintBoundary { 124 | ByteData byteData; 125 | Size imageSize; 126 | double progress; 127 | List<_Particle> particles; 128 | Rect bound; 129 | 130 | _ExplosionRenderObject( 131 | {this.byteData, this.imageSize, this.bound, RenderBox child}) 132 | : super(child: child); 133 | 134 | void update(ByteData byteData, Size imageSize, double progress) { 135 | this.byteData = byteData; 136 | this.imageSize = imageSize; 137 | this.progress = progress; 138 | markNeedsPaint(); 139 | } 140 | 141 | @override 142 | void paint(PaintingContext context, Offset offset) { 143 | if (byteData != null && 144 | imageSize != null && 145 | progress != 0 && 146 | progress != 1) { 147 | if (particles == null) { 148 | if (bound == null) { 149 | bound = Rect.fromLTWH(0, 0, size.width, size.height * 2); 150 | } 151 | particles = initParticleList(bound, byteData, imageSize); 152 | } 153 | draw(context.canvas, particles, progress); 154 | } else { 155 | if (child != null) { 156 | context.paintChild(child, offset); 157 | } 158 | } 159 | } 160 | } 161 | 162 | const double END_VALUE = 1.4; 163 | const double V = 2; 164 | const double X = 5; 165 | const double Y = 20; 166 | const double W = 1; 167 | 168 | List<_Particle> initParticleList( 169 | Rect bound, ByteData byteData, Size imageSize) { 170 | int partLen = 15; 171 | List<_Particle> particles = List(partLen * partLen); 172 | Math.Random random = new Math.Random(DateTime.now().millisecondsSinceEpoch); 173 | int w = imageSize.width ~/ (partLen + 2); 174 | int h = imageSize.height ~/ (partLen + 2); 175 | for (int i = 0; i < partLen; i++) { 176 | for (int j = 0; j < partLen; j++) { 177 | particles[(i * partLen) + j] = generateParticle( 178 | getColorByPixel(byteData, imageSize, 179 | Offset((j + 1) * w.toDouble(), (i + 1) * h.toDouble())), 180 | random, 181 | bound); 182 | } 183 | } 184 | return particles; 185 | } 186 | 187 | bool draw(Canvas canvas, List<_Particle> particles, double progress) { 188 | Paint paint = Paint(); 189 | for (int i = 0; i < particles.length; i++) { 190 | _Particle particle = particles[i]; 191 | particle.advance(progress); 192 | if (particle.alpha > 0) { 193 | paint.color = particle.color 194 | .withAlpha((particle.color.alpha * particle.alpha).toInt()); 195 | canvas.drawCircle( 196 | Offset(particle.cx, particle.cy), particle.radius, paint); 197 | } 198 | } 199 | return true; 200 | } 201 | 202 | _Particle generateParticle(Color color, Math.Random random, Rect bound) { 203 | _Particle particle = _Particle(); 204 | particle.color = color; 205 | particle.radius = V; 206 | if (random.nextDouble() < 0.2) { 207 | particle.baseRadius = V + ((X - V) * random.nextDouble()); 208 | } else { 209 | particle.baseRadius = W + ((V - W) * random.nextDouble()); 210 | } 211 | double nextDouble = random.nextDouble(); 212 | particle.top = bound.height * ((0.18 * random.nextDouble()) + 0.2); 213 | particle.top = nextDouble < 0.2 214 | ? particle.top 215 | : particle.top + ((particle.top * 0.2) * random.nextDouble()); 216 | particle.bottom = (bound.height * (random.nextDouble() - 0.5)) * 1.8; 217 | double f = nextDouble < 0.2 218 | ? particle.bottom 219 | : nextDouble < 0.8 ? particle.bottom * 0.6 : particle.bottom * 0.3; 220 | particle.bottom = f; 221 | particle.mag = 4.0 * particle.top / particle.bottom; 222 | particle.neg = (-particle.mag) / particle.bottom; 223 | f = bound.center.dx + (Y * (random.nextDouble() - 0.5)); 224 | particle.baseCx = f; 225 | particle.cx = f; 226 | f = bound.center.dy + (Y * (random.nextDouble() - 0.5)); 227 | particle.baseCy = f; 228 | particle.cy = f; 229 | particle.life = END_VALUE / 10 * random.nextDouble(); 230 | particle.overflow = 0.4 * random.nextDouble(); 231 | particle.alpha = 1; 232 | return particle; 233 | } 234 | 235 | class _Particle { 236 | double alpha; 237 | Color color; 238 | double cx; 239 | double cy; 240 | double radius; 241 | double baseCx; 242 | double baseCy; 243 | double baseRadius; 244 | double top; 245 | double bottom; 246 | double mag; 247 | double neg; 248 | double life; 249 | double overflow; 250 | 251 | void advance(double factor) { 252 | double f = 0; 253 | double normalization = factor / END_VALUE; 254 | if (normalization < life || normalization > 1 - overflow) { 255 | alpha = 0; 256 | return; 257 | } 258 | normalization = (normalization - life) / (1 - life - overflow); 259 | double f2 = normalization * END_VALUE; 260 | if (normalization >= 0.7) { 261 | f = (normalization - 0.7) / 0.3; 262 | } 263 | alpha = 1 - f; 264 | f = bottom * f2; 265 | cx = baseCx + f; 266 | cy = (baseCy - this.neg * Math.pow(f, 2.0)) - f * mag; 267 | radius = V + (baseRadius - V) * f2; 268 | } 269 | } 270 | -------------------------------------------------------------------------------- /anvil_effect/lib/pixel_utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | import 'dart:ui'; 3 | 4 | import 'package:flutter/material.dart'; 5 | 6 | Color getColorByPixel(ByteData byteData, Size size, Offset pixel) { 7 | //rawRgba 8 | assert(byteData.lengthInBytes == size.width * size.height * 4); 9 | assert(pixel.dx < size.width && pixel.dy < size.height); 10 | int index = ((pixel.dy * size.width + pixel.dx) * 4).toInt(); 11 | int r = byteData.getUint8(index); 12 | int g = byteData.getUint8(index + 1); 13 | int b = byteData.getUint8(index + 2); 14 | int a = byteData.getUint8(index + 3); 15 | return Color.fromARGB(a, r, g, b); 16 | } 17 | -------------------------------------------------------------------------------- /anvil_effect/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: anvil_effect 2 | description: A new Flutter package. 3 | version: 0.0.1 4 | author: 5 | homepage: 6 | 7 | environment: 8 | sdk: ">=2.1.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | 18 | # For information on the generic Dart part of this file, see the 19 | # following page: https://www.dartlang.org/tools/pub/pubspec 20 | 21 | # The following section is specific to Flutter. 22 | flutter: 23 | 24 | # To add assets to your package, add an assets section, like this: 25 | assets: 26 | - assets/images/ 27 | 28 | # For details regarding assets in packages, see 29 | # https://flutter.io/assets-and-images/#from-packages 30 | # 31 | # An image asset can refer to one or more resolution-specific "variants", see 32 | # https://flutter.io/assets-and-images/#resolution-aware. 33 | 34 | # To add custom fonts to your package, add a fonts section here, 35 | # in this "flutter" section. Each entry in this list should have a 36 | # "family" key with the font family name, and a "fonts" key with a 37 | # list giving the asset and other descriptors for the font. For 38 | # example: 39 | # fonts: 40 | # - family: Schyler 41 | # fonts: 42 | # - asset: fonts/Schyler-Regular.ttf 43 | # - asset: fonts/Schyler-Italic.ttf 44 | # style: italic 45 | # - family: Trajan Pro 46 | # fonts: 47 | # - asset: fonts/TrajanPro.ttf 48 | # - asset: fonts/TrajanPro_Bold.ttf 49 | # weight: 700 50 | # 51 | # For details regarding fonts in packages, see 52 | # https://flutter.io/custom-fonts/#from-packages 53 | -------------------------------------------------------------------------------- /anvil_effect/test/anvil_effect_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | -------------------------------------------------------------------------------- /lib/flutter_text_effect.dart: -------------------------------------------------------------------------------- 1 | library flutter_effects; 2 | 3 | export 'package:flutter_effects/src/text/diff_scale_text.dart'; 4 | export 'package:flutter_effects/src/text/line_border_text.dart'; 5 | export 'package:flutter_effects/src/text/rainbow_text.dart'; 6 | -------------------------------------------------------------------------------- /lib/src/text/diff_scale_text.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as Math; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | 6 | class DiffScaleText extends StatefulWidget { 7 | final String text; 8 | final TextStyle textStyle; 9 | 10 | const DiffScaleText({Key key, this.text, this.textStyle}) 11 | : assert(text != null), 12 | super(key: key); 13 | 14 | @override 15 | _DiffScaleTextState createState() => _DiffScaleTextState(); 16 | } 17 | 18 | class _DiffScaleTextState extends State 19 | with TickerProviderStateMixin { 20 | AnimationController _animationController; 21 | 22 | @override 23 | void initState() { 24 | super.initState(); 25 | _animationController = 26 | AnimationController(vsync: this, duration: Duration(milliseconds: 400)); 27 | _animationController.addStatusListener((status) {}); 28 | } 29 | 30 | @override 31 | void didUpdateWidget(DiffScaleText oldWidget) { 32 | super.didUpdateWidget(oldWidget); 33 | if (oldWidget.text != widget.text) { 34 | if (!_animationController.isAnimating) { 35 | _animationController.value = 0; 36 | _animationController.forward(); 37 | } 38 | } 39 | } 40 | 41 | @override 42 | void dispose() { 43 | _animationController.dispose(); 44 | super.dispose(); 45 | } 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | TextStyle textStyle = widget.textStyle == null 50 | ? TextStyle( 51 | fontSize: 20, 52 | color: Colors.white, 53 | ) 54 | : widget.textStyle; 55 | return AnimatedBuilder( 56 | animation: _animationController, 57 | builder: (BuildContext context, Widget child) { 58 | return RepaintBoundary( 59 | child: CustomPaint( 60 | child: Text(widget.text, 61 | style: textStyle.merge(TextStyle(color: Color(0x00000000))), 62 | maxLines: 1, 63 | textDirection: TextDirection.ltr), 64 | foregroundPainter: _DiffText( 65 | text: widget.text, 66 | textStyle: textStyle, 67 | progress: _animationController.value), 68 | )); 69 | }, 70 | ); 71 | } 72 | } 73 | 74 | class _DiffText extends CustomPainter { 75 | final String text; 76 | final TextStyle textStyle; 77 | final double progress; 78 | String _oldText; 79 | List<_TextLayoutInfo> _textLayoutInfo = []; 80 | List<_TextLayoutInfo> _oldTextLayoutInfo = []; 81 | Alignment alignment; 82 | 83 | _DiffText({this.text, 84 | this.textStyle, 85 | this.progress = 1, 86 | this.alignment = Alignment.center}) 87 | : assert(text != null), 88 | assert(textStyle != null); 89 | 90 | @override 91 | void paint(Canvas canvas, Size size) { 92 | double percent = Math.max(0, Math.min(1, progress)); 93 | if (_textLayoutInfo.length == 0) { 94 | calculateLayoutInfo(text, _textLayoutInfo); 95 | } 96 | canvas.save(); 97 | if (_oldTextLayoutInfo != null && _oldTextLayoutInfo.length > 0) { 98 | for (_TextLayoutInfo _oldTextLayoutInfo in _oldTextLayoutInfo) { 99 | if (_oldTextLayoutInfo.needMove) { 100 | double p = percent * 2; 101 | p = p > 1 ? 1 : p; 102 | drawText( 103 | canvas, 104 | _oldTextLayoutInfo.text, 105 | 1, 106 | 1, 107 | Offset( 108 | _oldTextLayoutInfo.offsetX - 109 | (_oldTextLayoutInfo.offsetX - _oldTextLayoutInfo.toX) * p, 110 | _oldTextLayoutInfo.offsetY), 111 | _oldTextLayoutInfo); 112 | } else { 113 | drawText( 114 | canvas, 115 | _oldTextLayoutInfo.text, 116 | 1 - percent, 117 | percent, 118 | Offset(_oldTextLayoutInfo.offsetX, _oldTextLayoutInfo.offsetY), 119 | _oldTextLayoutInfo); 120 | } 121 | } 122 | } else { 123 | //no oldText 124 | percent = 1; 125 | } 126 | for (_TextLayoutInfo _textLayoutInfo in _textLayoutInfo) { 127 | if (!_textLayoutInfo.needMove) { 128 | drawText( 129 | canvas, 130 | _textLayoutInfo.text, 131 | percent, 132 | percent, 133 | Offset(_textLayoutInfo.offsetX, _textLayoutInfo.offsetY), 134 | _textLayoutInfo); 135 | } 136 | } 137 | canvas.restore(); 138 | } 139 | 140 | void drawText(Canvas canvas, String text, double textScaleFactor, 141 | double alphaFactor, Offset offset, _TextLayoutInfo textLayoutInfo) { 142 | var textPaint = Paint(); 143 | if (alphaFactor == 1) { 144 | textPaint.color = textStyle.color; 145 | } else { 146 | textPaint.color = textStyle.color 147 | .withAlpha((textStyle.color.alpha * alphaFactor).floor()); 148 | } 149 | var textPainter = TextPainter( 150 | text: TextSpan( 151 | text: text, 152 | style: textStyle.merge(TextStyle( 153 | color: null, 154 | foreground: textPaint, 155 | textBaseline: TextBaseline.ideographic))), 156 | textDirection: TextDirection.ltr); 157 | textPainter.textAlign = TextAlign.center; 158 | textPainter.textScaleFactor = textScaleFactor; 159 | textPainter.textDirection = TextDirection.ltr; 160 | textPainter.layout(); 161 | textPainter.paint( 162 | canvas, 163 | Offset(offset.dx, 164 | offset.dy + (textLayoutInfo.height - textPainter.height) / 2)); 165 | } 166 | 167 | @override 168 | bool shouldRepaint(CustomPainter oldDelegate) { 169 | if (oldDelegate is _DiffText) { 170 | String oldFrameText = oldDelegate.text; 171 | if (oldFrameText == text) { 172 | this._oldText = oldDelegate._oldText; 173 | this._oldTextLayoutInfo = oldDelegate._oldTextLayoutInfo; 174 | this._textLayoutInfo = oldDelegate._textLayoutInfo; 175 | if (this.progress == oldDelegate.progress) { 176 | return false; 177 | } 178 | } else { 179 | this._oldText = oldDelegate.text; 180 | calculateLayoutInfo(text, _textLayoutInfo); 181 | calculateLayoutInfo(_oldText, _oldTextLayoutInfo); 182 | calculateMove(); 183 | } 184 | } 185 | return true; 186 | } 187 | 188 | void calculateLayoutInfo(String text, List<_TextLayoutInfo> list) { 189 | list.clear(); 190 | 191 | TextPainter textPainter = TextPainter( 192 | text: TextSpan(text: text, style: textStyle), 193 | textDirection: TextDirection.ltr, 194 | maxLines: 1); 195 | textPainter.layout(); 196 | for (int i = 0; i < text.length; i++) { 197 | var forCaret = 198 | textPainter.getOffsetForCaret(TextPosition(offset: i), Rect.zero); 199 | var offsetX = forCaret.dx; 200 | if (i > 0 && offsetX == 0) { 201 | break; 202 | } 203 | var textLayoutInfo = _TextLayoutInfo(); 204 | textLayoutInfo.text = text.substring(i, i + 1); 205 | textLayoutInfo.offsetX = offsetX; 206 | textLayoutInfo.offsetY = forCaret.dy; 207 | textLayoutInfo.width = 0; 208 | textLayoutInfo.height = textPainter.height; 209 | textLayoutInfo.baseline = 210 | textPainter.computeDistanceToActualBaseline(TextBaseline.ideographic); 211 | list.add(textLayoutInfo); 212 | } 213 | } 214 | 215 | void calculateMove() { 216 | if (_oldTextLayoutInfo == null || _oldTextLayoutInfo.length == 0) { 217 | return; 218 | } 219 | if (_textLayoutInfo == null || _textLayoutInfo.length == 0) { 220 | return; 221 | } 222 | 223 | for (_TextLayoutInfo oldText in _oldTextLayoutInfo) { 224 | for (_TextLayoutInfo text in _textLayoutInfo) { 225 | if (!text.needMove && !oldText.needMove && text.text == oldText.text) { 226 | text.fromX = oldText.offsetX; 227 | oldText.toX = text.offsetX; 228 | text.needMove = true; 229 | oldText.needMove = true; 230 | } 231 | } 232 | } 233 | } 234 | } 235 | 236 | class _TextLayoutInfo { 237 | String text; 238 | double offsetX; 239 | double offsetY; 240 | double baseline; 241 | double width; 242 | double height; 243 | double fromX = 0; 244 | double toX = 0; 245 | bool needMove = false; 246 | } 247 | -------------------------------------------------------------------------------- /lib/src/text/line_border_text.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | 6 | class LineBorderText extends StatefulWidget { 7 | final Widget child; 8 | final Size size; 9 | final bool autoAnim; 10 | final dynamic tag; 11 | 12 | const LineBorderText( 13 | {Key key, 14 | this.child, 15 | this.size = Size.zero, 16 | this.autoAnim = false, 17 | this.tag = ""}) 18 | : super(key: key); 19 | 20 | @override 21 | _LineBorderTextState createState() => _LineBorderTextState(); 22 | } 23 | 24 | class _LineBorderTextState extends State 25 | with TickerProviderStateMixin { 26 | AnimationController _animationController; 27 | 28 | @override 29 | void initState() { 30 | super.initState(); 31 | _animationController = 32 | AnimationController(duration: Duration(milliseconds: 600), vsync: this); 33 | _animationController.addStatusListener((status) { 34 | if (status == AnimationStatus.completed) { 35 | _animationController.value = 0; 36 | } 37 | }); 38 | if (widget.autoAnim) { 39 | _animationController.forward(); 40 | } 41 | } 42 | 43 | @override 44 | void didUpdateWidget(LineBorderText oldWidget) { 45 | super.didUpdateWidget(oldWidget); 46 | dynamic oldTag = oldWidget.tag; 47 | dynamic tag = widget.tag; 48 | bool equals = tag == oldTag; 49 | if (!equals && widget.autoAnim && !_animationController.isAnimating) { 50 | _animationController.forward(); 51 | } 52 | } 53 | 54 | @override 55 | void dispose() { 56 | _animationController.dispose(); 57 | super.dispose(); 58 | } 59 | 60 | void onTap() { 61 | if (!_animationController.isAnimating) { 62 | _animationController.forward(); 63 | } 64 | } 65 | 66 | @override 67 | Widget build(BuildContext context) { 68 | return GestureDetector( 69 | behavior: HitTestBehavior.translucent, 70 | onTap: onTap, 71 | child: AnimatedBuilder( 72 | animation: _animationController, 73 | builder: (BuildContext context, Widget child) { 74 | double progress = _animationController.value; 75 | return CustomPaint( 76 | foregroundPainter: _BorderLinePainter(progress), 77 | child: RepaintBoundary(child: widget.child), 78 | size: widget.size, 79 | ); 80 | }, 81 | )); 82 | } 83 | } 84 | 85 | class _BorderLinePainter extends CustomPainter { 86 | final double _progress; 87 | 88 | _BorderLinePainter(this._progress); 89 | 90 | @override 91 | void paint(Canvas canvas, Size size) { 92 | Paint paint = Paint(); 93 | paint.color = Colors.black; 94 | paint.isAntiAlias = true; 95 | paint.style = PaintingStyle.stroke; 96 | paint.strokeCap = StrokeCap.square; 97 | paint.strokeWidth = 2; 98 | 99 | double percent = _progress; 100 | double percent2 = sqrt(3.38 - (percent - 1.7) * (percent - 1.7)) - 0.7; 101 | 102 | double width = size.width; 103 | double height = size.height; 104 | 105 | Offset pA = Offset(0, 0); 106 | Offset pB = Offset(width, 0); 107 | Offset pC = Offset(width, height); 108 | Offset pD = Offset(0, height); 109 | 110 | Offset p1 = Offset(width * percent2, pB.dy); 111 | canvas.drawLine(p1, pB, paint); 112 | 113 | Offset p2 = Offset(pB.dx, height * percent); 114 | canvas.drawLine(pB, p2, paint); 115 | 116 | Offset p3 = Offset(width, height * percent2); 117 | canvas.drawLine(p3, pC, paint); 118 | 119 | Offset p4 = Offset(width * (1 - percent), height); 120 | canvas.drawLine(pC, p4, paint); 121 | 122 | Offset p5 = Offset(width * (1 - percent2), height); 123 | canvas.drawLine(p5, pD, paint); 124 | 125 | Offset p6 = Offset(0, height * (1 - percent)); 126 | canvas.drawLine(pD, p6, paint); 127 | 128 | Offset p7 = Offset(0, height * (1 - percent2)); 129 | canvas.drawLine(p7, pA, paint); 130 | 131 | Offset p8 = Offset(width * percent, 0); 132 | canvas.drawLine(pA, p8, paint); 133 | } 134 | 135 | @override 136 | bool shouldRepaint(CustomPainter oldDelegate) { 137 | if (oldDelegate is _BorderLinePainter) { 138 | double oldProgress = oldDelegate._progress; 139 | if (oldProgress == _progress) { 140 | return false; 141 | } 142 | } 143 | return true; 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /lib/src/text/rainbow_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | 4 | 5 | typedef EasyCallback = R Function(P param); 6 | class RainbowText extends StatefulWidget { 7 | final List colors; 8 | final String text; 9 | final bool loop; 10 | 11 | const RainbowText({Key key, this.colors, this.text, this.loop = false}) 12 | : assert(colors != null), 13 | super(key: key); 14 | 15 | @override 16 | _RainbowTextState createState() => _RainbowTextState(); 17 | } 18 | 19 | class _RainbowTextState extends State 20 | with TickerProviderStateMixin { 21 | AnimationController _animationController; 22 | 23 | Size _textSize = Size.zero; 24 | 25 | @override 26 | void initState() { 27 | super.initState(); 28 | _animationController = AnimationController( 29 | duration: Duration(milliseconds: 1000), vsync: this); 30 | if (widget.loop) { 31 | _animationController.forward(); 32 | _animationController.addStatusListener((status) { 33 | if (widget.loop) { 34 | if (status == AnimationStatus.completed) { 35 | _animationController.value = 0; 36 | _animationController.forward(); 37 | } 38 | } 39 | }); 40 | } 41 | } 42 | 43 | void calculateTextWidth() { 44 | var textPainter = TextPainter( 45 | text: TextSpan(text: widget.text, style: TextStyle(fontSize: 20)), 46 | textDirection: TextDirection.ltr); 47 | textPainter.layout(); 48 | } 49 | 50 | @override 51 | void dispose() { 52 | _animationController.dispose(); 53 | super.dispose(); 54 | } 55 | 56 | @override 57 | void didUpdateWidget(RainbowText oldWidget) { 58 | super.didUpdateWidget(oldWidget); 59 | } 60 | 61 | void onSizeCallBack(Size size) { 62 | if (_textSize != null && _textSize == size) { 63 | return; 64 | } 65 | _textSize = size; 66 | print("onSizeCallBack:" + _textSize.toString()); 67 | } 68 | 69 | @override 70 | Widget build(BuildContext context) { 71 | if (!_animationController.isAnimating) { 72 | _animationController.value = 0; 73 | _animationController.forward(); 74 | } 75 | return AnimatedBuilder( 76 | animation: _animationController, 77 | builder: (BuildContext context, Widget child) { 78 | var width = _textSize.width; 79 | TextStyle textStyle = TextStyle(fontSize: 20); 80 | if (widget.colors.length > 0 && width > 0) { 81 | Shader shader = LinearGradient( 82 | begin: Alignment.centerLeft, 83 | end: Alignment.centerRight, 84 | colors: widget.colors, 85 | tileMode: TileMode.repeated) 86 | .createShader(Rect.fromLTWH( 87 | _animationController.value * width, 0, width, 0)); 88 | var foreground = Paint(); 89 | foreground.shader = shader; 90 | textStyle = textStyle.merge(TextStyle(foreground: foreground)); 91 | } 92 | return RepaintBoundary( 93 | child: CustomPaint( 94 | painter: _SizeGetPainter(onSizeCallBack, tag: widget.text), 95 | child: Text( 96 | widget.text, 97 | style: textStyle, 98 | ))); 99 | }, 100 | ); 101 | } 102 | } 103 | 104 | class _SizeGetPainter extends CustomPainter { 105 | final EasyCallback sizeCallBack; 106 | 107 | final dynamic tag; 108 | 109 | _SizeGetPainter(this.sizeCallBack, {this.tag = ""}); 110 | 111 | @override 112 | void paint(Canvas canvas, Size size) { 113 | if (sizeCallBack != null) { 114 | sizeCallBack(size); 115 | } 116 | } 117 | 118 | @override 119 | bool shouldRepaint(CustomPainter oldDelegate) { 120 | if (oldDelegate is _SizeGetPainter) { 121 | return oldDelegate.tag != tag && tag != ""; 122 | } 123 | return true; 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_effects 2 | description: A new Flutter package. 3 | version: 0.0.1 4 | author: 5 | homepage: 6 | 7 | environment: 8 | sdk: ">=2.1.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | 18 | # For information on the generic Dart part of this file, see the 19 | # following page: https://www.dartlang.org/tools/pub/pubspec 20 | 21 | # The following section is specific to Flutter. 22 | flutter: 23 | 24 | # To add assets to your package, add an assets section, like this: 25 | # assets: 26 | # - images/a_dot_burr.jpeg 27 | # - images/a_dot_ham.jpeg 28 | # 29 | # For details regarding assets in packages, see 30 | # https://flutter.io/assets-and-images/#from-packages 31 | # 32 | # An image asset can refer to one or more resolution-specific "variants", see 33 | # https://flutter.io/assets-and-images/#resolution-aware. 34 | 35 | # To add custom fonts to your package, add a fonts section here, 36 | # in this "flutter" section. Each entry in this list should have a 37 | # "family" key with the font family name, and a "fonts" key with a 38 | # list giving the asset and other descriptors for the font. For 39 | # example: 40 | # fonts: 41 | # - family: Schyler 42 | # fonts: 43 | # - asset: fonts/Schyler-Regular.ttf 44 | # - asset: fonts/Schyler-Italic.ttf 45 | # style: italic 46 | # - family: Trajan Pro 47 | # fonts: 48 | # - asset: fonts/TrajanPro.ttf 49 | # - asset: fonts/TrajanPro_Bold.ttf 50 | # weight: 700 51 | # 52 | # For details regarding fonts in packages, see 53 | # https://flutter.io/custom-fonts/#from-packages 54 | -------------------------------------------------------------------------------- /sample/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | pubspec.lock 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | .settings 21 | .classpath 22 | .project 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | .dart_tool/ 27 | .flutter-plugins 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Generated.xcconfig 62 | **/ios/Flutter/app.flx 63 | **/ios/Flutter/app.zip 64 | **/ios/Flutter/flutter_assets/ 65 | **/ios/ServiceDefinitions.json 66 | **/ios/Runner/GeneratedPluginRegistrant.* 67 | 68 | # Exceptions to above rules. 69 | !**/ios/**/default.mode1v3 70 | !**/ios/**/default.mode2v3 71 | !**/ios/**/default.pbxuser 72 | !**/ios/**/default.perspectivev3 73 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 74 | -------------------------------------------------------------------------------- /sample/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /sample/README.md: -------------------------------------------------------------------------------- 1 | # sample 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.io/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /sample/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 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 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.flutter_effects" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /sample/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /sample/android/app/src/main/java/com/example/flutter_effects/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.flutter_effects; 2 | 3 | import android.os.Bundle; 4 | 5 | import io.flutter.app.FlutterActivity; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | GeneratedPluginRegistrant.registerWith(this); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sample/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /sample/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /sample/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.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 | -------------------------------------------------------------------------------- /sample/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /sample/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /sample/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.withReader('UTF-8') { reader -> plugins.load(reader) } 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 | -------------------------------------------------------------------------------- /sample/assets/images/bg_gift_bag_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/assets/images/bg_gift_bag_bottom.png -------------------------------------------------------------------------------- /sample/assets/images/icon_sm_sigin_status_three.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/assets/images/icon_sm_sigin_status_three.png -------------------------------------------------------------------------------- /sample/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 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /sample/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /sample/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /sample/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 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 64 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3B80C3931E831B6300D905FE /* App.framework */, 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 77 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 78 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 79 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 80 | ); 81 | name = Flutter; 82 | sourceTree = ""; 83 | }; 84 | 97C146E51CF9000F007C117D = { 85 | isa = PBXGroup; 86 | children = ( 87 | 9740EEB11CF90186004384FC /* Flutter */, 88 | 97C146F01CF9000F007C117D /* Runner */, 89 | 97C146EF1CF9000F007C117D /* Products */, 90 | ); 91 | sourceTree = ""; 92 | }; 93 | 97C146EF1CF9000F007C117D /* Products */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 97C146EE1CF9000F007C117D /* Runner.app */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | 97C146F01CF9000F007C117D /* Runner */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 105 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 106 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 107 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 108 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 109 | 97C147021CF9000F007C117D /* Info.plist */, 110 | 97C146F11CF9000F007C117D /* Supporting Files */, 111 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 112 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 113 | ); 114 | path = Runner; 115 | sourceTree = ""; 116 | }; 117 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 97C146F21CF9000F007C117D /* main.m */, 121 | ); 122 | name = "Supporting Files"; 123 | sourceTree = ""; 124 | }; 125 | /* End PBXGroup section */ 126 | 127 | /* Begin PBXNativeTarget section */ 128 | 97C146ED1CF9000F007C117D /* Runner */ = { 129 | isa = PBXNativeTarget; 130 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 131 | buildPhases = ( 132 | 9740EEB61CF901F6004384FC /* Run Script */, 133 | 97C146EA1CF9000F007C117D /* Sources */, 134 | 97C146EB1CF9000F007C117D /* Frameworks */, 135 | 97C146EC1CF9000F007C117D /* Resources */, 136 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 137 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 138 | ); 139 | buildRules = ( 140 | ); 141 | dependencies = ( 142 | ); 143 | name = Runner; 144 | productName = Runner; 145 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 146 | productType = "com.apple.product-type.application"; 147 | }; 148 | /* End PBXNativeTarget section */ 149 | 150 | /* Begin PBXProject section */ 151 | 97C146E61CF9000F007C117D /* Project object */ = { 152 | isa = PBXProject; 153 | attributes = { 154 | LastUpgradeCheck = 0910; 155 | ORGANIZATIONNAME = "The Chromium Authors"; 156 | TargetAttributes = { 157 | 97C146ED1CF9000F007C117D = { 158 | CreatedOnToolsVersion = 7.3.1; 159 | DevelopmentTeam = SLM5Y4FHYV; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | Base, 170 | ); 171 | mainGroup = 97C146E51CF9000F007C117D; 172 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 97C146ED1CF9000F007C117D /* Runner */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 97C146EC1CF9000F007C117D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 187 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 188 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 189 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 190 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | name = "Thin Binary"; 205 | outputPaths = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | shellPath = /bin/sh; 209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 210 | }; 211 | 9740EEB61CF901F6004384FC /* Run Script */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | ); 218 | name = "Run Script"; 219 | outputPaths = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 224 | }; 225 | /* End PBXShellScriptBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | 97C146EA1CF9000F007C117D /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 233 | 97C146F31CF9000F007C117D /* main.m in Sources */, 234 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 97C146FB1CF9000F007C117D /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 97C147001CF9000F007C117D /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 261 | isa = XCBuildConfiguration; 262 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | CLANG_ANALYZER_NONNULL = YES; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 275 | CLANG_WARN_EMPTY_BODY = YES; 276 | CLANG_WARN_ENUM_CONVERSION = YES; 277 | CLANG_WARN_INFINITE_RECURSION = YES; 278 | CLANG_WARN_INT_CONVERSION = YES; 279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNREACHABLE_CODE = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_NO_COMMON_BLOCKS = YES; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 301 | MTL_ENABLE_DEBUG_INFO = NO; 302 | SDKROOT = iphoneos; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | VALIDATE_PRODUCT = YES; 305 | }; 306 | name = Profile; 307 | }; 308 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 314 | DEVELOPMENT_TEAM = SLM5Y4FHYV; 315 | ENABLE_BITCODE = NO; 316 | FRAMEWORK_SEARCH_PATHS = ( 317 | "$(inherited)", 318 | "$(PROJECT_DIR)/Flutter", 319 | ); 320 | INFOPLIST_FILE = Runner/Info.plist; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | LIBRARY_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "$(PROJECT_DIR)/Flutter", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEffects; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | VERSIONING_SYSTEM = "apple-generic"; 329 | }; 330 | name = Profile; 331 | }; 332 | 97C147031CF9000F007C117D /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = 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_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 355 | CLANG_WARN_STRICT_PROTOTYPES = YES; 356 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = dwarf; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | ENABLE_TESTABILITY = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_DYNAMIC_NO_PIC = NO; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 379 | MTL_ENABLE_DEBUG_INFO = YES; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = iphoneos; 382 | TARGETED_DEVICE_FAMILY = "1,2"; 383 | }; 384 | name = Debug; 385 | }; 386 | 97C147041CF9000F007C117D /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_ANALYZER_NONNULL = YES; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_COMMA = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INFINITE_RECURSION = YES; 404 | CLANG_WARN_INT_CONVERSION = YES; 405 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 409 | CLANG_WARN_STRICT_PROTOTYPES = YES; 410 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 411 | CLANG_WARN_UNREACHABLE_CODE = YES; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 414 | COPY_PHASE_STRIP = NO; 415 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 416 | ENABLE_NS_ASSERTIONS = NO; 417 | ENABLE_STRICT_OBJC_MSGSEND = YES; 418 | GCC_C_LANGUAGE_STANDARD = gnu99; 419 | GCC_NO_COMMON_BLOCKS = YES; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 427 | MTL_ENABLE_DEBUG_INFO = NO; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = "1,2"; 430 | VALIDATE_PRODUCT = YES; 431 | }; 432 | name = Release; 433 | }; 434 | 97C147061CF9000F007C117D /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 440 | DEVELOPMENT_TEAM = SLM5Y4FHYV; 441 | ENABLE_BITCODE = NO; 442 | FRAMEWORK_SEARCH_PATHS = ( 443 | "$(inherited)", 444 | "$(PROJECT_DIR)/Flutter", 445 | ); 446 | INFOPLIST_FILE = Runner/Info.plist; 447 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 448 | LIBRARY_SEARCH_PATHS = ( 449 | "$(inherited)", 450 | "$(PROJECT_DIR)/Flutter", 451 | ); 452 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEffects; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | VERSIONING_SYSTEM = "apple-generic"; 455 | }; 456 | name = Debug; 457 | }; 458 | 97C147071CF9000F007C117D /* Release */ = { 459 | isa = XCBuildConfiguration; 460 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 461 | buildSettings = { 462 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 463 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 464 | DEVELOPMENT_TEAM = SLM5Y4FHYV; 465 | ENABLE_BITCODE = NO; 466 | FRAMEWORK_SEARCH_PATHS = ( 467 | "$(inherited)", 468 | "$(PROJECT_DIR)/Flutter", 469 | ); 470 | INFOPLIST_FILE = Runner/Info.plist; 471 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 472 | LIBRARY_SEARCH_PATHS = ( 473 | "$(inherited)", 474 | "$(PROJECT_DIR)/Flutter", 475 | ); 476 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEffects; 477 | PRODUCT_NAME = "$(TARGET_NAME)"; 478 | VERSIONING_SYSTEM = "apple-generic"; 479 | }; 480 | name = Release; 481 | }; 482 | /* End XCBuildConfiguration section */ 483 | 484 | /* Begin XCConfigurationList section */ 485 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 486 | isa = XCConfigurationList; 487 | buildConfigurations = ( 488 | 97C147031CF9000F007C117D /* Debug */, 489 | 97C147041CF9000F007C117D /* Release */, 490 | 249021D3217E4FDB00AE95B9 /* Profile */, 491 | ); 492 | defaultConfigurationIsVisible = 0; 493 | defaultConfigurationName = Release; 494 | }; 495 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | 97C147061CF9000F007C117D /* Debug */, 499 | 97C147071CF9000F007C117D /* Release */, 500 | 249021D4217E4FDB00AE95B9 /* Profile */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | /* End XCConfigurationList section */ 506 | }; 507 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 508 | } 509 | -------------------------------------------------------------------------------- /sample/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /sample/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /sample/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /sample/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 | "size": "1024x1024", 113 | "idiom": "ios-marketing", 114 | "filename": "Icon-App-1024x1024@1x.png", 115 | "scale": "1x" 116 | } 117 | ], 118 | "info": { 119 | "version": 1, 120 | "author": "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "idiom": "universal", 5 | "filename": "LaunchImage.png", 6 | "scale": "1x" 7 | }, 8 | { 9 | "idiom": "universal", 10 | "filename": "LaunchImage@2x.png", 11 | "scale": "2x" 12 | }, 13 | { 14 | "idiom": "universal", 15 | "filename": "LaunchImage@3x.png", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "version": 1, 21 | "author": "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HitenDev/flutter_effects/bf4114e3fafa829e63aab42a7ae5ae21c0e36222/sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /sample/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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /sample/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 | -------------------------------------------------------------------------------- /sample/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | flutter_effects 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_effect_text 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /sample/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, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sample/lib/demo/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/rendering.dart'; 3 | 4 | void main() => runApp(MyApp()); 5 | 6 | class MyApp extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | return MaterialApp( 10 | title: 'Blog Demo', 11 | theme: ThemeData( 12 | primarySwatch: Colors.blue, 13 | ), 14 | home: MyHomePage(title: 'Blog Demo'), 15 | ); 16 | } 17 | } 18 | 19 | class MyHomePage extends StatefulWidget { 20 | MyHomePage({Key key, this.title}) : super(key: key); 21 | 22 | final String title; 23 | 24 | @override 25 | _MyHomePageState createState() => _MyHomePageState(); 26 | } 27 | 28 | class _MyHomePageState extends State { 29 | @override 30 | Widget build(BuildContext context) { 31 | return Scaffold( 32 | appBar: AppBar(title: Center(child: Text(widget.title))), 33 | body: ListView.builder( 34 | itemBuilder: (BuildContext context, int index) { 35 | return Container( 36 | alignment: Alignment.center, 37 | child: Transform( 38 | transform: Matrix4.translationValues(100, 0, 0), 39 | child: _CustomRenderObjectWidget( 40 | child: Transform( 41 | transform: Matrix4.translationValues(-50, 0, 0), 42 | child: Container( 43 | alignment: Alignment.center, 44 | width: 100, 45 | height: 100, 46 | color: Colors.black, 47 | child: Text( 48 | "Text", 49 | style: TextStyle(color: Colors.white), 50 | ))), 51 | ))); 52 | }, 53 | itemCount: 10), 54 | ); 55 | } 56 | } 57 | 58 | class _CustomRenderObjectWidget extends SingleChildRenderObjectWidget { 59 | final Widget child; 60 | 61 | _CustomRenderObjectWidget({this.child}) : super(child: child); 62 | @override 63 | RenderObject createRenderObject(BuildContext context) { 64 | return _CustomRenderObject(); 65 | } 66 | } 67 | 68 | class _CustomRenderObject extends RenderProxyBox { 69 | @override 70 | void paint(PaintingContext context, Offset offset) { 71 | super.paint(context, offset); 72 | print(offset); 73 | context.canvas.drawCircle(offset, 3, Paint()..color = Colors.red); 74 | } 75 | } 76 | 77 | class _BorderLinePainter extends CustomPainter { 78 | @override 79 | void paint(Canvas canvas, Size size) { 80 | canvas.drawCircle(Offset.zero, 3, Paint()..color = Colors.red); 81 | } 82 | 83 | @override 84 | bool shouldRepaint(CustomPainter oldDelegate) { 85 | return true; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /sample/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui' as ui; 2 | 3 | import 'package:anvil_effect/anvil_effect.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_effects/flutter_text_effect.dart'; 6 | import 'package:sample/scratch_card_widget.dart'; 7 | import 'package:sample/utils.dart'; 8 | 9 | void main() => runApp(MyApp()); 10 | 11 | class MyApp extends StatelessWidget { 12 | // This widget is the root of your application. 13 | @override 14 | Widget build(BuildContext context) { 15 | return MaterialApp( 16 | title: 'Effect Demo', 17 | theme: ThemeData( 18 | primarySwatch: Colors.blue, 19 | ), 20 | home: MyHomePage(title: 'Flutter Effects Sample'), 21 | ); 22 | } 23 | } 24 | 25 | class MyHomePage extends StatefulWidget { 26 | MyHomePage({Key key, this.title}) : super(key: key); 27 | 28 | final String title; 29 | 30 | @override 31 | _MyHomePageState createState() => _MyHomePageState(); 32 | } 33 | 34 | class _MyHomePageState extends State { 35 | List sentences; 36 | 37 | int diffScaleNext = 0; 38 | 39 | ui.Image _image; 40 | 41 | @override 42 | void initState() { 43 | super.initState(); 44 | sentences = [ 45 | "What is design?", 46 | "Design is not just", 47 | "what it looks like and feels like.", 48 | "Design is how it works. \n- Steve Jobs", 49 | "Older people", 50 | "sit down and ask,", 51 | "'What is it?'", 52 | "but the boy asks,", 53 | "What can I do with it?. \n- Steve Jobs", 54 | "Swift", 55 | "Objective-C", 56 | "iPhone", 57 | "iPad", 58 | "Mac Mini", 59 | "MacBook Pro", 60 | "Mac Pro", 61 | "爱老婆", 62 | "老婆和女儿" 63 | ]; 64 | 65 | Utils.getImage("assets/images/bg_gift_bag_bottom.png").then((image) { 66 | _image = image; 67 | setState(() { 68 | 69 | }); 70 | }); 71 | } 72 | 73 | @override 74 | Widget build(BuildContext context) { 75 | return Scaffold( 76 | appBar: AppBar( 77 | title: Text(widget.title), 78 | ), 79 | body: SingleChildScrollView( 80 | child: Container( 81 | margin: EdgeInsets.all(8), 82 | child: Column( 83 | children: [ 84 | createItem(ScratchCardWidget( 85 | strokeWidth: 20, 86 | threshold: 0.5, 87 | foreground: (canvas, size, offset) { 88 | if (_image != null) { 89 | double scale; 90 | double dx = 0; 91 | double dy = 0; 92 | if (_image.width * size.height > 93 | size.width * _image.height) { 94 | scale = size.height / _image.height; 95 | dx = (size.width - _image.width * scale) / 2; 96 | } else { 97 | scale = size.width / _image.width; 98 | dy = (size.height - _image.height * scale) / 2; 99 | } 100 | canvas.save(); 101 | canvas.translate(dx, dy); 102 | canvas.scale(scale, scale); 103 | canvas.drawImage(_image, Offset(0, 0), new Paint()); 104 | canvas.restore(); 105 | } else { 106 | canvas.drawRect( 107 | Rect.fromLTWH(0, 0, size.width, size.height), 108 | Paint() 109 | ..color = Colors.grey); 110 | } 111 | }, 112 | child: Container( 113 | color: Colors.blueAccent, 114 | alignment: Alignment.center, 115 | child: Image.asset( 116 | "assets/images/icon_sm_sigin_status_three.png", 117 | fit: BoxFit.scaleDown, height: 20,), 118 | ))), 119 | Divider(), 120 | createItem(RainbowText(colors: [ 121 | Color(0xFFFF2B22), 122 | Color(0xFFFF7F22), 123 | Color(0xFFEDFF22), 124 | Color(0xFF22FF22), 125 | Color(0xFF22F4FF), 126 | Color(0xFF5400F7), 127 | ], text: "Welcome to BBT", loop: true)), 128 | Divider(), 129 | createItem(ExplosionWidget( 130 | tag: "Explosion Text", 131 | child: Container( 132 | alignment: Alignment.center, 133 | color: Colors.blueAccent, 134 | child: Text( 135 | "Explosion Text", 136 | style: TextStyle( 137 | fontSize: 20, 138 | color: Colors.red, 139 | fontWeight: FontWeight.bold), 140 | )))), 141 | Divider(), 142 | LineBorderText( 143 | child: createItem(Text( 144 | "Border Effect", 145 | style: TextStyle(fontSize: 20), 146 | )), 147 | autoAnim: true), 148 | Divider(), 149 | createItem( 150 | DiffScaleText( 151 | text: sentences[diffScaleNext % sentences.length], 152 | textStyle: TextStyle(fontSize: 20, color: Colors.blue), 153 | ), 154 | bgColor: Colors.black, onTap: () { 155 | setState(() { 156 | diffScaleNext++; 157 | }); 158 | }), 159 | Divider(), 160 | createItem(AnvilEffectWidget(child: Text( 161 | "👉AnvilEffect👈", 162 | style: TextStyle(color: Colors.white, fontSize: 20), 163 | ),), bgColor: Colors.black), 164 | ], 165 | ), 166 | )), 167 | ); 168 | } 169 | 170 | Widget createItem(Widget child, 171 | {VoidCallback onTap, Color bgColor = Colors.transparent}) { 172 | return GestureDetector( 173 | onTap: onTap, 174 | child: Container( 175 | color: bgColor, 176 | child: child, 177 | height: 100, 178 | alignment: Alignment.center, 179 | )); 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /sample/lib/scratch_card_widget.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/rendering.dart'; 5 | import 'package:flutter/widgets.dart'; 6 | 7 | typedef MaskPainter = Function(Canvas canvas, Size size, Offset offset); 8 | 9 | class ScratchCardWidget extends StatefulWidget { 10 | final Widget child; 11 | final MaskPainter foreground; 12 | final double strokeWidth; 13 | 14 | final double threshold; 15 | 16 | const ScratchCardWidget( 17 | {Key key, this.child, this.foreground, this.strokeWidth, this.threshold}) 18 | : assert(foreground != null), 19 | super(key: key); 20 | 21 | @override 22 | _ScratchCardWidgetState createState() => _ScratchCardWidgetState(); 23 | } 24 | 25 | class _ScratchCardWidgetState extends State { 26 | Path _path = Path(); 27 | 28 | bool _complete = false; 29 | 30 | GlobalKey scratchCardRenderKey = new GlobalKey(); 31 | 32 | @override 33 | void initState() { 34 | super.initState(); 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return GestureDetector( 40 | behavior: HitTestBehavior.translucent, 41 | onPanUpdate: (detail) { 42 | _path.lineTo(detail.globalPosition.dx, detail.globalPosition.dy); 43 | setState(() {}); 44 | }, 45 | onPanStart: (detail) { 46 | _path.moveTo(detail.globalPosition.dx, detail.globalPosition.dy); 47 | setState(() {}); 48 | }, 49 | onPanEnd: (detail) { 50 | _ScratchCardRenderObject _scratchCardRenderObject = 51 | scratchCardRenderKey.currentContext.findRenderObject(); 52 | _scratchCardRenderObject.eraserComplete().then((complete) { 53 | if (complete) { 54 | setState(() { 55 | _complete = true; 56 | }); 57 | } 58 | }); 59 | }, 60 | child: _complete 61 | ? widget.child 62 | : RepaintBoundary( 63 | child: _ScratchCardRenderWidget( 64 | key: scratchCardRenderKey, 65 | child: widget.child, 66 | path: _path, 67 | foreground: widget.foreground, 68 | strokeWidth: widget.strokeWidth, 69 | threshold: widget.threshold, 70 | ))); 71 | } 72 | } 73 | 74 | class _ScratchCardRenderWidget extends SingleChildRenderObjectWidget { 75 | final Path path; 76 | final MaskPainter foreground; 77 | final double strokeWidth; 78 | final double threshold; 79 | 80 | const _ScratchCardRenderWidget( 81 | {Key key, 82 | Widget child, 83 | this.path, 84 | this.foreground, 85 | this.strokeWidth, 86 | this.threshold}) 87 | : super(key: key, child: child); 88 | 89 | @override 90 | _ScratchCardRenderObject createRenderObject(BuildContext context) { 91 | return _ScratchCardRenderObject( 92 | path: path, 93 | foreground: foreground, 94 | strokeWidth: strokeWidth, 95 | threshold: threshold); 96 | } 97 | 98 | @override 99 | void updateRenderObject( 100 | BuildContext context, _ScratchCardRenderObject renderObject) { 101 | renderObject.path = path; 102 | renderObject.strokeWidth = strokeWidth; 103 | renderObject.foreground = foreground; 104 | renderObject.threshold = threshold; 105 | renderObject.updatePoint(); 106 | } 107 | } 108 | 109 | class _ScratchCardRenderObject extends RenderProxyBox { 110 | _ScratchCardRenderObject( 111 | {RenderBox child, 112 | this.path, 113 | this.foreground, 114 | this.strokeWidth, 115 | this.threshold = 0.66}) 116 | : assert(threshold > 0 && threshold <= 1), 117 | super(child); 118 | 119 | MaskPainter foreground; 120 | 121 | Path path; 122 | 123 | double strokeWidth; 124 | 125 | double threshold; 126 | 127 | void updatePoint() { 128 | markNeedsPaint(); 129 | } 130 | 131 | Future eraserComplete() async { 132 | var pictureRecorder = PictureRecorder(); 133 | Canvas canvas = Canvas(pictureRecorder); 134 | canvas.saveLayer(Rect.fromLTWH(0, 0, size.width, size.height), Paint()); 135 | foreground(canvas, size, Offset.zero); 136 | var eraserPaint = Paint(); 137 | eraserPaint.color = Colors.transparent; 138 | eraserPaint.style = PaintingStyle.stroke; 139 | eraserPaint.strokeWidth = strokeWidth == null ? 20 : strokeWidth; 140 | eraserPaint.strokeCap = StrokeCap.round; 141 | eraserPaint.strokeJoin = StrokeJoin.round; 142 | eraserPaint.blendMode = BlendMode.dstIn; 143 | eraserPaint.isAntiAlias = true; 144 | if (path != null) { 145 | var toGlobal = localToGlobal(Offset(0, 0)); 146 | var _path = path.shift(-toGlobal); 147 | canvas.drawPath(_path, eraserPaint); 148 | } 149 | canvas.restore(); 150 | var picture = pictureRecorder.endRecording(); 151 | var image = await picture.toImage(size.width.toInt(), size.height.toInt()); 152 | var byteData = await image.toByteData(); 153 | int pixelCount = 0; 154 | int maxCount = (size.width * size.height * threshold).toInt(); 155 | for (int index = 0; index < size.width * size.height; index++) { 156 | int i = index * 4; 157 | int r = byteData.getUint8(i); 158 | int g = byteData.getUint8(i + 1); 159 | int b = byteData.getUint8(i + 2); 160 | int a = byteData.getUint8(i + 3); 161 | if (r == 0 && g == 0 && b == 0 && a == 0) { 162 | pixelCount++; 163 | } 164 | if (pixelCount > maxCount) { 165 | return true; 166 | } 167 | } 168 | return false; 169 | } 170 | 171 | @override 172 | void paint(PaintingContext context, Offset offset) { 173 | super.paint(context, offset); 174 | context.canvas.saveLayer( 175 | Rect.fromLTWH(offset.dx, offset.dy, size.width, size.height), Paint()); 176 | context.canvas.translate(offset.dx, offset.dy); 177 | foreground(context.canvas, size, offset); 178 | var eraserPaint = Paint(); 179 | eraserPaint.color = Colors.transparent; 180 | eraserPaint.style = PaintingStyle.stroke; 181 | eraserPaint.strokeWidth = strokeWidth == null ? 20 : strokeWidth; 182 | eraserPaint.strokeCap = StrokeCap.round; 183 | eraserPaint.strokeJoin = StrokeJoin.round; 184 | eraserPaint.blendMode = BlendMode.dstIn; 185 | eraserPaint.isAntiAlias = true; 186 | if (path != null) { 187 | var toGlobal = localToGlobal(Offset(0, 0)); 188 | var _path = path.shift(-toGlobal); 189 | context.canvas.drawPath(_path, eraserPaint); 190 | } 191 | context.canvas.restore(); 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /sample/lib/utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | import 'dart:ui'; 3 | import 'dart:ui' as ui; 4 | 5 | import 'package:flutter/services.dart' show rootBundle; 6 | 7 | class Utils { 8 | final context; 9 | 10 | Utils({this.context}) : super(); 11 | 12 | static double getWidth() { 13 | return ui.window.physicalSize.width; 14 | } 15 | 16 | static double getlRatio() { 17 | return ui.window.devicePixelRatio; 18 | } 19 | 20 | static double getHeight() { 21 | return ui.window.physicalSize.height; 22 | } 23 | 24 | static Future getImage(String asset) async { 25 | ByteData data = await rootBundle.load(asset); 26 | Codec codec = await ui.instantiateImageCodec(data.buffer.asUint8List()); 27 | FrameInfo fi = await codec.getNextFrame(); 28 | return fi.image; 29 | } 30 | } 31 | 32 | class CanvasOffset extends Offset { 33 | const CanvasOffset(double width, double height) : super(width, height); 34 | } 35 | -------------------------------------------------------------------------------- /sample/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: sample 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.2 26 | 27 | dev_dependencies: 28 | flutter_test: 29 | sdk: flutter 30 | flutter_effects: 31 | path: ../ 32 | 33 | anvil_effect: 34 | path: ../anvil_effect/ 35 | 36 | 37 | # For information on the generic Dart part of this file, see the 38 | # following page: https://www.dartlang.org/tools/pub/pubspec 39 | 40 | # The following section is specific to Flutter. 41 | flutter: 42 | 43 | # The following line ensures that the Material Icons font is 44 | # included with your application, so that you can use the icons in 45 | # the material Icons class. 46 | uses-material-design: true 47 | 48 | # To add assets to your application, add an assets section, like this: 49 | assets: 50 | - assets/images/bg_gift_bag_bottom.png 51 | - assets/images/icon_sm_sigin_status_three.png 52 | 53 | # An image asset can refer to one or more resolution-specific "variants", see 54 | # https://flutter.io/assets-and-images/#resolution-aware. 55 | 56 | # For details regarding adding assets from package dependencies, see 57 | # https://flutter.io/assets-and-images/#from-packages 58 | 59 | # To add custom fonts to your application, add a fonts section here, 60 | # in this "flutter" section. Each entry in this list should have a 61 | # "family" key with the font family name, and a "fonts" key with a 62 | # list giving the asset and other descriptors for the font. For 63 | # example: 64 | # fonts: 65 | # - family: Schyler 66 | # fonts: 67 | # - asset: fonts/Schyler-Regular.ttf 68 | # - asset: fonts/Schyler-Italic.ttf 69 | # style: italic 70 | # - family: Trajan Pro 71 | # fonts: 72 | # - asset: fonts/TrajanPro.ttf 73 | # - asset: fonts/TrajanPro_Bold.ttf 74 | # weight: 700 75 | # 76 | # For details regarding fonts from package dependencies, 77 | # see https://flutter.io/custom-fonts/#from-packages 78 | -------------------------------------------------------------------------------- /sample/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:sample/main.dart'; 10 | import 'package:flutter_test/flutter_test.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(MyApp()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /test/flutter_package_test.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | void main() { 4 | } 5 | --------------------------------------------------------------------------------