Buscar pacotes, repositórios e categorias de apps

Detalhes do pacotev1.0.2

cube_transition

Um bonito efeito de cubo 3D para suas transições PageView e PageRoute.

Downloads em 30 dias
47
Curtidas
70
Pontos Pub
40

Instalar pacote

flutter pub add cube_transition

Visão geral do pacote

Orientação gerada a partir de informações públicas. Apenas para referência.

CubeTransition é um pacote Flutter que fornece um efeito de animação suave em 3D de cubo para transições de PageView e PageRoute. Ele melhora a experiência do usuário ao adicionar profundidade e apelo visual à navegação entre telas ou páginas. O pacote aproveita os recursos de renderização do Flutter para criar animações envolventes semelhantes a cartões, simulando uma rotação real de um cubo no espaço 3D. Ideal para aplicativos que buscam transições modernas e envolventes sem implementação complexa. Integra-se perfeitamente aos padrões existentes de navegação do Flutter.

Casos de uso

  • Transições de página no PageView
  • Efeitos de navegação do PageRoute
  • onboarding interativo do aplicativo
  • Feedback visual em mudanças de aba
  • Melhorar o acabamento da interface em aplicativos móveis

Principais recursos

  • animação de rotação de cubo 3D
  • Transições suaves e personalizáveis
  • Funciona com PageView e PageRoute
  • Leve e fácil de integrar
  • Suporta virada direcional

Indicado para

  • Desenvolvedores procurando animações de interface modernas
  • Aplicativos com navegação interativa
  • Projetos Flutter centrados no design
  • Aplicativos móveis com foco na engajamento do usuário

Considerações

  • Limitado apenas ao estilo cubo 3D
  • Pode afetar o desempenho em dispositivos de baixa gama
  • Sem personalização embutida para tamanho ou textura do cubo
  • Requer manipulação manual dos estados de transição
  • Não adequado para designs de interface mínimos ou não interativos

README original

Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.

Cube Transition

pub package

A 3D Cube transition for your PageView and PageRoute.

Aeyrium Inc. is a provider of innovative software solutions for the business and commercial aviation

Features

  • Use the cube transition between the navigation of your pages.
  • Add cube transitions to your PageView.
  • Add custom transformation in your items of your PageView.

Getting started

You should ensure that you add the dependency in your flutter project.

dependencies:
  cube_transition: "^1.0.0"

You should then run flutter packages upgrade or update your packages in IntelliJ.

Import the package:

import 'package:cube_transition/cube_transition.dart';

Example Project

There is a example project in the example folder. Check it out. Otherwise, keep reading to get up and running.

Usage

Navigator Cube Transition

class Sample1 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Navigator Cube Transition'),
      ),
      body: Center(
        child: RaisedButton(
          child: Text('Next Page'),
          onPressed: () {
            Navigator.of(context).push(
              CubePageRoute(
                enterPage: Sample1NextPage(),
                exitPage: this,
                duration: const Duration(milliseconds: 900),
              ),
            );
          },
        ),
      ),
    );
  }
}

PageView Cube Transition (default)

class Sample2 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final height = MediaQuery.of(context).size.height / 2;
    return Scaffold(
      appBar: AppBar(
        title: Text('PageView Cube Transition'),
      ),
      body: Center(
        child: SizedBox(
          height: height,
          child: CubePageView(
            children: places
                .map(
                  (item) =>  Image.network(
                        item.url,
                        height: height,
                        fit: BoxFit.cover,
                      ),
                )
                .toList(),
          ),
        ),
      ),
    );
  }
}

PageView Cube Transition Custom (If you want more control over the items inside the CubePageView)

class Sample3 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final height = MediaQuery.of(context).size.height / 2;
    return Scaffold(
      appBar: AppBar(
        title: Text('Custom Cube Transition'),
      ),
      body: Center(
        child: SizedBox(
          height: height,
          child: CubePageView.builder(
            itemCount: places.length,
            itemBuilder: (context, index, notifier) {
              final item = places[index];
              final transform = Matrix4.identity();
              final t = (index - notifier).abs();
              final scale = lerpDouble(1.5, 0, t);
              transform.scale(scale, scale);
              return CubeWidget(
                index: index,
                pageNotifier: notifier,
                child: Stack(
                  children: [
                    Image.network(
                      item.url,
                      height: height,
                      fit: BoxFit.cover,
                    ),
                    Transform(
                      alignment: Alignment.center,
                      transform: transform,
                      child: Center(
                        child: Padding(
                          padding: const EdgeInsets.all(12.0),
                          child: Container(
                            decoration: BoxDecoration(boxShadow: [
                              BoxShadow(
                                color: Colors.black45,
                                spreadRadius: 5,
                                blurRadius: 5,
                              ),
                            ]),
                            child: Text(
                              item.name.split('-').join('\n'),
                              textAlign: TextAlign.center,
                              style: Theme.of(context).textTheme.title,
                            ),
                          ),
                        ),
                      ),
                    ),
                  ],
                ),
              );
            },
          ),
        ),
      ),
    );
  }
}

Copyright Aeyrium Inc

You can follow me on twitter @diegoveloper

Categorias

Repositório-fonte

Projetos que usam este pacote

Ainda não há dados.