transitions_page 1.0.0
transitions_page: ^1.0.0 copied to clipboard

This package helps to manage the transitions between screens facilitating the user experience.

example/main.dart

import 'package:flutter/material.dart';
import 'package:transitions_page/transitions_page.dart';
 
void main() => runApp(MyApp());
 
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Transition',
      initialRoute: 'page1',
      routes: {
        'page1': ( _ ) => Page1(),
        'page2': ( _ ) => Page2(),
      },
    );
  }
}


class Page1 extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Pagina 1'),
        backgroundColor: Colors.transparent,
      ),
      backgroundColor: Colors.blue,
      body: Center(
        child: MaterialButton(
          child: Text('Ir a pagina 2'),
          color: Colors.white,
          onPressed: (){
            TransitionsPage(
              context: context, 
              child: Page2(),
              animation: AnimationType.fadeIn,
              duration: Duration(milliseconds: 300),
              //replacement: true,
            );
          },
        )
     ),
   );
  }
}



class Page2 extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
       appBar: AppBar(
        title: Text('Pagina 2'),
        backgroundColor: Colors.transparent,
      ),
      backgroundColor: Colors.green,
      body: Center(
        child: Text('Pagina 2'),
     ),
   );
  }
}
0
likes
130
pub points
62%
popularity

This package helps to manage the transitions between screens facilitating the user experience.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on transitions_page