custom_route_transitions_is 0.0.3 custom_route_transitions_is: ^0.0.3 copied to clipboard
Paquete para el manejo de transiciones entre Pantallas de manera sencilla.
import 'package:flutter/material.dart';
import 'package:custom_route_transitions_is/custom_route_transitions_is';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
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'),
centerTitle: true,
backgroundColor: Colors.transparent,
),
backgroundColor: Colors.blue,
body: Center(
child: MaterialButton(
child: Text('Ir a la Pagina 2'),
color: Colors.white,
onPressed: () {
// Navigator.push(context, MaterialPageRoute(builder: (_) => Page2()));
// Navigator.pushNamed(context, 'page2');
RoutesTransitions(
duration: Duration(milliseconds: 100),
context: context,
child: Page2(),
animation: AnimationType.fadeIn,
// replacement: true,
);
},
),
),
);
}
}
class Page2 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Page 1'),
centerTitle: true,
backgroundColor: Colors.transparent,
),
backgroundColor: Colors.blueGrey,
body: Center(
child: Text('Page 2'),
),
);
}
}