From cc8b9d272d810f6f8a5715c336769986afb25d8a Mon Sep 17 00:00:00 2001 From: ashutoshsingh05 <201851029@iiitvadodara.ac.in> Date: Tue, 21 Apr 2020 20:10:29 +0530 Subject: [PATCH] Update README --- README.md | 41 +++++++++++++++++++++++++++++--------- lib/show_up_animation.dart | 20 +++++++++---------- pubspec.yaml | 1 - 3 files changed, 42 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 66e2eec..509024a 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,37 @@ -# show_up_animation +# show_up_animation [![Build Status](https://travis-ci.com/ashutoshsingh05/show_up_animation.svg?branch=master)](https://travis-ci.com/ashutoshsingh05/show_up_animation) -A new Flutter package project. +A flutter package to simplify implementation of "show up" animation in flutter ## Getting Started -This project is a starting point for a Dart -[package](https://flutter.dev/developing-packages/), -a library module containing code that can be shared easily across -multiple Flutter or Dart projects. +Install dependencies -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +```yaml +dependencies: + show_up_animation: ^0.0.1 +``` + +Then import wherever you want to implement the animation + +```dart +import 'package:show_up_animation/show_up_animation.dart'; +``` + +Wrap any widget you want to animate inside `ShowUpAnimation` widget and provide a `Duration()` to `delayStart` field to control after how much delay the animation fires. + +## Properties + +You can customize how to do you want to animate your `child` using the parameters described below. + +| Property | Function | +| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| child | The widget on which to apply the given `ShowUpAnimation` | +| offset | The offset by which to slide and [child] into view from [Direction]. Use negative value to reverse animation [direction]. Defaults to 0.2 | +| curve | The curve used to animate the [child] into view. Defaults to [Curves.easeIn] | +| direction | horizontal or vertical | +| delayStart | The delay with which to animate the [child]. Takes in a [Duration] and defaults to 0 seconds | +| animationDuration | The total duration in which the animation completes. Defaults to 800 milliseconds | + +## Examples + +![videotogif_2020 04 21_19 44 01](https://user-images.githubusercontent.com/42690541/79876554-d2d4fd00-8408-11ea-9b8e-550954f618f3.gif) diff --git a/lib/show_up_animation.dart b/lib/show_up_animation.dart index 7ad6165..aa2318a 100644 --- a/lib/show_up_animation.dart +++ b/lib/show_up_animation.dart @@ -8,27 +8,27 @@ import 'package:flutter/material.dart'; enum Direction { vertical, horizontal } class ShowUpAnimation extends StatefulWidget { - ///The child on which to apply the given [ShowUpAnimation] + /// The child on which to apply the given [ShowUpAnimation] final Widget child; - ///The offset by which to slide and [child] into view from [Direction]. - ///Defaults to 0.2 + /// The offset by which to slide and [child] into view from [Direction]. + /// Use negative value to reverse animation [direction].Defaults to 0.2 final double offset; - ///The curve used to animate the [child] into view. - ///Defaults to [Curves.easeIn] + /// The curve used to animate the [child] into view. + /// Defaults to [Curves.easeIn] final Curve curve; - ///The direction from which to animate the [child] into view. [Direction.horizontal] - ///will make the child slide on x-axis by [offset] and [Direction.vertical] on y-axis. - ///Defaults to [Direction.vertical] + /// The direction from which to animate the [child] into view. [Direction.horizontal] + /// will make the child slide on x-axis by [offset] and [Direction.vertical] on y-axis. + /// Defaults to [Direction.vertical] final Direction direction; - ///The delay with which to animate the [child]. Takes in a [Duration] and + /// The delay with which to animate the [child]. Takes in a [Duration] and /// defaults to 0.0 seconds final Duration delayStart; - ///The total duration in which the animation completes. Defaults to 800 milliseconds + /// The total duration in which the animation completes. Defaults to 800 milliseconds final Duration animationDuration; ShowUpAnimation({ diff --git a/pubspec.yaml b/pubspec.yaml index b2477ec..2ee33bc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,6 @@ name: show_up_animation description: A flutter package to simplify implementation of "show up" animation in flutter version: 0.0.1 -author: Ashutosh Singh<201851029@iiitvadodara.ac.in> homepage: https://github.com/ashutoshsingh05/show_up_animation environment: