Skip to content

Commit

Permalink
[auto_animated] Bump 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeShkurko committed Dec 17, 2019
1 parent d4719bf commit a4412a6
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 101 deletions.
4 changes: 4 additions & 0 deletions packages/auto_animated/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.0

* Fixed lexical error in `AutoAnimatedIconButton` (`firstToolip` & `secondToolip` renamed to `firstTooltip` & secondTooltip)

## 1.3.0-dev.5

* Fixed error when timer not initialized
Expand Down
25 changes: 21 additions & 4 deletions packages/auto_animated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,28 @@ Widget _buildAnimatedItem(
end: Offset.zero,
).animate(animation),
// Paste you Widget
child: YouWidgetHere(),
child: YouWidgetHere(title: index.toString()),
),
)
```

## `AutoAnimatedSliverGrid` usage example

```dart
AutoAnimatedSliverGrid(
delay: Duration(milliseconds: 500) * 4,
showItemInterval: Duration(milliseconds: 500),
showItemDuration: Duration(seconds: 1),
itemCount: 6,
itemBuilder: animationItemBuilder(
(index) => YouWidgetHere(title: index.toString()),
),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
),
)
```

## `AutoAnimatedIconButton` usage example
### Basic
```dart
Expand All @@ -77,11 +94,11 @@ AutoAnimatedIconButton(
onPressed: () {},
)
```
### With separate toolips
### With separate tooltips
```dart
AutoAnimatedIconButton(
icon: AnimatedIcons.arrow_menu,
firstToolip: 'Event',
secondToolip: 'Add',
firstTooltip: 'Event',
secondTooltip: 'Add',
)
```
29 changes: 15 additions & 14 deletions packages/auto_animated/example/lib/screens/grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class _AutoAnimatedGridExampleState extends State<AutoAnimatedGridExample> {
@override
void initState() {
Future.delayed(Duration(milliseconds: 500) * 5, () {
if (!mounted) {
return;
}
setState(() {
itemsCount += 10;
});
Expand All @@ -21,20 +24,18 @@ class _AutoAnimatedGridExampleState extends State<AutoAnimatedGridExample> {
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: AutoAnimatedGrid(
showItemInterval: Duration(milliseconds: 500),
showItemDuration: Duration(seconds: 1),
itemCount: itemsCount,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
Widget build(BuildContext context) => Scaffold(
body: SafeArea(
child: AutoAnimatedGrid(
showItemInterval: Duration(milliseconds: 500),
showItemDuration: Duration(seconds: 1),
itemCount: itemsCount,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
),
itemBuilder: animationItemBuilder(
(index) => HorizontalItem(title: index.toString())),
),
itemBuilder: animationItemBuilder(
(index) => HorizontalItem(title: index.toString())),
),
),
);
}
);
}
76 changes: 37 additions & 39 deletions packages/auto_animated/example/lib/screens/icon_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,44 @@ class _AutoAnimatedIconButtonExampleState
bool _externalState = false;

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: EdgeInsets.all(16),
child: AppBar(
primary: false,
title: Text('Auto animated Icon'),
// Implement animated icon
leading: AutoAnimatedIconButton(
icon: AnimatedIcons.menu_close,
firstToolip: 'Menu',
secondToolip: 'Close',
onPressed: () {},
Widget build(BuildContext context) => Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: EdgeInsets.all(16),
child: AppBar(
primary: false,
title: Text('Auto animated Icon'),
// Implement animated icon
leading: AutoAnimatedIconButton(
icon: AnimatedIcons.menu_close,
firstTooltip: 'Menu',
secondTooltip: 'Close',
onPressed: () {},
),
),
),
),
AutoAnimatedIconButton.externalState(
icon: AnimatedIcons.arrow_menu,
onPressed: () {
setState(() {
_externalState = !_externalState;
});
},
iconState: !_externalState ? IconState.first : IconState.second,
),
AutoAnimatedIconButton(
icon: AnimatedIcons.play_pause,
onPressed: () {},
),
AutoAnimatedIconButton(
icon: AnimatedIcons.search_ellipsis,
onPressed: () {},
),
],
AutoAnimatedIconButton.externalState(
icon: AnimatedIcons.arrow_menu,
onPressed: () {
setState(() {
_externalState = !_externalState;
});
},
iconState: !_externalState ? IconState.first : IconState.second,
),
AutoAnimatedIconButton(
icon: AnimatedIcons.play_pause,
onPressed: () {},
),
AutoAnimatedIconButton(
icon: AnimatedIcons.search_ellipsis,
onPressed: () {},
),
],
),
),
),
);
}
);
}
20 changes: 11 additions & 9 deletions packages/auto_animated/example/lib/screens/sliver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ class SliverExample extends StatelessWidget {
SliverPadding(
padding: EdgeInsets.all(16),
sliver: AutoAnimatedSliverGrid(
delay: Duration(milliseconds: 500) * 4,
showItemInterval: Duration(milliseconds: 500),
showItemDuration: Duration(seconds: 1),
itemCount: 6,
itemBuilder: animationItemBuilder(
(index) => HorizontalItem(title: index.toString())),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
)),
delay: Duration(milliseconds: 500) * 4,
showItemInterval: Duration(milliseconds: 500),
showItemDuration: Duration(seconds: 1),
itemCount: 6,
itemBuilder: animationItemBuilder(
(index) => HorizontalItem(title: index.toString()),
),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
),
),
)
],
),
Expand Down
2 changes: 1 addition & 1 deletion packages/auto_animated/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.3.0-dev.5"
version: "1.3.0"
boolean_selector:
dependency: transitive
description:
Expand Down
14 changes: 7 additions & 7 deletions packages/auto_animated/lib/src/icon_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
enum IconState { first, second }

///Creates an AnimatedIcon which is automaically animated.
///Creates an AnimatedIcon which is automatically animated.
///
///The [icon] and [onPressed] are required.
///[icon] cannot be null.
Expand All @@ -32,8 +32,8 @@ class AutoAnimatedIconButton extends StatefulWidget {
this.focusNode,
this.semanticLabel,
this.textDirection,
this.firstToolip,
this.secondToolip,
this.firstTooltip,
this.secondTooltip,
}) : iconState = null,
super(key: key);

Expand All @@ -55,15 +55,15 @@ class AutoAnimatedIconButton extends StatefulWidget {
this.focusNode,
this.semanticLabel,
this.textDirection,
this.firstToolip,
this.secondToolip,
this.firstTooltip,
this.secondTooltip,
}) : super(key: key);

final AnimatedIconData icon;
final Function onPressed;
final Duration duration;
final Color splashColor, hoverColor;
final String firstToolip, secondToolip, semanticLabel;
final String firstTooltip, secondTooltip, semanticLabel;
final double size;
final EdgeInsetsGeometry padding;
final AlignmentGeometry alignment;
Expand Down Expand Up @@ -134,7 +134,7 @@ class _AutoAnimatedIconButtonState extends State<AutoAnimatedIconButton>
onPressed: _onPressed,
splashColor: widget.splashColor,
hoverColor: widget.hoverColor,
tooltip: !_isPressed ? widget.firstToolip : widget.secondToolip,
tooltip: !_isPressed ? widget.firstTooltip : widget.secondTooltip,
iconSize: widget.size,
padding: widget.padding,
alignment: widget.alignment,
Expand Down
2 changes: 1 addition & 1 deletion packages/auto_animated/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: auto_animated
description: Widgets starting auto play animation when mounted. It is already possible to animate the list and icons.
version: 1.3.0-dev.5
version: 1.3.0
author: Serge Shkurko <sergeshkurko@outlook.com>
homepage: https://github.com/rbcprolabs/packages.flutter/tree/master/packages/auto_animated

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
Expand Down Expand Up @@ -39,7 +38,6 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
3AAAD1612F3F80D493B394F2 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
Expand All @@ -54,6 +52,9 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CAF299D3D15708246AEABBE0 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
D6E55656A65A91BB53719F03 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
F746E5650ECC70938C853B2C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -73,6 +74,9 @@
09037512C9FEFC32EC0E6879 /* Pods */ = {
isa = PBXGroup;
children = (
CAF299D3D15708246AEABBE0 /* Pods-Runner.debug.xcconfig */,
D6E55656A65A91BB53719F03 /* Pods-Runner.release.xcconfig */,
F746E5650ECC70938C853B2C /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
Expand All @@ -88,7 +92,6 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
Expand Down Expand Up @@ -207,7 +210,6 @@
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -270,25 +272,23 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
"${BUILT_PRODUCTS_DIR}/native_pdf_renderer/native_pdf_renderer.framework",
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
"${BUILT_PRODUCTS_DIR}/native_pdf_view/native_pdf_view.framework",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/native_pdf_renderer.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/native_pdf_view.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
Loading

0 comments on commit a4412a6

Please sign in to comment.