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

An epic library to handling screen transitions with animations.

example/main.dart

import 'package:epic_route_transitions/epic_route_transitions.dart';
import 'package:flutter/material.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 {
  const Page1({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Page 1'),
        backgroundColor: Colors.transparent,
      ),
      backgroundColor: Colors.blueAccent,
      body: Center(
        child: MaterialButton(
          child: Text('Go to page2'),
          color: Colors.white,
          onPressed: () {
            EpicRouteTransitions(
              context: context,
              child: Page2(),
              animation: AnimationType.fadeIn,
              duration: Duration(seconds: 1),
              replacement: false,
            );
          },
        ),
      ),
    );
  }
}



class Page2 extends StatelessWidget {
  const Page2({Key key}) : super(key: key);

  @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'),),
    );
  }
}
1
likes
40
pub points
0%
popularity

Publisher

unverified uploader

An epic library to handling screen transitions with animations.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on epic_route_transitions