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

An easy way to navigate between pages in an elegant mode and interactive

example/main.dart

import 'package:route_transitions_eg/route_transitions_eg.dart';

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      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('Page1'),
        backgroundColor: Colors.transparent,
      ),
      backgroundColor: Colors.green,
      body: Center(
        child: MaterialButton(
            color: Colors.white,
            child: Text('Go to page 2'),
            onPressed: () {
              RouteTransitions(
                  context: context,
                  child: Page2(),
                  animation: AnimationType.fadeIn,
                  duration: Duration(milliseconds: 200),
                  replacement: false);
            }),
      ),
    );
  }
}

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

Publisher

unverified uploader

An easy way to navigate between pages in an elegant mode and interactive

Homepage

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on route_transitions_eg