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

Mi primer paquete en Pub.Dev. Sirve para el Manejo de transiciones entre Pantallas de forma Personalizada.

example/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      debugShowCheckedModeBanner: false,
      initialRoute: 'screen1',
      routes: {
        'screen1': (_) => const Screen1(),
        'screen2': (_) => const Screen2(),
      },
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: const Text('Screen 1'),
        backgroundColor: Colors.transparent,
      ),
      backgroundColor: Colors.blue,
      body: Center(
        child: MaterialButton(
          onPressed: (){

            TransitionRouteV(
              context: context,
              animation: AnimationType.fadeIn,
              child: const Screen2(),
              duration: const Duration(seconds: 1)
            );

          },
          color: Colors.white,
          child: const Text('Go to page2'),
        )
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: const Text('Screen 2'),
        backgroundColor: Colors.transparent,
      ),
      backgroundColor: Colors.blueGrey,
      body: const Center(
        child: Text('Screen2')
      ),
    );
  }
}
1
likes
160
points
21
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Mi primer paquete en Pub.Dev. Sirve para el Manejo de transiciones entre Pantallas de forma Personalizada.

Homepage

License

MIT (license)

Dependencies

flutter

More

Packages that depend on transition_route_vic