navigator_transitions_route 0.1.3 copy "navigator_transitions_route: ^0.1.3" to clipboard
navigator_transitions_route: ^0.1.3 copied to clipboard

This package helps to manage the transitions between screens in an elegant and easy way.

example/main.dart

import 'package:flutter/material.dart';
import "package:navigator_transitions_route/navigator_transitions_route.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("Page 1"),
        backgroundColor: Colors.transparent,
      ),
      backgroundColor: Colors.blue,
      body: Center(
        child: MaterialButton(
          child: Text("Go to Page 2"),
          color: Colors.white,
          onPressed: () {
            NavigatorTransitionsRoute(
              context: context,
              child: Page2(),
              animation: AnimationType.fade,
              duration: Duration(milliseconds: 300),
              //replacement: true
            );
          }
        )
     ),
   );
  }
}

class Page2 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.blueGrey,
      appBar: AppBar(
        title: Text("Page 2"),
        backgroundColor: Colors.transparent,
      ),
      body: Center(
        child: Text("Page2"),
     ),
   );
  }
}
5
likes
30
pub points
0%
popularity

Publisher

unverified uploader

This package helps to manage the transitions between screens in an elegant and easy way.

Homepage

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on navigator_transitions_route