blockbuilder_transition 0.0.3 blockbuilder_transition: ^0.0.3 copied to clipboard
A Flutter package that prevents the build function to execute on the page that start the navigation routes.
BlockBuildPageRoute #
A Flutter package that prevents the build function to execute on the page that start the navigation routes.
Usage #
To use this plugin, add blockbuilder_transition
as a [dependency in your pubspec.yaml file].
Example #
// Import package
import 'package:blockbuilder_transition';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Home Page'),
),
body: Center(
child: RaisedButton(
child: Text('Open route'),
onPressed: () {
Navigator.of(context).push(BlockBuildPageRoute(
transition:PageTransition.FadeTrans //not specifying transition uses CupertinoPageTransition
widget: SecondRoute(
)),//Navigate to second route when tapped.
},
),
),
);
}
}
class SecondRoute extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Second Route"),
),
body: Center(
child: RaisedButton(
onPressed: () {
},
child: Text('Go back!'),
),
),
);
}
}