FadeScaleTransitionConfiguration class
The modal transition configuration for a Material fade transition.
The fade pattern is used for UI elements that enter or exit from within the screen bounds. Elements that enter use a quick fade in and scale from 80% to 100%. Elements that exit simply fade out. The scale animation is only applied to entering elements to emphasize new content over old.
/// Sample widget that uses [showModal] with [FadeScaleTransitionConfiguration].
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ElevatedButton(
onPressed: () {
showModal(
context: context,
configuration: FadeScaleTransitionConfiguration(),
builder: (BuildContext context) {
return _CenteredFlutterLogo();
},
);
},
child: Icon(Icons.add),
),
),
);
}
}
/// Displays a centered Flutter logo with size constraints.
class _CenteredFlutterLogo extends StatelessWidget {
const _CenteredFlutterLogo();
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox(
width: 250,
height: 250,
child: const Material(
child: Center(
child: FlutterLogo(size: 250),
),
),
),
);
}
}
- Inheritance
-
- Object
- ModalConfiguration
- FadeScaleTransitionConfiguration
Constructors
- FadeScaleTransitionConfiguration({Color barrierColor = Colors.black54, bool barrierDismissible = true, Duration transitionDuration = const Duration(milliseconds: 150), Duration reverseTransitionDuration = const Duration(milliseconds: 75), String barrierLabel = 'Dismiss'})
-
Creates the Material fade transition configuration.
const
Properties
- barrierColor → Color
-
The color to use for the modal barrier. If this is null, the barrier will
be transparent.
finalinherited
- barrierDismissible → bool
-
Whether you can dismiss this route by tapping the modal barrier.
finalinherited
- barrierLabel → String?
-
The semantic label used for a dismissible barrier.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- reverseTransitionDuration → Duration
-
The duration of the transition running in reverse.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transitionDuration → Duration
-
The duration of the transition running forwards.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transitionBuilder(
BuildContext context, Animation< double> animation, Animation<double> secondaryAnimation, Widget child) → Widget -
A builder that defines how the route arrives on and leaves the screen.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited