패키지, 저장소 및 앱 카테고리 검색

page_route_animator 표지
패키지 상세v1.0.4

page_route_animator

Flutter 페이지 라우트 전환 패키지, 62가지의 다른 전환 효과를 포함합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
138
좋아요
95
Pub 점수
160

패키지 설치

flutter pub add page_route_animator

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

네비게이션 애니메이션을 향상시키기 위해 62개의 내장된 페이지 라우트 전환 기능을 제공하는 플러터 패키지입니다. 다양한 플랫폼에서 동적이고 시각적으로 매력적인 화면 전환 구현을 간소화합니다. 개발자는 슬라이드, 페이드, 스케일 및 사용자 정의 효과와 같은 사전 정의된 애니메이션을 최소한의 코드로 쉽게 적용할 수 있습니다. Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼을 지원하여 장치 간 일관된 동작을 보장합니다. 부드럽고 몰입감 있는 네비게이션 흐름을 통해 사용자 경험을 향상시키려는 앱에 이상적입니다.

사용 사례

  • 부드러운 전환을 통해 앱 탐색 개선
  • 몰입형 온보딩 경험 만들기
  • 탭 또는 화면 전환에 시각적 마무리 추가
  • 상호작용형 튜토리얼 만들기
  • 애니메이션 탐색을 사용한 현대적인 UI 설계
  • 동적 전환을 통한 사용자 참여도 향상

주요 기능

  • 62개의 사전 구축된 전환 애니메이션
  • 직관적인 구성이 가능한 간단한 API
  • 크로스 플랫폼 호환성
  • 사용자 지정 가능한 애니메이션 매개변수
  • 푸시 및 팝 전환 지원
  • 경량이며 통합이 쉬움

적합한 대상

  • 풍부한 탐색 효과를 원하는 플러터 개발자
  • 정교한 온보딩 또는 튜토리얼 흐름이 필요한 앱
  • 디자이너는 사용자 경험과 모션 디자인에 집중합니다
  • 현대적이고 애니메이션 기능이 있는 UI를 목표로 하는 프로젝트
  • 복잡한 코딩 없이 빠른 전환 구현을 원하는 개발자

고려 사항

  • 포함된 애니메이션으로 인해 번들 크기가 약간 증가할 수 있습니다
  • 일부 고급 애니메이션은 저사양 기기에서 성능 조정이 필요할 수 있습니다
  • 매우 독특한 전환 로직에 대한 제한된 사용자 지정
  • 애니메이션보다 미니멀리즘을 우선시하는 앱에는 적합하지 않음
  • Flutter의 Navigator 및 라우팅 시스템에 대한 이해가 필요합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Page Route Animator Package

Flutter page route transition package, with 62 different page transitions.

flutter platform pub package BSD-3-Clause effective dart

Examples

page_route_animator_20_transitions_p1 page_route_animator_20_transitions_p2 page_route_animator_20_transitions_p3

Getting Started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  page_route_transition: ^1.0.4

Usage

To use this package you have to import it in your file by using below command:

import 'package:page_route_animator/page_route_animator.dart';

Code Example

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

void main(List<String> args) => runApp(const MyApp());

/// This widget is the root of your app.
class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Page Route Animator Code Example',
      theme: ThemeData(primarySwatch: Colors.purple),
      home: const HomeScreen(),

      /// using onGenerateRoute
      onGenerateRoute: (settings) {

        switch (settings.name) {
          case '/second-screen':
            return PageRouteAnimator(
              child: const SecondScreen(),
              routeAnimation: RouteAnimation.topToBottom,
              settings: settings,
              curve: Curves.linear,
              duration: const Duration(milliseconds: 500),
              reverseDuration: const Duration(milliseconds: 500),
            );
          default:
            return null;
        }
      },
    );
  }
}

/// HomeScreen
class HomeScreen extends StatelessWidget {
  const HomeScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('HomeScreen'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: ListView(
          children: [
            /// Push using onGenerateRoute
            /// Navigator.pushNamed()
            ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(
                  context,
                  '/second-screen',
                  arguments: 'I am going',
                );
              },
              child: getText('Top To Bottom - onGenerateRoute'),
            ),

            /// Navigator.push()
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  PageRouteAnimator(
                    child: const SecondScreen(),
                    routeAnimation: RouteAnimation.bottomToTop,
                    settings: const RouteSettings(arguments: 'I am going'),
                    curve: Curves.slowMiddle,
                    duration: const Duration(milliseconds: 500),
                    reverseDuration: const Duration(milliseconds: 500),
                  ),
                );
              },
              child: getText('Bottom To Top'),
            ),

            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  PageRouteAnimator(
                    child: const SecondScreen(),
                    routeAnimation: RouteAnimation.leftToRight,
                    settings: const RouteSettings(arguments: 'I am going'),
                    curve: Curves.linear,
                  ),
                );
              },
              child: getText('Left To Right'),
            ),

            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  PageRouteAnimator(
                    child: const SecondScreen(),
                    routeAnimation: RouteAnimation.rightToLeft,
                    settings: const RouteSettings(arguments: 'I am going'),
                    curve: Curves.easeOut,
                  ),
                );
              },
              child: getText('Right To left'),
            ),

            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  PageRouteAnimator(
                    child: const SecondScreen(),
                    routeAnimation: RouteAnimation
                        .bottomRightToTopLeftWithFadeRotateAndScale,
                    settings: const RouteSettings(arguments: 'I am going'),
                    curve: Curves.easeOut,
                  ),
                );
              },
              child:
                  getText('BottomRight To TopLeft With Fade, Rotate And Scale'),
            ),
          ],
        ),
      ),
    );
  }
}

/// SecondScreen
class SecondScreen extends StatelessWidget {
  const SecondScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    String? argument = ModalRoute.of(context)?.settings.arguments as String?;
    return Scaffold(
      backgroundColor: Colors.yellow,
      appBar: AppBar(
        title: const Text('SecondScreen'),
      ),
      body: Center(
        child: Text(
          argument ?? 'No Data',
          style: const TextStyle(
            fontSize: 48.0,
            fontWeight: FontWeight.bold,
            color: Colors.black,
          ),
        ),
      ),
    );
  }
}

// Helper Widget
Widget getText(String text) {
  return Align(
    alignment: Alignment.centerLeft,
    child: Text(text),
  );
}

Types Of Transitions

  • topToBottom,
  • bottomToTop,
  • leftToRight,
  • rightToLeft,
  • fade,
  • rotate,
  • scale,
  • size,
  • sizeFromTop,
  • sizeFromBottom,
  • fadeAndRotate,
  • fadeAndScale,
  • rotateAndScale,
  • fadeRotateAndScale,
  • topToBottomJoined,
  • bottomToTopJoined,
  • leftToRightJoined,
  • rightToLeftJoined,
  • topLeftToBottomRight,
  • topRightToBottomLeft,
  • bottomLeftToTopRight,
  • bottomRightToTopLeft,
  • topToBottomWithFade,
  • bottomToTopWithFade,
  • leftToRightWithFade,
  • rightToLeftWithFade,
  • topLeftToBottomRightWithFade,
  • bottomLeftToTopRightWithFade,
  • bottomRightToTopLeftWithFade,
  • topRightToBottomLeftWithFade,
  • topToBottomWithRotation,
  • bottomToTopWithRotation,
  • leftToRightWithRotation,
  • rightToLeftWithRotation,
  • topLeftToBottomRightWithRotation,
  • bottomLeftToTopRightWithRotation,
  • bottomRightToTopLeftWithRotation,
  • topRightToBottomLeftWithRotation,
  • topToBottomWithFadeAndRotate,
  • bottomToTopWithFadeAndRotate,
  • leftToRightWithFadeAndRotate,
  • rightToLeftWithFadeAndRotate,
  • topLeftToBottomRightWithFadeAndRotate,
  • topRightToBottomLeftWithFadeAndRotate,
  • bottomLeftToTopRightWithFadeAndRotate,
  • bottomRightToTopLeftWithFadeAndRotate,
  • topToBottomWithScale,
  • bottomToTopWithScale,
  • leftToRightWithScale,
  • rightToLeftWithScale,
  • topLeftToBottomRightWithScale,
  • topRightToBottomLeftWithScale,
  • bottomLeftToTopRightWithScale,
  • bottomRightToTopLeftWithScale,
  • topToBottomWithFadeRotateAndScale,
  • bottomToTopWithFadeRotateAndScale,
  • leftToRightWithFadeRotateAndScale,
  • rightToLeftWithFadeRotateAndScale,
  • topLeftToBottomRightWithFadeRotateAndScale,
  • topRightToBottomLeftWithFadeRotateAndScale,
  • bottomLeftToTopRightWithFadeRotateAndScale,
  • bottomRightToTopLeftWithFadeRotateAndScale,

Curves

Learn about Curves from official docs, curves.

License

BSD 3-Clause

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.