smooth_transition 1.0.5 copy "smooth_transition: ^1.0.5" to clipboard
smooth_transition: ^1.0.5 copied to clipboard

A simple and customizable Flutter package for smooth page transition animations, including fade, slide, and scale effects. Easy to use with Navigator.push().

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Smooth Transition Example',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const FirstPage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("First Page")),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  PageTransition(
                    child: const SecondPage(),
                    type: PageTransitionType.fade,
                  ),
                );
              },
              child: const Text("Fade Transition"),
            ),
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  PageTransition(
                    child: const SecondPage(),
                    type: PageTransitionType.scale,
                  ),
                );
              },
              child: const Text("Scale Transition"),
            ),
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  PageTransition(
                    child: const SecondPage(),
                    type: PageTransitionType.slideLeft,
                  ),
                );
              },
              child: const Text("Slide Left Transition"),
            ),
          ],
        ),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Second Page")),
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            Navigator.pop(context);
          },
          child: const Text("Go Back"),
        ),
      ),
    );
  }
}
2
likes
0
points
94
downloads

Publisher

unverified uploader

Weekly Downloads

A simple and customizable Flutter package for smooth page transition animations, including fade, slide, and scale effects. Easy to use with Navigator.push().

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

flutter

More

Packages that depend on smooth_transition