transition_customer 0.0.5 transition_customer: ^0.0.5 copied to clipboard
Este paquete facilita la implementacón de transiciones entre pantallas de forma fácil.
import 'package:flutter/material.dart';
import 'package:transition_customer/transition_customer.dart';
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('Pagina 1'),
backgroundColor: Colors.transparent
),
body: Center(
child: MaterialButton(
child: Text('Ir a Page 2'),
color: Colors.blue,
onPressed: () {
TransitionCustomer(
context: context,
child: Page2(),
animation: AnimationType.fadeIn,
duration: Duration(milliseconds: 200 ),
replacement: true
);
},)
),
);
}
}
class Page2 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Pagina 2'),
backgroundColor: Colors.transparent,
),
backgroundColor: Colors.blueGrey,
body: Center(
child: Text('Pagina 2'),
),
);
}
}