custom_route_transition_ra 0.0.3 custom_route_transition_ra: ^0.0.3 copied to clipboard
This packages main objective is to help you manage pages transitions easily and better. So you don't have to worry and fill your code navigating between pages
import 'package:flutter/material.dart';
import 'package:custom_route_transition_ra/custom_route_transition_ra.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
debugShowCheckedModeBanner: false,
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,
),
backgroundColor: Colors.blue,
body: Center(
child: MaterialButton(
child: Text('Go to page 2'),
color: Colors.white,
onPressed: () {
RouteTranstitions(
context: context,
child: Page2(),
animation: AnimationType.fadeIn,
replacement: true,
duration: Duration(seconds: 2)
);
}
)
),
);
}
}
class Page2 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Page 2'),
backgroundColor: Colors.transparent,
),
backgroundColor: Colors.blueGrey,
body: Center(
child: Text('Page 2'),
),
);
}
}