Skip to content

Commit

Permalink
Merge pull request #42 from bahricanyesil/develop
Browse files Browse the repository at this point in the history
Ready for V1.2.1
  • Loading branch information
bahricanyesil authored Jan 27, 2022
2 parents 1db2587 + 1f173e6 commit 79ac76f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Versions

## [1.2.1] - 27.01.2022

* Fixed the auth mode change behavior on mobile.
* Optimized the spaces/paddings between form and action button for mobile.

## [1.2.0] - 27.01.2022

* Optimized the use of AnimatedBuilder to avoid unnecessary rebuilds.
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.2.0"
version: "1.2.1"
animations:
dependency: transitive
description:
Expand Down
19 changes: 9 additions & 10 deletions lib/animated_login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -517,20 +517,19 @@ class __ViewState extends State<_View> with SingleTickerProviderStateMixin {
auth.setIsReverse(welcomeTransitionAnimation.value <=
context.read<LoginTheme>().formWidthRatio / 2);
} else if (_forwardCheck) {
auth.setIsReverse(!auth.isReverse);
auth.setIsReverse(false);
} else if (_reverseCheck) {
auth.setIsReverse(true);
}
}
});
}

bool get _forwardCheck => _isLandscape
? welcomeTransitionAnimation.value <=
context.read<LoginTheme>().formWidthRatio / 2
: welcomeTransitionAnimation.value <= -100 && _statusCheck;
bool get _forwardCheck =>
welcomeTransitionAnimation.value > 0 &&
welcomeTransitionAnimation.status == AnimationStatus.forward;

bool get _statusCheck =>
(welcomeTransitionAnimation.status == AnimationStatus.forward &&
_isReverse) ||
(welcomeTransitionAnimation.status == AnimationStatus.reverse &&
!_isReverse);
bool get _reverseCheck =>
welcomeTransitionAnimation.value < 0 &&
welcomeTransitionAnimation.status == AnimationStatus.reverse;
}
14 changes: 11 additions & 3 deletions lib/src/widgets/form_part.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,22 @@ class __FormPartState extends State<_FormPart> {
loginTheme.spacingWithoutSocial ?? dynamicSize.height * 6,
),
_form,
SizedBox(
height: loginTheme.spacingFormAndAction ??
dynamicSize.height * (_isLandscape ? 4 : 3)),
SizedBox(height: loginTheme.spacingFormAndAction ?? _customSpace),
_actionButton,
],
),
);

double get _customSpace {
double factor = 3;
if (_isLandscape) {
factor = 4;
} else if (_isReverse) {
factor = 0.5;
}
return dynamicSize.height * factor;
}

List<Widget> get _socialLoginPart => <Widget>[
SizedBox(height: dynamicSize.height * 2.5),
_socialLoginOptions,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: animated_login
description: Animated Login for Flutter. You can welcome your users with this beautiful animated screen that gives functionality for both login and sign up.
version: 1.2.0
version: 1.2.1
homepage: https://github.com/bahricanyesil/flutter-animated-login
repository: https://github.com/bahricanyesil/flutter-animated-login

Expand Down

0 comments on commit 79ac76f

Please sign in to comment.