├── .gitignore
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── example
├── .gitignore
├── .metadata
├── README.md
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── example
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable-v21
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── 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-night
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle
├── assets
│ ├── dash.jpg
│ ├── mattis.jpeg
│ └── people
│ │ ├── people01.jpg
│ │ ├── people02.jpg
│ │ ├── people03.jpg
│ │ ├── people04.jpg
│ │ ├── people05.jpg
│ │ ├── people06.jpg
│ │ ├── people07.jpg
│ │ ├── people08.jpg
│ │ ├── people09.jpg
│ │ ├── people10.jpg
│ │ ├── people11.jpg
│ │ ├── people12.jpg
│ │ ├── people13.jpg
│ │ ├── people14.jpg
│ │ ├── people15.jpg
│ │ ├── people16.jpg
│ │ ├── people17.jpg
│ │ ├── people18.jpg
│ │ ├── people19.jpg
│ │ ├── people20.jpg
│ │ ├── people21.jpg
│ │ ├── people22.jpg
│ │ ├── people23.jpg
│ │ ├── people24.jpg
│ │ ├── people25.jpg
│ │ ├── people26.jpg
│ │ ├── people27.jpg
│ │ ├── people28.jpg
│ │ ├── people29.jpg
│ │ ├── people30.jpg
│ │ ├── people31.jpg
│ │ ├── people32.jpg
│ │ ├── people33.jpg
│ │ ├── people34.jpg
│ │ ├── people35.jpg
│ │ ├── people36.jpg
│ │ ├── people37.jpg
│ │ ├── people38.jpg
│ │ ├── people39.jpg
│ │ ├── people40.jpg
│ │ ├── people41.jpg
│ │ ├── people42.jpg
│ │ ├── people43.jpg
│ │ ├── people44.jpg
│ │ ├── people45.jpg
│ │ └── people46.jpg
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── Runner
│ │ ├── AppDelegate.swift
│ │ ├── 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
│ │ └── Runner-Bridging-Header.h
├── lib
│ └── main.dart
├── pubspec.lock
├── pubspec.yaml
├── test
│ └── widget_test.dart
└── web
│ ├── favicon.png
│ ├── icons
│ ├── Icon-192.png
│ └── Icon-512.png
│ ├── index.html
│ └── manifest.json
├── lib
├── animated_counter.dart
├── blocks_counter.dart
├── circle_wave_counter.dart
├── common.dart
├── creature_counter.dart
├── disks_counter.dart
├── image_bubble_counter.dart
├── particles_counter.dart
├── pixel_counter.dart
├── portrait_counter.dart
├── rotating_bubbles_counter.dart
├── rotating_planets_counter.dart
├── volcano_counter.dart
└── wave_counter.dart
├── pubspec.lock
├── pubspec.yaml
├── ss
├── blocks.gif
├── circle_wave.gif
├── creatures.gif
├── disks.gif
├── image_bubble.gif
├── mattis.gif
├── particles.gif
├── pixel.gif
├── portrait.gif
├── rotating_bubbles.gif
├── rotating_planets.gif
├── triangles.gif
├── volcano.gif
└── wave.gif
├── test
└── animated_counter_test.dart
└── volcano.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
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/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 |
--------------------------------------------------------------------------------
/.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: 022b333a089afb81c471ec43d1f1f4f26305d876
8 | channel: beta
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [1.0.0] - 2020-04-15
2 |
3 | * Added support for Null-Safety.
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 | # animated_counter
2 | -------------------------------------------------------------
3 |
4 | A collection of animated counters sourced during the FlutterCounterChallenge2020.
5 |
6 | Block | Circle Wave | Creatures
7 | :-------------------------:|:-------------------------:|:-------------------------:
8 |  |  | 
9 |
10 | Image Bubble |Particles | Portrait
11 | :-------------------------:|:-------------------------:|:-------------------------:
12 |  | | 
13 |
14 | Rotating Bubbles | Rotating Planets | Volcano
15 | :-------------------------:|:-------------------------:|:-------------------------:
16 |  | | 
17 |
18 | Wave | Pixel | Disks
19 | :-------------------------:|:-------------------------:|:-------------------------:
20 |  |  | 
21 |
22 |
23 | ## Features
24 |
25 | * Beautiful Smooth Animations
26 | * Ability to increment, decrement and get current counter value.
27 | * One stop destination for FlutterCounterChallenge2020 widgets.
28 | * Completely open source.
29 | * Added support for Null-Safety
30 |
31 | ## Supported platforms
32 |
33 | * Flutter Android
34 | * Flutter iOS
35 | * Flutter web
36 | * Flutter desktop
37 |
38 | ## Live preview
39 |
40 | http://ryuukenshi.github.io/animated_counter
41 |
42 | Note: This page is built with flutter-web, hence the animations may not be smooth. For a better user experience, please run the example app on a mobile device.
43 |
44 | ## Installation
45 |
46 | Add `animated_counter: 1.0.0` to your `pubspec.yaml` dependencies. And import it:
47 |
48 | ```dart
49 | import 'package:collapsible_sidebar/collapsible_sidebar.dart';
50 | ```
51 |
52 | ## How to use
53 | -----------------------------------------------
54 |
55 | First create the object of the Animated Counter you wish to use. Then use its `build()` method to build it. Finally use the `incrementCounter()`, `decrementCounter()` and `getCounter()` methods to control the widget animations.
56 |
57 | ### Create the object of the animated counter you like
58 |
59 | ```dart
60 | BlocksCounter block = BlocksCounter(initialCounter: 0);
61 | DisksCounter disk = DisksCounter(initialCounter: 0);
62 | WaveCounter wave = WaveCounter(initialCounter: 0);
63 | CircleWaveCounter circle;
64 | RotatingBubblesCounter bub = RotatingBubblesCounter(initialCounter: 0, initialColors: [Colors.red, Colors.green, Colors.blue]);
65 | RotatingPlanetsCounter plan = RotatingPlanetsCounter(initialCounter: 0, initialColors: [Colors.red, Colors.green, Colors.blue]);
66 | CreatureCounter cre;
67 | ImageBubbleCounter imgbub = ImageBubbleCounter(initialCounter: 0, image: 'assets/dash.jpg');
68 | PortraitCounter por = PortraitCounter(initialCounter: 0, image: 'assets/mattis.jpeg');
69 | ParticlesCounter part;
70 | VolcanoCounter vol = VolcanoCounter(initialCounter: 0, enableSky: true);
71 | PixelCounter pix = PixelCounter(initialCounter: 0);
72 |
73 | @override
74 | void initState() {
75 | circle = CircleWaveCounter(vsync: this, initialCounter: 0, initialColors: [Colors.red, Colors.green, Colors.blue]);
76 | cre = CreatureCounter(vsync: this, initialCounter: 0, initialColors: [Colors.red, Colors.green, Colors.blue]);
77 | part = ParticlesCounter(initialCounter: 0, images: ['image1.jpg', 'image2.jpg', 'image3.jpg', 'image4.jpg', 'image5.jpg']);
78 | super.initState();
79 | }
80 | ```
81 | `CircleWaveCounter()` and `CreatureCounter()` require a vsync hence the parent class needs to extend `TickerProviderStateMixin` to use these counters.
82 |
83 | ### Use it in widget tree using `build()` method. Control it using the `incrementCounter()`, `decrementCounter()` and `getCounter()` methods.
84 |
85 | ```dart
86 | @override
87 | Widget build(BuildContext context) {
88 | return Scaffold(
89 | body: PageView(
90 | children: [
91 | block.build(context),
92 | disk.build(context),
93 | wave.build(context),
94 | circle.build(context),
95 | bub.build(context),
96 | plan.build(context),
97 | cre.build(context),
98 | imgbub.build(context),
99 | por.build(context),
100 | part.build(context),
101 | vol.build(context),
102 | pix.build(context),
103 | ],
104 | ),
105 | floatingActionButton: FloatingActionButton(
106 | onPressed: (){
107 | setState(() {
108 | block.incrementCounter();
109 | disk.incrementCounter();
110 | wave.incrementCounter();
111 | circle.incrementCounter();
112 | bub.incrementCounter();
113 | plan.incrementCounter();
114 | cre.incrementCounter();
115 | imgbub.incrementCounter();
116 | por.incrementCounter();
117 | part.incrementCounter();
118 | vol.incrementCounter();
119 | pix.incrementCounter();
120 | });
121 | },
122 | ),
123 | );
124 | }
125 | ```
126 |
127 | ## License
128 | --------------------------------------------------------------
129 |
130 | Apache 2.0
131 |
132 | ## Credits
133 | ----------------------------------------------------------
134 | This package was made possible with code open-sourced by these awesome devs:
135 | * [Romain Rastel](https://github.com/letsar) 🌟🌟🌟
136 | * [Mahmoud Ashour](https://github.com/MeitanteiAshour) 🌟
137 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/example/.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: 022b333a089afb81c471ec43d1f1f4f26305d876
8 | channel: beta
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # example
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.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 |
--------------------------------------------------------------------------------
/example/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 plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 29
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.example.example"
42 | minSdkVersion 16
43 | targetSdkVersion 29
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | }
47 |
48 | buildTypes {
49 | release {
50 | // TODO: Add your own signing config for the release build.
51 | // Signing with the debug keys for now, so `flutter run --release` works.
52 | signingConfig signingConfigs.debug
53 | }
54 | }
55 | }
56 |
57 | flutter {
58 | source '../..'
59 | }
60 |
61 | dependencies {
62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63 | }
64 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
13 |
17 |
21 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
37 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 | android.enableR8=true
5 |
--------------------------------------------------------------------------------
/example/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-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/example/assets/dash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/dash.jpg
--------------------------------------------------------------------------------
/example/assets/mattis.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/mattis.jpeg
--------------------------------------------------------------------------------
/example/assets/people/people01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people01.jpg
--------------------------------------------------------------------------------
/example/assets/people/people02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people02.jpg
--------------------------------------------------------------------------------
/example/assets/people/people03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people03.jpg
--------------------------------------------------------------------------------
/example/assets/people/people04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people04.jpg
--------------------------------------------------------------------------------
/example/assets/people/people05.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people05.jpg
--------------------------------------------------------------------------------
/example/assets/people/people06.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people06.jpg
--------------------------------------------------------------------------------
/example/assets/people/people07.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people07.jpg
--------------------------------------------------------------------------------
/example/assets/people/people08.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people08.jpg
--------------------------------------------------------------------------------
/example/assets/people/people09.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people09.jpg
--------------------------------------------------------------------------------
/example/assets/people/people10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people10.jpg
--------------------------------------------------------------------------------
/example/assets/people/people11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people11.jpg
--------------------------------------------------------------------------------
/example/assets/people/people12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people12.jpg
--------------------------------------------------------------------------------
/example/assets/people/people13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people13.jpg
--------------------------------------------------------------------------------
/example/assets/people/people14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people14.jpg
--------------------------------------------------------------------------------
/example/assets/people/people15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people15.jpg
--------------------------------------------------------------------------------
/example/assets/people/people16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people16.jpg
--------------------------------------------------------------------------------
/example/assets/people/people17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people17.jpg
--------------------------------------------------------------------------------
/example/assets/people/people18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people18.jpg
--------------------------------------------------------------------------------
/example/assets/people/people19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people19.jpg
--------------------------------------------------------------------------------
/example/assets/people/people20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people20.jpg
--------------------------------------------------------------------------------
/example/assets/people/people21.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people21.jpg
--------------------------------------------------------------------------------
/example/assets/people/people22.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people22.jpg
--------------------------------------------------------------------------------
/example/assets/people/people23.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people23.jpg
--------------------------------------------------------------------------------
/example/assets/people/people24.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people24.jpg
--------------------------------------------------------------------------------
/example/assets/people/people25.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people25.jpg
--------------------------------------------------------------------------------
/example/assets/people/people26.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people26.jpg
--------------------------------------------------------------------------------
/example/assets/people/people27.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people27.jpg
--------------------------------------------------------------------------------
/example/assets/people/people28.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people28.jpg
--------------------------------------------------------------------------------
/example/assets/people/people29.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people29.jpg
--------------------------------------------------------------------------------
/example/assets/people/people30.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people30.jpg
--------------------------------------------------------------------------------
/example/assets/people/people31.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people31.jpg
--------------------------------------------------------------------------------
/example/assets/people/people32.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people32.jpg
--------------------------------------------------------------------------------
/example/assets/people/people33.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people33.jpg
--------------------------------------------------------------------------------
/example/assets/people/people34.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people34.jpg
--------------------------------------------------------------------------------
/example/assets/people/people35.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people35.jpg
--------------------------------------------------------------------------------
/example/assets/people/people36.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people36.jpg
--------------------------------------------------------------------------------
/example/assets/people/people37.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people37.jpg
--------------------------------------------------------------------------------
/example/assets/people/people38.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people38.jpg
--------------------------------------------------------------------------------
/example/assets/people/people39.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people39.jpg
--------------------------------------------------------------------------------
/example/assets/people/people40.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people40.jpg
--------------------------------------------------------------------------------
/example/assets/people/people41.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people41.jpg
--------------------------------------------------------------------------------
/example/assets/people/people42.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people42.jpg
--------------------------------------------------------------------------------
/example/assets/people/people43.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people43.jpg
--------------------------------------------------------------------------------
/example/assets/people/people44.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people44.jpg
--------------------------------------------------------------------------------
/example/assets/people/people45.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people45.jpg
--------------------------------------------------------------------------------
/example/assets/people/people46.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/assets/people/people46.jpg
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
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 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/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 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "";
23 | dstSubfolderSpec = 10;
24 | files = (
25 | );
26 | name = "Embed Frameworks";
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXFrameworksBuildPhase section */
56 |
57 | /* Begin PBXGroup section */
58 | 9740EEB11CF90186004384FC /* Flutter */ = {
59 | isa = PBXGroup;
60 | children = (
61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
65 | );
66 | name = Flutter;
67 | sourceTree = "";
68 | };
69 | 97C146E51CF9000F007C117D = {
70 | isa = PBXGroup;
71 | children = (
72 | 9740EEB11CF90186004384FC /* Flutter */,
73 | 97C146F01CF9000F007C117D /* Runner */,
74 | 97C146EF1CF9000F007C117D /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | 97C146EF1CF9000F007C117D /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 97C146EE1CF9000F007C117D /* Runner.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | 97C146F01CF9000F007C117D /* Runner */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
92 | 97C147021CF9000F007C117D /* Info.plist */,
93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
97 | );
98 | path = Runner;
99 | sourceTree = "";
100 | };
101 | /* End PBXGroup section */
102 |
103 | /* Begin PBXNativeTarget section */
104 | 97C146ED1CF9000F007C117D /* Runner */ = {
105 | isa = PBXNativeTarget;
106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107 | buildPhases = (
108 | 9740EEB61CF901F6004384FC /* Run Script */,
109 | 97C146EA1CF9000F007C117D /* Sources */,
110 | 97C146EB1CF9000F007C117D /* Frameworks */,
111 | 97C146EC1CF9000F007C117D /* Resources */,
112 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
114 | );
115 | buildRules = (
116 | );
117 | dependencies = (
118 | );
119 | name = Runner;
120 | productName = Runner;
121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
122 | productType = "com.apple.product-type.application";
123 | };
124 | /* End PBXNativeTarget section */
125 |
126 | /* Begin PBXProject section */
127 | 97C146E61CF9000F007C117D /* Project object */ = {
128 | isa = PBXProject;
129 | attributes = {
130 | LastUpgradeCheck = 1020;
131 | ORGANIZATIONNAME = "";
132 | TargetAttributes = {
133 | 97C146ED1CF9000F007C117D = {
134 | CreatedOnToolsVersion = 7.3.1;
135 | LastSwiftMigration = 1100;
136 | };
137 | };
138 | };
139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
140 | compatibilityVersion = "Xcode 9.3";
141 | developmentRegion = en;
142 | hasScannedForEncodings = 0;
143 | knownRegions = (
144 | en,
145 | Base,
146 | );
147 | mainGroup = 97C146E51CF9000F007C117D;
148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
149 | projectDirPath = "";
150 | projectRoot = "";
151 | targets = (
152 | 97C146ED1CF9000F007C117D /* Runner */,
153 | );
154 | };
155 | /* End PBXProject section */
156 |
157 | /* Begin PBXResourcesBuildPhase section */
158 | 97C146EC1CF9000F007C117D /* Resources */ = {
159 | isa = PBXResourcesBuildPhase;
160 | buildActionMask = 2147483647;
161 | files = (
162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
166 | );
167 | runOnlyForDeploymentPostprocessing = 0;
168 | };
169 | /* End PBXResourcesBuildPhase section */
170 |
171 | /* Begin PBXShellScriptBuildPhase section */
172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173 | isa = PBXShellScriptBuildPhase;
174 | buildActionMask = 2147483647;
175 | files = (
176 | );
177 | inputPaths = (
178 | );
179 | name = "Thin Binary";
180 | outputPaths = (
181 | );
182 | runOnlyForDeploymentPostprocessing = 0;
183 | shellPath = /bin/sh;
184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
185 | };
186 | 9740EEB61CF901F6004384FC /* Run Script */ = {
187 | isa = PBXShellScriptBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | );
191 | inputPaths = (
192 | );
193 | name = "Run Script";
194 | outputPaths = (
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | shellPath = /bin/sh;
198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
199 | };
200 | /* End PBXShellScriptBuildPhase section */
201 |
202 | /* Begin PBXSourcesBuildPhase section */
203 | 97C146EA1CF9000F007C117D /* Sources */ = {
204 | isa = PBXSourcesBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | };
212 | /* End PBXSourcesBuildPhase section */
213 |
214 | /* Begin PBXVariantGroup section */
215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
216 | isa = PBXVariantGroup;
217 | children = (
218 | 97C146FB1CF9000F007C117D /* Base */,
219 | );
220 | name = Main.storyboard;
221 | sourceTree = "";
222 | };
223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
224 | isa = PBXVariantGroup;
225 | children = (
226 | 97C147001CF9000F007C117D /* Base */,
227 | );
228 | name = LaunchScreen.storyboard;
229 | sourceTree = "";
230 | };
231 | /* End PBXVariantGroup section */
232 |
233 | /* Begin XCBuildConfiguration section */
234 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
235 | isa = XCBuildConfiguration;
236 | buildSettings = {
237 | ALWAYS_SEARCH_USER_PATHS = NO;
238 | CLANG_ANALYZER_NONNULL = YES;
239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
240 | CLANG_CXX_LIBRARY = "libc++";
241 | CLANG_ENABLE_MODULES = YES;
242 | CLANG_ENABLE_OBJC_ARC = YES;
243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
244 | CLANG_WARN_BOOL_CONVERSION = YES;
245 | CLANG_WARN_COMMA = YES;
246 | CLANG_WARN_CONSTANT_CONVERSION = YES;
247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
249 | CLANG_WARN_EMPTY_BODY = YES;
250 | CLANG_WARN_ENUM_CONVERSION = YES;
251 | CLANG_WARN_INFINITE_RECURSION = YES;
252 | CLANG_WARN_INT_CONVERSION = YES;
253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
258 | CLANG_WARN_STRICT_PROTOTYPES = YES;
259 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
260 | CLANG_WARN_UNREACHABLE_CODE = YES;
261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
263 | COPY_PHASE_STRIP = NO;
264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
265 | ENABLE_NS_ASSERTIONS = NO;
266 | ENABLE_STRICT_OBJC_MSGSEND = YES;
267 | GCC_C_LANGUAGE_STANDARD = gnu99;
268 | GCC_NO_COMMON_BLOCKS = YES;
269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
271 | GCC_WARN_UNDECLARED_SELECTOR = YES;
272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
273 | GCC_WARN_UNUSED_FUNCTION = YES;
274 | GCC_WARN_UNUSED_VARIABLE = YES;
275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
276 | MTL_ENABLE_DEBUG_INFO = NO;
277 | SDKROOT = iphoneos;
278 | SUPPORTED_PLATFORMS = iphoneos;
279 | TARGETED_DEVICE_FAMILY = "1,2";
280 | VALIDATE_PRODUCT = YES;
281 | };
282 | name = Profile;
283 | };
284 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
285 | isa = XCBuildConfiguration;
286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
287 | buildSettings = {
288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
289 | CLANG_ENABLE_MODULES = YES;
290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
291 | ENABLE_BITCODE = NO;
292 | FRAMEWORK_SEARCH_PATHS = (
293 | "$(inherited)",
294 | "$(PROJECT_DIR)/Flutter",
295 | );
296 | INFOPLIST_FILE = Runner/Info.plist;
297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
298 | LIBRARY_SEARCH_PATHS = (
299 | "$(inherited)",
300 | "$(PROJECT_DIR)/Flutter",
301 | );
302 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
303 | PRODUCT_NAME = "$(TARGET_NAME)";
304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
305 | SWIFT_VERSION = 5.0;
306 | VERSIONING_SYSTEM = "apple-generic";
307 | };
308 | name = Profile;
309 | };
310 | 97C147031CF9000F007C117D /* Debug */ = {
311 | isa = XCBuildConfiguration;
312 | buildSettings = {
313 | ALWAYS_SEARCH_USER_PATHS = NO;
314 | CLANG_ANALYZER_NONNULL = YES;
315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
316 | CLANG_CXX_LIBRARY = "libc++";
317 | CLANG_ENABLE_MODULES = YES;
318 | CLANG_ENABLE_OBJC_ARC = YES;
319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
320 | CLANG_WARN_BOOL_CONVERSION = YES;
321 | CLANG_WARN_COMMA = YES;
322 | CLANG_WARN_CONSTANT_CONVERSION = YES;
323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
325 | CLANG_WARN_EMPTY_BODY = YES;
326 | CLANG_WARN_ENUM_CONVERSION = YES;
327 | CLANG_WARN_INFINITE_RECURSION = YES;
328 | CLANG_WARN_INT_CONVERSION = YES;
329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
334 | CLANG_WARN_STRICT_PROTOTYPES = YES;
335 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
336 | CLANG_WARN_UNREACHABLE_CODE = YES;
337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
339 | COPY_PHASE_STRIP = NO;
340 | DEBUG_INFORMATION_FORMAT = dwarf;
341 | ENABLE_STRICT_OBJC_MSGSEND = YES;
342 | ENABLE_TESTABILITY = YES;
343 | GCC_C_LANGUAGE_STANDARD = gnu99;
344 | GCC_DYNAMIC_NO_PIC = NO;
345 | GCC_NO_COMMON_BLOCKS = YES;
346 | GCC_OPTIMIZATION_LEVEL = 0;
347 | GCC_PREPROCESSOR_DEFINITIONS = (
348 | "DEBUG=1",
349 | "$(inherited)",
350 | );
351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
353 | GCC_WARN_UNDECLARED_SELECTOR = YES;
354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
355 | GCC_WARN_UNUSED_FUNCTION = YES;
356 | GCC_WARN_UNUSED_VARIABLE = YES;
357 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
358 | MTL_ENABLE_DEBUG_INFO = YES;
359 | ONLY_ACTIVE_ARCH = YES;
360 | SDKROOT = iphoneos;
361 | TARGETED_DEVICE_FAMILY = "1,2";
362 | };
363 | name = Debug;
364 | };
365 | 97C147041CF9000F007C117D /* Release */ = {
366 | isa = XCBuildConfiguration;
367 | buildSettings = {
368 | ALWAYS_SEARCH_USER_PATHS = NO;
369 | CLANG_ANALYZER_NONNULL = YES;
370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
371 | CLANG_CXX_LIBRARY = "libc++";
372 | CLANG_ENABLE_MODULES = YES;
373 | CLANG_ENABLE_OBJC_ARC = YES;
374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
375 | CLANG_WARN_BOOL_CONVERSION = YES;
376 | CLANG_WARN_COMMA = YES;
377 | CLANG_WARN_CONSTANT_CONVERSION = YES;
378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
380 | CLANG_WARN_EMPTY_BODY = YES;
381 | CLANG_WARN_ENUM_CONVERSION = YES;
382 | CLANG_WARN_INFINITE_RECURSION = YES;
383 | CLANG_WARN_INT_CONVERSION = YES;
384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
389 | CLANG_WARN_STRICT_PROTOTYPES = YES;
390 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
391 | CLANG_WARN_UNREACHABLE_CODE = YES;
392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
394 | COPY_PHASE_STRIP = NO;
395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
396 | ENABLE_NS_ASSERTIONS = NO;
397 | ENABLE_STRICT_OBJC_MSGSEND = YES;
398 | GCC_C_LANGUAGE_STANDARD = gnu99;
399 | GCC_NO_COMMON_BLOCKS = YES;
400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
402 | GCC_WARN_UNDECLARED_SELECTOR = YES;
403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
404 | GCC_WARN_UNUSED_FUNCTION = YES;
405 | GCC_WARN_UNUSED_VARIABLE = YES;
406 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
407 | MTL_ENABLE_DEBUG_INFO = NO;
408 | SDKROOT = iphoneos;
409 | SUPPORTED_PLATFORMS = iphoneos;
410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
411 | TARGETED_DEVICE_FAMILY = "1,2";
412 | VALIDATE_PRODUCT = YES;
413 | };
414 | name = Release;
415 | };
416 | 97C147061CF9000F007C117D /* Debug */ = {
417 | isa = XCBuildConfiguration;
418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
419 | buildSettings = {
420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
421 | CLANG_ENABLE_MODULES = YES;
422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
423 | ENABLE_BITCODE = NO;
424 | FRAMEWORK_SEARCH_PATHS = (
425 | "$(inherited)",
426 | "$(PROJECT_DIR)/Flutter",
427 | );
428 | INFOPLIST_FILE = Runner/Info.plist;
429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
430 | LIBRARY_SEARCH_PATHS = (
431 | "$(inherited)",
432 | "$(PROJECT_DIR)/Flutter",
433 | );
434 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
435 | PRODUCT_NAME = "$(TARGET_NAME)";
436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
438 | SWIFT_VERSION = 5.0;
439 | VERSIONING_SYSTEM = "apple-generic";
440 | };
441 | name = Debug;
442 | };
443 | 97C147071CF9000F007C117D /* Release */ = {
444 | isa = XCBuildConfiguration;
445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
446 | buildSettings = {
447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
448 | CLANG_ENABLE_MODULES = YES;
449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
450 | ENABLE_BITCODE = NO;
451 | FRAMEWORK_SEARCH_PATHS = (
452 | "$(inherited)",
453 | "$(PROJECT_DIR)/Flutter",
454 | );
455 | INFOPLIST_FILE = Runner/Info.plist;
456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
457 | LIBRARY_SEARCH_PATHS = (
458 | "$(inherited)",
459 | "$(PROJECT_DIR)/Flutter",
460 | );
461 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
462 | PRODUCT_NAME = "$(TARGET_NAME)";
463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
464 | SWIFT_VERSION = 5.0;
465 | VERSIONING_SYSTEM = "apple-generic";
466 | };
467 | name = Release;
468 | };
469 | /* End XCBuildConfiguration section */
470 |
471 | /* Begin XCConfigurationList section */
472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
473 | isa = XCConfigurationList;
474 | buildConfigurations = (
475 | 97C147031CF9000F007C117D /* Debug */,
476 | 97C147041CF9000F007C117D /* Release */,
477 | 249021D3217E4FDB00AE95B9 /* Profile */,
478 | );
479 | defaultConfigurationIsVisible = 0;
480 | defaultConfigurationName = Release;
481 | };
482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
483 | isa = XCConfigurationList;
484 | buildConfigurations = (
485 | 97C147061CF9000F007C117D /* Debug */,
486 | 97C147071CF9000F007C117D /* Release */,
487 | 249021D4217E4FDB00AE95B9 /* Profile */,
488 | );
489 | defaultConfigurationIsVisible = 0;
490 | defaultConfigurationName = Release;
491 | };
492 | /* End XCConfigurationList section */
493 | };
494 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
495 | }
496 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/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.
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'package:animated_counter/animated_counter.dart';
4 |
5 | void main() {
6 | runApp(const MyApp());
7 | }
8 |
9 | class MyApp extends StatelessWidget {
10 | const MyApp({
11 | Key key,
12 | }) : super(key: key);
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return MaterialApp(
17 | debugShowCheckedModeBanner: false,
18 | title: 'Flutter Demo',
19 | theme: ThemeData(primarySwatch: Colors.blue),
20 | home: Demos(),
21 | );
22 | }
23 | }
24 |
25 | class Demos extends StatefulWidget {
26 | @override
27 | _DemosState createState() => _DemosState();
28 | }
29 |
30 | class _DemosState extends State with TickerProviderStateMixin {
31 | TabController _controller;
32 |
33 | BlocksCounter block = BlocksCounter(
34 | initialCounter: 0, color: Colors.red, blend: BlendMode.lighten);
35 | DisksCounter disk = DisksCounter(initialCounter: 0, color: Colors.blue);
36 | WaveCounter wave = WaveCounter(initialCounter: 0, color: Colors.orange);
37 | CircleWaveCounter circle;
38 | RotatingBubblesCounter bub = RotatingBubblesCounter(
39 | initialCounter: 0,
40 | initialColors: [Colors.red, Colors.green, Colors.blue],
41 | blend: BlendMode.lighten);
42 | RotatingPlanetsCounter plan = RotatingPlanetsCounter(
43 | initialCounter: 0,
44 | initialColors: [Colors.red, Colors.green, Colors.blue],
45 | blend: BlendMode.lighten);
46 | CreatureCounter cre;
47 | ImageBubbleCounter imgbub =
48 | ImageBubbleCounter(initialCounter: 0, image: 'assets/dash.jpg');
49 | PortraitCounter por =
50 | PortraitCounter(initialCounter: 0, image: 'assets/mattis.jpeg');
51 | ParticlesCounter part;
52 | VolcanoCounter vol = VolcanoCounter(initialCounter: 0, enableSky: true);
53 | PixelCounter pix = PixelCounter(initialCounter: 0, color: Colors.cyan);
54 |
55 | List getAssetName() {
56 | List names = List();
57 | for (int i = 1; i < 47; i++) {
58 | final n = i < 10 ? '0$i' : '$i';
59 | names.add('assets/people/people$n.jpg');
60 | }
61 | return names;
62 | }
63 |
64 | @override
65 | void initState() {
66 | _controller = TabController(length: 12, vsync: this);
67 |
68 | circle = CircleWaveCounter(
69 | vsync: this,
70 | initialCounter: 0,
71 | initialColors: [Colors.red, Colors.green, Colors.blue],
72 | blend: BlendMode.lighten);
73 | cre = CreatureCounter(
74 | vsync: this,
75 | initialCounter: 0,
76 | initialColors: [Colors.red, Colors.green, Colors.blue]);
77 | part = ParticlesCounter(initialCounter: 0, images: getAssetName());
78 | super.initState();
79 | }
80 |
81 | @override
82 | Widget build(BuildContext context) {
83 | return Scaffold(
84 | backgroundColor: Colors.black,
85 | appBar: AppBar(
86 | title: const Text(
87 | 'Counter Demos: Press [+] to increment counter and [-] to decrement counter.'),
88 | bottom: TabBar(
89 | controller: _controller,
90 | isScrollable: true,
91 | tabs: [
92 | Tab(
93 | text: 'Block',
94 | ),
95 | Tab(
96 | text: 'Disk',
97 | ),
98 | Tab(
99 | text: 'Wave',
100 | ),
101 | Tab(
102 | text: 'CircleWave',
103 | ),
104 | Tab(
105 | text: 'RotatingBubbles',
106 | ),
107 | Tab(
108 | text: 'RotatingPlanets',
109 | ),
110 | Tab(
111 | text: 'Creature',
112 | ),
113 | Tab(
114 | text: 'ImageBubble',
115 | ),
116 | Tab(
117 | text: 'Portrait',
118 | ),
119 | Tab(
120 | text: 'Particles',
121 | ),
122 | Tab(
123 | text: 'Volcano',
124 | ),
125 | Tab(
126 | text: 'Pixel',
127 | )
128 | ],
129 | ),
130 | ),
131 | body: Stack(
132 | alignment: Alignment.bottomCenter,
133 | children: [
134 | TabBarView(
135 | controller: _controller,
136 | children: [
137 | block.build(context),
138 | disk.build(context),
139 | wave.build(context),
140 | circle.build(context),
141 | bub.build(context),
142 | plan.build(context),
143 | cre.build(context),
144 | imgbub.build(context),
145 | por.build(context),
146 | part.build(context),
147 | vol.build(context),
148 | pix.build(context),
149 | ],
150 | ),
151 | Padding(
152 | padding: const EdgeInsets.only(bottom: 10),
153 | child: Row(
154 | mainAxisSize: MainAxisSize.max,
155 | mainAxisAlignment: MainAxisAlignment.center,
156 | children: [
157 | FloatingActionButton(
158 | child: Icon(Icons.remove),
159 | onPressed: () {
160 | setState(() {
161 | block.decrementCounter();
162 | disk.decrementCounter();
163 | wave.decrementCounter();
164 | circle.decrementCounter();
165 | bub.decrementCounter();
166 | plan.decrementCounter();
167 | cre.decrementCounter();
168 | imgbub.decrementCounter();
169 | por.decrementCounter();
170 | part.decrementCounter();
171 | vol.decrementCounter();
172 | pix.decrementCounter();
173 | });
174 | },
175 | ),
176 | SizedBox(
177 | width: 50,
178 | ),
179 | FloatingActionButton(
180 | child: Icon(Icons.add),
181 | onPressed: () {
182 | setState(() {
183 | block.incrementCounter();
184 | disk.incrementCounter();
185 | wave.incrementCounter();
186 | circle.incrementCounter();
187 | bub.incrementCounter();
188 | plan.incrementCounter();
189 | cre.incrementCounter();
190 | imgbub.incrementCounter();
191 | por.incrementCounter();
192 | part.incrementCounter();
193 | vol.incrementCounter();
194 | pix.incrementCounter();
195 | });
196 | },
197 | ),
198 | ],
199 | ),
200 | )
201 | ],
202 | ),
203 | );
204 | }
205 | }
206 |
--------------------------------------------------------------------------------
/example/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | animated_counter:
5 | dependency: "direct main"
6 | description:
7 | path: ".."
8 | relative: true
9 | source: path
10 | version: "0.0.7"
11 | async:
12 | dependency: transitive
13 | description:
14 | name: async
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.5.0"
18 | boolean_selector:
19 | dependency: transitive
20 | description:
21 | name: boolean_selector
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.1.0"
25 | characters:
26 | dependency: transitive
27 | description:
28 | name: characters
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.1.0"
32 | charcode:
33 | dependency: transitive
34 | description:
35 | name: charcode
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.2.0"
39 | clock:
40 | dependency: transitive
41 | description:
42 | name: clock
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.1.0"
46 | collection:
47 | dependency: transitive
48 | description:
49 | name: collection
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.15.0"
53 | fake_async:
54 | dependency: transitive
55 | description:
56 | name: fake_async
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.2.0"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_test:
66 | dependency: "direct dev"
67 | description: flutter
68 | source: sdk
69 | version: "0.0.0"
70 | matcher:
71 | dependency: transitive
72 | description:
73 | name: matcher
74 | url: "https://pub.dartlang.org"
75 | source: hosted
76 | version: "0.12.10"
77 | meta:
78 | dependency: transitive
79 | description:
80 | name: meta
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "1.3.0"
84 | path:
85 | dependency: transitive
86 | description:
87 | name: path
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "1.8.0"
91 | sky_engine:
92 | dependency: transitive
93 | description: flutter
94 | source: sdk
95 | version: "0.0.99"
96 | source_span:
97 | dependency: transitive
98 | description:
99 | name: source_span
100 | url: "https://pub.dartlang.org"
101 | source: hosted
102 | version: "1.8.1"
103 | stack_trace:
104 | dependency: transitive
105 | description:
106 | name: stack_trace
107 | url: "https://pub.dartlang.org"
108 | source: hosted
109 | version: "1.10.0"
110 | stream_channel:
111 | dependency: transitive
112 | description:
113 | name: stream_channel
114 | url: "https://pub.dartlang.org"
115 | source: hosted
116 | version: "2.1.0"
117 | string_scanner:
118 | dependency: transitive
119 | description:
120 | name: string_scanner
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "1.1.0"
124 | term_glyph:
125 | dependency: transitive
126 | description:
127 | name: term_glyph
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "1.2.0"
131 | test_api:
132 | dependency: transitive
133 | description:
134 | name: test_api
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "0.2.19"
138 | typed_data:
139 | dependency: transitive
140 | description:
141 | name: typed_data
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "1.3.0"
145 | vector_math:
146 | dependency: transitive
147 | description:
148 | name: vector_math
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "2.1.0"
152 | sdks:
153 | dart: ">=2.12.0 <3.0.0"
154 | flutter: ">=1.17.0"
155 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: example
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.7.0 <3.0.0"
22 |
23 | dependencies:
24 | flutter:
25 | sdk: flutter
26 |
27 |
28 | # The following adds the Cupertino Icons font to your application.
29 | # Use with the CupertinoIcons class for iOS style icons.
30 | animated_counter:
31 | path: ../
32 |
33 | dev_dependencies:
34 | flutter_test:
35 | sdk: flutter
36 |
37 | # For information on the generic Dart part of this file, see the
38 | # following page: https://dart.dev/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/
51 | - assets/people/
52 | # - images/a_dot_ham.jpeg
53 |
54 | # An image asset can refer to one or more resolution-specific "variants", see
55 | # https://flutter.dev/assets-and-images/#resolution-aware.
56 |
57 | # For details regarding adding assets from package dependencies, see
58 | # https://flutter.dev/assets-and-images/#from-packages
59 |
60 | # To add custom fonts to your application, add a fonts section here,
61 | # in this "flutter" section. Each entry in this list should have a
62 | # "family" key with the font family name, and a "fonts" key with a
63 | # list giving the asset and other descriptors for the font. For
64 | # example:
65 | # fonts:
66 | # - family: Schyler
67 | # fonts:
68 | # - asset: fonts/Schyler-Regular.ttf
69 | # - asset: fonts/Schyler-Italic.ttf
70 | # style: italic
71 | # - family: Trajan Pro
72 | # fonts:
73 | # - asset: fonts/TrajanPro.ttf
74 | # - asset: fonts/TrajanPro_Bold.ttf
75 | # weight: 700
76 | #
77 | # For details regarding fonts from package dependencies,
78 | # see https://flutter.dev/custom-fonts/#from-packages
79 |
--------------------------------------------------------------------------------
/example/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:flutter_test/flutter_test.dart';
10 |
11 | import 'package:example/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/example/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/web/favicon.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/example/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/example/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | example
30 |
31 |
32 |
33 |
36 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/example/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example",
3 | "short_name": "example",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/lib/animated_counter.dart:
--------------------------------------------------------------------------------
1 | library animated_counter;
2 |
3 | export 'blocks_counter.dart';
4 | export 'circle_wave_counter.dart';
5 | export 'creature_counter.dart';
6 | export 'disks_counter.dart';
7 | export 'image_bubble_counter.dart';
8 | export 'particles_counter.dart';
9 | export 'portrait_counter.dart';
10 | export 'rotating_bubbles_counter.dart';
11 | export 'rotating_planets_counter.dart';
12 | export 'volcano_counter.dart';
13 | export 'wave_counter.dart';
14 | export 'pixel_counter.dart';
15 |
--------------------------------------------------------------------------------
/lib/blocks_counter.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | class BlocksCounter {
6 | BlocksCounter(
7 | {required int initialCounter,
8 | Color color = Colors.white,
9 | BlendMode blend = BlendMode.difference}) {
10 | _counter = initialCounter;
11 | _color = color;
12 | _blend = blend;
13 | for (int i = 0; i < _counter!; i++) {
14 | final dx = _random.nextInt(_blockCount);
15 | final dy = (_lastIndices[dx] - 1) % _blockCount;
16 | _lastIndices[dx] = dy;
17 | _indices.add(Offset(dx.toDouble(), dy.toDouble()));
18 | }
19 | }
20 | static const _blockCount = 5;
21 | final Random _random = Random();
22 | final List _indices = [];
23 | final List _lastIndices = List.filled(_blockCount, _blockCount);
24 | int? _counter;
25 | Color? _color;
26 | BlendMode? _blend;
27 |
28 | void incrementCounter() {
29 | _counter = _counter! + 1;
30 | final dx = _random.nextInt(_blockCount);
31 | final dy = (_lastIndices[dx] - 1) % _blockCount;
32 | _lastIndices[dx] = dy;
33 | _indices.add(Offset(dx.toDouble(), dy.toDouble()));
34 | }
35 |
36 | void decrementCounter() {
37 | if (_counter! > 0) {
38 | _counter = _counter! - 1;
39 | _indices.removeLast();
40 | }
41 | }
42 |
43 | int? getCounter() {
44 | return _counter;
45 | }
46 |
47 | Widget build(BuildContext context) {
48 | return LayoutBuilder(
49 | builder: (_, constraints) {
50 | final blockSize = Size(
51 | constraints.maxWidth / _blockCount,
52 | constraints.maxHeight / _blockCount,
53 | );
54 | return Stack(
55 | children: [
56 | for (int i = 0; i < _indices.length; i++)
57 | Positioned.fill(
58 | child: _Block(
59 | blockSize: blockSize,
60 | endOffset: Offset(
61 | _indices[i].dx * blockSize.width,
62 | _indices[i].dy * blockSize.height,
63 | ),
64 | color: _color,
65 | blend: _blend,
66 | ),
67 | ),
68 | ],
69 | );
70 | },
71 | );
72 | }
73 | }
74 |
75 | class _Block extends StatefulWidget {
76 | const _Block({
77 | Key? key,
78 | this.blockSize,
79 | this.endOffset,
80 | this.color,
81 | this.blend,
82 | }) : super(key: key);
83 |
84 | final Size? blockSize;
85 | final Offset? endOffset;
86 | final Color? color;
87 | final BlendMode? blend;
88 |
89 | @override
90 | __BlockState createState() => __BlockState();
91 | }
92 |
93 | class __BlockState extends State<_Block> with SingleTickerProviderStateMixin {
94 | late AnimationController controller;
95 | Animation? offset;
96 |
97 | @override
98 | void initState() {
99 | super.initState();
100 |
101 | final endOffset = widget.endOffset!;
102 | final blockHeight = widget.blockSize!.height;
103 | final distance = blockHeight + endOffset.dy;
104 | final duration = (distance * 2).toInt();
105 |
106 | controller = AnimationController(
107 | vsync: this,
108 | duration: Duration(milliseconds: duration),
109 | )..forward();
110 |
111 | offset = controller.drive(
112 | Tween(
113 | begin: Offset(endOffset.dx, -blockHeight),
114 | end: endOffset,
115 | ),
116 | );
117 | }
118 |
119 | @override
120 | void dispose() {
121 | controller.dispose();
122 | super.dispose();
123 | }
124 |
125 | @override
126 | Widget build(BuildContext context) {
127 | return CustomPaint(
128 | painter: _BlockPainter(
129 | offset,
130 | widget.blockSize,
131 | widget.color,
132 | widget.blend,
133 | ),
134 | );
135 | }
136 | }
137 |
138 | class _BlockPainter extends CustomPainter {
139 | _BlockPainter(
140 | this.offset,
141 | this.blockSize,
142 | this.color,
143 | this.blend,
144 | ) : super(repaint: offset);
145 |
146 | final Animation? offset;
147 | final Size? blockSize;
148 | final Color? color;
149 | final BlendMode? blend;
150 | @override
151 | void paint(Canvas canvas, Size size) {
152 | canvas.drawRect(
153 | offset!.value & blockSize!,
154 | Paint()
155 | ..color = color!
156 | ..blendMode = blend!,
157 | );
158 | }
159 |
160 | @override
161 | bool shouldRepaint(_BlockPainter oldDelegate) => false;
162 | }
163 |
--------------------------------------------------------------------------------
/lib/circle_wave_counter.dart:
--------------------------------------------------------------------------------
1 | // Credits to https://dribbble.com/shots/1698964-Circle-wave-II
2 |
3 | import 'dart:math' as math;
4 | import 'dart:ui';
5 |
6 | import 'package:flutter/material.dart';
7 |
8 | import 'common.dart';
9 |
10 | class CircleWaveCounter {
11 | CircleWaveCounter(
12 | {required TickerProvider vsync,
13 | required List initialColors,
14 | required int initialCounter,
15 | BlendMode blend = BlendMode.hardLight}) {
16 | _counter = initialCounter;
17 | _colors = initialColors;
18 | _blend = blend;
19 |
20 | _controller = AnimationController(
21 | vsync: vsync,
22 | upperBound: 2,
23 | duration: const Duration(seconds: 10),
24 | )..repeat();
25 | _addPointController = AnimationController(
26 | vsync: vsync,
27 | duration: const Duration(milliseconds: 500),
28 | );
29 | _addPointAnimation =
30 | _addPointController.drive(CurveTween(curve: Curves.ease));
31 |
32 | for (int i = 0; i < _counter!; i++) {
33 | _addPointController.forward(from: 0);
34 | }
35 | }
36 |
37 | late List _colors;
38 | AnimationController? _controller;
39 | late AnimationController _addPointController;
40 | Animation? _addPointAnimation;
41 | int? _counter;
42 | BlendMode? _blend;
43 |
44 | void incrementCounter() {
45 | _counter = _counter! + 1;
46 | _addPointController.forward(from: 0);
47 | }
48 |
49 | void decrementCounter() {
50 | if (_counter! > 0) {
51 | _counter = _counter! - 1;
52 | _addPointController.forward(from: 0);
53 | }
54 | }
55 |
56 | int? getCounter() {
57 | return _counter;
58 | }
59 |
60 | Widget build(BuildContext context) {
61 | return Stack(
62 | children: [
63 | for (int i = 0; i < _colors.length; i++)
64 | Positioned.fill(
65 | child: TweenAnimationBuilder(
66 | tween: Tween(begin: 0, end: 1),
67 | duration: const Duration(milliseconds: 500),
68 | curve: Curves.easeIn,
69 | builder: (_, double opacity, __) {
70 | return CustomPaint(
71 | painter: _CircleWavePainter(
72 | _controller,
73 | _addPointAnimation,
74 | i,
75 | _colors[i].withOpacity(opacity),
76 | _counter,
77 | _blend,
78 | ),
79 | );
80 | },
81 | ),
82 | ),
83 | ],
84 | );
85 | }
86 | }
87 |
88 | class _CircleWavePainter extends CustomPainter {
89 | _CircleWavePainter(
90 | this.animation,
91 | this.addAnimation,
92 | this.index,
93 | this.color,
94 | this.count,
95 | this.blend,
96 | ) : super(repaint: animation);
97 | final Animation? animation;
98 | final Animation? addAnimation;
99 | final int index;
100 | final Color color;
101 | final int? count;
102 | final BlendMode? blend;
103 |
104 | static const halfPi = math.pi / 2;
105 | static const twoPi = math.pi * 2;
106 | final n = 7;
107 |
108 | @override
109 | void paint(Canvas canvas, Size size) {
110 | final t = animation!.value;
111 | final halfWidth = size.width / 2;
112 | final halfHeight = size.height / 2;
113 | final q = index * halfPi;
114 |
115 | List computeOffsets(int length) {
116 | final offsets = [];
117 | for (var i = 0; i < length; i++) {
118 | final th = i * twoPi / length;
119 | double os = map(math.cos(th - twoPi * t), -1, 1, 0, 1);
120 | os = 0.125 * math.pow(os, 2.75);
121 | final r = 165 * (1 + os * math.cos(n * th + 1.5 * twoPi * t + q));
122 | offsets.add(Offset(
123 | r * math.sin(th) + halfWidth, -r * math.cos(th) + halfHeight));
124 | }
125 | return offsets;
126 | }
127 |
128 | final offsets = computeOffsets(count!);
129 |
130 | if (count! > 1 && addAnimation!.value < 1) {
131 | final t = addAnimation!.value;
132 | final oldOffsets = computeOffsets(count! - 1);
133 | for (var i = 0; i < count! - 1; i++) {
134 | offsets[i] = Offset.lerp(oldOffsets[i], offsets[i], t);
135 | }
136 | offsets[count! - 1] = Offset.lerp(
137 | oldOffsets[count! - 2],
138 | offsets[count! - 1],
139 | t,
140 | );
141 | }
142 |
143 | final path = Path()..addPolygon(offsets as List, true);
144 | canvas.drawPath(
145 | path,
146 | Paint()
147 | ..blendMode = blend!
148 | ..color = color
149 | ..strokeWidth = 8
150 | ..style = PaintingStyle.stroke,
151 | );
152 | }
153 |
154 | @override
155 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
156 | return false;
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/lib/common.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter/services.dart';
5 |
6 | double map(double x, double minIn, double maxIn, double minOut, double maxOut) {
7 | return (x - minIn) * (maxOut - minOut) / (maxIn - minIn) + minOut;
8 | }
9 |
10 | final Random _random = Random();
11 |
12 | double randNextD(double max) => _random.nextDouble() * max;
13 | int randNextI(int max) => _random.nextInt(max);
14 | double randD(double min, double max) => _random.d(min, max);
15 | int randI(int min, int max) => _random.i(min, max);
16 |
17 | extension RandomExtension on Random {
18 | double d(double min, double max) {
19 | return nextDouble() * (max - min) + min;
20 | }
21 |
22 | int i(int min, int max) {
23 | return nextInt(max - min) + min;
24 | }
25 | }
26 |
27 | class Pixels {
28 | const Pixels({
29 | required this.byteData,
30 | required this.width,
31 | required this.height,
32 | });
33 |
34 | final ByteData? byteData;
35 | final int width;
36 | final int height;
37 |
38 | Color getColorAt(int x, int y) {
39 | final offset = 4 * (x + y * width);
40 | final rgba = byteData!.getUint32(offset);
41 | final a = rgba & 0xFF;
42 | final rgb = rgba >> 8;
43 | final argb = (a << 24) + rgb;
44 | return Color(argb);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/creature_counter.dart:
--------------------------------------------------------------------------------
1 | // Credits to https://gist.github.com/beesandbombs/6f3e6fb723f50b080916816ae8e561e3
2 |
3 | import 'dart:math' as math;
4 | import 'dart:ui';
5 |
6 | import 'package:flutter/material.dart';
7 |
8 | import 'common.dart';
9 |
10 | class CreatureCounter {
11 | CreatureCounter(
12 | {required TickerProvider vsync,
13 | required List initialColors,
14 | required int initialCounter,
15 | BlendMode blend = BlendMode.hardLight}) {
16 | _counter = initialCounter;
17 | _colors = initialColors;
18 | _blend = blend;
19 |
20 | _controller = AnimationController(
21 | vsync: vsync,
22 | upperBound: 2,
23 | duration: const Duration(seconds: 10),
24 | )..repeat();
25 | _addPointController = AnimationController(
26 | vsync: vsync,
27 | duration: const Duration(milliseconds: 500),
28 | );
29 | _addPointAnimation =
30 | _addPointController.drive(CurveTween(curve: Curves.ease));
31 | }
32 |
33 | late List _colors;
34 | int? _counter;
35 | BlendMode? _blend;
36 |
37 | AnimationController? _controller;
38 | late AnimationController _addPointController;
39 | Animation? _addPointAnimation;
40 |
41 | void incrementCounter() {
42 | _counter = _counter! + 1;
43 | _addPointController.forward(from: 0);
44 | }
45 |
46 | void decrementCounter() {
47 | if (_counter! > 0) {
48 | _counter = _counter! - 1;
49 | _addPointController.forward(from: 0);
50 | }
51 | }
52 |
53 | int? getCounter() {
54 | return _counter;
55 | }
56 |
57 | Widget build(BuildContext context) {
58 | return Stack(
59 | children: [
60 | for (int i = 0; i < _counter!; i++)
61 | Positioned.fill(
62 | child: TweenAnimationBuilder(
63 | tween: Tween(begin: 0, end: 1),
64 | duration: const Duration(milliseconds: 500),
65 | curve: Curves.easeIn,
66 | builder: (_, double opacity, __) {
67 | return CustomPaint(
68 | painter: _CreaturePainter(
69 | _controller,
70 | _addPointAnimation,
71 | i,
72 | _colors[i % _colors.length].withOpacity(opacity),
73 | _counter,
74 | _blend,
75 | ),
76 | );
77 | },
78 | ),
79 | ),
80 | ],
81 | );
82 | }
83 | }
84 |
85 | class _CreaturePainter extends CustomPainter {
86 | _CreaturePainter(
87 | this.animation,
88 | this.addAnimation,
89 | this.index,
90 | this.color,
91 | this.count,
92 | this.blend,
93 | ) : super(repaint: animation);
94 | final Animation? animation;
95 | final Animation? addAnimation;
96 | final int index;
97 | final Color color;
98 | final int? count;
99 | final BlendMode? blend;
100 |
101 | static const twoPi = math.pi * 2;
102 | final n = 300;
103 |
104 | @override
105 | void paint(Canvas canvas, Size size) {
106 | final t = animation!.value;
107 | final halfWidth = size.width / 2;
108 | final halfHeight = size.height / 2;
109 | final q = twoPi * index / count!;
110 | canvas.translate(halfWidth, halfHeight);
111 | if (index > 0 && count! > 2) {
112 | canvas.rotate(twoPi *
113 | (index / (count! - 1)) *
114 | (count! - addAnimation!.value) /
115 | count!);
116 | } else {
117 | canvas.rotate(q);
118 | }
119 |
120 | List computeOffsets(int? length) {
121 | final offsets = [];
122 | for (var i = 0; i < n; i++) {
123 | final qq = i / (n - 1);
124 | final r = map(math.cos(twoPi * qq), 1, -1, 0, 42) * math.sqrt(qq);
125 | final th = 12 * twoPi * qq - 4 * twoPi * t - q;
126 | final x = r * math.cos(th);
127 | final y = -(halfWidth - 10) * qq + r * math.sin(th);
128 | final tw = math.pi / 10 * math.sin(twoPi * t - math.pi * qq);
129 | final xx = x * math.cos(tw) + y * math.sin(tw);
130 | final yy = y * math.cos(tw) - x * math.sin(tw);
131 |
132 | offsets.add(Offset(xx, yy));
133 | }
134 | return offsets;
135 | }
136 |
137 | final offsets = computeOffsets(count);
138 |
139 | final path = Path()..addPolygon(offsets, false);
140 | canvas.drawPath(
141 | path,
142 | Paint()
143 | ..blendMode = blend!
144 | ..color = color
145 | ..strokeWidth = 5
146 | ..style = PaintingStyle.stroke
147 | ..maskFilter = const MaskFilter.blur(BlurStyle.solid, 10),
148 | );
149 | }
150 |
151 | @override
152 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
153 | return false;
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/lib/disks_counter.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | class DisksCounter {
6 | DisksCounter(
7 | {required int initialCounter,
8 | Color color = Colors.white,
9 | BlendMode blend = BlendMode.difference}) {
10 | _counter = initialCounter;
11 | _color = color;
12 | _blend = blend;
13 | }
14 |
15 | final Random _random = Random();
16 | int? _counter;
17 | Color? _color;
18 | BlendMode? _blend;
19 |
20 | void incrementCounter() {
21 | _counter = _counter! + 1;
22 | }
23 |
24 | void decrementCounter() {
25 | if (_counter! > 0) {
26 | _counter = _counter! - 1;
27 | }
28 | }
29 |
30 | int? getCounter() {
31 | return _counter;
32 | }
33 |
34 | Widget build(BuildContext context) {
35 | return Stack(
36 | children: [
37 | for (int i = 0; i < _counter!; i++)
38 | Positioned.fill(
39 | child: _Disk(
40 | random: _random,
41 | color: _color,
42 | blend: _blend,
43 | ),
44 | ),
45 | ],
46 | );
47 | }
48 | }
49 |
50 | class _Disk extends StatefulWidget {
51 | const _Disk({
52 | Key? key,
53 | this.color,
54 | this.blend,
55 | required this.random,
56 | }) : super(key: key);
57 |
58 | final Random random;
59 | final Color? color;
60 | final BlendMode? blend;
61 |
62 | @override
63 | __DiskState createState() => __DiskState();
64 | }
65 |
66 | class __DiskState extends State<_Disk> with SingleTickerProviderStateMixin {
67 | AnimationController? controller;
68 | double? radius;
69 | CenterTween? centerTween;
70 |
71 | @override
72 | void initState() {
73 | super.initState();
74 | final random = widget.random;
75 | controller = AnimationController(
76 | vsync: this,
77 | duration: const Duration(seconds: 2),
78 | )..repeat();
79 | radius = random.nextDouble() * 50 + 25;
80 |
81 | final candidates = [
82 | Offset(random.nextDouble(), -0.1),
83 | Offset(random.nextDouble(), 1.1),
84 | Offset(-0.1, random.nextDouble()),
85 | Offset(1.1, random.nextDouble()),
86 | ];
87 |
88 | final start = candidates.removeAt(random.nextInt(candidates.length));
89 | final end = candidates.removeAt(random.nextInt(candidates.length));
90 |
91 | centerTween = CenterTween(start, end, random.nextDouble());
92 | }
93 |
94 | @override
95 | void dispose() {
96 | controller!.dispose();
97 | super.dispose();
98 | }
99 |
100 | @override
101 | Widget build(BuildContext context) {
102 | return TweenAnimationBuilder(
103 | tween: Tween(begin: 0, end: radius),
104 | duration: const Duration(seconds: 1),
105 | curve: Curves.elasticOut,
106 | builder: (_, double effectiveRadius, __) {
107 | return CustomPaint(
108 | painter: _DiskPainter(controller, centerTween, effectiveRadius,
109 | widget.color, widget.blend),
110 | );
111 | },
112 | );
113 | }
114 | }
115 |
116 | class CenterTween extends Animatable {
117 | const CenterTween(this.begin, this.end, this.shift)
118 | : translation = begin - end;
119 |
120 | final Offset begin;
121 | final Offset end;
122 | final double shift;
123 | final Offset translation;
124 |
125 | @override
126 | Offset transform(double t) {
127 | return begin + (end - begin) * ((t + shift) % 1);
128 | }
129 | }
130 |
131 | class _DiskPainter extends CustomPainter {
132 | const _DiskPainter(
133 | this.animation,
134 | this.centerTween,
135 | this.radius,
136 | this.color,
137 | this.blend,
138 | ) : super(repaint: animation);
139 |
140 | final Animation? animation;
141 | final double radius;
142 | final CenterTween? centerTween;
143 | final Color? color;
144 | final BlendMode? blend;
145 |
146 | @override
147 | void paint(Canvas canvas, Size size) {
148 | final Offset ratioCenter = centerTween!.evaluate(animation!);
149 | final center = Offset(
150 | ratioCenter.dx * size.width,
151 | ratioCenter.dy * size.height,
152 | );
153 | final translation = Offset(
154 | centerTween!.translation.dx * size.width,
155 | centerTween!.translation.dy * size.height,
156 | );
157 | canvas.drawCircle(
158 | center,
159 | radius,
160 | Paint()
161 | ..color = color!
162 | ..blendMode = blend!,
163 | );
164 | canvas.drawCircle(
165 | center + translation,
166 | radius,
167 | Paint()
168 | ..color = color!
169 | ..blendMode = blend!,
170 | );
171 | }
172 |
173 | @override
174 | bool shouldRepaint(_DiskPainter oldDelegate) => oldDelegate.radius != radius;
175 | }
176 |
--------------------------------------------------------------------------------
/lib/image_bubble_counter.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter/rendering.dart';
5 |
6 | class ImageBubbleCounter {
7 | ImageBubbleCounter({required int initialCounter, required String image}) {
8 | _counter = initialCounter;
9 | _image = image;
10 | for (int i = 0; i < _counter!; i++) {
11 | _bubbles.add(_ImageBubble(
12 | center: Offset(_random.nextDouble(), _random.nextDouble()),
13 | radius: (_random.nextInt(50) + 20).toDouble(),
14 | image: _image,
15 | ));
16 | }
17 | }
18 |
19 | int? _counter;
20 | String? _image;
21 |
22 | final Random _random = Random();
23 | final List<_ImageBubble> _bubbles = <_ImageBubble>[];
24 |
25 | void incrementCounter() {
26 | _counter = _counter! + 1;
27 | _bubbles.add(_ImageBubble(
28 | center: Offset(_random.nextDouble(), _random.nextDouble()),
29 | radius: (_random.nextInt(50) + 20).toDouble(),
30 | image: _image,
31 | ));
32 | }
33 |
34 | void decrementCounter() {
35 | if (_counter! > 0) {
36 | _counter = _counter! - 1;
37 | _bubbles.removeLast();
38 | }
39 | }
40 |
41 | int? getCounter() {
42 | return _counter;
43 | }
44 |
45 | Widget build(BuildContext context) {
46 | return Stack(
47 | children: [
48 | ..._bubbles,
49 | ],
50 | );
51 | }
52 | }
53 |
54 | class _ImageBubble extends StatefulWidget {
55 | const _ImageBubble({
56 | Key? key,
57 | required this.center,
58 | required this.radius,
59 | required this.image,
60 | }) : super(key: key);
61 |
62 | final Offset center;
63 | final double radius;
64 | final String? image;
65 |
66 | @override
67 | __ImageBubbleState createState() => __ImageBubbleState();
68 | }
69 |
70 | class __ImageBubbleState extends State<_ImageBubble>
71 | with TickerProviderStateMixin {
72 | late AnimationController centerController;
73 | late AnimationController radiusController;
74 | late Animation center;
75 | late Animation radius;
76 |
77 | @override
78 | void initState() {
79 | super.initState();
80 | centerController = AnimationController(
81 | vsync: this,
82 | duration: const Duration(seconds: 4),
83 | )..repeat();
84 | center = centerController.drive(RotationTween(widget.center, 0.01));
85 | radiusController = AnimationController(
86 | vsync: this,
87 | duration: const Duration(milliseconds: 500),
88 | )..forward();
89 | radius = radiusController
90 | .drive(CurveTween(curve: Curves.ease))
91 | .drive(Tween(begin: 0, end: widget.radius));
92 | }
93 |
94 | @override
95 | void dispose() {
96 | centerController.dispose();
97 | radiusController.dispose();
98 | super.dispose();
99 | }
100 |
101 | @override
102 | Widget build(BuildContext context) {
103 | return SizedBox.expand(
104 | child: AnimatedBuilder(
105 | animation: center,
106 | builder: (_, child) {
107 | return CustomPaint(
108 | painter: _ImageBubbleShadowPainter(center.value, radius.value),
109 | child: ClipOval(
110 | clipper: _ImageBubbleClipper(center.value, radius.value),
111 | clipBehavior: Clip.hardEdge,
112 | child: CustomPaint(
113 | foregroundPainter: _ImageBubblePainter(
114 | center.value,
115 | radius.value,
116 | ),
117 | child: child),
118 | ),
119 | );
120 | },
121 | child: Image.asset(
122 | widget.image!,
123 | fit: BoxFit.cover,
124 | ),
125 | ),
126 | );
127 | }
128 | }
129 |
130 | class RotationTween extends Animatable {
131 | const RotationTween(this.center, this.distance);
132 |
133 | final Offset center;
134 | final double distance;
135 |
136 | @override
137 | Offset transform(double t) {
138 | final direction = t * pi * 2;
139 | return Offset.fromDirection(direction, distance) + center;
140 | }
141 | }
142 |
143 | class _ImageBubbleClipper extends CustomClipper {
144 | const _ImageBubbleClipper(this.center, this.radius);
145 |
146 | final Offset center;
147 | final double radius;
148 |
149 | @override
150 | Rect getClip(Size size) {
151 | final effectiveCenter =
152 | Offset(center.dx * size.width, center.dy * size.height);
153 | return Rect.fromCircle(center: effectiveCenter, radius: radius);
154 | }
155 |
156 | @override
157 | bool shouldReclip(covariant CustomClipper oldClipper) {
158 | return true;
159 | }
160 | }
161 |
162 | class _ImageBubbleShadowPainter extends CustomPainter {
163 | _ImageBubbleShadowPainter(this.center, this.radius);
164 | final Offset center;
165 | final double radius;
166 |
167 | @override
168 | void paint(Canvas canvas, Size size) {
169 | final effectiveCenter =
170 | Offset(center.dx * size.width, center.dy * size.height);
171 | final rect = Rect.fromCircle(center: effectiveCenter, radius: radius);
172 |
173 | const boxShadow = BoxShadow(
174 | blurRadius: 4, offset: Offset(2, 2), color: Color(0x80000000));
175 | final Paint paint = boxShadow.toPaint();
176 | final Rect bounds =
177 | rect.shift(boxShadow.offset).inflate(boxShadow.spreadRadius);
178 |
179 | canvas.drawCircle(
180 | bounds.center,
181 | bounds.shortestSide / 2.0,
182 | paint,
183 | );
184 | }
185 |
186 | @override
187 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
188 | return true;
189 | }
190 | }
191 |
192 | class _ImageBubblePainter extends CustomPainter {
193 | _ImageBubblePainter(this.center, this.radius);
194 | final Offset center;
195 | final double radius;
196 |
197 | @override
198 | void paint(Canvas canvas, Size size) {
199 | final effectiveCenter =
200 | Offset(center.dx * size.width, center.dy * size.height);
201 | final rect = Rect.fromCircle(center: effectiveCenter, radius: radius);
202 |
203 | canvas.drawCircle(
204 | effectiveCenter,
205 | radius,
206 | Paint()
207 | ..blendMode = BlendMode.overlay
208 | ..shader = const LinearGradient(colors: [Colors.black, Colors.white])
209 | .createShader(rect),
210 | );
211 | canvas.drawCircle(
212 | rect.topLeft + (rect.center - rect.topLeft) / 2,
213 | rect.longestSide / 6,
214 | Paint()
215 | ..color = const Color(0xCCFFFFFF)
216 | ..maskFilter = MaskFilter.blur(
217 | BlurStyle.normal,
218 | rect.longestSide * 0.1,
219 | ),
220 | );
221 | }
222 |
223 | @override
224 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
225 | return true;
226 | }
227 | }
228 |
--------------------------------------------------------------------------------
/lib/particles_counter.dart:
--------------------------------------------------------------------------------
1 | // Credits to https://www.openprocessing.org/sketch/427313
2 |
3 | import 'dart:async';
4 | import 'dart:math';
5 | import 'dart:ui' as ui;
6 |
7 | import 'package:flutter/material.dart';
8 | import 'package:vector_math/vector_math.dart';
9 |
10 | import 'common.dart';
11 |
12 | const loadPercentage = 0.045; // 0 to 1.0.
13 | const countMultiplier = 1;
14 | const closeEnoughTarget = 50.0;
15 | const particleSize = 8.0;
16 | const speed = 1;
17 | const touchSize = 100;
18 |
19 | class ParticlesCounter {
20 | ParticlesCounter(
21 | {required int initialCounter, required List images}) {
22 | _counter = initialCounter;
23 | _images = images;
24 | }
25 |
26 | int? _counter;
27 | List? _images;
28 |
29 | void incrementCounter() {
30 | _counter = _counter! + 1;
31 | }
32 |
33 | void decrementCounter() {
34 | if (_counter! > 0) {
35 | _counter = _counter! - 1;
36 | }
37 | }
38 |
39 | int? getCounter() {
40 | return _counter;
41 | }
42 |
43 | Widget build(BuildContext context) {
44 | return Stack(
45 | fit: StackFit.expand,
46 | alignment: Alignment.topCenter,
47 | children: [
48 | Positioned.fill(
49 | child: LayoutBuilder(
50 | builder: (_, constraints) {
51 | return __ParticleImageSwitcher(
52 | imagePaths: _images,
53 | imageIndex: _counter! % 46,
54 | size: constraints.biggest,
55 | );
56 | },
57 | ),
58 | ),
59 | ],
60 | );
61 | }
62 | }
63 |
64 | class _TouchPointer {
65 | Offset? offset;
66 | }
67 |
68 | class _TouchDetector extends StatelessWidget {
69 | const _TouchDetector({
70 | Key? key,
71 | required this.touchPointer,
72 | required this.child,
73 | }) : super(key: key);
74 |
75 | final _TouchPointer touchPointer;
76 | final Widget child;
77 |
78 | @override
79 | Widget build(BuildContext context) {
80 | return GestureDetector(
81 | behavior: HitTestBehavior.opaque,
82 | onPanStart: (details) => touchPointer.offset = details.localPosition,
83 | onPanUpdate: (details) => touchPointer.offset = details.localPosition,
84 | onPanEnd: (details) => touchPointer.offset = null,
85 | child: child,
86 | );
87 | }
88 | }
89 |
90 | class __ParticleImageSwitcher extends StatefulWidget {
91 | const __ParticleImageSwitcher({
92 | Key? key,
93 | required this.imagePaths,
94 | required this.imageIndex,
95 | required this.size,
96 | }) : super(key: key);
97 |
98 | final List? imagePaths;
99 | final int imageIndex;
100 | final Size size;
101 |
102 | @override
103 | ___ParticleImageSwitcherState createState() =>
104 | ___ParticleImageSwitcherState();
105 | }
106 |
107 | class ___ParticleImageSwitcherState extends State<__ParticleImageSwitcher>
108 | with SingleTickerProviderStateMixin {
109 | final List<_Particle> particles = <_Particle>[];
110 | final List> allPixels = >[];
111 | final List onDispose = [];
112 | final _TouchPointer touchPointer = _TouchPointer();
113 | AnimationController? controller;
114 |
115 | @override
116 | void initState() {
117 | super.initState();
118 | controller =
119 | AnimationController(vsync: this, duration: const Duration(seconds: 1))
120 | ..repeat();
121 | for (var i = 0; i < widget.imagePaths!.length; i++) {
122 | allPixels.add(loadPixels(widget.imagePaths![i]));
123 | }
124 | showParticles(0);
125 | }
126 |
127 | @override
128 | void didUpdateWidget(covariant __ParticleImageSwitcher oldWidget) {
129 | super.didUpdateWidget(oldWidget);
130 | if (oldWidget.imageIndex != widget.imageIndex) {
131 | showParticles(widget.imageIndex);
132 | }
133 | }
134 |
135 | @override
136 | void dispose() {
137 | controller!.dispose();
138 | onDispose.forEach((x) => x());
139 | super.dispose();
140 | }
141 |
142 | Future loadPixels(String imagePath) async {
143 | final provider = ExactAssetImage(imagePath);
144 | final imageStream = provider.resolve(ImageConfiguration.empty);
145 | final completer = Completer();
146 | late ImageStreamListener imageStreamListener;
147 | imageStreamListener = ImageStreamListener((frame, _) {
148 | completer.complete(frame.image);
149 | imageStream.removeListener(imageStreamListener);
150 | });
151 | imageStream.addListener(imageStreamListener);
152 | final image = await completer.future;
153 | final byteData = await image.toByteData(format: ui.ImageByteFormat.rawRgba);
154 | onDispose.add(() => image.dispose());
155 | return Pixels(
156 | byteData: byteData,
157 | width: image.width,
158 | height: image.height,
159 | );
160 | }
161 |
162 | Future showParticles(int index) async {
163 | final pixels = await allPixels[index];
164 | final particleIndices = List.generate(particles.length, (i) => i);
165 | final width = widget.size.width;
166 | final height = widget.size.height;
167 | final halfWidth = width / 2;
168 | final halfHeight = height / 2;
169 | final halfImageWidth = pixels.width / 2;
170 | final halfImageHeight = pixels.height / 2;
171 | final tx = halfWidth - halfImageWidth;
172 | final ty = halfHeight - halfImageHeight;
173 |
174 | for (var y = 0; y < pixels.height; y++) {
175 | for (var x = 0; x < pixels.width; x++) {
176 | // Give it small odds that we'll assign a particle to this pixel.
177 | if (randNextD(1) > loadPercentage * countMultiplier) {
178 | continue;
179 | }
180 |
181 | final pixelColor = pixels.getColorAt(x, y);
182 | _Particle newParticle;
183 | if (particleIndices.isNotEmpty) {
184 | // Re-use existing particles.
185 | final index = particleIndices.length == 1
186 | ? particleIndices.removeAt(0)
187 | : particleIndices.removeAt(randI(0, particleIndices.length - 1));
188 | newParticle = particles[index];
189 | } else {
190 | // Create a new particle.
191 | newParticle = _Particle(halfWidth, halfHeight);
192 | particles.add(newParticle);
193 | }
194 |
195 | newParticle.target.x = x + tx;
196 | newParticle.target.y = y + ty;
197 | newParticle.endColor = pixelColor;
198 | }
199 | }
200 |
201 | // Kill off any left over particles that aren't assigned to anything.
202 | if (particleIndices.isNotEmpty) {
203 | for (var i = 0; i < particleIndices.length; i++) {
204 | particles[particleIndices[i]].kill(width, height);
205 | }
206 | }
207 | setState(() {});
208 | }
209 |
210 | @override
211 | Widget build(BuildContext context) {
212 | return _TouchDetector(
213 | touchPointer: touchPointer,
214 | child: CustomPaint(
215 | painter: _ParticulesPainter(controller, particles, touchPointer),
216 | ),
217 | );
218 | }
219 | }
220 |
221 | class _Particle {
222 | _Particle(this.x, this.y)
223 | : pos = Vector2(x, y),
224 | maxSpeed = randD(0.25, 2),
225 | maxForce = randD(8, 15),
226 | colorBlendRate = randD(0.01, 0.05);
227 |
228 | final double x;
229 | final double y;
230 | final Vector2 pos;
231 | final double maxSpeed; // How fast it can move per frame.
232 | final double maxForce; // Its speed limit.
233 | final double colorBlendRate;
234 |
235 | Vector2 vel = Vector2.zero();
236 | Vector2 acc = Vector2.zero();
237 | Vector2 target = Vector2.zero();
238 | bool isKilled = false;
239 | Color? currentColor = const Color(0x00000000);
240 | Color endColor = const Color(0x00000000);
241 | double? currentSize = 0;
242 | double distToTarget = 0;
243 |
244 | void move([Offset? touchPosition]) {
245 | distToTarget = pos.distanceTo(target);
246 |
247 | double proximityMult;
248 |
249 | // If it's close enough to its target, the slower it'll get
250 | // so that it can settle.
251 | if (distToTarget < closeEnoughTarget) {
252 | proximityMult = distToTarget / closeEnoughTarget;
253 | vel *= 0.9;
254 | } else {
255 | proximityMult = 1;
256 | vel *= 0.95;
257 | }
258 |
259 | // Steer towards its target.
260 | if (distToTarget > 1) {
261 | final steer = target.clone()
262 | ..sub(pos)
263 | ..normalize()
264 | ..scale(maxSpeed * proximityMult * speed);
265 | acc.add(steer);
266 | }
267 |
268 | if (touchPosition != null) {
269 | final touch = Vector2(touchPosition.dx, touchPosition.dy);
270 | final distToTouch = pos.distanceTo(touch);
271 | if (distToTouch < touchSize) {
272 | final push = pos.clone()..sub(touch);
273 | push.normalize();
274 | push.scale((touchSize - distToTouch) * 0.05);
275 | acc.add(push);
276 | }
277 | }
278 |
279 | vel.add(acc);
280 | vel.limit(maxForce * speed);
281 | pos.add(vel);
282 | acc.scale(0);
283 | }
284 |
285 | void kill(double width, double height) {
286 | if (!isKilled) {
287 | target = generateRandomPos(
288 | width / 2, height / 2, max(width, height), width, height);
289 | endColor = const Color(0x00000000);
290 | isKilled = true;
291 | }
292 | }
293 | }
294 |
295 | extension on Vector2 {
296 | void limit(double max) {
297 | if (length2 > max * max) {
298 | normalize();
299 | scale(max);
300 | }
301 | }
302 | }
303 |
304 | Vector2 generateRandomPos(
305 | double x, double y, double mag, double width, double height) {
306 | final pos = Vector2(x, y);
307 | final vel = Vector2(randD(0, width), randD(0, height));
308 | vel.sub(pos);
309 | vel.normalize();
310 | vel.scale(mag);
311 | pos.add(vel);
312 |
313 | return pos;
314 | }
315 |
316 | class _ParticulesPainter extends CustomPainter {
317 | _ParticulesPainter(
318 | this.animation,
319 | this.allParticles,
320 | this.touchPointer,
321 | ) : super(repaint: animation);
322 |
323 | final Animation? animation;
324 | final List<_Particle> allParticles;
325 | final _TouchPointer touchPointer;
326 |
327 | @override
328 | void paint(Canvas canvas, Size size) {
329 | final width = size.width;
330 | final height = size.height;
331 |
332 | for (var i = allParticles.length - 1; i >= 0; i--) {
333 | final particle = allParticles[i];
334 | particle.move(touchPointer.offset);
335 |
336 | final color = particle.currentColor!;
337 | particle.currentColor = Color.lerp(
338 | particle.currentColor, particle.endColor, particle.colorBlendRate);
339 | double targetSize = 2;
340 | if (!particle.isKilled) {
341 | targetSize = map(
342 | min(particle.distToTarget, closeEnoughTarget),
343 | closeEnoughTarget,
344 | 0,
345 | 0,
346 | particleSize,
347 | );
348 | }
349 |
350 | particle.currentSize =
351 | ui.lerpDouble(particle.currentSize, targetSize, 0.1);
352 |
353 | final center = Offset(particle.pos.x, particle.pos.y);
354 | canvas.drawCircle(center, particle.currentSize!, Paint()..color = color);
355 |
356 | if (particle.isKilled) {
357 | if (particle.pos.x < 0 ||
358 | particle.pos.x > width ||
359 | particle.pos.y < 0 ||
360 | particle.pos.y > height) {
361 | allParticles.removeAt(i);
362 | }
363 | }
364 | }
365 | }
366 |
367 | @override
368 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
369 | return false;
370 | }
371 | }
372 |
--------------------------------------------------------------------------------
/lib/pixel_counter.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class PixelCounter {
4 | PixelCounter({required int initialCounter, Color color = Colors.yellow}) {
5 | _counter = initialCounter;
6 | _color = color;
7 | }
8 | List numberOfBlocks = [];
9 | int? _counter;
10 | Color? _color;
11 |
12 | void incrementCounter() {
13 | _counter = _counter! + 1;
14 | }
15 |
16 | void decrementCounter() {
17 | if (_counter! > 0) {
18 | _counter = _counter! - 1;
19 | }
20 | }
21 |
22 | int? getCounter() {
23 | return _counter;
24 | }
25 |
26 | Widget build(BuildContext context) {
27 | return Center(
28 | child: Row(
29 | children: [
30 | for (int i = 0; i < _counter.toString().length; i++)
31 | Expanded(
32 | flex: _counter.toString().length > 5 ? 1 : 0,
33 | child: blocks(_counter.toString()[i]))
34 | ],
35 | mainAxisAlignment: MainAxisAlignment.center,
36 | crossAxisAlignment: CrossAxisAlignment.center,
37 | ),
38 | );
39 | }
40 |
41 | Widget blocks(digit) {
42 | int x = int.parse(digit);
43 | List kaza = _numberBlocks(x);
44 |
45 | return Padding(
46 | padding: const EdgeInsets.all(8.0),
47 | child: Container(
48 | width: 190,
49 | height: 400,
50 | decoration: BoxDecoration(
51 | boxShadow: [
52 | BoxShadow(color: Colors.black12, blurRadius: 10, spreadRadius: 4),
53 | BoxShadow(
54 | color: Colors.black12,
55 | blurRadius: 10,
56 | spreadRadius: 10,
57 | offset: Offset(30, 0),
58 | )
59 | ],
60 | ),
61 | child: GridView(
62 | children: [
63 | for (var index = 0; index < 15; index++)
64 | AnimatedContainer(
65 | duration: Duration(milliseconds: index * 140),
66 | clipBehavior: Clip.antiAlias,
67 | decoration: BoxDecoration(
68 | color: kaza.contains(index) ? Colors.black : _color,
69 | boxShadow: [
70 | BoxShadow(
71 | blurRadius: 2,
72 | spreadRadius: 1,
73 | color: Colors.black,
74 | ),
75 | ],
76 | border: Border.all(
77 | color: kaza.contains(index) ? _color! : Colors.black,
78 | width: 0.3,
79 | style: BorderStyle.solid,
80 | ),
81 | ),
82 | )
83 | ],
84 | addAutomaticKeepAlives: false,
85 | gridDelegate:
86 | SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
87 | ),
88 | ),
89 | );
90 | }
91 |
92 | _numberBlocks(int digit) {
93 | numberOfBlocks.clear();
94 | switch (digit) {
95 | case 0:
96 | numberOfBlocks.addAll([0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 14]);
97 | break;
98 | case 1:
99 | numberOfBlocks.addAll([1, 4, 7, 10, 13]);
100 | break;
101 | case 2:
102 | numberOfBlocks.addAll([0, 1, 2, 5, 6, 7, 8, 9, 12, 13, 14]);
103 | break;
104 | case 3:
105 | numberOfBlocks.addAll([0, 1, 2, 5, 6, 7, 8, 11, 12, 13, 14]);
106 | break;
107 | case 4:
108 | numberOfBlocks.addAll([0, 3, 5, 6, 7, 8, 11, 14]);
109 | break;
110 | case 5:
111 | numberOfBlocks.addAll([0, 1, 2, 3, 6, 7, 8, 11, 12, 13, 14]);
112 | break;
113 | case 6:
114 | numberOfBlocks.addAll([0, 1, 2, 3, 6, 7, 8, 9, 11, 12, 13, 14]);
115 | break;
116 | case 7:
117 | numberOfBlocks.addAll([0, 1, 2, 5, 8, 11, 14]);
118 | break;
119 | case 8:
120 | numberOfBlocks.addAll([0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 14]);
121 | break;
122 | case 9:
123 | numberOfBlocks.addAll([0, 1, 2, 3, 5, 6, 7, 8, 11, 14]);
124 | break;
125 | default:
126 | }
127 | return numberOfBlocks;
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/lib/portrait_counter.dart:
--------------------------------------------------------------------------------
1 | // Credits to https://www.openprocessing.org/sketch/392202/
2 |
3 | import 'dart:async';
4 | import 'dart:math';
5 | import 'dart:ui' as ui;
6 |
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter/services.dart';
9 |
10 | import 'common.dart';
11 |
12 | class PortraitCounter {
13 | PortraitCounter({required int initialCounter, required String image}) {
14 | _counter = initialCounter;
15 | _image = image;
16 | }
17 |
18 | int? _counter;
19 | String? _image;
20 | void incrementCounter() {
21 | _counter = _counter! + 1;
22 | }
23 |
24 | void decrementCounter() {
25 | if (_counter! > 0) {
26 | _counter = _counter! - 1;
27 | }
28 | }
29 |
30 | int? getCounter() {
31 | return _counter;
32 | }
33 |
34 | Widget build(BuildContext context) {
35 | return Stack(
36 | fit: StackFit.expand,
37 | alignment: Alignment.topCenter,
38 | children: [
39 | Portrait(assetName: _image, counter: _counter),
40 | ],
41 | );
42 | }
43 | }
44 |
45 | class Portrait extends StatefulWidget {
46 | const Portrait({
47 | Key? key,
48 | required this.assetName,
49 | required this.counter,
50 | }) : super(key: key);
51 |
52 | final String? assetName;
53 | final int? counter;
54 |
55 | @override
56 | _PortraitState createState() => _PortraitState();
57 | }
58 |
59 | class _PortraitState extends State {
60 | final Random random = Random();
61 | ui.Image? image;
62 | ByteData? byteData;
63 |
64 | @override
65 | void initState() {
66 | super.initState();
67 | loadPixels();
68 | }
69 |
70 | @override
71 | void dispose() {
72 | image?.dispose();
73 | super.dispose();
74 | }
75 |
76 | Future loadPixels() async {
77 | image?.dispose();
78 | final provider = ExactAssetImage(widget.assetName!);
79 | final imageStream = provider.resolve(ImageConfiguration.empty);
80 | final completer = Completer();
81 | late ImageStreamListener imageStreamListener;
82 | imageStreamListener = ImageStreamListener((frame, _) {
83 | completer.complete(frame.image);
84 | imageStream.removeListener(imageStreamListener);
85 | });
86 | imageStream.addListener(imageStreamListener);
87 | image = await completer.future;
88 | byteData = await image!.toByteData(format: ui.ImageByteFormat.rawRgba);
89 | setState(() {});
90 | }
91 |
92 | @override
93 | Widget build(BuildContext context) {
94 | final child = image == null
95 | ? const SizedBox.expand()
96 | : Stack(
97 | fit: StackFit.expand,
98 | children: [
99 | for (var i = 0; i < widget.counter!; i++)
100 | _PortaitPaint(
101 | imgWidth: image!.width,
102 | imgHeight: image!.height,
103 | byteData: byteData,
104 | random: random,
105 | counter: i,
106 | ),
107 | ],
108 | );
109 | return Positioned.fill(child: child);
110 | }
111 | }
112 |
113 | class _PortaitPaint extends StatelessWidget {
114 | const _PortaitPaint({
115 | Key? key,
116 | required this.imgWidth,
117 | required this.imgHeight,
118 | required this.byteData,
119 | required this.random,
120 | required this.counter,
121 | }) : super(key: key);
122 |
123 | final int imgWidth;
124 | final int imgHeight;
125 | final ByteData? byteData;
126 | final Random random;
127 | final int counter;
128 |
129 | @override
130 | Widget build(BuildContext context) {
131 | return RepaintBoundary(
132 | child: CustomPaint(
133 | painter: _PortraitPainter(
134 | imgWidth,
135 | imgHeight,
136 | byteData,
137 | random,
138 | counter,
139 | ),
140 | ),
141 | );
142 | }
143 | }
144 |
145 | class _PortraitPainter extends CustomPainter {
146 | _PortraitPainter(
147 | this.imgWidth,
148 | this.imgHeight,
149 | ByteData? byteData,
150 | this.random,
151 | this.counter,
152 | ) : pixels = Pixels(byteData: byteData, width: imgWidth, height: imgHeight);
153 |
154 | final int imgWidth;
155 | final int imgHeight;
156 | final Random random;
157 | final int counter;
158 | final Pixels pixels;
159 |
160 | @override
161 | void paint(Canvas canvas, Size size) {
162 | final width = size.width;
163 | final height = size.height;
164 | final tdx = (width - imgWidth) / 2;
165 | final tdy = (height - imgHeight) / 2;
166 |
167 | void curve(
168 | double x1,
169 | double y1,
170 | double x2,
171 | double y2,
172 | double x3,
173 | double y3,
174 | double x4,
175 | double y4,
176 | double thickness,
177 | Color color,
178 | ) {
179 | final vertices = [
180 | Offset(x1, y1),
181 | Offset(x2, y2),
182 | Offset(x3, y3),
183 | Offset(x4, y4),
184 | ];
185 | final path = Path();
186 | path.moveTo(x2, y2);
187 | for (int i = 1; i + 2 < vertices.length; i++) {
188 | final v = vertices[i];
189 | final b = List.filled(4, Offset.zero);
190 | b[0] = v;
191 | b[1] = v + (vertices[i + 1] - vertices[i - 1]) / 6;
192 | b[2] = vertices[i + 1] + (v - vertices[i + 2]) / 6;
193 | b[3] = vertices[i + 1];
194 | path.cubicTo(b[1].dx, b[1].dy, b[2].dx, b[2].dy, b[3].dx, b[3].dy);
195 | }
196 | canvas.drawPath(
197 | path,
198 | Paint()
199 | ..style = PaintingStyle.stroke
200 | ..strokeWidth = thickness
201 | ..color = color,
202 | );
203 | }
204 |
205 | void paintStroke(double length, Color color, int thickness) {
206 | final stepLength = length / 4;
207 |
208 | // Determines if the stroke is curved. A straight line is 0.
209 | double tangent1 = 0;
210 | double tangent2 = 0;
211 |
212 | final odds = random.nextDouble();
213 |
214 | if (odds < 0.7) {
215 | tangent1 = random.d(-length, length);
216 | tangent2 = random.d(-length, length);
217 | }
218 |
219 | curve(
220 | tangent1,
221 | -stepLength * 2,
222 | 0,
223 | -stepLength,
224 | 0,
225 | stepLength,
226 | tangent2,
227 | stepLength * 2,
228 | thickness.toDouble(),
229 | color,
230 | );
231 | }
232 |
233 | for (var y = 0; y < imgHeight; y++) {
234 | for (var x = 0; x < imgWidth; x++) {
235 | final odds = random.d(0, 2000).toInt();
236 |
237 | if (odds < 1) {
238 | final color = pixels.getColorAt(x, y).withAlpha(100);
239 | final tx = x + tdx;
240 | final ty = y + tdy;
241 | canvas.translate(tx, ty);
242 |
243 | if (counter < 20) {
244 | paintStroke(random.d(150, 250), color, random.d(20, 40).toInt());
245 | } else if (counter < 50) {
246 | paintStroke(random.d(75, 125), color, random.d(8, 12).toInt());
247 | } else if (counter < 300) {
248 | paintStroke(random.d(30, 60), color, random.d(1, 4).toInt());
249 | } else if (counter < 500) {
250 | paintStroke(random.d(5, 20), color, random.d(5, 15).toInt());
251 | } else {
252 | paintStroke(random.d(1, 10), color, random.d(1, 7).toInt());
253 | }
254 |
255 | canvas.translate(-tx, -ty);
256 | }
257 | }
258 | }
259 | }
260 |
261 | @override
262 | bool shouldRepaint(_PortraitPainter oldDelegate) {
263 | return false;
264 | }
265 | }
266 |
--------------------------------------------------------------------------------
/lib/rotating_bubbles_counter.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math' as math;
2 | import 'dart:ui';
3 |
4 | import 'package:flutter/material.dart';
5 |
6 | class RotatingBubblesCounter {
7 | RotatingBubblesCounter(
8 | {required List initialColors,
9 | required int initialCounter,
10 | BlendMode blend = BlendMode.hardLight}) {
11 | _counter = initialCounter;
12 | _colors = initialColors;
13 | _blend = blend;
14 |
15 | for (int i = 0; i < _counter!; i++) {
16 | _radii.add(_random.nextInt(25) + 12.5);
17 | }
18 | }
19 |
20 | late List _colors;
21 | int? _counter;
22 | BlendMode? _blend;
23 | final math.Random _random = math.Random();
24 | final List _radii = [];
25 |
26 | void incrementCounter() {
27 | _counter = _counter! + 1;
28 | _radii.add(_random.nextInt(25) + 12.5);
29 | }
30 |
31 | void decrementCounter() {
32 | if (_counter! > 0) {
33 | _counter = _counter! - 1;
34 | _radii.removeLast();
35 | }
36 | }
37 |
38 | int? getCounter() {
39 | return _counter;
40 | }
41 |
42 | Widget build(BuildContext context) {
43 | return Stack(
44 | children: [
45 | for (int i = 0; i < _radii.length; i++)
46 | Positioned.fill(
47 | child: TweenAnimationBuilder(
48 | tween: Tween(begin: 0, end: _radii[i]),
49 | duration: const Duration(milliseconds: 500),
50 | curve: Curves.easeIn,
51 | builder: (_, double radius, __) {
52 | return _RotatingBubble(
53 | random: _random,
54 | radius: radius,
55 | color: _colors[i % _colors.length],
56 | blend: _blend,
57 | );
58 | },
59 | ),
60 | ),
61 | ],
62 | );
63 | }
64 | }
65 |
66 | class _RotatingBubble extends StatefulWidget {
67 | const _RotatingBubble({
68 | Key? key,
69 | required this.random,
70 | required this.radius,
71 | required this.color,
72 | required this.blend,
73 | }) : super(key: key);
74 |
75 | final math.Random random;
76 | final double radius;
77 | final Color color;
78 | final BlendMode? blend;
79 |
80 | @override
81 | __RotatingBubbleState createState() => __RotatingBubbleState();
82 | }
83 |
84 | class __RotatingBubbleState extends State<_RotatingBubble>
85 | with SingleTickerProviderStateMixin {
86 | late AnimationController controller;
87 | Animation? angle;
88 | double? shift;
89 |
90 | static const double twoPi = math.pi * 2;
91 |
92 | @override
93 | void initState() {
94 | super.initState();
95 | final random = widget.random;
96 | controller = AnimationController(
97 | vsync: this,
98 | duration: Duration(milliseconds: random.nextInt(1200) + 800),
99 | )..repeat();
100 | final startAngle = random.nextDouble() * twoPi;
101 | final endAngle = startAngle + (twoPi * (random.nextBool() ? 1 : -1));
102 | angle = controller.drive(Tween(begin: startAngle, end: endAngle));
103 |
104 | shift = random.nextDouble() / 10 + 1;
105 | }
106 |
107 | @override
108 | void dispose() {
109 | controller.dispose();
110 | super.dispose();
111 | }
112 |
113 | @override
114 | Widget build(BuildContext context) {
115 | return CustomPaint(
116 | painter: _RotatingBubblePainter(
117 | angle, shift, widget.radius, widget.color, widget.blend),
118 | );
119 | }
120 | }
121 |
122 | class _RotatingBubblePainter extends CustomPainter {
123 | _RotatingBubblePainter(
124 | this.angle,
125 | this.shift,
126 | this.radius,
127 | this.color,
128 | this.blend,
129 | ) : super(repaint: angle);
130 |
131 | final Animation? angle;
132 | final double? shift;
133 | final double radius;
134 | final Color color;
135 | final BlendMode? blend;
136 |
137 | @override
138 | void paint(Canvas canvas, Size size) {
139 | final appCenter = size.center(Offset.zero);
140 | final bigRadius = size.width / 2.7;
141 | final center =
142 | (Offset.fromDirection(angle!.value, bigRadius * shift!)) + appCenter;
143 | canvas.drawCircle(
144 | center,
145 | radius,
146 | Paint()
147 | ..blendMode = blend!
148 | ..color = color,
149 | );
150 | }
151 |
152 | @override
153 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
154 | return false;
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/lib/rotating_planets_counter.dart:
--------------------------------------------------------------------------------
1 | // Credits to https://twitter.com/beesandbombs/status/1329468633723101187?s=20
2 | import 'dart:math' as math;
3 | import 'dart:ui';
4 |
5 | import 'package:flutter/material.dart';
6 |
7 | class RotatingPlanetsCounter {
8 | RotatingPlanetsCounter(
9 | {required List initialColors,
10 | required int initialCounter,
11 | BlendMode blend = BlendMode.hardLight}) {
12 | _counter = initialCounter;
13 | _colors = initialColors;
14 | _blend = blend;
15 |
16 | for (int i = 0; i < _counter!; i++) {
17 | _radii.add(_random.nextInt(20) + 10.0);
18 | }
19 | }
20 |
21 | late List _colors;
22 | int? _counter;
23 | BlendMode? _blend;
24 |
25 | final math.Random _random = math.Random();
26 | final List _radii = [];
27 |
28 | void incrementCounter() {
29 | _counter = _counter! + 1;
30 | _radii.add(_random.nextInt(20) + 10.0);
31 | }
32 |
33 | void decrementCounter() {
34 | if (_counter! > 0) {
35 | _counter = _counter! - 1;
36 | _radii.removeLast();
37 | }
38 | }
39 |
40 | int? getCounter() {
41 | return _counter;
42 | }
43 |
44 | Widget build(BuildContext context) {
45 | return Stack(
46 | children: [
47 | for (int i = 0; i < _radii.length; i++)
48 | Positioned.fill(
49 | child: TweenAnimationBuilder(
50 | tween: Tween(begin: 0, end: _radii[i]),
51 | duration: const Duration(milliseconds: 500),
52 | curve: Curves.easeIn,
53 | builder: (_, double radius, __) {
54 | return _RotatingBubble1(
55 | random: _random,
56 | radius: radius,
57 | color: _colors[i % _colors.length],
58 | blend: _blend,
59 | );
60 | },
61 | ),
62 | ),
63 | ],
64 | );
65 | }
66 | }
67 |
68 | class _RotatingBubble1 extends StatefulWidget {
69 | const _RotatingBubble1({
70 | Key? key,
71 | required this.random,
72 | required this.radius,
73 | required this.color,
74 | required this.blend,
75 | }) : super(key: key);
76 |
77 | final math.Random random;
78 | final double radius;
79 | final Color color;
80 | final BlendMode? blend;
81 |
82 | @override
83 | _RotatingBubble1State createState() => _RotatingBubble1State();
84 | }
85 |
86 | class _RotatingBubble1State extends State<_RotatingBubble1>
87 | with SingleTickerProviderStateMixin {
88 | AnimationController? controller;
89 | double? dy;
90 | double? margin;
91 | double? radiusFactor;
92 |
93 | @override
94 | void initState() {
95 | super.initState();
96 | final random = widget.random;
97 | controller = AnimationController(
98 | vsync: this,
99 | duration: const Duration(milliseconds: 2000),
100 | )..repeat(reverse: true);
101 | dy = map(random.nextDouble(), 0.3, 0.7);
102 | margin = map(random.nextDouble(), 0.1, 0.3);
103 | radiusFactor = random.nextDouble() + 1.5;
104 | }
105 |
106 | @override
107 | void dispose() {
108 | controller!.dispose();
109 | super.dispose();
110 | }
111 |
112 | @override
113 | Widget build(BuildContext context) {
114 | return CustomPaint(
115 | painter: _RotatingBubble1Painter(
116 | controller,
117 | dy,
118 | widget.radius,
119 | radiusFactor,
120 | widget.color,
121 | margin,
122 | widget.blend,
123 | ),
124 | );
125 | }
126 | }
127 |
128 | class _RotatingBubble1Painter extends CustomPainter {
129 | _RotatingBubble1Painter(
130 | this.animation,
131 | this.dy,
132 | this.radius,
133 | this.radiusFactor,
134 | this.color,
135 | this.margin,
136 | this.blend,
137 | ) : super(repaint: animation);
138 |
139 | final Animation? animation;
140 | final double? dy;
141 | final double radius;
142 | final double? radiusFactor;
143 | final Color color;
144 | final double? margin;
145 | final BlendMode? blend;
146 |
147 | @override
148 | void paint(Canvas canvas, Size size) {
149 | final curve = Curves.easeInOutSine;
150 |
151 | final t = curve.transform(animation!.value);
152 | final y = size.height * dy!;
153 | final x = lerpDouble(margin, 1 - margin!, t)! * size.width;
154 | final center = Offset(x, y);
155 | final factor = animation!.status == AnimationStatus.forward
156 | ? radiusFactor!
157 | : 1 / radiusFactor!;
158 | final effectiveRadus = RadiusCurve(radius, radius * factor).transform(t)!;
159 | final opacity = animation!.status == AnimationStatus.forward
160 | ? 1.0
161 | : const RadiusCurve(1, 0.3).transform(t)!;
162 | canvas.drawCircle(
163 | center,
164 | effectiveRadus,
165 | Paint()
166 | ..blendMode = blend!
167 | ..maskFilter = const MaskFilter.blur(BlurStyle.solid, 10)
168 | ..color = color.withOpacity(opacity),
169 | );
170 | }
171 |
172 | @override
173 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
174 | return false;
175 | }
176 | }
177 |
178 | double map(double x, double minOut, double maxOut) {
179 | return x * (maxOut - minOut) + minOut;
180 | }
181 |
182 | class RadiusCurve extends Animatable {
183 | const RadiusCurve(this.small, this.big);
184 |
185 | final double small;
186 | final double big;
187 |
188 | @override
189 | double? transform(double t) {
190 | if (t <= 0.5) {
191 | return lerpDouble(small, big, t);
192 | } else {
193 | return lerpDouble(big, small, t);
194 | }
195 | }
196 | }
197 |
--------------------------------------------------------------------------------
/lib/volcano_counter.dart:
--------------------------------------------------------------------------------
1 | // Icons made by Freepik from www.flaticon.com
2 | // https://www.flaticon.com/free-icon/volcano_1497529import
3 |
4 | import 'dart:math' as math;
5 | import 'dart:ui';
6 |
7 | import 'package:flutter/material.dart';
8 |
9 | import 'common.dart';
10 |
11 | class VolcanoCounter {
12 | VolcanoCounter(
13 | {required int initialCounter,
14 | bool enableSky = false,
15 | bool enableGrass = false}) {
16 | _counter = initialCounter;
17 | _enableGrass = enableGrass;
18 | _enableSky = enableSky;
19 | }
20 |
21 | int? _counter;
22 | late bool _enableSky;
23 | late bool _enableGrass;
24 |
25 | void incrementCounter() {
26 | _counter = _counter! + 1;
27 | }
28 |
29 | void decrementCounter() {
30 | if (_counter! > 0) {
31 | _counter = _counter! - 1;
32 | }
33 | }
34 |
35 | int? getCounter() {
36 | return _counter;
37 | }
38 |
39 | Widget build(BuildContext context) {
40 | return Stack(
41 | fit: StackFit.expand,
42 | children: [
43 | if (_enableSky) const Sky(),
44 | for (int i = 0; i < _counter!; i++) _Eruption(count: i + 1),
45 | Volcano(),
46 | if (_enableGrass) const Grass(),
47 | ],
48 | );
49 | }
50 | }
51 |
52 | class LavaParticle {
53 | LavaParticle({
54 | this.mass,
55 | this.initialVelocity,
56 | this.initialPosition,
57 | });
58 |
59 | final double? mass;
60 | final Offset? initialVelocity;
61 | final Offset? initialPosition;
62 | late Offset velocity;
63 | Offset? position;
64 | }
65 |
66 | class _Eruption extends StatefulWidget {
67 | const _Eruption({
68 | Key? key,
69 | this.count,
70 | }) : super(key: key);
71 |
72 | final int? count;
73 |
74 | @override
75 | _EruptionState createState() => _EruptionState();
76 | }
77 |
78 | class _EruptionState extends State<_Eruption>
79 | with SingleTickerProviderStateMixin {
80 | final math.Random random = math.Random();
81 | final List particles = [];
82 | AnimationController? controller;
83 |
84 | @override
85 | void initState() {
86 | super.initState();
87 |
88 | for (var i = 0; i < widget.count!; i++) {
89 | final mass = map(random.nextDouble(), 0, 1, 3, 6);
90 | final velocityX = map(random.nextDouble(), 0, 1, -10, 10);
91 | final velocityY = map(random.nextDouble(), 0, 1, -200, -50);
92 | final positionX = map(random.nextDouble(), 0, 1, 0.4, 0.6);
93 | particles.add(
94 | LavaParticle(
95 | mass: mass,
96 | initialVelocity: Offset(velocityX, velocityY),
97 | initialPosition: Offset(positionX, 0.6),
98 | ),
99 | );
100 | }
101 |
102 | controller = AnimationController(
103 | vsync: this,
104 | duration: const Duration(seconds: 8),
105 | )..forward();
106 | }
107 |
108 | @override
109 | void dispose() {
110 | controller!.dispose();
111 | super.dispose();
112 | }
113 |
114 | @override
115 | Widget build(BuildContext context) {
116 | return Positioned.fill(
117 | child: CustomPaint(
118 | painter: _EruptionPainter(
119 | controller,
120 | particles,
121 | ),
122 | ),
123 | );
124 | }
125 | }
126 |
127 | class _EruptionPainter extends CustomPainter {
128 | _EruptionPainter(this.animation, this.particles)
129 | : random = math.Random(),
130 | super(repaint: animation);
131 |
132 | final Animation? animation;
133 | final List particles;
134 | final math.Random random;
135 | double dt = 0.1;
136 | static final colorTween = ColorTween(
137 | begin: const Color(0xFFDB4B38),
138 | end: const Color(0xFF732F13),
139 | );
140 |
141 | @override
142 | void paint(Canvas canvas, Size size) {
143 | final opacity = 1 - animation!.value;
144 | final count = particles.length;
145 | final color = colorTween.transform(animation!.value);
146 |
147 | for (int i = 0; i < count; i++) {
148 | final particle = particles[i];
149 | final radius = particle.mass! * 3;
150 |
151 | if (particle.position == null || opacity == 1) {
152 | final position = particle.initialPosition!;
153 | particle.position = Offset(
154 | position.dx * size.width,
155 | position.dy * size.height,
156 | );
157 | particle.velocity = Offset(
158 | particle.initialVelocity!.dx,
159 | particle.initialVelocity!.dy,
160 | );
161 | }
162 |
163 | final Offset force = Offset(0, particle.mass! * 9.81);
164 | final Offset acceleration = force / particle.mass!;
165 | particle.velocity += acceleration * dt;
166 | particle.position = particle.position! + particle.velocity * dt;
167 | canvas.drawCircle(
168 | particle.position!,
169 | radius,
170 | Paint()..color = color!,
171 | );
172 | }
173 | }
174 |
175 | @override
176 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
177 | return false;
178 | }
179 | }
180 |
181 | class Counter extends StatelessWidget {
182 | const Counter({
183 | Key? key,
184 | this.count,
185 | }) : super(key: key);
186 |
187 | final int? count;
188 |
189 | @override
190 | Widget build(BuildContext context) {
191 | return Positioned(
192 | top: 50,
193 | left: 0,
194 | right: 0,
195 | child: Text(
196 | '$count',
197 | textAlign: TextAlign.center,
198 | style: Theme.of(context)
199 | .textTheme
200 | .headline1!
201 | .copyWith(foreground: Paint()..color = Colors.white),
202 | ),
203 | );
204 | }
205 | }
206 |
207 | class Sky extends StatefulWidget {
208 | const Sky({
209 | Key? key,
210 | }) : super(key: key);
211 |
212 | @override
213 | _SkyState createState() => _SkyState();
214 | }
215 |
216 | class _SkyState extends State with TickerProviderStateMixin {
217 | late AnimationController skyController;
218 | late AnimationController sunController;
219 | Animation? sunAnimation;
220 | Animation? skyAnimation;
221 |
222 | @override
223 | void initState() {
224 | super.initState();
225 | skyController = AnimationController(
226 | vsync: this,
227 | duration: const Duration(seconds: 40),
228 | )..repeat(reverse: true);
229 | sunController = AnimationController(
230 | vsync: this,
231 | duration: const Duration(seconds: 80),
232 | )..repeat();
233 | skyAnimation = skyController.drive(ColorTween(
234 | begin: Colors.blue,
235 | end: Colors.blueGrey.shade900,
236 | ));
237 | sunAnimation = sunController.drive(Tween(
238 | begin: 3 * math.pi / 2,
239 | end: 7 * math.pi / 2,
240 | ));
241 | }
242 |
243 | @override
244 | void dispose() {
245 | skyController.dispose();
246 | sunController.dispose();
247 | super.dispose();
248 | }
249 |
250 | @override
251 | Widget build(BuildContext context) {
252 | return Positioned.fill(
253 | child: CustomPaint(
254 | painter: SkyPainter(skyAnimation, sunAnimation),
255 | ),
256 | );
257 | }
258 | }
259 |
260 | class SkyPainter extends CustomPainter {
261 | const SkyPainter(this.skyAnimation, this.sunAnimation)
262 | : super(repaint: skyAnimation);
263 |
264 | final Animation? skyAnimation;
265 | final Animation? sunAnimation;
266 |
267 | static const sunColor = Color(0xFFFFC471);
268 | static const moonColor = Color(0xFFFFFFFF);
269 | static const sunRadius = 100.0;
270 | static const moonRadius = 75.0;
271 |
272 | @override
273 | void paint(Canvas canvas, Size size) {
274 | // Sky color.
275 | canvas.drawColor(skyAnimation!.value!, BlendMode.src);
276 |
277 | final halfWidth = size.width / 2;
278 | final distance = 2 / 4 * size.height;
279 |
280 | // Sun.
281 | final sunCenter = Offset.fromDirection(
282 | sunAnimation!.value,
283 | distance,
284 | ) +
285 | Offset(halfWidth, size.height);
286 | canvas.drawCircle(
287 | sunCenter,
288 | sunRadius,
289 | Paint()
290 | ..color = sunColor
291 | ..maskFilter = const MaskFilter.blur(BlurStyle.solid, 50),
292 | );
293 |
294 | // Moon.
295 | final moonCenter = Offset.fromDirection(
296 | sunAnimation!.value + math.pi,
297 | distance,
298 | ) +
299 | Offset(halfWidth, size.height);
300 |
301 | canvas.drawCircle(
302 | moonCenter,
303 | moonRadius,
304 | Paint()
305 | ..color = moonColor
306 | ..maskFilter = const MaskFilter.blur(BlurStyle.solid, 50),
307 | );
308 | }
309 |
310 | @override
311 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
312 | return false;
313 | }
314 | }
315 |
316 | class Volcano extends StatelessWidget {
317 | const Volcano({
318 | Key? key,
319 | }) : super(key: key);
320 |
321 | @override
322 | Widget build(BuildContext context) {
323 | return Positioned(
324 | bottom: 0,
325 | left: 0,
326 | right: 0,
327 | child: Image.network(
328 | 'https://raw.githubusercontent.com/RyuuKenshi/flutter_animated_counter/main/volcano.png'),
329 | );
330 | }
331 | }
332 |
333 | class Grass extends StatelessWidget {
334 | const Grass({
335 | Key? key,
336 | }) : super(key: key);
337 |
338 | @override
339 | Widget build(BuildContext context) {
340 | return const Positioned(
341 | bottom: 0,
342 | left: 0,
343 | right: 0,
344 | height: 50,
345 | child: CustomPaint(painter: GrassPainter()),
346 | );
347 | }
348 | }
349 |
350 | class GrassPainter extends CustomPainter {
351 | const GrassPainter();
352 |
353 | @override
354 | void paint(Canvas canvas, Size size) {
355 | final paint = Paint()..color = const Color(0xFF00B673);
356 | final width = size.width;
357 | final height = size.height;
358 | final halfHeight = height / 2;
359 |
360 | canvas.drawRect(
361 | Offset(0, halfHeight) & Size(size.width, halfHeight),
362 | paint,
363 | );
364 | canvas.drawCircle(Offset(0, height), 50, paint);
365 | canvas.drawCircle(Offset(width * 0.3, halfHeight), 40, paint);
366 | canvas.drawCircle(Offset(width * 0.4, halfHeight), 20, paint);
367 | canvas.drawCircle(Offset(width * 0.7, height), 70, paint);
368 | }
369 |
370 | @override
371 | bool shouldRepaint(covariant CustomPainter oldDelegate) {
372 | return false;
373 | }
374 | }
375 |
--------------------------------------------------------------------------------
/lib/wave_counter.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math' as math;
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | class WaveCounter {
6 | WaveCounter({required int initialCounter, Color color = Colors.black}) {
7 | _counter = initialCounter;
8 | _color = color;
9 | }
10 |
11 | int? _counter;
12 | Color? _color;
13 |
14 | void incrementCounter() {
15 | _counter = _counter! + 1;
16 | }
17 |
18 | void decrementCounter() {
19 | if (_counter! > 0) {
20 | _counter = _counter! - 1;
21 | }
22 | }
23 |
24 | int? getCounter() {
25 | return _counter;
26 | }
27 |
28 | Widget build(BuildContext context) {
29 | return Stack(
30 | children: [
31 | Positioned.fill(
32 | child: TweenAnimationBuilder(
33 | tween: Tween(begin: 0, end: _counter!.toDouble()),
34 | duration: const Duration(milliseconds: 1000),
35 | curve: Curves.bounceOut,
36 | builder: (_, double ratio, __) {
37 | return FractionallySizedBox(
38 | heightFactor: (ratio / 100).clamp(0, 100).toDouble(),
39 | alignment: Alignment.bottomCenter,
40 | child: _Wave(
41 | child: DifferenceMask(
42 | color: _color,
43 | ),
44 | ),
45 | );
46 | },
47 | ),
48 | ),
49 | ],
50 | );
51 | }
52 | }
53 |
54 | class _Wave extends StatefulWidget {
55 | const _Wave({
56 | Key? key,
57 | required this.child,
58 | }) : super(key: key);
59 |
60 | final Widget child;
61 |
62 | @override
63 | __WaveState createState() => __WaveState();
64 | }
65 |
66 | class __WaveState extends State<_Wave> with SingleTickerProviderStateMixin {
67 | late AnimationController controller;
68 | Animation>? waves;
69 |
70 | @override
71 | void initState() {
72 | super.initState();
73 | controller = AnimationController(
74 | vsync: this,
75 | duration: const Duration(seconds: 5),
76 | )..repeat(reverse: false);
77 | waves = controller.drive(_WaveTween(100, 20));
78 | }
79 |
80 | @override
81 | void dispose() {
82 | controller.dispose();
83 | super.dispose();
84 | }
85 |
86 | @override
87 | Widget build(BuildContext context) {
88 | return ClipPath(
89 | clipper: _WaveClipper(waves),
90 | child: widget.child,
91 | );
92 | }
93 | }
94 |
95 | class _WaveTween extends Animatable> {
96 | _WaveTween(this.count, this.height);
97 |
98 | final int count;
99 | final double height;
100 | static const twoPi = math.pi * 2;
101 | static const waveCount = 3;
102 |
103 | @override
104 | List transform(double t) {
105 | return List.generate(
106 | count,
107 | (i) {
108 | final ratio = i / (count - 1);
109 | final amplitude = 1 - (0.5 - ratio).abs() * 2;
110 | return Offset(
111 | ratio,
112 | amplitude * height * math.sin(waveCount * (ratio + t) * twoPi) +
113 | height * amplitude,
114 | );
115 | },
116 | growable: false,
117 | );
118 | }
119 | }
120 |
121 | class _WaveClipper extends CustomClipper {
122 | _WaveClipper(this.waves) : super(reclip: waves);
123 |
124 | Animation>? waves;
125 |
126 | @override
127 | Path getClip(Size size) {
128 | final width = size.width;
129 | final points = waves!.value.map((o) => Offset(o.dx * width, o.dy)).toList();
130 | return Path()
131 | ..addPolygon(points, false)
132 | ..lineTo(size.width, size.height)
133 | ..lineTo(0, size.height)
134 | ..close();
135 | }
136 |
137 | @override
138 | bool shouldReclip(_WaveClipper oldClipper) => false;
139 | }
140 |
141 | class DifferenceMask extends StatelessWidget {
142 | const DifferenceMask({
143 | Key? key,
144 | this.color,
145 | }) : super(key: key);
146 |
147 | final color;
148 | @override
149 | Widget build(BuildContext context) {
150 | return CustomPaint(
151 | painter: DifferencePainter(color: color),
152 | );
153 | }
154 | }
155 |
156 | class DifferencePainter extends CustomPainter {
157 | const DifferencePainter({required this.color}) : super();
158 |
159 | final color;
160 | @override
161 | void paint(Canvas canvas, Size size) {
162 | canvas.drawRect(Offset.zero & size, Paint()..color = color);
163 | }
164 |
165 | @override
166 | bool shouldRepaint(DifferencePainter oldDelegate) => false;
167 | }
168 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.5.0"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.1.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.2.0"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.15.0"
46 | fake_async:
47 | dependency: transitive
48 | description:
49 | name: fake_async
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.2.0"
53 | flutter:
54 | dependency: "direct main"
55 | description: flutter
56 | source: sdk
57 | version: "0.0.0"
58 | flutter_test:
59 | dependency: "direct dev"
60 | description: flutter
61 | source: sdk
62 | version: "0.0.0"
63 | matcher:
64 | dependency: transitive
65 | description:
66 | name: matcher
67 | url: "https://pub.dartlang.org"
68 | source: hosted
69 | version: "0.12.10"
70 | meta:
71 | dependency: transitive
72 | description:
73 | name: meta
74 | url: "https://pub.dartlang.org"
75 | source: hosted
76 | version: "1.3.0"
77 | path:
78 | dependency: transitive
79 | description:
80 | name: path
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "1.8.0"
84 | sky_engine:
85 | dependency: transitive
86 | description: flutter
87 | source: sdk
88 | version: "0.0.99"
89 | source_span:
90 | dependency: transitive
91 | description:
92 | name: source_span
93 | url: "https://pub.dartlang.org"
94 | source: hosted
95 | version: "1.8.1"
96 | stack_trace:
97 | dependency: transitive
98 | description:
99 | name: stack_trace
100 | url: "https://pub.dartlang.org"
101 | source: hosted
102 | version: "1.10.0"
103 | stream_channel:
104 | dependency: transitive
105 | description:
106 | name: stream_channel
107 | url: "https://pub.dartlang.org"
108 | source: hosted
109 | version: "2.1.0"
110 | string_scanner:
111 | dependency: transitive
112 | description:
113 | name: string_scanner
114 | url: "https://pub.dartlang.org"
115 | source: hosted
116 | version: "1.1.0"
117 | term_glyph:
118 | dependency: transitive
119 | description:
120 | name: term_glyph
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "1.2.0"
124 | test_api:
125 | dependency: transitive
126 | description:
127 | name: test_api
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "0.2.19"
131 | typed_data:
132 | dependency: transitive
133 | description:
134 | name: typed_data
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "1.3.0"
138 | vector_math:
139 | dependency: "direct main"
140 | description:
141 | name: vector_math
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "2.1.0"
145 | sdks:
146 | dart: ">=2.12.0 <3.0.0"
147 | flutter: ">=1.17.0"
148 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: animated_counter
2 | description: A package containing awesome animated counters to enhance your application with custom counter widgets.
3 | version: 1.0.0
4 | homepage: https://github.com/RyuuKenshi/flutter_animated_counter
5 | repository: https://github.com/RyuuKenshi/flutter_animated_counter
6 |
7 | environment:
8 | sdk: '>=2.12.0 <3.0.0'
9 | flutter: ">=1.17.0"
10 |
11 | dependencies:
12 | flutter:
13 | sdk: flutter
14 | vector_math: ^2.0.8
15 |
16 | dev_dependencies:
17 | flutter_test:
18 | sdk: flutter
19 |
20 | # For information on the generic Dart part of this file, see the
21 | # following page: https://dart.dev/tools/pub/pubspec
22 |
23 | # The following section is specific to Flutter.
24 | flutter:
25 |
26 | # To add assets to your package, add an assets section, like this:
27 | # assets:
28 | # - assets/
29 | # - images/a_dot_ham.jpeg
30 | #
31 | # For details regarding assets in packages, see
32 | # https://flutter.dev/assets-and-images/#from-packages
33 | #
34 | # An image asset can refer to one or more resolution-specific "variants", see
35 | # https://flutter.dev/assets-and-images/#resolution-aware.
36 |
37 | # To add custom fonts to your package, add a fonts section here,
38 | # in this "flutter" section. Each entry in this list should have a
39 | # "family" key with the font family name, and a "fonts" key with a
40 | # list giving the asset and other descriptors for the font. For
41 | # example:
42 | # fonts:
43 | # - family: Schyler
44 | # fonts:
45 | # - asset: fonts/Schyler-Regular.ttf
46 | # - asset: fonts/Schyler-Italic.ttf
47 | # style: italic
48 | # - family: Trajan Pro
49 | # fonts:
50 | # - asset: fonts/TrajanPro.ttf
51 | # - asset: fonts/TrajanPro_Bold.ttf
52 | # weight: 700
53 | #
54 | # For details regarding fonts in packages, see
55 | # https://flutter.dev/custom-fonts/#from-packages
56 |
--------------------------------------------------------------------------------
/ss/blocks.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/blocks.gif
--------------------------------------------------------------------------------
/ss/circle_wave.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/circle_wave.gif
--------------------------------------------------------------------------------
/ss/creatures.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/creatures.gif
--------------------------------------------------------------------------------
/ss/disks.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/disks.gif
--------------------------------------------------------------------------------
/ss/image_bubble.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/image_bubble.gif
--------------------------------------------------------------------------------
/ss/mattis.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/mattis.gif
--------------------------------------------------------------------------------
/ss/particles.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/particles.gif
--------------------------------------------------------------------------------
/ss/pixel.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/pixel.gif
--------------------------------------------------------------------------------
/ss/portrait.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/portrait.gif
--------------------------------------------------------------------------------
/ss/rotating_bubbles.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/rotating_bubbles.gif
--------------------------------------------------------------------------------
/ss/rotating_planets.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/rotating_planets.gif
--------------------------------------------------------------------------------
/ss/triangles.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/triangles.gif
--------------------------------------------------------------------------------
/ss/volcano.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/volcano.gif
--------------------------------------------------------------------------------
/ss/wave.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/ss/wave.gif
--------------------------------------------------------------------------------
/test/animated_counter_test.dart:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/test/animated_counter_test.dart
--------------------------------------------------------------------------------
/volcano.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DrunkOnBytes/flutter_animated_counter/4120e65869d6d2926589c681ae997d86c237dc03/volcano.png
--------------------------------------------------------------------------------