Skip to content

Commit

Permalink
Added new package: auto_animated, updated license
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeShkurko committed Oct 31, 2019
1 parent 3079977 commit ee802be
Show file tree
Hide file tree
Showing 75 changed files with 2,055 additions and 19 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ Common plugins for flutter framework

## Available plugins

| Plugin | Version | Source code |
|---|---|---|
| [native_pdf_renderer][native_pdf_renderer_pub] | ![pub package][native_pdf_renderer_badge] | [`packages/native_pdf_renderer`][native_pdf_renderer_code] |
| [native_pdf_view][native_pdf_view_pub] | ![pub package][native_pdf_view_badge] | [`packages/native_pdf_view`][native_pdf_view_code] |
| [native_color][native_color_pub] | ![pub package][native_color_badge] | [`packages/native_color`][native_color_code] |
| Plugin | Source code |
|---|---|
| [![pub package][native_pdf_renderer_badge]][native_pdf_renderer_pub] | [`packages/native_pdf_renderer`][native_pdf_renderer_code] |
| [![pub package][native_pdf_view_badge]][native_pdf_view_pub] | [`packages/native_pdf_view`][native_pdf_view_code] |
| [![pub package][native_color_badge]][native_color_pub] | [`packages/native_color`][native_color_code] |
| [![pub package][auto_animated_badge]][auto_animated_pub] | [`packages/auto_animated`][auto_animated_code] |


[native_pdf_renderer_pub]: https://pub.dartlang.org/packages/native_pdf_renderer
Expand All @@ -21,4 +22,8 @@ Common plugins for flutter framework

[native_color_pub]: https://pub.dartlang.org/packages/native_color
[native_color_code]: https://github.com/rbcprolabs/flutter_plugins/tree/master/packages/native_color
[native_color_badge]: https://img.shields.io/pub/v/native_color.svg
[native_color_badge]: https://img.shields.io/pub/v/native_color.svg

[auto_animated_pub]: https://pub.dartlang.org/packages/auto_animated
[auto_animated_code]: https://github.com/rbcprolabs/flutter_plugins/tree/master/packages/auto_animated
[auto_animated_badge]: https://img.shields.io/pub/v/auto_animated.svg
7 changes: 7 additions & 0 deletions packages/auto_animated/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
.dart_tool/

.packages
.pub/

build/
10 changes: 10 additions & 0 deletions packages/auto_animated/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f
channel: stable

project_type: plugin
3 changes: 3 additions & 0 deletions packages/auto_animated/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

* Initial release.
21 changes: 21 additions & 0 deletions packages/auto_animated/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 RBC, Serge Shkurko

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
63 changes: 63 additions & 0 deletions packages/auto_animated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Auto animated

Auto animated list

## Screenshots
<p float="left">
<img src='./example/media/horizontal.gif' width="30%">
<img src='./example/media/vertical.gif' width="30%" hspace="4%">
<img src='./example/media/combined.gif' width="30%">
</p>

## Getting Started
In your flutter project add the dependency:

[![pub package](https://img.shields.io/pub/v/auto_animated.svg)](https://pub.dartlang.org/packages/auto_animated)

```dart
dependencies:
...
auto_animated: any
```
For help getting started with Flutter, view the online [documentation](https://flutter.io/).

## Usage example
### **It very simple!**

```dart
AutoAnimatedList(
// Start animation after (default zero)
delay: Duration(seconds: 1),
// Show each item through
showItemInterval: Duration(milliseconds: 500),
// Animation duration
showItemDuration: Duration(seconds: 1),
// Other properties correspond to the `AnimatedList` widget
scrollDirection: Axis.horizontal,
itemsCount: 10,
itemBuilder: _buildAnimatedItem,
)
// Build item
Widget _buildAnimatedItem(
BuildContext context,
int index,
Animation<double> animation,
) =>
// Wrap with fade transition
FadeTransition(
opacity: Tween<double>(
begin: 0,
end: 1,
).animate(animation),
// And slide transition
child: SlideTransition(
position: Tween<Offset>(
begin: Offset(0, -0.1),
end: Offset.zero,
).animate(animation),
// Paste you Widget
child: YouWidgetHere(),
),
)
```
73 changes: 73 additions & 0 deletions packages/auto_animated/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
/build/

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
10 changes: 10 additions & 0 deletions packages/auto_animated/example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f
channel: stable

project_type: app
81 changes: 81 additions & 0 deletions packages/auto_animated/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Example of usage `auto_animated`

```dart
import 'package:flutter/material.dart';
import 'package:auto_animated/auto_animated.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
home: Scaffold(
backgroundColor: Colors.grey[100],
appBar: AppBar(
title: Text('Auto animated example'),
),
body: Column(
children: <Widget>[
SizedBox(
height: 200,
child: AutoAnimatedList(
showItemInterval: Duration(milliseconds: 500),
showItemDuration: Duration(seconds: 1),
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 24),
scrollDirection: Axis.horizontal,
itemsCount: 10,
itemBuilder: _buildAnimatedItem,
),
),
],
),
),
);
/// Wrap Ui item with animation & padding
Widget _buildAnimatedItem(
BuildContext context,
int index,
Animation<double> animation,
) =>
FadeTransition(
opacity: Tween<double>(
begin: 0,
end: 1,
).animate(animation),
child: SlideTransition(
position: Tween<Offset>(
begin: Offset(0, -0.1),
end: Offset.zero,
).animate(animation),
child: Padding(
padding: EdgeInsets.only(right: 32),
child: _buildCard(index.toString()),
),
),
);
/// UI item for showing
Widget _buildCard(String text) => Builder(
builder: (context) => Container(
width: 140,
child: ClipRRect(
borderRadius: BorderRadius.circular(4),
child: Material(
color: Colors.lime,
child: Center(
child: Text(
text,
style: Theme.of(context)
.textTheme
.display1
.copyWith(color: Colors.black),
),
),
),
),
),
);
}
```
67 changes: 67 additions & 0 deletions packages/auto_animated/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.auto_animated_example"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.auto_animated_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Loading

0 comments on commit ee802be

Please sign in to comment.