mirror of
https://github.com/flutter/samples.git
synced 2025-11-12 15:58:32 +00:00
[material_3_demo] Refactor application code into multiple small libraries (#2581)
This commit is contained in:
31
material_3_demo/lib/src/animations.dart
Normal file
31
material_3_demo/lib/src/animations.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright 2021 The Flutter team. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SizeAnimation extends CurvedAnimation {
|
||||
SizeAnimation(Animation<double> parent)
|
||||
: super(
|
||||
parent: parent,
|
||||
curve: const Interval(0.2, 0.8, curve: Curves.easeInOutCubicEmphasized),
|
||||
reverseCurve: Interval(
|
||||
0,
|
||||
0.2,
|
||||
curve: Curves.easeInOutCubicEmphasized.flipped,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class OffsetAnimation extends CurvedAnimation {
|
||||
OffsetAnimation(Animation<double> parent)
|
||||
: super(
|
||||
parent: parent,
|
||||
curve: const Interval(0.4, 1.0, curve: Curves.easeInOutCubicEmphasized),
|
||||
reverseCurve: Interval(
|
||||
0,
|
||||
0.2,
|
||||
curve: Curves.easeInOutCubicEmphasized.flipped,
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user