├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── reactle │ │ │ │ │ └── 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 │ ├── cloud1.png │ ├── cloud2.png │ ├── cloud3.png │ └── sun.png ├── 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 │ └── samples.dart ├── pubspec.lock ├── pubspec.yaml ├── test │ └── widget_test.dart └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png │ ├── index.html │ └── manifest.json ├── lib ├── src │ ├── styles │ │ ├── animation_settings.dart │ │ ├── animation_style.dart │ │ ├── animation_style_builder.dart │ │ ├── atRest │ │ │ ├── animation_style_bounce.dart │ │ │ ├── animation_style_dangle.dart │ │ │ ├── animation_style_fidget.dart │ │ │ ├── animation_style_none.dart │ │ │ ├── animation_style_pulse.dart │ │ │ ├── animation_style_rotate.dart │ │ │ ├── animation_style_size.dart │ │ │ ├── animation_style_slide.dart │ │ │ ├── animation_style_swing.dart │ │ │ ├── animation_style_vibrate.dart │ │ │ └── animation_style_wave.dart │ │ └── transitions │ │ │ ├── animation_incoming_transition_offset_and_scale.dart │ │ │ ├── animation_incoming_transition_offset_and_scale_and_step.dart │ │ │ └── animation_outgoing_transition_offset_and_scale.dart │ ├── text_animator.dart │ ├── text_animator_sequence.dart │ ├── widget_animator.dart │ └── widget_animator_sequence.dart └── widget_and_text_animator.dart ├── logo.gif ├── pubspec.yaml ├── test └── widget_and_text_animator_test.dart ├── text_sample.gif ├── title.png ├── wave.gif └── widget_sequence.gif /.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 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 25 | /pubspec.lock 26 | **/doc/api/ 27 | .dart_tool/ 28 | .packages 29 | build/ 30 | -------------------------------------------------------------------------------- /.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: c860cba910319332564e1e9d470a17074c1f2dfd 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.1.5 - 2023-07-24 2 | 3 | * Bug fixes 4 | 5 | ## 1.1.4 - 2023-07-24 6 | 7 | * Updated screenshots 8 | 9 | 10 | ## 1.1.3 - 2023-07-24 11 | 12 | * Added `onLongPress`, `onLongPress` and `onTapUp` to `GestureAnimator` 13 | 14 | 15 | ## 1.1.2 - 2023-07-21 16 | 17 | * Fix for https://github.com/andrewpmoore/widget_and_text_animator/issues/5 18 | 19 | ## 1.1.1 - 2023-07-21 20 | 21 | * Bug fixes 22 | 23 | ## 1.1.0 - 2023-07-21 24 | 25 | * Added a GestureAnimator so that animations can trigger on pressing on a widget 26 | 27 | ## 1.0.9 - 2022-05-26 28 | 29 | * Fix for https://github.com/andrewpmoore/widget_and_text_animator/issues/4 (outgoing animation delay is ignored) 30 | 31 | ## 1.0.8 - 2022-05-26 32 | 33 | * Fix for some animations not working 34 | 35 | ## 1.0.7 - 2022-05-23 36 | 37 | * Style improvements to match dart standard 38 | 39 | ## 1.0.6 - 2022-05-23 40 | 41 | * Extra checks to make sure Tween weights are not set to zero 42 | 43 | ## 1.0.5 - 2022-04-25 44 | 45 | * Description improvements 46 | 47 | ## 1.0.4 - 2022-04-25 48 | 49 | * Documentation improvements 50 | 51 | ## 1.0.3 - 2022-04-22 52 | 53 | * Fix for where text was too long to fit on a line for a single word and truncated instead of wrapping 54 | * More documentation added 55 | 56 | ## 1.0.2 - 2022-04-20 57 | 58 | * Fixes to Pass static analysis 59 | 60 | ## 1.0.1 - 2022-04-20 61 | 62 | * Fix for home page issue 63 | 64 | ## 1.0.0 - 2022-04-14 65 | 66 | * Initial release 67 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Andrew Moore 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to deal 4 | in the Software without restriction, including without limitation the rights 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | The above copyright notice and this permission notice shall be included in all 9 | copies or substantial portions of the Software. 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 11 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 13 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 14 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 15 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 16 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # [widget and text animator](https://pub.dev/packages/widget_and_text_animator) 3 | 4 | 5 | 6 | 7 | 8 | A collection of effects to make `Widget` Animations a breeze and `Text` animations look beautiful! 9 | 10 | 11 | See a [live preview](https://andrewpmoore.github.io/widget_and_text_animator_example/index.html#/) running in your browser. 12 | 13 | 14 | > Supported Platforms 15 | > 16 | > - ALL 17 | 18 | 19 | ## How to Use 20 | 21 | ```yaml 22 | # add this line to your dependencies 23 | widget_and_text_animator: ^1.1.5 24 | ``` 25 | 26 | ```dart 27 | import 'package:widget_and_text_animator/widget_and_text_animator.dart'; 28 | ``` 29 | 30 | 31 | ## Basics 32 | The Widget `WidgetAnimator` can be wrapped around any widget to let you do effects on it without worrying about vsync, stateful classes and all the usual boilerplate code required. 33 | It provides you with three main features: 34 | - `Incoming effects` - effects that show when a widget first enters the screen 35 | - `At rest effects` - effects that are shown while the widget is visible 36 | - `Outgoing effects` - effects for if the widget is changed and is leaving the screen to be replaced 37 | 38 | 39 | So for a really simple example where you might want to animate a `Container` appearing onto the screen you can just do the following: 40 | 41 | ```dart 42 | WidgetAnimator( 43 | incomingEffect: WidgetTransitionEffects.incomingSlideInFromBottom(), 44 | child: Container( 45 | width: 100, 46 | height: 100, 47 | color: Colors.blue, 48 | ), 49 | ) 50 | ``` 51 | 52 | 53 | 54 | 55 | or maybe you would like it to swing backwards and forwards while displayed 56 | 57 | ```dart 58 | WidgetAnimator( 59 | atRestEffect: WidgetRestingEffects.swing(), 60 | child: Container( 61 | width: 100, 62 | height: 100, 63 | color: Colors.blue, 64 | ), 65 | ) 66 | ``` 67 | 68 | 69 | 70 | 71 | The library comes with a collection of constructors such as `WidgetTransitionEffects.incomingSlideInFromBottom()` to allow for a range of really simple effect to be created with minimal code. 72 | 73 | `WidgetTransitionEffects` are used for both `incoming` and `outgoing` effects and `WidgetAtRestEffects` are used when a widget is `at rest`. 74 | 75 | Extending the two examples above, here's a version where both the `incoming` and `at rest` animations are combined : 76 | 77 | ```dart 78 | WidgetAnimator( 79 | incomingEffect: WidgetTransitionEffects.incomingSlideInFromBottom(), 80 | atRestEffect: WidgetRestingEffects.swing(), 81 | child: FloatingActionButton( 82 | onPressed: (){}, 83 | tooltip: 'Increment', 84 | child: const Icon(Icons.add), 85 | ), 86 | ) 87 | ``` 88 | 89 | 90 | 91 | 92 | ## Widget overview 93 | The library comprises of four main Widgets which all have their own purpose: 94 | - `WidgetAnimator` Animates any widget with effects such as opacity, offset, blur, skew, rotation, scale 95 | 96 | - `WidgetAnimatorSequence` Animates a list of `WidgetAnimator` either based on Time or a user pressing on the widget (or both) 97 | 98 | - `TextAnimator` Can be used as a direct replacement for the standard `Text` widget, giving it animation superpowers 99 | 100 | - `TextAnimatorSequence` Similar to `WidgetAnimatorSequence` but works on `TextAnimator` widgets 101 | 102 | 103 | #### Why does `Text` have it's own special widgets? 104 | Although you can animate a `Text` widget easily with the `WidgetAnimator`, it'll operate on the text as a whole. The reason `TextAnimator` exists is it allows 105 | for processing effects on each character within a string creating some cool staggered effects. `TextAnimator` is a wrapper around `WidgetAnimator` 106 | handling some of the trickier parts of doing this yourself manually. 107 | 108 | Here's some examples below: 109 | 110 | 111 | 112 | 113 | 114 | ## Getting into more detail 115 | In the earlier examples `WidgetTransitionEffects` and `WidgetAtRestEffects` were used to create some basic effects, but just with some default values. Let's 116 | take a look in more detail at what can be set for each: 117 | 118 | 119 | ### `WidgetTransitionEffects` 120 | | property | description | default | 121 | | --------------- | ------------------------------------------------------------------ |------------| 122 | | `offset` | set up the offset from the position that the widget would normally render, e.g. `Offset(50, 20)` would render 50 pixels to the right and 20 below the normal location, `Offset(-50, -20)` would render 50 pixels to the left and 20 above the normal location |`Offset(0,0)` | 123 | | `skew` | Skew, the amount of skew on the X and Y axis e.g. `Offset(0.2, 0.5)` would be a skew of 0.2 on the X axis and 0.5 on the Y axis |`Offset(0,0)` | 124 | | `scale` | The scale proportion compared to the widgets normal size, the default scale is 1.25x the normal size, use smaller numbers such as 0.5 to decrease the size and values larger | `1` | 125 | | `blur` | Blur, the amount of blur on the X and Y axis e.g. `Offset(2, 5)` would be a blur of 2 on the X axis and 5 on the Y axis, note that this effect can be quite performance intensive, so try to limit the amount it's used | `Offset(0,0)` | 126 | | `rotation` | The rotation in radians, so math.pi/0.5 will rotate a full circle, math.pi/6 will rotate a small amount |`0` | 127 | | `opacity` | An opacity range from 0..1 |`1` | 128 | | `curve` | A curve for the animation tween the play, `Curves.Linear` if you want it the animation to play at a constant speed, but you can also use things like `Curves.bounce` to bounce the effect | `Curve.eastInOut` | 129 | | `builder` | The builder allows you to create your own more complicated version of the animations available by default, find more details about the builders below in the `custom animation` section | `null` | 130 | | `duration` | The duration the animation should play for | `Duration(milliseconds: 300)` | 131 | | `delay` | The length of time before the animation starts to play | `null` | 132 | 133 | 134 | 135 | 136 | ### `WidgetAtRestEffects` 137 | 138 | There are a collection of default constructors available to make standard effects simple to create: 139 | 140 | 141 | #### `WidgetRestingEffects.wave()` 142 | Wave the widget up and then down on it's Y axis 143 | 144 | 145 | 146 | #### `WidgetRestingEffects.pulse()` 147 | Pulse up and down the opacity of the widget 148 | 149 | 150 | 151 | 152 | #### `WidgetRestingEffects.rotate()` 153 | Rotate the widget around 360 degrees 154 | 155 | 156 | 157 | 158 | 159 | #### `WidgetRestingEffects.bounce()` 160 | Lift the widget and then bounce it back down 161 | 162 | 163 | 164 | 165 | 166 | #### `WidgetRestingEffects.slide()` 167 | Skew the widget from side-to-side based on a center axis 168 | 169 | 170 | 171 | 172 | #### `WidgetRestingEffects.swing()` 173 | Swing the widget back and forwards using rotation 174 | 175 | 176 | 177 | #### `WidgetRestingEffects.size()` 178 | Change the size of the widget, by default larger - `effectStrength` parameter can make it smaller too 179 | 180 | 181 | 182 | 183 | #### `WidgetRestingEffects.fidget()` 184 | Randomly shuffle the widget on both it's X and Y axis 185 | 186 | 187 | 188 | 189 | #### `WidgetRestingEffects.dangle()` 190 | Skew the widget from side-to-side based on a top center axis 191 | 192 | 193 | 194 | 195 | 196 | #### `WidgetRestingEffects.vibrate()` 197 | Randomly move the widget from its standard position on the X and Y axis 198 | 199 | 200 | 201 | 202 | 203 | 204 | For more control you can specify a collection of properties into the constructors: 205 | 206 | | property | description | default | 207 | | --------------- | ------------------------------------------------------------------ |------------| 208 | | `style` | Style requires an `enum` from `WidgetRestingEffectStyle' where 10 different effects are available |`WidgetRestingEffectStyle.none` | 209 | | `effectStrength`| Based on the `style` above, most effects have a default strength for them, for example when using `WidgetRestingEffectStyle.fidget` the Widget will randomly move about from it's original position. Changing the `effectStrength` you can increase or decrease the amount of movement that happens |`1` | 210 | | `alignment` | Used only for `skew` based effects to change the position that the effect takes place from |`Alignment.center` | 211 | | `numberOfPlays` | The number of times the animation should play before stopping, negative values and `null` will cause the animation to play forver |`null` (ie repeat forever) | 212 | | `curve` | A curve for the animation tween the play, `Curves.Linear` if you want it the animation to play at a constant speed, but you can also use things like `Curves.bounce` to bounce the effect | `Curve.eastInOut` | 213 | | `builder` | The builder allows you to create your own more complicated version of the animations available by default, find more details about the builders below in the `custom animation` section | `null` | 214 | | `duration` | The duration the animation should play one cycle for | `Duration(milliseconds: 600)` | 215 | | `delay` | The length of time before the animation starts to play | `null` | 216 | 217 | 218 | 219 | ## `WidgetAnimatorSequence` 220 | `WidgetAnimatorSequence` animates a list of `WidgetAnimator` either based on Time or a user pressing on the widget (or both). . 221 | 222 | | property | description | default | 223 | | --------------- | ------------------------------------------------------------------ |------------| 224 | | `children` | A list of `WidgetAnimator` for the sequence to play against |null, a list is required | 225 | | `tapToProceed` | If `true` allows the user to tap on the widget and proceed to displaying the next child in the list of children |`false` | 226 | | `loop` | Once the list of children has been displayed, does the list loop back to the start |`false` | 227 | | `transitionTime`| The length of time to wait between changing the widget once in input transition has completed, not specifying a duration will mean it won't change the sequence automatically |`null` | 228 | | `onPressed` | callback function to perform if the widget is pressed on |`null` | 229 | 230 | Here's an example displaying 3 containers that change automatically every 4 seconds and each have their own animation effects 231 | 232 | ```dart 233 | return WidgetAnimatorSequence( 234 | children: [ 235 | WidgetAnimator( 236 | key: const ValueKey('one'), 237 | incomingEffect: WidgetTransitionEffects.incomingScaleDown(), 238 | outgoingEffect: WidgetTransitionEffects.outgoingScaleUp(), 239 | child: Container(width: 200,height: 200,color: Colors.red,child: Align(alignment: Alignment.centerLeft,child: Text('Red',style: GoogleFonts.sanchez(textStyle: const TextStyle(fontWeight: FontWeight.w900, letterSpacing: -2, fontSize: 56)),)))), 240 | WidgetAnimator( 241 | key: const ValueKey('two'), 242 | incomingEffect: WidgetTransitionEffects.incomingSlideInFromLeft(), 243 | outgoingEffect: WidgetTransitionEffects.outgoingSlideOutToBottom(), 244 | child: Container(width: 200,height: 200,color: Colors.green,child: Align(alignment: Alignment.centerLeft,child: Text('Green',style: GoogleFonts.sanchez(textStyle: const TextStyle(fontWeight: FontWeight.w900, letterSpacing: -2, fontSize: 56)),)))), 245 | WidgetAnimator( 246 | key: const ValueKey('two'), 247 | incomingEffect: WidgetTransitionEffects(blur: const Offset(2,2), duration: const Duration(milliseconds: 600)), 248 | atRestEffect: WidgetRestingEffects.slide(), 249 | outgoingEffect: WidgetTransitionEffects(blur: const Offset(2,2), duration: const Duration(milliseconds: 600)), 250 | child: Container(width: 200,height: 200,color: Colors.blue,child: Align(alignment: Alignment.centerLeft,child: Text('Blue',style: GoogleFonts.sanchez(textStyle: const TextStyle(fontWeight: FontWeight.w900, letterSpacing: -2, fontSize: 56)),)))) 251 | ], 252 | tapToProceed: true, 253 | loop: true, 254 | transitionTime: const Duration(seconds: 4), 255 | ); 256 | 257 | ``` 258 | 259 | 260 | 261 | 262 | ## `TextAnimator` 263 | Can be used as a direct replacement for the standard `Text` widget, giving it animation superpowers. `TextAnimator` uses `WidgetAnimator` as its basis for the animation, but splits the text 264 | into characters and words to be able to create some nice effects. 265 | 266 | | property | description | default | 267 | | --------------- | ------------------------------------------------------------------ |------------| 268 | | `text ` | The [String] of text to display |null, but a `string` of text is required | 269 | | `WidgetTransitionEffects` | The incoming effects to play when the text is first shown |`null` | 270 | | `WidgetRestingEffects` | The effects to show when the text isn't incoming or outgoing |`null` | 271 | | `WidgetTransitionEffects` | the maximum number of lines of text to show within the widget, used in the same way as the standard [Text] widget |`null` | 272 | | `maxLines` | The outgoing effects to play when the text is replaced |`null` | 273 | | `textAlign` | The [TextAlign] of the text, in the same was it's used in the [Text] widget |`null` | 274 | | `textStyle` | The [TextStyle] of the text, in the same was it's used in the [Text] widget |`null` | 275 | | `initialDelay` | The length of time to wait before starting to show any of the text |`null` | 276 | | `characterDelay` | A delay to leave between each character of text to display to create a staggered text animation effect, if you want words to appear at once, then set a Duration of zero |`null` | 277 | | `spaceDelay` | The delay to leave between each word before showing the next. If set the same as the characterDelay the timing will be consistent for all characters. It can be used to drive the timing per word if `characterDelay` is set to zero |`null` | 278 | 279 | Here's a basic example of some text within a container using the `TextAnimator` to make the text wave up and down with a delay between each character 280 | 281 | ```dart 282 | return Container(width: 200, height: 200, color: Colors.red, 283 | child: TextAnimator('Wave text', atRestEffect: WidgetRestingEffects.wave(),) 284 | ); 285 | ``` 286 | 287 | 288 | 289 | 290 | ## `TextAnimatorSequence` 291 | `TextAnimatorSequence` Animates a list of `TextAnimator` either based on Time or a user pressing on the text (or both). 292 | 293 | | property | description | default | 294 | | --------------- | ------------------------------------------------------------------ |------------| 295 | | `children` | A list of `TextAnimator` for the sequence to play against |null, a list is required | 296 | | `tapToProceed` | If `true` allows the user to tap on the text and proceed to displaying the next child in the list of children |`false` | 297 | | `loop` | Once the list of children has been displayed, does the list loop back to the start |`false` | 298 | | `transitionTime`| The length of time to wait between changing the text once in input transition has completed, not specifying a duration will mean it won't change the sequence automatically |`null` | 299 | | `onPressed` | callback function to perform if the text is pressed on |`null` | 300 | 301 | Here's an example which changes between 3 strings of text every 4 seconds or when clicked upon, each with their own incoming and outgoing animation styles 302 | 303 | ```dart 304 | return TextAnimatorSequence( 305 | children: [ 306 | TextAnimator('Red', 307 | incomingEffect: WidgetTransitionEffects.incomingScaleDown(), 308 | atRestEffect: WidgetRestingEffects.bounce(), 309 | outgoingEffect: WidgetTransitionEffects.outgoingScaleUp(), 310 | style: GoogleFonts.sanchez(textStyle: const TextStyle(fontWeight: FontWeight.w900, color: Colors.red, letterSpacing: -2, fontSize: 64))), 311 | TextAnimator('Green', 312 | incomingEffect: WidgetTransitionEffects.incomingSlideInFromLeft(), 313 | atRestEffect: WidgetRestingEffects.fidget(), 314 | outgoingEffect: WidgetTransitionEffects.outgoingSlideOutToBottom(), 315 | style: GoogleFonts.sanchez(textStyle: const TextStyle(fontWeight: FontWeight.w900, color: Colors.green, letterSpacing: -2, fontSize: 64))), 316 | TextAnimator('Blue', 317 | incomingEffect: WidgetTransitionEffects(blur: const Offset(2, 2), duration: const Duration(milliseconds: 600)), 318 | atRestEffect: WidgetRestingEffects.wave(), 319 | outgoingEffect: WidgetTransitionEffects(blur: const Offset(2, 2), duration: const Duration(milliseconds: 600)), 320 | style: GoogleFonts.sanchez(textStyle: const TextStyle(fontWeight: FontWeight.w900, color: Colors.blue, letterSpacing: -2, fontSize: 64))), 321 | ], 322 | tapToProceed: true, 323 | loop: true, 324 | transitionTime: const Duration(seconds: 4), 325 | ); 326 | 327 | ``` 328 | 329 | 330 | 331 | 332 | 333 | ## Keys 334 | In a similar way to which widgets such as `AnimatedSwitcher` work changes are detected on the `WidgetAnimator` by a change in type of the `child` widget or by the child widget having a different `key`, without either of these differences 335 | the Widget will not be aware of the changes that have happened and you'll either miss any outgoing transitions or will have no change in widget at all. 336 | 337 | So for example if you have two different coloured containers that you want to switch both would need their own key 338 | 339 | ```dart 340 | WidgetAnimator( 341 | incomingEffect: WidgetTransitionEffects.incomingSlideInFromLeft(), 342 | outgoingEffect: WidgetTransitionEffects.outgoingSlideOutToRight(), 343 | child: isBlue ? Container(key: ValueKey('blue'), width: 100, height: 100, color: Colors.blue) : 344 | Container(key: ValueKey('red'), width: 100, height: 100, color: Colors.red) 345 | ) 346 | ``` 347 | 348 | 349 | 350 | 351 | ## Custom animations 352 | Do you want to create an effect that's not possible with the default effects? Then you may be able to create the effect you want with the `builder` properties. With these you need to return an `AnimationSettings` 353 | object and you are then free to define your own animation settings for the properties available. Find an example below which draws a container and while it's `at rest` moves it in a trianglar pattern by adjusting the `x` and `y` 354 | offset over the duration of the animation: 355 | 356 | ```dart 357 | WidgetAnimator( 358 | atRestEffect: WidgetRestingEffects( 359 | duration: const Duration(seconds: 3), 360 | builder: (WidgetRestingEffects effects, AnimationController animationController) { 361 | AnimationSettings _animationSettings = AnimationSettings(animationController: animationController); 362 | _animationSettings.offsetYAnimation = TweenSequence( 363 | [TweenSequenceItem(tween: Tween(begin: 0, end: 150).chain(CurveTween(curve: Curves.easeInOut)),weight: 33.0,), 364 | TweenSequenceItem(tween: Tween(begin: 150, end: 150).chain(CurveTween(curve: Curves.easeInOut)),weight: 33.0,), 365 | TweenSequenceItem(tween: Tween(begin: 150, end: 0).chain(CurveTween(curve: Curves.easeInOut)),weight: 33.0,),], 366 | ).animate(CurvedAnimation(parent: animationController, curve: Curves.linear)); 367 | 368 | _animationSettings.offsetXAnimation = TweenSequence( 369 | [TweenSequenceItem(tween: Tween(begin: 0, end: 80).chain(CurveTween(curve: Curves.easeInOut)),weight: 33.0,), 370 | TweenSequenceItem(tween: Tween(begin: 80, end: -80).chain(CurveTween(curve: Curves.easeInOut)),weight: 33.0,), 371 | TweenSequenceItem(tween: Tween(begin: -80, end: 0).chain(CurveTween(curve: Curves.easeInOut)),weight: 33.0,),], 372 | ).animate(CurvedAnimation(parent: animationController, curve: Curves.linear)); 373 | 374 | return _animationSettings; 375 | },), 376 | child: Container( 377 | width: 200, 378 | height: 200, 379 | color: Colors.amber, 380 | child: const Center( 381 | child: Padding( 382 | padding: EdgeInsets.all(8.0), 383 | child: Text('Hello'), 384 | )), 385 | ), 386 | ) 387 | ``` 388 | 389 | 390 | 391 | 392 | 393 | 394 | ## `GestureAnimator` 395 | This widget can be used as a direct replacement for the `GestureDetector`. It only covers basic `onTap` gestures, but allows you to animate effects on the widget pressed with just a few properties: 396 | 397 | | property | description | default | 398 | |--------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------| 399 | | `duration` | The [Duration] of the animation | 150 milliseconds | 400 | | `curve` | The animation curve to use | `Curves.linear` | 401 | | `scaleSize` | The size to reduce or increase by when the gesture is triggered | `0.9` | 402 | | `yOffset` | The amount of pixels to offset up or down the screen | `0` | 403 | | `xOffset` | The amount of pixels to offset across the screen | `0` | 404 | | `blurX` | The amount of blur on the `x` axis to apply to the child | `0` | 405 | | `blurY` | The amount of blur on the `y` axis to apply to the child | `0` | 406 | | `skewX` | The amount of skew on the `x` axis to apply to the child | `0` | 407 | | `skewY` | The amount of skew on the `y` axis to apply to the child | `0` | 408 | | `rotation` | The amount to rotate the child widget when the gesture is triggered | `0` | 409 | | `opacity` | The amount of opacity to trigger when the gesture is triggered | `0` | 410 | | `hapticFeedback` | The haptic feedback style to trigger when the gesture is triggered, this is useful if using `triggerOnTapAfterAnimationComplete` otherwise doing the haptic feedback in the `onTap` will seem delayed | `null` | 411 | | `triggerOnTapAfterAnimationComplete` | Delay triggering the `onTap` callback until after the animation has played, otherwise you may not see much of the animation if navigating to another page | `false` | 412 | | `onTap` | The code to call when a user taps on the widget | `null` | 413 | | `child` | The child widget to render | `null` | 414 | 415 | Here's a basic example of some text within a container using the `TextAnimator` to make the text wave up and down with a delay between each character 416 | 417 | ```dart 418 | return GestureAnimator( 419 | curve: Curves.easeInOut, 420 | scaleSize: 0.9, 421 | yOffset: -5, 422 | duration: const Duration(milliseconds: 150), 423 | // blurX: 2, 424 | // blurY: 2, 425 | // numberOfPlays: 4, 426 | // rotation: pi / 16, 427 | // skewX: 0.2, 428 | opacity: 0.8, 429 | hapticFeedback: HapticFeedback.selectionClick, 430 | triggerOnTapAfterAnimationComplete: true, 431 | onTap: (){ 432 | Navigator.of(context).push(Samples.route()); 433 | }, 434 | child: Padding( 435 | padding: const EdgeInsets.all(8.0), 436 | child: Container(color: Colors.green, child: const Padding( 437 | padding: EdgeInsets.all(12.0), 438 | child: Text('Do not push me!'), 439 | ),), 440 | ),); 441 | ``` 442 | 443 | 444 | 445 | ## Give me more! 446 | For more examples check out the [example](https://github.com/andrewpmoore/widget_and_text_animator/tree/main/example) project on github. 447 | 448 | 449 | 450 | ## If you find issues or want new features... 451 | If you come across any issues, please check out the outstanding [issues here](https://github.com/andrewpmoore/widget_and_text_animator/issues) and raise a new issue if required. 452 | 453 | Pull requests welcome, new feature suggestions can be [created here](https://github.com/andrewpmoore/widget_and_text_animator/issues) 454 | 455 | 456 | ## Buy Me a Coffee 457 | If you appreciate this package, you may buy me a coffee... 458 | 459 | Buy Me A Coffee 460 | 461 | 462 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:lints/recommended.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /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: c860cba910319332564e1e9d470a17074c1f2dfd 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example widget_and_text_animator project 2 | 3 | Example project to showcase the widget and text animator 4 | 5 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /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 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /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 flutter.compileSdkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.reactle.example" 47 | minSdkVersion flutter.minSdkVersion 48 | targetSdkVersion flutter.targetSdkVersion 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/reactle/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.reactle.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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 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 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M --add-opens java.base/java.io=ALL-UNNAMED 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | 5 | 6 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | 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/cloud1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/assets/cloud1.png -------------------------------------------------------------------------------- /example/assets/cloud2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/assets/cloud2.png -------------------------------------------------------------------------------- /example/assets/cloud3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/assets/cloud3.png -------------------------------------------------------------------------------- /example/assets/sun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/assets/sun.png -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.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 = 50; 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 = 1300; 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 | INFOPLIST_FILE = Runner/Info.plist; 293 | LD_RUNPATH_SEARCH_PATHS = ( 294 | "$(inherited)", 295 | "@executable_path/Frameworks", 296 | ); 297 | PRODUCT_BUNDLE_IDENTIFIER = com.reactle.example; 298 | PRODUCT_NAME = "$(TARGET_NAME)"; 299 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 300 | SWIFT_VERSION = 5.0; 301 | VERSIONING_SYSTEM = "apple-generic"; 302 | }; 303 | name = Profile; 304 | }; 305 | 97C147031CF9000F007C117D /* Debug */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ALWAYS_SEARCH_USER_PATHS = NO; 309 | CLANG_ANALYZER_NONNULL = YES; 310 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 311 | CLANG_CXX_LIBRARY = "libc++"; 312 | CLANG_ENABLE_MODULES = YES; 313 | CLANG_ENABLE_OBJC_ARC = YES; 314 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 315 | CLANG_WARN_BOOL_CONVERSION = YES; 316 | CLANG_WARN_COMMA = YES; 317 | CLANG_WARN_CONSTANT_CONVERSION = YES; 318 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 319 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 320 | CLANG_WARN_EMPTY_BODY = YES; 321 | CLANG_WARN_ENUM_CONVERSION = YES; 322 | CLANG_WARN_INFINITE_RECURSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 325 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 326 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 328 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 329 | CLANG_WARN_STRICT_PROTOTYPES = YES; 330 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 331 | CLANG_WARN_UNREACHABLE_CODE = YES; 332 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 333 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 334 | COPY_PHASE_STRIP = NO; 335 | DEBUG_INFORMATION_FORMAT = dwarf; 336 | ENABLE_STRICT_OBJC_MSGSEND = YES; 337 | ENABLE_TESTABILITY = YES; 338 | GCC_C_LANGUAGE_STANDARD = gnu99; 339 | GCC_DYNAMIC_NO_PIC = NO; 340 | GCC_NO_COMMON_BLOCKS = YES; 341 | GCC_OPTIMIZATION_LEVEL = 0; 342 | GCC_PREPROCESSOR_DEFINITIONS = ( 343 | "DEBUG=1", 344 | "$(inherited)", 345 | ); 346 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 347 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 348 | GCC_WARN_UNDECLARED_SELECTOR = YES; 349 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 350 | GCC_WARN_UNUSED_FUNCTION = YES; 351 | GCC_WARN_UNUSED_VARIABLE = YES; 352 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 353 | MTL_ENABLE_DEBUG_INFO = YES; 354 | ONLY_ACTIVE_ARCH = YES; 355 | SDKROOT = iphoneos; 356 | TARGETED_DEVICE_FAMILY = "1,2"; 357 | }; 358 | name = Debug; 359 | }; 360 | 97C147041CF9000F007C117D /* Release */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ALWAYS_SEARCH_USER_PATHS = NO; 364 | CLANG_ANALYZER_NONNULL = YES; 365 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 366 | CLANG_CXX_LIBRARY = "libc++"; 367 | CLANG_ENABLE_MODULES = YES; 368 | CLANG_ENABLE_OBJC_ARC = YES; 369 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 370 | CLANG_WARN_BOOL_CONVERSION = YES; 371 | CLANG_WARN_COMMA = YES; 372 | CLANG_WARN_CONSTANT_CONVERSION = YES; 373 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 374 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 375 | CLANG_WARN_EMPTY_BODY = YES; 376 | CLANG_WARN_ENUM_CONVERSION = YES; 377 | CLANG_WARN_INFINITE_RECURSION = YES; 378 | CLANG_WARN_INT_CONVERSION = YES; 379 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 380 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 381 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 382 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 383 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 384 | CLANG_WARN_STRICT_PROTOTYPES = YES; 385 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 386 | CLANG_WARN_UNREACHABLE_CODE = YES; 387 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 388 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 389 | COPY_PHASE_STRIP = NO; 390 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 391 | ENABLE_NS_ASSERTIONS = NO; 392 | ENABLE_STRICT_OBJC_MSGSEND = YES; 393 | GCC_C_LANGUAGE_STANDARD = gnu99; 394 | GCC_NO_COMMON_BLOCKS = YES; 395 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 396 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 397 | GCC_WARN_UNDECLARED_SELECTOR = YES; 398 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 399 | GCC_WARN_UNUSED_FUNCTION = YES; 400 | GCC_WARN_UNUSED_VARIABLE = YES; 401 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 402 | MTL_ENABLE_DEBUG_INFO = NO; 403 | SDKROOT = iphoneos; 404 | SUPPORTED_PLATFORMS = iphoneos; 405 | SWIFT_COMPILATION_MODE = wholemodule; 406 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 407 | TARGETED_DEVICE_FAMILY = "1,2"; 408 | VALIDATE_PRODUCT = YES; 409 | }; 410 | name = Release; 411 | }; 412 | 97C147061CF9000F007C117D /* Debug */ = { 413 | isa = XCBuildConfiguration; 414 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 415 | buildSettings = { 416 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 417 | CLANG_ENABLE_MODULES = YES; 418 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 419 | ENABLE_BITCODE = NO; 420 | INFOPLIST_FILE = Runner/Info.plist; 421 | LD_RUNPATH_SEARCH_PATHS = ( 422 | "$(inherited)", 423 | "@executable_path/Frameworks", 424 | ); 425 | PRODUCT_BUNDLE_IDENTIFIER = com.reactle.example; 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 428 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 429 | SWIFT_VERSION = 5.0; 430 | VERSIONING_SYSTEM = "apple-generic"; 431 | }; 432 | name = Debug; 433 | }; 434 | 97C147071CF9000F007C117D /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | CLANG_ENABLE_MODULES = YES; 440 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 441 | ENABLE_BITCODE = NO; 442 | INFOPLIST_FILE = Runner/Info.plist; 443 | LD_RUNPATH_SEARCH_PATHS = ( 444 | "$(inherited)", 445 | "@executable_path/Frameworks", 446 | ); 447 | PRODUCT_BUNDLE_IDENTIFIER = com.reactle.example; 448 | PRODUCT_NAME = "$(TARGET_NAME)"; 449 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 450 | SWIFT_VERSION = 5.0; 451 | VERSIONING_SYSTEM = "apple-generic"; 452 | }; 453 | name = Release; 454 | }; 455 | /* End XCBuildConfiguration section */ 456 | 457 | /* Begin XCConfigurationList section */ 458 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 97C147031CF9000F007C117D /* Debug */, 462 | 97C147041CF9000F007C117D /* Release */, 463 | 249021D3217E4FDB00AE95B9 /* Profile */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 469 | isa = XCConfigurationList; 470 | buildConfigurations = ( 471 | 97C147061CF9000F007C117D /* Debug */, 472 | 97C147071CF9000F007C117D /* Release */, 473 | 249021D4217E4FDB00AE95B9 /* Profile */, 474 | ); 475 | defaultConfigurationIsVisible = 0; 476 | defaultConfigurationName = Release; 477 | }; 478 | /* End XCConfigurationList section */ 479 | }; 480 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 481 | } 482 | -------------------------------------------------------------------------------- /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 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/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 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:widget_and_text_animator/widget_and_text_animator.dart'; 6 | 7 | import 'samples.dart'; 8 | 9 | void main() { 10 | runApp(const MyApp()); 11 | } 12 | 13 | class MyApp extends StatelessWidget { 14 | const MyApp({Key? key}) : super(key: key); 15 | 16 | // This widget is the root of your application. 17 | @override 18 | Widget build(BuildContext context) { 19 | return MaterialApp( 20 | debugShowCheckedModeBanner: false, 21 | title: 'Flutter Demo', 22 | theme: ThemeData( 23 | primarySwatch: Colors.blue, 24 | ), 25 | home: const MyHomePage(title: 'Widget and text animator'), 26 | ); 27 | } 28 | } 29 | 30 | /// [MyHomePage] is a slightly tacky version of the default template app for flutter with the counter 31 | /// It's a close to the original version as possible, but trying to animate pretty much very bit of text and widget to 32 | /// give a simple example of how basic animations can be added very simply 33 | /// Wouldn't recommend animating everything like this in your app :D 34 | /// [Text] widgets have been replaced with [TextAnimator] widgets 35 | /// Buttons such as the [FloatingActionButton] has been wrapped with a [WidgetAnimator] 36 | /// A "Samples" button has also been added to get through at more examples of the animations possible 37 | class MyHomePage extends StatefulWidget { 38 | const MyHomePage({Key? key, required this.title}) : super(key: key); 39 | 40 | final String title; 41 | 42 | @override 43 | State createState() => _MyHomePageState(); 44 | } 45 | 46 | class _MyHomePageState extends State { 47 | int _counter = 0; 48 | 49 | ///standard _incrementCounter 50 | void _incrementCounter() { 51 | setState(() { 52 | // This call to setState tells the Flutter framework that something has 53 | // changed in this State, which causes it to rerun the build method below 54 | // so that the display can reflect the updated values. If we changed 55 | // _counter without calling setState(), then the build method would not be 56 | // called again, and so nothing would appear to happen. 57 | _counter++; 58 | }); 59 | } 60 | 61 | ///the normal example build method but using `TextAnimator` instead of `Text` and wrapping widgets in `WidgetAnimator` 62 | @override 63 | Widget build(BuildContext context) { 64 | // This method is rerun every time setState is called, for instance as done 65 | // by the _incrementCounter method above. 66 | // 67 | // The Flutter framework has been optimized to make rerunning build methods 68 | // fast, so that you can just rebuild anything that needs updating rather 69 | // than having to individually change instances of widgets. 70 | return Scaffold( 71 | appBar: AppBar( 72 | // Here we take the value from the MyHomePage object that was created by 73 | // the App.build method, and use it to set our appbar title. 74 | title: TextAnimator( 75 | widget.title, 76 | atRestEffect: WidgetRestingEffects.wave(), 77 | ), 78 | ), 79 | body: Center( 80 | // Center is a layout widget. It takes a single child and positions it 81 | // in the middle of the parent. 82 | child: Column( 83 | // Column is also a layout widget. It takes a list of children and 84 | // arranges them vertically. By default, it sizes itself to fit its 85 | // children horizontally, and tries to be as tall as its parent. 86 | // 87 | // Invoke "debug painting" (press "p" in the console, choose the 88 | // "Toggle Debug Paint" action from the Flutter Inspector in Android 89 | // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) 90 | // to see the wireframe for each widget. 91 | // 92 | // Column has various properties to control how it sizes itself and 93 | // how it positions its children. Here we use mainAxisAlignment to 94 | // center the children vertically; the main axis here is the vertical 95 | // axis because Columns are vertical (the cross axis would be 96 | // horizontal). 97 | mainAxisAlignment: MainAxisAlignment.center, 98 | children: [ 99 | const Expanded( 100 | child: SizedBox(), 101 | ), 102 | TextAnimator( 103 | 'You have pushed the button this many times:', 104 | atRestEffect: WidgetRestingEffects.pulse(effectStrength: 0.6), 105 | style: Theme.of(context).textTheme.bodyMedium, 106 | incomingEffect: WidgetTransitionEffects.incomingSlideInFromTop( 107 | blur: const Offset(0, 20), scale: 2), 108 | textAlign: TextAlign.center, 109 | ), 110 | const SizedBox( 111 | height: 20, 112 | ), 113 | TextAnimator( 114 | '$_counter', 115 | style: Theme.of(context).textTheme.bodyLarge, 116 | incomingEffect: WidgetTransitionEffects.incomingSlideInFromBottom( 117 | curve: Curves.bounceOut, 118 | duration: const Duration(milliseconds: 1500)), 119 | atRestEffect: WidgetRestingEffects.dangle(), 120 | outgoingEffect: WidgetTransitionEffects.outgoingSlideOutToRight(), 121 | ), 122 | const Expanded( 123 | child: SizedBox(), 124 | ), 125 | WidgetAnimator( 126 | incomingEffect: WidgetTransitionEffects( 127 | delay: const Duration(milliseconds: 1500), 128 | offset: const Offset(0, -30), 129 | curve: Curves.bounceOut, 130 | duration: const Duration(milliseconds: 900)), 131 | atRestEffect: WidgetRestingEffects.wave(), 132 | child: ElevatedButton( 133 | child: const Text('Samples'), 134 | onPressed: () { 135 | Navigator.of(context).push(Samples.route()); 136 | }), 137 | ), 138 | const SizedBox( 139 | height: 20, 140 | ), 141 | WidgetAnimator( 142 | incomingEffect: WidgetTransitionEffects( 143 | delay: const Duration(milliseconds: 1500), 144 | offset: const Offset(0, 30), 145 | curve: Curves.easeInOut, 146 | duration: const Duration(milliseconds: 1200)), 147 | child: GestureAnimator( 148 | curve: Curves.easeInOut, 149 | scaleSize: 0.9, 150 | yOffset: -5, 151 | duration: const Duration(milliseconds: 150), 152 | onLongPress: (){ 153 | print('on long press triggered'); 154 | }, 155 | onTapDown: (_){ 156 | print('on tap down'); 157 | }, 158 | onTapUp: (_){ 159 | print('on tap up'); 160 | }, 161 | 162 | // blurX: 2, 163 | // blurY: 2, 164 | numberOfPlays: 1, 165 | // rotation: pi / 16, 166 | opacity: 0.8, 167 | // skewX: 0.2, 168 | hapticFeedback: HapticFeedback.selectionClick, 169 | triggerOnTapAfterAnimationComplete: true, 170 | onTap: () { 171 | Navigator.of(context).push(Samples.route()); 172 | }, 173 | child: Padding( 174 | padding: const EdgeInsets.all(8.0), 175 | child: Container( 176 | decoration: BoxDecoration( 177 | color: Colors.yellow, 178 | borderRadius: BorderRadius.circular(8), 179 | ), 180 | child: const Padding( 181 | padding: EdgeInsets.all(12.0), 182 | child: Text( 183 | 'GestureAnimator', 184 | ), 185 | ), 186 | ), 187 | ), 188 | ), 189 | ), 190 | const SizedBox( 191 | height: 20, 192 | ), 193 | ], 194 | ), 195 | ), 196 | floatingActionButton: WidgetAnimator( 197 | atRestEffect: WidgetRestingEffects.size(), 198 | child: FloatingActionButton( 199 | isExtended: true, 200 | onPressed: _incrementCounter, 201 | tooltip: 'Increment', 202 | child: const Icon(Icons.add), 203 | ), 204 | ), // This trailing comma makes auto-formatting nicer for build methods. 205 | ); 206 | } 207 | } 208 | -------------------------------------------------------------------------------- /example/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 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.1" 44 | crypto: 45 | dependency: transitive 46 | description: 47 | name: crypto 48 | sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "3.0.3" 52 | cupertino_icons: 53 | dependency: "direct main" 54 | description: 55 | name: cupertino_icons 56 | sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.0.5" 60 | fake_async: 61 | dependency: transitive 62 | description: 63 | name: fake_async 64 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 65 | url: "https://pub.dev" 66 | source: hosted 67 | version: "1.3.1" 68 | ffi: 69 | dependency: transitive 70 | description: 71 | name: ffi 72 | sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 73 | url: "https://pub.dev" 74 | source: hosted 75 | version: "2.0.2" 76 | flutter: 77 | dependency: "direct main" 78 | description: flutter 79 | source: sdk 80 | version: "0.0.0" 81 | flutter_lints: 82 | dependency: "direct dev" 83 | description: 84 | name: flutter_lints 85 | sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 86 | url: "https://pub.dev" 87 | source: hosted 88 | version: "1.0.4" 89 | flutter_test: 90 | dependency: "direct dev" 91 | description: flutter 92 | source: sdk 93 | version: "0.0.0" 94 | google_fonts: 95 | dependency: "direct main" 96 | description: 97 | name: google_fonts 98 | sha256: e20ff62b158b96f392bfc8afe29dee1503c94fbea2cbe8186fd59b756b8ae982 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "5.1.0" 102 | http: 103 | dependency: transitive 104 | description: 105 | name: http 106 | sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "1.1.0" 110 | http_parser: 111 | dependency: transitive 112 | description: 113 | name: http_parser 114 | sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" 115 | url: "https://pub.dev" 116 | source: hosted 117 | version: "4.0.2" 118 | js: 119 | dependency: transitive 120 | description: 121 | name: js 122 | sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 123 | url: "https://pub.dev" 124 | source: hosted 125 | version: "0.6.7" 126 | lints: 127 | dependency: transitive 128 | description: 129 | name: lints 130 | sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c 131 | url: "https://pub.dev" 132 | source: hosted 133 | version: "1.0.1" 134 | matcher: 135 | dependency: transitive 136 | description: 137 | name: matcher 138 | sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" 139 | url: "https://pub.dev" 140 | source: hosted 141 | version: "0.12.15" 142 | material_color_utilities: 143 | dependency: transitive 144 | description: 145 | name: material_color_utilities 146 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 147 | url: "https://pub.dev" 148 | source: hosted 149 | version: "0.2.0" 150 | meta: 151 | dependency: transitive 152 | description: 153 | name: meta 154 | sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" 155 | url: "https://pub.dev" 156 | source: hosted 157 | version: "1.9.1" 158 | path: 159 | dependency: transitive 160 | description: 161 | name: path 162 | sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" 163 | url: "https://pub.dev" 164 | source: hosted 165 | version: "1.8.3" 166 | path_provider: 167 | dependency: transitive 168 | description: 169 | name: path_provider 170 | sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" 171 | url: "https://pub.dev" 172 | source: hosted 173 | version: "2.0.15" 174 | path_provider_android: 175 | dependency: transitive 176 | description: 177 | name: path_provider_android 178 | sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" 179 | url: "https://pub.dev" 180 | source: hosted 181 | version: "2.0.27" 182 | path_provider_foundation: 183 | dependency: transitive 184 | description: 185 | name: path_provider_foundation 186 | sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297" 187 | url: "https://pub.dev" 188 | source: hosted 189 | version: "2.2.4" 190 | path_provider_linux: 191 | dependency: transitive 192 | description: 193 | name: path_provider_linux 194 | sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 195 | url: "https://pub.dev" 196 | source: hosted 197 | version: "2.1.11" 198 | path_provider_platform_interface: 199 | dependency: transitive 200 | description: 201 | name: path_provider_platform_interface 202 | sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" 203 | url: "https://pub.dev" 204 | source: hosted 205 | version: "2.0.6" 206 | path_provider_windows: 207 | dependency: transitive 208 | description: 209 | name: path_provider_windows 210 | sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" 211 | url: "https://pub.dev" 212 | source: hosted 213 | version: "2.1.7" 214 | platform: 215 | dependency: transitive 216 | description: 217 | name: platform 218 | sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" 219 | url: "https://pub.dev" 220 | source: hosted 221 | version: "3.1.0" 222 | plugin_platform_interface: 223 | dependency: transitive 224 | description: 225 | name: plugin_platform_interface 226 | sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" 227 | url: "https://pub.dev" 228 | source: hosted 229 | version: "2.1.5" 230 | sky_engine: 231 | dependency: transitive 232 | description: flutter 233 | source: sdk 234 | version: "0.0.99" 235 | source_span: 236 | dependency: transitive 237 | description: 238 | name: source_span 239 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 240 | url: "https://pub.dev" 241 | source: hosted 242 | version: "1.9.1" 243 | stack_trace: 244 | dependency: transitive 245 | description: 246 | name: stack_trace 247 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 248 | url: "https://pub.dev" 249 | source: hosted 250 | version: "1.11.0" 251 | stream_channel: 252 | dependency: transitive 253 | description: 254 | name: stream_channel 255 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 256 | url: "https://pub.dev" 257 | source: hosted 258 | version: "2.1.1" 259 | string_scanner: 260 | dependency: transitive 261 | description: 262 | name: string_scanner 263 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 264 | url: "https://pub.dev" 265 | source: hosted 266 | version: "1.2.0" 267 | term_glyph: 268 | dependency: transitive 269 | description: 270 | name: term_glyph 271 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 272 | url: "https://pub.dev" 273 | source: hosted 274 | version: "1.2.1" 275 | test_api: 276 | dependency: transitive 277 | description: 278 | name: test_api 279 | sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb 280 | url: "https://pub.dev" 281 | source: hosted 282 | version: "0.5.1" 283 | typed_data: 284 | dependency: transitive 285 | description: 286 | name: typed_data 287 | sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c 288 | url: "https://pub.dev" 289 | source: hosted 290 | version: "1.3.2" 291 | vector_math: 292 | dependency: transitive 293 | description: 294 | name: vector_math 295 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 296 | url: "https://pub.dev" 297 | source: hosted 298 | version: "2.1.4" 299 | widget_and_text_animator: 300 | dependency: "direct main" 301 | description: 302 | path: ".." 303 | relative: true 304 | source: path 305 | version: "1.1.0" 306 | win32: 307 | dependency: transitive 308 | description: 309 | name: win32 310 | sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee 311 | url: "https://pub.dev" 312 | source: hosted 313 | version: "5.0.5" 314 | xdg_directories: 315 | dependency: transitive 316 | description: 317 | name: xdg_directories 318 | sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff 319 | url: "https://pub.dev" 320 | source: hosted 321 | version: "1.0.1" 322 | sdks: 323 | dart: ">=3.0.5 <4.0.0" 324 | flutter: ">=3.3.0" 325 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: Example project to showcase the widget and text animator 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter 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.1.1+1 19 | 20 | environment: 21 | sdk: '>=3.0.5 <4.0.0' 22 | 23 | # Dependencies specify other packages that your package needs in order to work. 24 | # To automatically upgrade your package dependencies to the latest versions 25 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 26 | # dependencies can be manually updated by changing the version numbers below to 27 | # the latest version available on pub.dev. To see which dependencies have newer 28 | # versions available, run `flutter pub outdated`. 29 | dependencies: 30 | flutter: 31 | sdk: flutter 32 | 33 | widget_and_text_animator: 34 | path: ../ 35 | 36 | google_fonts: ^5.1.0 37 | 38 | 39 | # The following adds the Cupertino Icons font to your application. 40 | # Use with the CupertinoIcons class for iOS style icons. 41 | cupertino_icons: ^1.0.5 42 | 43 | dev_dependencies: 44 | flutter_test: 45 | sdk: flutter 46 | 47 | # The "flutter_lints" package below contains a set of recommended lints to 48 | # encourage good coding practices. The lint set provided by the package is 49 | # activated in the `analysis_options.yaml` file located at the root of your 50 | # package. See that file for information about deactivating specific lint 51 | # rules and activating additional ones. 52 | flutter_lints: ^1.0.0 53 | 54 | # For information on the generic Dart part of this file, see the 55 | # following page: https://dart.dev/tools/pub/pubspec 56 | 57 | # The following section is specific to Flutter. 58 | flutter: 59 | assets: 60 | - assets/ 61 | # The following line ensures that the Material Icons font is 62 | # included with your application, so that you can use the icons in 63 | # the material Icons class. 64 | uses-material-design: true 65 | 66 | # To add assets to your application, add an assets section, like this: 67 | # assets: 68 | # - images/a_dot_burr.jpeg 69 | # - images/a_dot_ham.jpeg 70 | 71 | # An image asset can refer to one or more resolution-specific "variants", see 72 | # https://flutter.dev/assets-and-images/#resolution-aware. 73 | 74 | # For details regarding adding assets from package dependencies, see 75 | # https://flutter.dev/assets-and-images/#from-packages 76 | 77 | # To add custom fonts to your application, add a fonts section here, 78 | # in this "flutter" section. Each entry in this list should have a 79 | # "family" key with the font family name, and a "fonts" key with a 80 | # list giving the asset and other descriptors for the font. For 81 | # example: 82 | # fonts: 83 | # - family: Schyler 84 | # fonts: 85 | # - asset: fonts/Schyler-Regular.ttf 86 | # - asset: fonts/Schyler-Italic.ttf 87 | # style: italic 88 | # - family: Trajan Pro 89 | # fonts: 90 | # - asset: fonts/TrajanPro.ttf 91 | # - asset: fonts/TrajanPro_Bold.ttf 92 | # weight: 700 93 | # 94 | # For details regarding fonts from package dependencies, 95 | # see https://flutter.dev/custom-fonts/#from-packages 96 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | import 'package:example/main.dart'; 5 | 6 | void main() { 7 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 8 | // Build our app and trigger a frame. 9 | await tester.pumpWidget(const MyApp()); 10 | 11 | // Verify that our counter starts at 0. 12 | expect(find.text('0', findRichText: true), findsOneWidget); 13 | expect(find.text('1', findRichText: true), findsNothing); 14 | 15 | // Tap the '+' icon and trigger a frame. 16 | await tester.tap(find.byIcon(Icons.add)); 17 | await tester.pump(); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | example 33 | 34 | 35 | 36 | 39 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /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": "Example project to showcase the widget and text animator", 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 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /lib/src/styles/animation_settings.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// [AnimationSettings] is used to store the settings that drive all the animations, these are mostly [Animation] objects that tweens are set on 4 | /// they are initialised with default sensible options 5 | class AnimationSettings { 6 | Animation? opacityAnimation; 7 | Animation? scaleAnimation; 8 | Animation? offsetXAnimation; 9 | Animation? offsetYAnimation; 10 | Animation? blurXAnimation; 11 | Animation? blurYAnimation; 12 | Animation? rotationAnimation; 13 | Animation? skewXAnimation; 14 | Animation? skewYAnimation; 15 | Alignment? skewAlignment; 16 | Alignment? scaleAlignment; 17 | 18 | AnimationSettings( 19 | {required AnimationController animationController, 20 | this.opacityAnimation, 21 | this.scaleAnimation, 22 | this.offsetXAnimation, 23 | this.offsetYAnimation, 24 | this.blurXAnimation, 25 | this.blurYAnimation, 26 | this.rotationAnimation, 27 | this.scaleAlignment, 28 | this.skewAlignment, 29 | this.skewXAnimation, 30 | this.skewYAnimation}) { 31 | opacityAnimation = Tween(begin: 1, end: 1).animate( 32 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 33 | scaleAnimation = Tween(begin: 1, end: 1).animate( 34 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 35 | offsetXAnimation = Tween(begin: 0, end: 0).animate( 36 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 37 | offsetYAnimation = Tween(begin: 0, end: 0).animate( 38 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 39 | rotationAnimation = Tween(begin: 0, end: 0).animate( 40 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 41 | blurXAnimation = Tween(begin: 0, end: 0).animate( 42 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 43 | blurYAnimation = Tween(begin: 0, end: 0).animate( 44 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 45 | skewXAnimation = Tween(begin: 0, end: 0).animate( 46 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 47 | skewYAnimation = Tween(begin: 0, end: 0).animate( 48 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 49 | skewAlignment = Alignment.center; 50 | scaleAlignment = Alignment.center; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/src/styles/animation_style.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../widget_and_text_animator.dart'; 3 | 4 | /// [AnimationAtRestStyle] base abstract class for all 'At Rest' animation settings to use 5 | abstract class AnimationAtRestStyle { 6 | AnimationSettings getSettings( 7 | WidgetRestingEffects effects, AnimationController animationController); 8 | } 9 | 10 | /// [AnimationTransitionStyle] base abstract class for all transition animation settings to use 11 | abstract class AnimationTransitionStyle { 12 | AnimationSettings getSettings( 13 | WidgetTransitionEffects effects, AnimationController animationController); 14 | } 15 | -------------------------------------------------------------------------------- /lib/src/styles/animation_style_builder.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | 3 | import '../widget_animator.dart'; 4 | import 'animation_settings.dart'; 5 | 6 | /// [AtRestAnimationSettingsBuilder] used for custom builder for 'at rest' animations 7 | typedef AtRestAnimationSettingsBuilder = AnimationSettings Function( 8 | WidgetRestingEffects effects, AnimationController animationController); 9 | 10 | /// [TransitionAnimationSettingsBuilder] used for custom builder for 'transition' animations 11 | typedef TransitionAnimationSettingsBuilder = AnimationSettings Function( 12 | WidgetTransitionEffects effects, AnimationController animationController); 13 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_bounce.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | 3 | import '../../widget_animator.dart'; 4 | import '../animation_settings.dart'; 5 | import '../animation_style.dart'; 6 | 7 | /// At rest animation [AnimationStyleBounce] bounces the widget by lifting it up and bouncing it down 8 | class AnimationStyleBounce extends AnimationAtRestStyle { 9 | @override 10 | AnimationSettings getSettings( 11 | WidgetRestingEffects effects, AnimationController animationController) { 12 | AnimationSettings _animationSettings = 13 | AnimationSettings(animationController: animationController); 14 | 15 | double strength = -20.0; 16 | strength = (strength * effects.effectStrength!).clamp(-1000, 1000); 17 | 18 | _animationSettings.offsetYAnimation = TweenSequence( 19 | >[ 20 | TweenSequenceItem( 21 | tween: Tween(begin: 0, end: strength) 22 | .chain(CurveTween(curve: Curves.easeInOut)), 23 | weight: 50.0, 24 | ), 25 | TweenSequenceItem( 26 | tween: Tween(begin: strength, end: 0) 27 | .chain(CurveTween(curve: Curves.bounceOut)), 28 | weight: 50.0, 29 | ), 30 | ], 31 | ).animate( 32 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 33 | 34 | return _animationSettings; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_dangle.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | import '../../widget_animator.dart'; 4 | import '../animation_settings.dart'; 5 | import '../animation_style.dart'; 6 | 7 | /// At rest animation [AnimationStyleDangle] which skews the widget to the right and back to the left from the top of the widget 8 | /// giving it an effect of dangling 9 | class AnimationStyleDangle extends AnimationAtRestStyle { 10 | @override 11 | AnimationSettings getSettings( 12 | WidgetRestingEffects effects, AnimationController animationController) { 13 | AnimationSettings _animationSettings = 14 | AnimationSettings(animationController: animationController); 15 | 16 | double skewAmount = 0.2; 17 | 18 | skewAmount = (skewAmount * effects.effectStrength!); 19 | _animationSettings.skewAlignment = Alignment.topCenter; 20 | 21 | _animationSettings.skewXAnimation = TweenSequence( 22 | >[ 23 | TweenSequenceItem( 24 | tween: Tween(begin: 0, end: skewAmount) 25 | .chain(CurveTween(curve: Curves.linear)), 26 | weight: 25.0, 27 | ), 28 | TweenSequenceItem( 29 | tween: Tween(begin: skewAmount, end: -skewAmount) 30 | .chain(CurveTween(curve: Curves.linear)), 31 | weight: 50.0, 32 | ), 33 | TweenSequenceItem( 34 | tween: Tween(begin: -skewAmount, end: 0) 35 | .chain(CurveTween(curve: Curves.linear)), 36 | weight: 25.0, 37 | ), 38 | ], 39 | ).animate( 40 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 41 | 42 | return _animationSettings; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_fidget.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/animation.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | 6 | import '../../widget_animator.dart'; 7 | import '../animation_settings.dart'; 8 | import '../animation_style.dart'; 9 | 10 | /// At rest animation [AnimationStyleFidget] which randomly slightly moves the widget position around 11 | class AnimationStyleFidget extends AnimationAtRestStyle { 12 | @override 13 | AnimationSettings getSettings( 14 | WidgetRestingEffects effects, AnimationController animationController) { 15 | AnimationSettings _animationSettings = 16 | AnimationSettings(animationController: animationController); 17 | 18 | double effectStrength = effects.effectStrength!.clamp(0.3, 300); 19 | 20 | Random rnd = Random(); 21 | int min = (-5 * effectStrength).toInt().clamp(-50, 50); 22 | int max = (5 * effectStrength).toInt().clamp(-50, 50); 23 | 24 | List> xList = []; 25 | List> yList = []; 26 | 27 | int iterations = (_getRandomNumber(3, 10, rnd)).toInt(); 28 | double nextRandom = 0; 29 | double currentRandom = _getRandomNumber(min, max, rnd); 30 | 31 | xList.add( 32 | TweenSequenceItem( 33 | tween: Tween(begin: 0, end: currentRandom) 34 | .chain(CurveTween(curve: effects.curve!)), 35 | weight: 100 / (iterations + 2), 36 | ), 37 | ); 38 | for (int i = 0; i < iterations; i++) { 39 | nextRandom = _getRandomNumber(min, max, rnd); 40 | xList.add( 41 | TweenSequenceItem( 42 | tween: Tween(begin: currentRandom, end: nextRandom) 43 | .chain(CurveTween(curve: effects.curve!)), 44 | weight: 100 / (iterations + 2), 45 | ), 46 | ); 47 | currentRandom = nextRandom; 48 | } 49 | xList.add( 50 | TweenSequenceItem( 51 | tween: Tween(begin: currentRandom, end: 0) 52 | .chain(CurveTween(curve: effects.curve!)), 53 | weight: 100 / (iterations + 2), 54 | ), 55 | ); 56 | 57 | iterations = (_getRandomNumber(3, 10, rnd)).toInt(); 58 | nextRandom = 0; 59 | currentRandom = _getRandomNumber(min, max, rnd); 60 | yList.add( 61 | TweenSequenceItem( 62 | tween: Tween(begin: 0, end: currentRandom) 63 | .chain(CurveTween(curve: effects.curve!)), 64 | weight: 100 / (iterations + 2), 65 | ), 66 | ); 67 | for (int i = 0; i < iterations; i++) { 68 | nextRandom = _getRandomNumber(min, max, rnd); 69 | yList.add( 70 | TweenSequenceItem( 71 | tween: Tween(begin: currentRandom, end: nextRandom) 72 | .chain(CurveTween(curve: effects.curve!)), 73 | weight: 100 / (iterations + 2), 74 | ), 75 | ); 76 | currentRandom = nextRandom; 77 | } 78 | yList.add( 79 | TweenSequenceItem( 80 | tween: Tween(begin: currentRandom, end: 0) 81 | .chain(CurveTween(curve: effects.curve!)), 82 | weight: 100 / (iterations + 2), 83 | ), 84 | ); 85 | 86 | _animationSettings.offsetXAnimation = TweenSequence( 87 | >[for (var x in xList) x], 88 | ).animate( 89 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 90 | 91 | _animationSettings.offsetYAnimation = TweenSequence( 92 | >[for (var y in yList) y], 93 | ).animate( 94 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 95 | 96 | return _animationSettings; 97 | } 98 | 99 | double _getRandomNumber(int min, int max, Random rnd) { 100 | return (min + rnd.nextInt(max - min) + rnd.nextDouble()); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_none.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | 3 | import '../../widget_animator.dart'; 4 | import '../animation_settings.dart'; 5 | import '../animation_style.dart'; 6 | 7 | /// At rest animation [AnimationStyleNone] used when no animation is required 8 | class AnimationStyleNone extends AnimationAtRestStyle { 9 | @override 10 | AnimationSettings getSettings( 11 | WidgetRestingEffects effects, AnimationController animationController) { 12 | AnimationSettings _animationSettings = 13 | AnimationSettings(animationController: animationController); 14 | return _animationSettings; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_pulse.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | 3 | import '../../widget_animator.dart'; 4 | import '../animation_settings.dart'; 5 | import '../animation_style.dart'; 6 | 7 | /// At rest animation [AnimationStylePulse] for changing the opacity of the widget, the effect strength should be in a range of [0..1] 8 | class AnimationStylePulse extends AnimationAtRestStyle { 9 | @override 10 | AnimationSettings getSettings( 11 | WidgetRestingEffects effects, AnimationController animationController) { 12 | AnimationSettings _animationSettings = 13 | AnimationSettings(animationController: animationController); 14 | 15 | double strength = 1 - (effects.effectStrength!.clamp(0, 1)); 16 | 17 | _animationSettings.opacityAnimation = TweenSequence( 18 | >[ 19 | TweenSequenceItem( 20 | tween: Tween(begin: 1, end: strength) 21 | .chain(CurveTween(curve: Curves.ease)), 22 | weight: 50.0, 23 | ), 24 | TweenSequenceItem( 25 | tween: Tween(begin: strength, end: 1) 26 | .chain(CurveTween(curve: Curves.ease)), 27 | weight: 50.0, 28 | ), 29 | ], 30 | ).animate( 31 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 32 | 33 | return _animationSettings; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_rotate.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | import 'dart:math' as math; 3 | 4 | import '../../widget_animator.dart'; 5 | import '../animation_settings.dart'; 6 | import '../animation_style.dart'; 7 | 8 | /// At rest animation [AnimationAtRestStyle] rotates the widget around a center axis, using a [Curves.easeInOut] if you want a rest on each rotation 9 | class AnimationStyleRotate extends AnimationAtRestStyle { 10 | @override 11 | AnimationSettings getSettings( 12 | WidgetRestingEffects effects, AnimationController animationController) { 13 | AnimationSettings _animationSettings = 14 | AnimationSettings(animationController: animationController); 15 | 16 | _animationSettings.rotationAnimation = TweenSequence( 17 | >[ 18 | TweenSequenceItem( 19 | tween: Tween(begin: 0, end: math.pi / 0.5) 20 | .chain(CurveTween(curve: effects.curve!)), 21 | weight: 100.0, 22 | ), 23 | ], 24 | ).animate( 25 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 26 | 27 | return _animationSettings; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_size.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | 3 | import '../../widget_animator.dart'; 4 | import '../animation_settings.dart'; 5 | import '../animation_style.dart'; 6 | 7 | /// At rest animation [AnimationAtRestStyle] changes the size of the widget, small effect strength will shrink the scale (e.g. 0.5), larger numbers will grow the scale (e.g. 2) 8 | class AnimationStyleSize extends AnimationAtRestStyle { 9 | @override 10 | AnimationSettings getSettings( 11 | WidgetRestingEffects effects, AnimationController animationController) { 12 | AnimationSettings _animationSettings = 13 | AnimationSettings(animationController: animationController); 14 | 15 | double increaseScale = 1.25; 16 | increaseScale = (increaseScale * effects.effectStrength!).clamp(-500, 500); 17 | 18 | _animationSettings.scaleAnimation = TweenSequence( 19 | >[ 20 | TweenSequenceItem( 21 | tween: Tween(begin: 1, end: increaseScale) 22 | .chain(CurveTween(curve: Curves.easeIn)), 23 | weight: 50.0, 24 | ), 25 | TweenSequenceItem( 26 | tween: Tween(begin: increaseScale, end: 1) 27 | .chain(CurveTween(curve: Curves.easeOut)), 28 | weight: 50.0, 29 | ), 30 | ], 31 | ).animate( 32 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 33 | 34 | return _animationSettings; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_slide.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | import '../../widget_animator.dart'; 4 | import '../animation_settings.dart'; 5 | import '../animation_style.dart'; 6 | 7 | /// At rest animation [AnimationStyleSlide] skew the widget to the right and left on a center axis 8 | class AnimationStyleSlide extends AnimationAtRestStyle { 9 | @override 10 | AnimationSettings getSettings( 11 | WidgetRestingEffects effects, AnimationController animationController) { 12 | AnimationSettings _animationSettings = 13 | AnimationSettings(animationController: animationController); 14 | 15 | double skewAmount = 0.2; 16 | 17 | skewAmount = (skewAmount * effects.effectStrength!); //.clamp(-100, 100); 18 | _animationSettings.skewAlignment = Alignment.center; 19 | _animationSettings.skewXAnimation = TweenSequence( 20 | >[ 21 | TweenSequenceItem( 22 | tween: Tween(begin: 0, end: skewAmount) 23 | .chain(CurveTween(curve: Curves.linear)), 24 | weight: 25.0, 25 | ), 26 | TweenSequenceItem( 27 | tween: Tween(begin: skewAmount, end: -skewAmount) 28 | .chain(CurveTween(curve: Curves.linear)), 29 | weight: 50.0, 30 | ), 31 | TweenSequenceItem( 32 | tween: Tween(begin: -skewAmount, end: 0) 33 | .chain(CurveTween(curve: Curves.linear)), 34 | weight: 25.0, 35 | ), 36 | ], 37 | ).animate( 38 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 39 | 40 | return _animationSettings; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_swing.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | import 'dart:math' as math; 3 | import 'package:flutter/widgets.dart'; 4 | 5 | import '../../widget_animator.dart'; 6 | import '../animation_settings.dart'; 7 | import '../animation_style.dart'; 8 | 9 | /// At rest animation [AnimationStyleSwing] rotate the widget back and forward to give it a swinging effect, note a larger effect strength gives a smaller rotation 10 | /// and a smaller effect strength gives a bigger rotation 11 | class AnimationStyleSwing extends AnimationAtRestStyle { 12 | @override 13 | AnimationSettings getSettings( 14 | WidgetRestingEffects effects, AnimationController animationController) { 15 | AnimationSettings _animationSettings = 16 | AnimationSettings(animationController: animationController); 17 | 18 | double rotationAmount = 8; 19 | rotationAmount = 20 | (-rotationAmount * (effects.effectStrength!)).clamp(-300, 300); 21 | 22 | _animationSettings.rotationAnimation = TweenSequence( 23 | >[ 24 | TweenSequenceItem( 25 | tween: Tween(begin: 0, end: math.pi / rotationAmount) 26 | .chain(CurveTween(curve: Curves.easeOut)), 27 | weight: 25.0, 28 | ), 29 | TweenSequenceItem( 30 | tween: Tween( 31 | begin: math.pi / rotationAmount, 32 | end: -math.pi / rotationAmount) 33 | .chain(CurveTween(curve: Curves.easeInOut)), 34 | weight: 50.0, 35 | ), 36 | TweenSequenceItem( 37 | tween: Tween(begin: -math.pi / rotationAmount, end: 0) 38 | .chain(CurveTween(curve: Curves.easeIn)), 39 | weight: 25.0, 40 | ), 41 | ], 42 | ).animate( 43 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 44 | 45 | return _animationSettings; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_vibrate.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/animation.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | 6 | import '../../widget_animator.dart'; 7 | import '../animation_settings.dart'; 8 | import '../animation_style.dart'; 9 | 10 | /// At rest animation [AnimationStyleVibrate] vibrates the widget around from its default position randomly 11 | /// fast speeds will make a widget look to vibrate, can also be used on slow like a screensaver that occasionally 12 | /// moves the position of the display to prevent screen burn 13 | class AnimationStyleVibrate extends AnimationAtRestStyle { 14 | @override 15 | AnimationSettings getSettings( 16 | WidgetRestingEffects effects, AnimationController animationController) { 17 | AnimationSettings _animationSettings = 18 | AnimationSettings(animationController: animationController); 19 | double effectStrength = effects.effectStrength!.clamp(0.3, 300); 20 | 21 | Random rnd = Random(); 22 | int min = (-5 * effectStrength).toInt().clamp(-50, 50); 23 | int max = (5 * effectStrength).toInt().clamp(-50, 50); 24 | 25 | List> xList = []; 26 | List> yList = []; 27 | 28 | int iterations = (_getRandomNumber(3, 10, rnd)).toInt(); 29 | double nextRandom = 0; 30 | 31 | for (int i = 0; i < iterations; i++) { 32 | nextRandom = _getRandomNumber(min, max, rnd); 33 | xList.add( 34 | TweenSequenceItem( 35 | tween: Tween(begin: nextRandom, end: nextRandom) 36 | .chain(CurveTween(curve: Curves.linear)), 37 | weight: _getRandomNumber(10, 100, rnd), 38 | ), 39 | ); 40 | } 41 | 42 | iterations = (_getRandomNumber(3, 10, rnd)).toInt(); 43 | nextRandom = 0; 44 | for (int i = 0; i < iterations; i++) { 45 | nextRandom = _getRandomNumber(min, max, rnd); 46 | yList.add( 47 | TweenSequenceItem( 48 | tween: Tween(begin: nextRandom, end: nextRandom) 49 | .chain(CurveTween(curve: Curves.linear)), 50 | weight: _getRandomNumber(10, 100, rnd), 51 | ), 52 | ); 53 | } 54 | 55 | _animationSettings.offsetXAnimation = TweenSequence( 56 | >[for (var x in xList) x], 57 | ).animate( 58 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 59 | 60 | _animationSettings.offsetYAnimation = TweenSequence( 61 | >[for (var y in yList) y], 62 | ).animate( 63 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 64 | 65 | return _animationSettings; 66 | } 67 | 68 | double _getRandomNumber(int min, int max, Random rnd) { 69 | return (min + rnd.nextInt(max - min) + rnd.nextDouble()); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/src/styles/atRest/animation_style_wave.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | 4 | import '../../widget_animator.dart'; 5 | import '../animation_settings.dart'; 6 | import '../animation_style.dart'; 7 | 8 | /// At rest animation [AnimationStyleWave] which waves the widget up and down 9 | class AnimationStyleWave extends AnimationAtRestStyle { 10 | @override 11 | AnimationSettings getSettings( 12 | WidgetRestingEffects effects, AnimationController animationController) { 13 | AnimationSettings _animationSettings = 14 | AnimationSettings(animationController: animationController); 15 | 16 | double offset = 4; 17 | offset = (offset * effects.effectStrength!).clamp(-200, 200); 18 | 19 | _animationSettings.offsetYAnimation = TweenSequence( 20 | >[ 21 | TweenSequenceItem( 22 | tween: Tween(begin: 0, end: -offset) 23 | .chain(CurveTween(curve: Curves.easeOut)), 24 | weight: 25.0, 25 | ), 26 | TweenSequenceItem( 27 | tween: Tween(begin: -offset, end: offset) 28 | .chain(CurveTween(curve: Curves.easeInOut)), 29 | weight: 50.0, 30 | ), 31 | TweenSequenceItem( 32 | tween: Tween(begin: offset, end: 0) 33 | .chain(CurveTween(curve: Curves.easeIn)), 34 | weight: 25.0, 35 | ), 36 | ], 37 | ).animate( 38 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 39 | 40 | return _animationSettings; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/src/styles/transitions/animation_incoming_transition_offset_and_scale.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | 3 | import '../../../widget_and_text_animator.dart'; 4 | 5 | /// [AnimationIncomingTransitionOffsetAndScale] demonstration of more transition animations where various elements are animated at different times 6 | class AnimationIncomingTransitionOffsetAndScale 7 | extends AnimationTransitionStyle { 8 | @override 9 | AnimationSettings getSettings(WidgetTransitionEffects effects, 10 | AnimationController animationController) { 11 | AnimationSettings _animationSettings = 12 | AnimationSettings(animationController: animationController); 13 | 14 | double delay = (effects.delay?.inMilliseconds ?? 0).toDouble(); 15 | double duration = (effects.duration?.inMilliseconds ?? 300).toDouble(); 16 | 17 | _animationSettings.opacityAnimation = TweenSequence( 18 | >[ 19 | if (delay > 0) 20 | TweenSequenceItem( 21 | tween: Tween(begin: 0, end: 0) 22 | .chain(CurveTween(curve: Curves.linear)), 23 | weight: delay, 24 | ), 25 | TweenSequenceItem( 26 | tween: Tween(begin: 0, end: 0.7) 27 | .chain(CurveTween(curve: Curves.easeInOut)), 28 | weight: duration * 0.7, 29 | ), 30 | TweenSequenceItem( 31 | tween: Tween(begin: 0.7, end: 1) 32 | .chain(CurveTween(curve: Curves.linear)), 33 | weight: duration * 0.3, 34 | ), 35 | ], 36 | ).animate( 37 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 38 | 39 | _animationSettings.offsetYAnimation = TweenSequence( 40 | >[ 41 | if (delay > 0) 42 | TweenSequenceItem( 43 | tween: Tween(begin: 0, end: 0) 44 | .chain(CurveTween(curve: Curves.linear)), 45 | weight: delay, 46 | ), 47 | TweenSequenceItem( 48 | tween: Tween(begin: 50, end: 0) 49 | .chain(CurveTween(curve: Curves.easeIn)), 50 | weight: duration * 0.7, 51 | ), 52 | TweenSequenceItem( 53 | tween: Tween(begin: 0, end: 0) 54 | .chain(CurveTween(curve: Curves.easeOut)), 55 | weight: duration * 0.3, 56 | ), 57 | ], 58 | ).animate( 59 | CurvedAnimation(parent: animationController, curve: Curves.easeInOut)); 60 | 61 | _animationSettings.scaleAnimation = TweenSequence( 62 | >[ 63 | if (delay > 0) 64 | TweenSequenceItem( 65 | tween: Tween(begin: 0, end: 0) 66 | .chain(CurveTween(curve: Curves.linear)), 67 | weight: delay, 68 | ), 69 | TweenSequenceItem( 70 | tween: Tween(begin: 1.3, end: 1.3) 71 | .chain(CurveTween(curve: Curves.linear)), 72 | weight: duration * 0.7, 73 | ), 74 | TweenSequenceItem( 75 | tween: Tween(begin: 1.3, end: 1) 76 | .chain(CurveTween(curve: Curves.ease)), 77 | weight: duration * 0.3, 78 | ), 79 | ], 80 | ).animate( 81 | CurvedAnimation(parent: animationController, curve: Curves.easeInOut)); 82 | 83 | return _animationSettings; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/src/styles/transitions/animation_incoming_transition_offset_and_scale_and_step.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | 3 | import '../../../widget_and_text_animator.dart'; 4 | 5 | /// [AnimationIncomingTransitionOffsetAndScaleAndStep] demonstration of more transition animations where various elements are animated at different times 6 | class AnimationIncomingTransitionOffsetAndScaleAndStep 7 | extends AnimationTransitionStyle { 8 | @override 9 | AnimationSettings getSettings(WidgetTransitionEffects effects, 10 | AnimationController animationController) { 11 | AnimationSettings _animationSettings = 12 | AnimationSettings(animationController: animationController); 13 | 14 | double delay = (effects.delay?.inMilliseconds ?? 0).toDouble(); 15 | double duration = (effects.duration?.inMilliseconds ?? 300).toDouble(); 16 | 17 | _animationSettings.opacityAnimation = TweenSequence( 18 | >[ 19 | if (delay > 0) 20 | TweenSequenceItem( 21 | tween: Tween(begin: 0, end: 0) 22 | .chain(CurveTween(curve: Curves.linear)), 23 | weight: delay, 24 | ), 25 | TweenSequenceItem( 26 | tween: Tween(begin: 0, end: 1) 27 | .chain(CurveTween(curve: Curves.easeInOut)), 28 | weight: duration * 0.3, 29 | ), 30 | TweenSequenceItem( 31 | tween: Tween(begin: 1, end: 1) 32 | .chain(CurveTween(curve: Curves.linear)), 33 | weight: duration * 0.2, 34 | ), 35 | TweenSequenceItem( 36 | tween: Tween(begin: 1, end: 1) 37 | .chain(CurveTween(curve: Curves.linear)), 38 | weight: duration * 0.2, 39 | ), 40 | TweenSequenceItem( 41 | tween: Tween(begin: 1, end: 1) 42 | .chain(CurveTween(curve: Curves.linear)), 43 | weight: duration * 0.2, 44 | ), 45 | ], 46 | ).animate( 47 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 48 | 49 | _animationSettings.offsetYAnimation = TweenSequence( 50 | >[ 51 | if (delay > 0) 52 | TweenSequenceItem( 53 | tween: Tween(begin: 0, end: 0) 54 | .chain(CurveTween(curve: Curves.linear)), 55 | weight: delay, 56 | ), 57 | TweenSequenceItem( 58 | tween: Tween(begin: 50, end: -5) 59 | .chain(CurveTween(curve: Curves.easeIn)), 60 | weight: duration * 0.3, 61 | ), 62 | TweenSequenceItem( 63 | tween: Tween(begin: -5, end: -5) 64 | .chain(CurveTween(curve: Curves.easeOut)), 65 | weight: duration * 0.2, 66 | ), 67 | TweenSequenceItem( 68 | tween: Tween(begin: -5, end: -5) 69 | .chain(CurveTween(curve: Curves.easeOut)), 70 | weight: duration * 0.2, 71 | ), 72 | TweenSequenceItem( 73 | tween: Tween(begin: -5, end: 0) 74 | .chain(CurveTween(curve: Curves.fastLinearToSlowEaseIn)), 75 | weight: duration * 0.2, 76 | ), 77 | ], 78 | ).animate( 79 | CurvedAnimation(parent: animationController, curve: Curves.easeInOut)); 80 | 81 | _animationSettings.scaleAnimation = TweenSequence( 82 | >[ 83 | if (delay > 0) 84 | TweenSequenceItem( 85 | tween: Tween(begin: 0, end: 0) 86 | .chain(CurveTween(curve: Curves.linear)), 87 | weight: delay, 88 | ), 89 | TweenSequenceItem( 90 | tween: Tween(begin: 1.2, end: 1.2) 91 | .chain(CurveTween(curve: Curves.linear)), 92 | weight: duration * 0.3, 93 | ), 94 | TweenSequenceItem( 95 | tween: Tween(begin: 1.2, end: 1.2) 96 | .chain(CurveTween(curve: Curves.ease)), 97 | weight: duration * 0.2, 98 | ), 99 | TweenSequenceItem( 100 | tween: Tween(begin: 1.2, end: 1) 101 | .chain(CurveTween(curve: Curves.ease)), 102 | weight: duration * 0.2, 103 | ), 104 | TweenSequenceItem( 105 | tween: Tween(begin: 1, end: 1) 106 | .chain(CurveTween(curve: Curves.ease)), 107 | weight: duration * 0.2, 108 | ), 109 | ], 110 | ).animate( 111 | CurvedAnimation(parent: animationController, curve: Curves.easeInOut)); 112 | 113 | return _animationSettings; 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /lib/src/styles/transitions/animation_outgoing_transition_offset_and_scale.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/animation.dart'; 2 | 3 | import '../../../widget_and_text_animator.dart'; 4 | 5 | /// [AnimationOutgoingTransitionOffsetAndScale] demonstration of more transition animations where various elements are animated at different times 6 | class AnimationOutgoingTransitionOffsetAndScale 7 | extends AnimationTransitionStyle { 8 | @override 9 | AnimationSettings getSettings(WidgetTransitionEffects effects, 10 | AnimationController animationController) { 11 | AnimationSettings _animationSettings = 12 | AnimationSettings(animationController: animationController); 13 | 14 | double delay = (effects.delay?.inMilliseconds ?? 0).toDouble(); 15 | double duration = (effects.duration?.inMilliseconds ?? 300).toDouble(); 16 | 17 | _animationSettings.opacityAnimation = TweenSequence( 18 | >[ 19 | if (delay > 0) 20 | TweenSequenceItem( 21 | tween: Tween(begin: 1, end: 1) 22 | .chain(CurveTween(curve: Curves.linear)), 23 | weight: delay, 24 | ), 25 | TweenSequenceItem( 26 | tween: Tween(begin: 1, end: 0) 27 | .chain(CurveTween(curve: Curves.easeInOut)), 28 | weight: duration), 29 | ], 30 | ).animate( 31 | CurvedAnimation(parent: animationController, curve: Curves.linear)); 32 | 33 | _animationSettings.offsetYAnimation = TweenSequence( 34 | >[ 35 | if (delay > 0) 36 | TweenSequenceItem( 37 | tween: Tween(begin: 0, end: 0) 38 | .chain(CurveTween(curve: Curves.linear)), 39 | weight: delay, 40 | ), 41 | TweenSequenceItem( 42 | tween: Tween(begin: 0, end: 0) 43 | .chain(CurveTween(curve: Curves.ease)), 44 | weight: duration * 0.3, 45 | ), 46 | TweenSequenceItem( 47 | tween: Tween(begin: 0, end: 70) 48 | .chain(CurveTween(curve: Curves.ease)), 49 | weight: duration * 0.7, 50 | ), 51 | ], 52 | ).animate( 53 | CurvedAnimation(parent: animationController, curve: Curves.easeInOut)); 54 | 55 | _animationSettings.scaleAnimation = TweenSequence( 56 | >[ 57 | if (delay > 0) 58 | TweenSequenceItem( 59 | tween: Tween(begin: 1, end: 1) 60 | .chain(CurveTween(curve: Curves.linear)), 61 | weight: delay, 62 | ), 63 | TweenSequenceItem( 64 | tween: Tween(begin: 1, end: 1.2) 65 | .chain(CurveTween(curve: Curves.linear)), 66 | weight: duration * 0.3, 67 | ), 68 | TweenSequenceItem( 69 | tween: Tween(begin: 1.2, end: 1.2) 70 | .chain(CurveTween(curve: Curves.ease)), 71 | weight: duration * 0.7, 72 | ), 73 | ], 74 | ).animate( 75 | CurvedAnimation(parent: animationController, curve: Curves.easeInOut)); 76 | 77 | return _animationSettings; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lib/src/text_animator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:widget_and_text_animator/src/widget_animator.dart'; 3 | 4 | /// The [TextAnimator] is a direct placement for the standard [Text] widget 5 | /// It makes use of the [WidgetAnimator] class to allow many different transition effects 6 | /// The class allows you to transition in individual characters or words together to create some cool effects 7 | class TextAnimator extends StatefulWidget { 8 | ///the [String] of text to display 9 | final String text; 10 | 11 | /// [WidgetTransitionEffects] The incoming effect to show when the text is first shown 12 | final WidgetTransitionEffects? incomingEffect; 13 | 14 | /// [WidgetTransitionEffects] The outgoing effect to show when the text is about to be replaced 15 | final WidgetTransitionEffects? outgoingEffect; 16 | 17 | /// [WidgetRestingEffects] The effect to show when the text is not transitioning on or off the screen 18 | final WidgetRestingEffects? atRestEffect; 19 | 20 | /// [int] the maximum number of lines of text to show within the widget, used in the same way as the standard [Text] widget 21 | final int? maxLines; 22 | 23 | /// The [TextAlign] of the text, in the same was it's used in the [Text] widget 24 | final TextAlign? textAlign; 25 | 26 | /// The [TextStyle] of the text, in the same was it's used in the [Text] widget 27 | final TextStyle? style; 28 | 29 | /// A [Duration] delay before the text initially starts to show 30 | final Duration? initialDelay; 31 | 32 | /// [Duration] a delay to leave between each character of text to display to create a 33 | /// staggered text animation effect, if you want words to appear at once, then set a Duration of zero 34 | final Duration? characterDelay; 35 | 36 | /// [Duration] a delay to leave between each space/word 37 | /// if set the same as the characterDelay the timing will be consistent for all characters 38 | /// can be used to drive the timing per word if characterDelay is set to zero 39 | final Duration? spaceDelay; 40 | 41 | /// Standard constructor for the text animator 42 | const TextAnimator(this.text, 43 | {Key? key, 44 | this.incomingEffect, 45 | this.outgoingEffect, 46 | this.atRestEffect, 47 | this.onIncomingAnimationComplete, 48 | this.onOutgoingAnimationComplete, 49 | this.maxLines, 50 | this.textAlign, 51 | this.style, 52 | this.initialDelay, 53 | this.characterDelay, 54 | this.spaceDelay}) 55 | : super(key: key); 56 | 57 | /// [Function] will be called when the last incoming animation character has completed its transition 58 | final Function(Key?)? onIncomingAnimationComplete; 59 | 60 | /// [Function] will be called when the last outgoing animation character has completed its transition 61 | final Function(Key?)? onOutgoingAnimationComplete; 62 | 63 | @override 64 | State createState() => _TextAnimatorState(); 65 | } 66 | 67 | class _TextAnimatorState extends State { 68 | ///list for holding all the words in the incoming text, split up 69 | final List _words = []; 70 | 71 | ///the text from the widget 72 | String _text = ''; 73 | 74 | ///is the text currently showing the outgoing animation (this is used to trigger a redraw of the text to get it animating again) 75 | bool _outgoing = false; 76 | 77 | ///a list for holding each word and character with the delays before triggering the animation 78 | final List> _incomingDelays = 79 | []; //the delays of each incoming character broken into words and then characters 80 | 81 | @override 82 | void initState() { 83 | super.initState(); 84 | _text = widget.text; 85 | _initWords(); 86 | } 87 | 88 | ///initialise the words in the string by splitting them and calculating the delays for showing them 89 | void _initWords() { 90 | ///split the text into words 91 | _words.clear(); 92 | _incomingDelays.clear(); 93 | List temp = []; 94 | temp = _text.split(' '); 95 | for (var element in temp) { 96 | _words.add(element = '$element '); 97 | } 98 | _words.last = _words.last.trim(); 99 | 100 | ///calculate the delays between each incoming character and store 101 | Duration delay = const Duration(milliseconds: 0); 102 | for (int i = 0; i < _words.length; i++) { 103 | List wordDelays = []; 104 | if (i > 0) { 105 | delay = delay + (widget.spaceDelay ?? const Duration(milliseconds: 80)); 106 | } else { 107 | delay = 108 | delay + (widget.initialDelay ?? const Duration(milliseconds: 0)); 109 | } 110 | for (int j = 0; j < (_words[i]).characters.length; j++) { 111 | delay = 112 | delay + (widget.characterDelay ?? const Duration(milliseconds: 40)); 113 | wordDelays.add(delay); 114 | } 115 | _incomingDelays.add(wordDelays); 116 | } 117 | } 118 | 119 | ///mark as outgoing, this will force the animation to rebuild and trigger the outgoing text 120 | void _textChangedOutgoing() async { 121 | _outgoing = true; 122 | if (mounted) { 123 | setState(() {}); 124 | } 125 | } 126 | 127 | ///force a redraw and update the words array with the next set of words to use 128 | void _textChangedReplaced(Key? p1) async { 129 | _outgoing = false; 130 | _text = widget.text; 131 | _initWords(); 132 | if (mounted) { 133 | setState(() {}); 134 | } 135 | } 136 | 137 | @override 138 | Widget build(BuildContext context) { 139 | ///detect text changes 140 | if (widget.text != _text) { 141 | _textChangedOutgoing(); 142 | } 143 | 144 | ///Use [RichText] to display each individual characters with delays as specified in the _incomingDelays 145 | return RichText( 146 | key: ValueKey( 147 | _text), //needs a key otherwise the old widget will be reused and if the new text is longer than the old text, you get a break in the animation between the two sections 148 | softWrap: true, 149 | maxLines: widget.maxLines, 150 | textAlign: widget.textAlign ?? TextAlign.start, 151 | text: TextSpan( 152 | style: widget.style, 153 | children: [ 154 | for (int i = 0; i < _words.length; i++) 155 | WidgetSpan( 156 | child: Wrap( 157 | children: [ 158 | for (int j = 0; j < (_words[i]).characters.length; j++) 159 | WidgetAnimator( 160 | incomingEffect: WidgetTransitionEffects.withStyle( 161 | opacity: widget.incomingEffect?.opacity, 162 | scale: widget.incomingEffect?.scale, 163 | offset: widget.incomingEffect?.offset, 164 | rotation: widget.incomingEffect?.rotation, 165 | blur: widget.incomingEffect?.blur, 166 | curve: widget.incomingEffect?.curve, 167 | skew: widget.incomingEffect?.skew, 168 | duration: widget.incomingEffect?.duration, 169 | builder: widget.incomingEffect?.builder, 170 | style: widget.incomingEffect?.style ?? 171 | WidgetTransitionEffectStyle.none, 172 | delay: _incomingDelays[i][j], 173 | ), 174 | outgoingEffect: widget.outgoingEffect, 175 | atRestEffect: widget.atRestEffect, 176 | onIncomingAnimationComplete: (_isLastCharacter(i, j)) 177 | ? widget.onIncomingAnimationComplete 178 | : null, 179 | onOutgoingAnimationComplete: (_isLastCharacter(i, j)) 180 | ? _triggerLastOutgoingAnimation 181 | : null, 182 | child: Text( 183 | _words[i].characters.characterAt(j).string, 184 | key: ValueKey('$_text-text$i-$j-$_outgoing'), 185 | style: widget.style, 186 | )) 187 | ], 188 | )), 189 | ], 190 | )); 191 | } 192 | 193 | ///we need to know which is the last character animation to trigger on outgoing events to know when to switch over onto the next text 194 | _isLastCharacter(int i, int j) { 195 | return i == _words.length - 1 && j == _words[i].characters.length - 1; 196 | } 197 | 198 | ///when the last animation character triggers, now it's time to replace the text with the new incoming text 199 | _triggerLastOutgoingAnimation(Key? p1) { 200 | _textChangedReplaced(p1); 201 | if (widget.onOutgoingAnimationComplete != null) { 202 | widget.onOutgoingAnimationComplete!(p1); 203 | } 204 | } 205 | } 206 | -------------------------------------------------------------------------------- /lib/src/text_animator_sequence.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../widget_and_text_animator.dart'; 5 | 6 | /// [TextAnimatorSequence] allows you to provide a list of [TextAnimator] widgets and have them show in sequence 7 | /// The sequence can progress based upon a duration set or by the user tapping on the widget (or both) 8 | class TextAnimatorSequence extends StatefulWidget { 9 | const TextAnimatorSequence( 10 | {Key? key, 11 | required this.children, 12 | this.tapToProceed, 13 | this.loop, 14 | this.transitionTime, 15 | this.onPressed}) 16 | : super(key: key); 17 | 18 | ///List of [TextAnimator] objects to display in the order you want them displaying 19 | final List children; 20 | 21 | /// [bool] do you want the user to be able to tab on the widget to proceed to the next text, default is false 22 | final bool? tapToProceed; 23 | 24 | /// [bool] once the end of the sequence is reached, does the list loop back ground to the start again, default is false 25 | final bool? loop; 26 | 27 | /// [Duration] The length of time to wait between changing the text once in input transition has completed, 28 | /// not specifying a duration will mean it won't change the sequence automatically 29 | final Duration? transitionTime; 30 | 31 | /// [Function] callback function to perform if the Text is pressed on 32 | final Function? onPressed; 33 | 34 | @override 35 | State createState() => _TextAnimatorSequenceState(); 36 | } 37 | 38 | class _TextAnimatorSequenceState extends State { 39 | int currentChildToRender = 0; 40 | Timer _timer = Timer(const Duration(seconds: 1), () {}); 41 | 42 | @override 43 | void dispose() { 44 | super.dispose(); 45 | _timer.cancel(); 46 | } 47 | 48 | @override 49 | Widget build(BuildContext context) { 50 | TextAnimator textAnimatorToShow = widget.children[currentChildToRender]; 51 | 52 | return GestureDetector( 53 | onTap: () { 54 | _timer.cancel(); 55 | if (widget.tapToProceed ?? false) { 56 | ///move onto the next item in the sequence if clicked on 57 | int nextChild = _getNextChild(); 58 | if (mounted) { 59 | if (currentChildToRender != nextChild) { 60 | setState(() { 61 | currentChildToRender = nextChild; 62 | }); 63 | } 64 | } 65 | if (widget.onPressed != null) { 66 | widget.onPressed!(); 67 | } 68 | } 69 | }, 70 | child: TextAnimator( 71 | textAnimatorToShow.text, 72 | style: textAnimatorToShow.style, 73 | incomingEffect: textAnimatorToShow.incomingEffect, 74 | outgoingEffect: textAnimatorToShow.outgoingEffect, 75 | atRestEffect: textAnimatorToShow.atRestEffect, 76 | onIncomingAnimationComplete: (key) { 77 | ///trigger the callback function if specified 78 | if (textAnimatorToShow.onIncomingAnimationComplete != null) { 79 | textAnimatorToShow.onIncomingAnimationComplete!(key); 80 | } 81 | 82 | if (widget.transitionTime != null) { 83 | ///set a time which once complete will move the text onto the next in the sequence 84 | _timer = Timer(widget.transitionTime!, () { 85 | if (mounted) { 86 | int nextChild = _getNextChild(); 87 | if (currentChildToRender != nextChild) { 88 | setState(() { 89 | currentChildToRender = nextChild; 90 | }); 91 | } 92 | } 93 | }); 94 | } 95 | }, 96 | onOutgoingAnimationComplete: 97 | textAnimatorToShow.onOutgoingAnimationComplete, 98 | textAlign: textAnimatorToShow.textAlign, 99 | characterDelay: textAnimatorToShow.characterDelay, 100 | spaceDelay: textAnimatorToShow.spaceDelay, 101 | initialDelay: textAnimatorToShow.initialDelay, 102 | maxLines: textAnimatorToShow.maxLines, 103 | )); 104 | } 105 | 106 | ///get the next child in the list of children to change to, if set to loop then loop back to the start at the end 107 | ///if not set to loop and at the end, return the current child 108 | int _getNextChild() { 109 | int nextChild = currentChildToRender + 1; 110 | if (nextChild >= widget.children.length) { 111 | ///loop back around the children if set to loop 112 | if ((widget.loop ?? false) == true) { 113 | nextChild = 0; 114 | } else { 115 | ///or keep on the same child if not set to loop 116 | nextChild = nextChild - 1; 117 | } 118 | } 119 | return nextChild; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /lib/src/widget_animator_sequence.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../widget_and_text_animator.dart'; 5 | 6 | /// [WidgetAnimatorSequence] allows you to provide a list of [WidgetAnimator] widgets and have them show in sequence 7 | /// The sequence can progress based upon a duration set or by the user tapping on the widget (or both) 8 | class WidgetAnimatorSequence extends StatefulWidget { 9 | const WidgetAnimatorSequence( 10 | {Key? key, 11 | required this.children, 12 | this.tapToProceed, 13 | this.loop, 14 | this.transitionTime, 15 | this.onPressed}) 16 | : super(key: key); 17 | 18 | ///List of [WidgetAnimator] objects to display in the order you want them displaying 19 | final List children; 20 | 21 | /// [bool] do you want the user to be able to tab on the widget to proceed to the next text, default is false 22 | final bool? tapToProceed; 23 | 24 | /// [bool] once the end of the sequence is reached, does the list loop back ground to the start again, default is false 25 | final bool? loop; 26 | 27 | /// [Duration] The length of time to wait between changing the widget once in input transition has completed, 28 | /// not specifying a duration will mean it won't change the sequence automatically 29 | final Duration? transitionTime; 30 | 31 | /// [Function] callback function to perform if the Widget is pressed on 32 | final Function? onPressed; 33 | 34 | @override 35 | State createState() => _WidgetAnimatorSequenceState(); 36 | } 37 | 38 | class _WidgetAnimatorSequenceState extends State { 39 | int currentChildToRender = 0; 40 | Timer _timer = Timer(const Duration(seconds: 1), () {}); 41 | 42 | @override 43 | void dispose() { 44 | super.dispose(); 45 | _timer.cancel(); 46 | } 47 | 48 | @override 49 | Widget build(BuildContext context) { 50 | WidgetAnimator widgetAnimatorToShow = widget.children[currentChildToRender]; 51 | 52 | return GestureDetector( 53 | onTap: () { 54 | _timer.cancel(); 55 | if (widget.tapToProceed ?? false) { 56 | ///move onto the next item in the sequence if clicked on 57 | int nextChild = _getNextChild(); 58 | if (mounted) { 59 | if (currentChildToRender != nextChild) { 60 | setState(() { 61 | currentChildToRender = nextChild; 62 | }); 63 | } 64 | } 65 | if (widget.onPressed != null) { 66 | widget.onPressed!(); 67 | } 68 | } 69 | }, 70 | child: WidgetAnimator( 71 | outgoingEffect: widgetAnimatorToShow.outgoingEffect, 72 | incomingEffect: widgetAnimatorToShow.incomingEffect, 73 | atRestEffect: widgetAnimatorToShow.atRestEffect, 74 | child: Container( 75 | key: ValueKey('widget$currentChildToRender'), 76 | child: widgetAnimatorToShow.child, 77 | ), 78 | onIncomingAnimationComplete: (key) { 79 | ///trigger the callback function if specified 80 | if (widgetAnimatorToShow.onIncomingAnimationComplete != null) { 81 | widgetAnimatorToShow.onIncomingAnimationComplete!(key); 82 | } 83 | 84 | ///set a time which once complete will move the text onto the next in the sequence 85 | if (widget.transitionTime != null) { 86 | _timer = Timer(widget.transitionTime!, () { 87 | if (mounted) { 88 | int nextChild = _getNextChild(); 89 | if (currentChildToRender != nextChild) { 90 | setState(() { 91 | currentChildToRender = nextChild; 92 | }); 93 | } 94 | } 95 | }); 96 | } 97 | }, 98 | onOutgoingAnimationComplete: 99 | widgetAnimatorToShow.onOutgoingAnimationComplete)); 100 | } 101 | 102 | ///get the next child in the list of children to change to, if set to loop then loop back to the start at the end 103 | ///if not set to loop and at the end, return the current child 104 | int _getNextChild() { 105 | int nextChild = currentChildToRender + 1; 106 | if (nextChild >= widget.children.length) { 107 | ///loop back around the children if set to loop 108 | if ((widget.loop ?? false) == true) { 109 | nextChild = 0; 110 | } else { 111 | ///or keep on the same child if not set to loop 112 | nextChild = nextChild - 1; 113 | } 114 | } 115 | return nextChild; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /lib/widget_and_text_animator.dart: -------------------------------------------------------------------------------- 1 | //_Widget and text animation_ is a library with an extensive list of cool animations for widget and text 2 | library widget_and_text_animator; 3 | 4 | export 'src/widget_animator.dart'; 5 | export 'src/widget_animator_sequence.dart'; 6 | export 'src/text_animator.dart'; 7 | export 'src/text_animator_sequence.dart'; 8 | export 'src/styles/animation_settings.dart'; 9 | export 'src/styles/animation_style.dart'; 10 | export 'src/styles/atRest/animation_style_bounce.dart'; 11 | export 'src/styles/animation_style_builder.dart'; 12 | export 'src/styles/atRest/animation_style_dangle.dart'; 13 | export 'src/styles/atRest/animation_style_fidget.dart'; 14 | export 'src/styles/atRest/animation_style_none.dart'; 15 | export 'src/styles/atRest/animation_style_pulse.dart'; 16 | export 'src/styles/atRest/animation_style_rotate.dart'; 17 | export 'src/styles/atRest/animation_style_size.dart'; 18 | export 'src/styles/atRest/animation_style_slide.dart'; 19 | export 'src/styles/atRest/animation_style_swing.dart'; 20 | export 'src/styles/atRest/animation_style_vibrate.dart'; 21 | export 'src/styles/atRest/animation_style_wave.dart'; 22 | -------------------------------------------------------------------------------- /logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/logo.gif -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | # Steps to take before publishing 2 | # 3 | # change pubspec.yaml version 4 | # change changelog.md 5 | # change line 13 readme.md 6 | # dart format . 7 | # dart pub publish --dry-run 8 | # dart pub publish 9 | 10 | 11 | name: widget_and_text_animator 12 | description: Make animating widgets a breeze with many effects built in. Make Text animations beautiful with staggered text effects. transitions, blurs & more, animate gestures too 13 | version: 1.1.5 14 | homepage: https://github.com/andrewpmoore/widget_and_text_animator 15 | 16 | environment: 17 | sdk: '>=3.0.5 <4.0.0' 18 | flutter: ">=1.17.0" 19 | 20 | dependencies: 21 | flutter: 22 | sdk: flutter 23 | 24 | dev_dependencies: 25 | flutter_test: 26 | sdk: flutter 27 | flutter_lints: ^1.0.0 28 | lints: ^1.0.1 29 | 30 | # For information on the generic Dart part of this file, see the 31 | # following page: https://dart.dev/tools/pub/pubspec 32 | 33 | # The following section is specific to Flutter. 34 | flutter: 35 | 36 | 37 | screenshots: 38 | - description: 'Widget and text animator sample' 39 | path: title.png 40 | - description: 'WidgetAnimator sample' 41 | path: wave.gif 42 | - description: 'TextAnimator sample' 43 | path: text_sample.gif 44 | - description: 'Widget sequence sample' 45 | path: widget_sequence.gif -------------------------------------------------------------------------------- /test/widget_and_text_animator_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | -------------------------------------------------------------------------------- /text_sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/text_sample.gif -------------------------------------------------------------------------------- /title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/title.png -------------------------------------------------------------------------------- /wave.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/wave.gif -------------------------------------------------------------------------------- /widget_sequence.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewpmoore/widget_and_text_animator/195716e8373dcab4742365f33223c2b906fbc32f/widget_sequence.gif --------------------------------------------------------------------------------