Skip to content
Merged
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
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,21 +327,21 @@ targets:
timeout: 30
properties:
target_file: analyze_legacy.yaml
channel: "3.32.8"
channel: "3.35.7"
env_variables: >-
{
"CHANNEL": "3.32.8"
"CHANNEL": "3.35.7"
}

- name: Linux analyze_legacy N-2
recipe: packages/packages
timeout: 30
properties:
target_file: analyze_legacy.yaml
channel: "3.29.3"
channel: "3.32.8"
env_variables: >-
{
"CHANNEL": "3.29.3"
"CHANNEL": "3.32.8"
}

- name: Linux_android custom_package_tests master
Expand Down
2 changes: 1 addition & 1 deletion .ci/targets/repo_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tasks:
script: .ci/scripts/tool_runner.sh
args:
- "pubspec-check"
- "--min-min-flutter-version=3.27.0"
- "--min-min-flutter-version=3.32.0"
- "--allow-dependencies=script/configs/allowed_unpinned_deps.yaml"
- "--allow-pinned-dependencies=script/configs/allowed_pinned_deps.yaml"
always: true
Expand Down
4 changes: 4 additions & 0 deletions packages/animations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Updates minimum supported SDK version to Flutter 3.32/Dart 3.8.

## 2.1.0

* Updates examples to use the new RadioGroup API instead of deprecated Radio parameters.
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.8.0
flutter: ">=3.32.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 @@ -288,28 +288,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 @@ -747,8 +748,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 @@ -809,23 +811,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