Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions packages/animations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 2.1.0

* Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.
* Updates Java compatibility version to 17.
* If required, Updates minimum supported SDK version to Flutter 3.35/Dart 3.9.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "If required" is kind of confusing for a client-facing message. If you don't want to manually trim the line out of the packages that don't need it, I would just say "Sets minimum supported SDK version to Flutter 3.35/Dart 3.9."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If required was so that I could have the same message in all changelogs and handled the case where some plugins had already bumped to 3.35.


## 2.0.11

Expand Down
6 changes: 3 additions & 3 deletions packages/animations/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ android {
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '11'
jvmTarget = JavaVersion.VERSION_17.toString()
}

sourceSets {
Expand Down
7 changes: 3 additions & 4 deletions packages/animations/example/lib/container_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ class _OpenContainerTransformDemoState
onPressed: (int index) {
setModalState(() {
setState(() {
_transitionType =
index == 0
? ContainerTransitionType.fade
: ContainerTransitionType.fadeThrough;
_transitionType = index == 0
? ContainerTransitionType.fade
: ContainerTransitionType.fadeThrough;
});
});
},
Expand Down
32 changes: 16 additions & 16 deletions packages/animations/example/lib/fade_scale_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ class _FadeScaleTransitionDemoState extends State<FadeScaleTransitionDemo>

@override
void initState() {
_controller = AnimationController(
value: 0.0,
duration: const Duration(milliseconds: 150),
reverseDuration: const Duration(milliseconds: 75),
vsync: this,
)..addStatusListener((AnimationStatus status) {
setState(() {
// setState needs to be called to trigger a rebuild because
// the 'HIDE FAB'/'SHOW FAB' button needs to be updated based
// the latest value of [_controller.status].
});
});
_controller =
AnimationController(
value: 0.0,
duration: const Duration(milliseconds: 150),
reverseDuration: const Duration(milliseconds: 75),
vsync: this,
)..addStatusListener((AnimationStatus status) {
setState(() {
// setState needs to be called to trigger a rebuild because
// the 'HIDE FAB'/'SHOW FAB' button needs to be updated based
// the latest value of [_controller.status].
});
});
super.initState();
}

Expand Down Expand Up @@ -99,10 +100,9 @@ class _FadeScaleTransitionDemoState extends State<FadeScaleTransitionDemo>
_controller.forward();
}
},
child:
_isAnimationRunningForwardsOrComplete
? const Text('HIDE FAB')
: const Text('SHOW FAB'),
child: _isAnimationRunningForwardsOrComplete
? const Text('HIDE FAB')
: const Text('SHOW FAB'),
),
],
),
Expand Down
23 changes: 12 additions & 11 deletions packages/animations/example/lib/fade_through_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ class _FadeThroughTransitionDemoState extends State<FadeThroughTransitionDemo> {
return Scaffold(
appBar: AppBar(title: const Text('Fade through')),
body: PageTransitionSwitcher(
transitionBuilder: (
Widget child,
Animation<double> animation,
Animation<double> secondaryAnimation,
) {
return FadeThroughTransition(
animation: animation,
secondaryAnimation: secondaryAnimation,
child: child,
);
},
transitionBuilder:
(
Widget child,
Animation<double> animation,
Animation<double> secondaryAnimation,
) {
return FadeThroughTransition(
animation: animation,
secondaryAnimation: secondaryAnimation,
child: child,
);
},
child: pageList[pageIndex],
),
bottomNavigationBar: BottomNavigationBar(
Expand Down
25 changes: 13 additions & 12 deletions packages/animations/example/lib/shared_axis_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,19 @@ class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
Expanded(
child: PageTransitionSwitcher(
reverse: !_isLoggedIn,
transitionBuilder: (
Widget child,
Animation<double> animation,
Animation<double> secondaryAnimation,
) {
return SharedAxisTransition(
animation: animation,
secondaryAnimation: secondaryAnimation,
transitionType: _transitionType!,
child: child,
);
},
transitionBuilder:
(
Widget child,
Animation<double> animation,
Animation<double> secondaryAnimation,
) {
return SharedAxisTransition(
animation: animation,
secondaryAnimation: secondaryAnimation,
transitionType: _transitionType!,
child: child,
);
},
child: _isLoggedIn ? _CoursePage() : _SignInPage(),
),
),
Expand Down
4 changes: 2 additions & 2 deletions packages/animations/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ publish_to: none
version: 0.0.1

environment:
sdk: ^3.7.0
flutter: ">=3.29.0"
sdk: ^3.9.0
flutter: ">=3.35.0"

dependencies:
animations:
Expand Down
40 changes: 17 additions & 23 deletions packages/animations/lib/src/fade_scale_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,29 +137,23 @@ class FadeScaleTransition extends StatelessWidget {
Widget build(BuildContext context) {
return DualTransitionBuilder(
animation: animation,
forwardBuilder: (
BuildContext context,
Animation<double> animation,
Widget? child,
) {
return FadeTransition(
opacity: _fadeInTransition.animate(animation),
child: ScaleTransition(
scale: _scaleInTransition.animate(animation),
child: child,
),
);
},
reverseBuilder: (
BuildContext context,
Animation<double> animation,
Widget? child,
) {
return FadeTransition(
opacity: _fadeOutTransition.animate(animation),
child: child,
);
},
forwardBuilder:
(BuildContext context, Animation<double> animation, Widget? child) {
return FadeTransition(
opacity: _fadeInTransition.animate(animation),
child: ScaleTransition(
scale: _scaleInTransition.animate(animation),
child: child,
),
);
},
reverseBuilder:
(BuildContext context, Animation<double> animation, Widget? child) {
return FadeTransition(
opacity: _fadeOutTransition.animate(animation),
child: child,
);
},
child: child,
);
}
Expand Down
22 changes: 8 additions & 14 deletions packages/animations/lib/src/fade_through_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,14 @@ class _ZoomedFadeInFadeOut extends StatelessWidget {
Widget build(BuildContext context) {
return DualTransitionBuilder(
animation: animation,
forwardBuilder: (
BuildContext context,
Animation<double> animation,
Widget? child,
) {
return _ZoomedFadeIn(animation: animation, child: child);
},
reverseBuilder: (
BuildContext context,
Animation<double> animation,
Widget? child,
) {
return _FadeOut(animation: animation, child: child);
},
forwardBuilder:
(BuildContext context, Animation<double> animation, Widget? child) {
return _ZoomedFadeIn(animation: animation, child: child);
},
reverseBuilder:
(BuildContext context, Animation<double> animation, Widget? child) {
return _FadeOut(animation: animation, child: child);
},
child: child,
);
}
Expand Down
79 changes: 39 additions & 40 deletions packages/animations/lib/src/open_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -279,28 +279,29 @@ class _OpenContainerState<T> extends State<OpenContainer<T?>> {
Future<void> openContainer() async {
final Color middleColor =
widget.middleColor ?? Theme.of(context).canvasColor;
final T? data = await Navigator.of(
context,
rootNavigator: widget.useRootNavigator,
).push(
_OpenContainerRoute<T>(
closedColor: widget.closedColor,
openColor: widget.openColor,
middleColor: middleColor,
closedElevation: widget.closedElevation,
openElevation: widget.openElevation,
closedShape: widget.closedShape,
openShape: widget.openShape,
closedBuilder: widget.closedBuilder,
openBuilder: widget.openBuilder,
hideableKey: _hideableKey,
closedBuilderKey: _closedBuilderKey,
transitionDuration: widget.transitionDuration,
transitionType: widget.transitionType,
useRootNavigator: widget.useRootNavigator,
routeSettings: widget.routeSettings,
),
);
final T? data =
await Navigator.of(
context,
rootNavigator: widget.useRootNavigator,
).push(
_OpenContainerRoute<T>(
closedColor: widget.closedColor,
openColor: widget.openColor,
middleColor: middleColor,
closedElevation: widget.closedElevation,
openElevation: widget.openElevation,
closedShape: widget.closedShape,
openShape: widget.openShape,
closedBuilder: widget.closedBuilder,
openBuilder: widget.openBuilder,
hideableKey: _hideableKey,
closedBuilderKey: _closedBuilderKey,
transitionDuration: widget.transitionDuration,
transitionType: widget.transitionType,
useRootNavigator: widget.useRootNavigator,
routeSettings: widget.routeSettings,
),
);
if (widget.onClosed != null) {
widget.onClosed!(data);
}
Expand Down Expand Up @@ -738,8 +739,9 @@ class _OpenContainerRoute<T> extends ModalRoute<T> {
final Animation<double> curvedAnimation = CurvedAnimation(
parent: animation,
curve: Curves.fastOutSlowIn,
reverseCurve:
_transitionWasInterrupted ? null : Curves.fastOutSlowIn.flipped,
reverseCurve: _transitionWasInterrupted
? null
: Curves.fastOutSlowIn.flipped,
);
TweenSequence<Color?>? colorTween;
TweenSequence<double>? closedOpacityTween, openOpacityTween;
Expand Down Expand Up @@ -800,23 +802,20 @@ class _OpenContainerRoute<T> extends ModalRoute<T> {
height: _rectTween.begin!.height,
child:
(hideableKey.currentState?.isInTree ?? false)
? null
: FadeTransition(
opacity: closedOpacityTween!.animate(
animation,
),
child: Builder(
key: closedBuilderKey,
builder: (BuildContext context) {
// Use dummy "open container" callback
// since we are in the process of opening.
return closedBuilder(
context,
() {},
);
},
),
? null
: FadeTransition(
opacity: closedOpacityTween!.animate(
animation,
),
child: Builder(
key: closedBuilderKey,
builder: (BuildContext context) {
// Use dummy "open container" callback
// since we are in the process of opening.
return closedBuilder(context, () {});
},
),
),
),
),

Expand Down
Loading