custom_route_transition_j 0.0.3
custom_route_transition_j: ^0.0.3 copied to clipboard
Este paquete ayuda con con las transciones entre diferentes pantallas de froma facil.
example/main.dart
import 'package:flutter/material.dart';
import 'package:custom_route_transition_j/custom_route_transition_j.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Material App',
initialRoute: 'page1',
routes: {
'page1': (context) => const Page1Page(),
'page2': (context) => const Page2Page(),
});
}
}
class Page1Page extends StatelessWidget {
const Page1Page({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Page 1'),
centerTitle: true,
backgroundColor: Colors.transparent),
backgroundColor: Colors.blue,
body: Center(
child: MaterialButton(
onPressed: () {
RouteTransition(
context: context,
child: const Page2Page(),
animation: AnimationType.fadeIn,
);
},
child: const Text('Go to page2'),
)),
);
}
}
class Page2Page extends StatelessWidget {
const Page2Page({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: const Text('Page 2'),
backgroundColor: Colors.transparent),
backgroundColor: Colors.blueGrey,
body: const Center(
child: Text('Page2Page'),
),
);
}
}