ripple_backdrop_animate_route 0.1.2 ripple_backdrop_animate_route: ^0.1.2 copied to clipboard
A ripple animation with backdrop of route. This will create a transparent page with a ripple backdrop animation to animate the widgets.
import 'package:flutter/material.dart';
import 'package:ripple_backdrop_animate_route/ripple_backdrop_animate_route.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Click button to see the page.',
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
Navigator.of(context).push(TransparentRoute(
builder: (context) => RippleBackdropAnimatePage(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Text("This is ripple backdrop animate page."),
],
),
childFade: true,
duration: 300,
blurRadius: 20.0,
bottomButton: Icon(Icons.visibility),
bottomHeight: 60.0,
bottomButtonRotate: false,
),
));
},
tooltip: 'Push to page',
child: Icon(Icons.arrow_forward),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
);
}
}