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

Custom route transitions with animation, This package helps handle transitions between screens elegantly and easily.

example/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      initialRoute: 'pageOne',
      routes: {
        'pageOne': (context) => const PageOne(),
        'pageTwo': (context) => const PageTwo()
      },
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Page one'),
        backgroundColor: Colors.transparent,
      ),
      backgroundColor: Colors.blueGrey,
      body: Center(
        child: MaterialButton(
          onPressed: () {
            RouteTransitions(
                context: context,
                child: const PageTwo(),
                animation: AnimationType.fadeIn,
                animationDuration: const Duration(milliseconds: 500),
                replacement: false);
          },
          color: Colors.white,
          child: const Text('Go page two'),
        ),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Page two'),
        backgroundColor: Colors.transparent,
      ),
      backgroundColor: Colors.cyan,
      body: const Center(
        child: Text('Page two'),
      ),
    );
  }
}
0
likes
160
pub points
0%
popularity

Publisher

unverified uploader

Custom route transitions with animation, This package helps handle transitions between screens elegantly and easily.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on custom_route_transitions_rmua