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

xl 표지
패키지 상세v0.9.1

xl

가속도계 및 포인터 또는 터치로 유도되는 파라랄랙스 애니메이션을 전용 XL 레이어링 패러다임으로 구현합니다. 자이로스코프 지원.

AndroidiOSWeb
30일 다운로드
14
좋아요
25
Pub 점수
140

패키지 설치

flutter pub add xl

패키지 개요

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

XL은 가속도계, 자이로스코프 및 터치/포인터 입력을 기반으로 한 파라럭스 애니메이션을 가능하게 하는 Flutter 패키지로, 독특한 레이어링 시스템을 사용하여 몰입형 3D 효과를 제공합니다. 개발자들이 디바이스의 움직임과 사용자 상호작용에 반응하는 동적이고 반응성 있는 인터페이스를 만들 수 있게 해줍니다. 대시보드, 게임 또는 시각적으로 풍부한 UI와 같은 깊이감과 상호작용이 필요한 앱에 적합합니다. 이 패키지는 Android, iOS, Web 플랫폼을 지원하며 다양한 장치에서 부드러운 성능을 제공합니다.

사용 사례

  • 인터랙티브 앱 인터페이스
  • 게임 UI 요소
  • 동적 대시보드 시각화
  • 터치 및 모션 반응형 레이아웃
  • 웹 및 모바일 앱에서의 3D처럼 깊이감

주요 기능

  • 가속도계 및 자이로스코프 통합
  • 사용자 정의 가능한 레이어링 시스템
  • 터치 및 포인터 이벤트 지원
  • 크로스 플랫폼 호환성 (Android, iOS, Web)
  • 부드러운 파라렉스 애니메이션

적합한 대상

  • 몰입형 UI를 만드는 개발자
  • 모션 기반 상호작용을 찾는 디자이너
  • 센서 기반 피드백이 필요한 앱
  • 심도 효과가 있는 웹 및 모바일 프로젝트
  • 인터랙티브 경험 프로토타이핑

고려 사항

  • 완전한 기능을 위해 장치 센서가 필요합니다
  • 저사양 기기에서는 성능이 다를 수 있습니다
  • 웹 지원을 위한 추가 설정이 필요합니다
  • 시각 효과에 한정되며, 데이터 처리는 포함되지 않음
  • 복잡한 레이어 계층 구조에 최적화가 필요할 수 있습니다

원본 README

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

🕹️ xl

pub.dev Listing | API Doc | GitHub

API References: XL
🐸 Zaba.app ― simple packages, simple names.

XL Package Logotype XL Logotype "Spinning Top"
Starfield Warpspeed

A package providing the XL stack widget to implement accelerometer- and
pointer-fueled parallax animations that smoothly transform
children according to a spatial, three-dimensional layer definition.
Touch and Gyroscope support included.

Design simple or elaborate XL-erometer driven interactions and interfaces.

 

Getting Started

To get started with sensor data, use an XL with XLayers:

const Widget xl = XL(layers: [XLayer(. . .), ...]);

To distinguish between pointer data (mouse/touch) and sensors data,
employ PLayers and the relevant flags:

const Widget xl = XL(
 sharesPointer = false, // default is true
 sharesSensors = false, // default is false
 layers: [
   PLayer(. . .), // ignores sensors
   PLayer(. . .), // ignores sensors
   XLayer(. . .), // ignores pointer
   ...
 ],
);

 

Layers

The XL.layers property takes a list of XLayers or PLayers.

These layers allow you to define the animatable properties of their child widgets.

Delicious parallax by accelerometer 🤤 is the result of the below Example:

class Example extends StatelessWidget {
 @override
 Widget build(BuildContext context) {
   return MaterialApp(home: Scaffold(
     body: XL(
       layers: [
         XLayer(
           xRotation: 1.0,
           yRotation: 1.0,
           xOffset: 200,
           yOffset: 200,
           child: Center(
             child: Container(
               width: 250,
               height: 250,
               color: Colors.black,
         ))),
         XLayer(
           xRotation: 1.5,
           yRotation: 1.5,
           xOffset: 300,
           yOffset: 300,
           child: Center(
             child: Container(
               width: 200,
               height: 200,
               color: Colors.red,
         ))),
       ],
     ),
   ));
 }
}

 

Advanced Usage

As stated, an XL may have both varieties of layer interspersed.
The default function of the stack is to apply pointer data to both
varieties of Layer, and to only apply sensors data to XLayers;
there are, however, flags available to toggle either functionality, as:

const layers = [
  XLayer(/* Blue X Layer; reactive */),
  PLayer(/* Red P Layer; more reactive */),
  XLayer(/* Black Layer; non-reactive control */),
];

final example = Column(children: [
  Expanded(
    child: Row(children: [
      const Expanded(
        child: XL(
          // X and P Layers behave the same way with these flags
          // (but still may differ slightly on parameters for Z axis rotation).
          sharesPointer: true,
          sharesSensors: true,
          layers: layers,
      )),
      const Expanded(
        child: XL(
          // All Layers react to pointers, but only XLayers
          // will recognize sensors. Default flags.
          sharesPointer: true, // default
          sharesSensors: false, // default
          layers: layers,
  ))])),
  Expanded(
    child: Row(children: [
      const Expanded(
        child: XL(
          // All Layers react to sensors,
          // but only PLayers will recognize pointer.
          sharesPointer: false,
          sharesSensors: true,
          layers: layers,
      )),
      const Expanded(
        child: XL(
          // Each Layer will deal only with its prescribed input data.
          sharesPointer: false,
          sharesSensors: false,
          layers: layers,
  ))])),
]);

That same stack of layers laid out in a demonstration with the two flags in their four possible configurations:

Flags to handle `XLayers` and `PLayers` separately

🟥 Red layers are PLayers and react primarily to pointers data.
👈 The left two 🟥 PLayers also consider sensors data

🟦 Blue layers are XLayers and react primarily to sensors data.
👆 The top two 🟦 XLayers also consider pointer data

⬛ Black layers are control XLayers with no animation properties. They make no reaction to any input.

 

Reference

🛣️ Roadmap

  1. 🔳 Provide richer access to sensors data and ability to manipulate Layers in new ways
    • Such as an AccelSpec and GyroSpec that would enable transformation of any axis based on input from any axis, determined by parameter.
      • Currently, for example, yRotation is controlled by accelerometer X axis rotation. zRotation may also be controlled by accelerometer X axis rotation with parameter zRotationByX. However, zRotationByGyro may interpret Z axis gyroscope rotations. It is the only axis with two such inputs.
      • Imagine declaring an axis to rotate or offset, then also determining which axis/sensor contributes to it. What deep options that could provide! Such as offsetting a Widget vertically and rotating it over Y axis based on only one input from accelerometer.
  2. 🔳 Along with #1 above, provide more Gyroscope functionality than only one axis of influence.
    • Gyro is a little tricker, as the sensor mostly reads flat near-0 values unless the device is moving.
    • This still provides cool options for developers to make neat interactions, and so should be expanded upon.
  3. ✅ Offer an automatic XL stack that simply accepts a List<Widget> (not necessarily XLayers) and dynamically generates progressively greater translation and rotation values for each layer.
    • Check out AutoXL which makes a parallax stack even easier to implement.
      Simply provide any old widgets as layers and optionally tinker with the depthFactor or max layer depth.
    • Pre-configured: AutoXL.pane, AutoXL.wiggler, AutoXL.deep

 

🐞 Bugs

  1. Discrepancy with normalization delay and normalization duration.

 

📜 History

For posterity and developer preference, there are three extension "wrappers" available.

  • Instead of the short, all-caps XL, consider a ParallaxStack
  • Instead of the double-cap XLayer, consider an AcceleraxLayer
  • Instead of the double-cap PLayer, consider a ParallaxLayer
final xl = ParallaxStack( // XL
  sharesSensors: true, // same parameters and functionality
  layers: [
    AcceleraxLayer(. . .), // XLayer
    ParallaxLayer(. . .), // PLayer
  ],
);
WORK IN PROGRESS
Forked from mouse_parallax considering the required AnimatedParallaxStack widget is not exported with the original package and that accelerometers have nothing to do with mice.
transparent 600x1 pixel-pusher (ignore) 📚

🐸 Zaba.app ― simple packages, simple names.

More by Zaba
Wrappers | Widgets that surround other widgets with functionality

Container Widget | Wraps many functionalities in one, very customizable

Succinct Utility | Work great alone or employed above

카테고리

의존성

의존성 목록 1 개

소스 저장소

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

아직 데이터가 없습니다.