route_transitions_fm 0.0.3 icon indicating copy to clipboard operation
route_transitions_fm: ^0.0.3 copied to clipboard

Este paquete ayuda al manejo de transiciones entre pantallas de forma elegante y facil.

example/main.dart

import 'package:flutter/material.dart';
import 'package:route_transitions_fm/route_transitions_fm.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 {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Page 1'),
      ),
      body: Container(
        width: double.infinity,
        height: double.infinity,
        color:Colors.blue,
        child: Center(
          child: MaterialButton(
            color: Colors.white,
            onPressed: (){
              RouteTransition(
                context: context,
                child: Page2(),
                animation: AnimationType.fadeIn,
                replacement: true
                );
            },
            child: Text('Go')
            ,
          ),
        ),
      ),
    );
  }
}

class Page2 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
return Scaffold(
      appBar: AppBar(
        title: Text('Page 2'),
      ),
      body: Container(
        width: double.infinity,
        height: double.infinity,
        color:Colors.red,
        child: Center(
          child: MaterialButton(
            color: Colors.white,
            onPressed: (){

            },
            child: Text('Go')
            ,
          ),
        ),
      ),
    );
  }
}
0
likes
100
pub points
0%
popularity

Publisher

unverified uploader

Este paquete ayuda al manejo de transiciones entre pantallas de forma elegante y facil.

Homepage

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on route_transitions_fm