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

Paquete para manejo de transiciones entre pantallas de forma sencilla.

example/main.dart

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


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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Material App',
      initialRoute: 'page1',
      routes: {
        'page1': (context) => Page1(),
        'page2': (context) => Page2(),
      },
      theme: ThemeData.light().copyWith(
        appBarTheme: AppBarTheme(
          centerTitle: true,
          foregroundColor: Colors.white,
          backgroundColor: Colors.transparent,
          shadowColor: Colors.black,
          elevation: 1
        )
      ),
    );
  }
}

class Page1 extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Page1'),
      ),
      backgroundColor: Colors.blue,
      body: Center(
        child: MaterialButton(
          color: Colors.white,
          onPressed: () {
            //Navigator.pushNamed(context, 'page2');
            RouteTransitions(
              context: context, 
              child: Page2(),
              animation: AnimationType.fadeIn,
              animationDuration: Duration(milliseconds: 500),
              replacement: true
            );
          },
          child: Text('Go to page2'),
        )
     ),
   );
  }
}

class RouteTransition {
}


class Page2 extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Page2'),
      ),
      backgroundColor: Colors.blueGrey,
      body: Center(
        child: Text('page2'),
     ),
   );
  }
}
0
likes
160
points
34
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Paquete para manejo de transiciones entre pantallas de forma sencilla.

Homepage

License

MIT (license)

Dependencies

flutter

More

Packages that depend on custom_route_transition_p_ca