A group of widgets, methods and extension to improve your coding experience. Some features were taken from this great repository of flutter and dart tricks: flutter-tips-and-tricks.
Other features were obtained from stack overflow and others blogs 😅. Thanks to all of them.
Features
-
Animations
- Reveal animation
- Shake animation
-
Extensions
- Duration
- Iterable
- String
- Widget
Installation
Just add this to your pubspec.yaml
:
dependencies:
power_ups: ^0.1.1
Or
dependencies:
power_ups:
git: https://github.com/alejandrogiubel/power_ups.git
Usage
- Reveal animation
widget.withRevealAnimation
- Delayed reveal animation
widget.withDelayedRevealAnimation(const Duration(microseconds: 200))
- Shake animation
late AnimationController animationController;
widget.withShakeAnimation(
(controller) {
animationController = controller;
},
animationWidth: 5, //Horizontal size of the animation. Optional. Default 10.
animationDuration: Duration(milliseconds: 100) //Animation duration. Optional. Default 370 milliseconds.
),
ElevatedButton(
onPressed: () {
animationController.forward(from: 0.0);
},
child: Text('Do shake'),
),
- Map with index
List list = ['apple', 'banana', 'mango'];
list.mapWithIndex(
(index, value) {
print(index);
print(value);
},
);
- String utils
String name = 'john doe';
name.inCapFirst; // John doe
name.allInCaps; //JOHN DOE
name.capitalizeFirstOfEach; // John Doe
- Duration to text
Duration duration = const Duration(seconds: 3);
print(duration.toText()); // 00:03
Additional information
PR are welcome
Libraries
- animations/animations
- animations/reveal_animation/delayed_reveal_animation
- animations/reveal_animation/reveal_animation
- animations/shake_animation/shake_animation
- extensions/column_extension
- extensions/duration_extension
- extensions/extensions
- extensions/iterable_extension
- extensions/row_extension
- extensions/string_extension
- extensions/widget_extension
- power_ups
- utils/utils