custom_route_transition_vid 0.0.3 custom_route_transition_vid: ^0.0.3 copied to clipboard
This package helps in the managment of transitions between pages in an easy and elegant way.
import 'package:flutter/material.dart';
import 'package:custom_route_transition_vid/custom_route_transition_vid.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
initialRoute: "page1",
routes: {
"page1": (_) => Page1(),
"page2": (_) => Page2(),
},
);
}
}
class Page1 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Page 1"),
backgroundColor: Colors.transparent,
centerTitle: true,
),
backgroundColor: Colors.blue,
body: Center(
child: MaterialButton(
color: Colors.white,
child: Text("siguiente!!!"),
onPressed: () {
RouteTransitions(
context: context,
child: Page2(),
animation: AnimationType.fadeIn,
duration: Duration(milliseconds: 1000),
replacement: true,
);
},
),
),
);
}
}
class Page2 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: Text("Page 2"),
backgroundColor: Colors.transparent,
),
backgroundColor: Colors.blueGrey,
body: Center(
child: Text('Hola Mundo2'),
),
);
}
}