transitions_route_basic 0.0.3 copy "transitions_route_basic: ^0.0.3" to clipboard
transitions_route_basic: ^0.0.3 copied to clipboard

Package that provides to manage transitions between screens, very symple

example/main.dart

import 'package:flutter/material.dart';
import 'package:transitions_route_basic/transitions_route_basic.dart';

void main() {
  runApp(MaterialApp(
    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.blueGrey,
      body: Center(
          child: MaterialButton(
        child: Text("Go to page 2"),
        color: Colors.white,
        onPressed: () {
          // Navigator.push(context, MaterialPageRoute(builder: (_) => Page2()));

          // Navigator.pushNamed(context, '/page2');
          //
          TransitionsRouteBasic(
            context: context,
            child: Page2(),
            animation: AnimationType.nomal,
            duration: Duration(milliseconds: 300),
          );
        },
      )),
    );
  }
}

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

Publisher

unverified uploader

Package that provides to manage transitions between screens, very symple

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on transitions_route_basic