|
- import 'package:flutter/material.dart';
-
- class TutorialOverlay extends ModalRoute<void> {
- @override
- Duration get transitionDuration => Duration(milliseconds: 100);
-
- @override
- bool get opaque => false;
-
- @override
- bool get barrierDismissible => false;
-
- @override
- Color get barrierColor => Colors.black.withOpacity(0.5);
-
- @override
- String get barrierLabel => null;
-
- @override
- bool get maintainState => true;
-
- final child;
-
- TutorialOverlay({this.child});
-
- @override
- Widget buildPage(
- BuildContext context,
- Animation<double> animation,
- Animation<double> secondaryAnimation,
- ) {
- // This makes sure that text and other content follows the material style
- return Material(
- type: MaterialType.transparency,
- // make sure that the overlay content is not cut off
- child: SafeArea(
- child: child, //_buildOverlayContent(context),
- ),
- );
- }
-
- @override
- Widget buildTransitions(BuildContext context, Animation<double> animation,
- Animation<double> secondaryAnimation, Widget child) {
- return FadeTransition(
- opacity: animation,
- child: child,
- );
- }
- }
|