v1.2.0juxtapose
슬라이더의 핸드를 드래그하여 슬라이더의 양쪽 중 하나를 표시함으로써 두 개의 겹쳐진 위젯을 비교하는 위젯이며, 수평 또는 수직으로 가능합니다.
102좋아요 49030일 다운로드150Pub 점수
AndroidiOSWebmacOSWindowsLinux
슬라이더 손잡이를 드래그하여 수평 또는 수직으로 슬라이더의 한쪽을 노출시켜 두 개의 겹쳐진 위젯을 비교할 수 있는 플러터 위젯입니다.
{"sdk":"flutter"}{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A flutter widget for comparing two stacked widgets by dragging a slider thumb to reveal either sides of the slider horizontally or vertically.
Inspired by Knightlab's JuxtaposeJS
Add the Juxtapose package to pubspec.yaml
dependencies:
juxtapose: ^1.0.2
Import the package in your dart file
import 'package:juxtapose/juxtapose.dart';
Juxtapose(
backgroundColor: Color(0xFF012747),
foregroundWidget: Image.asset("flutter-logo.png"),
backgroundWidget: Image.asset("flutter-logo-stroke.png"),
),
| Horizontal | Vertical |
|---|---|
| https://github.com/lesliearkorful/juxtapose/raw/master/assets/horizontal.gif | https://github.com/lesliearkorful/juxtapose/raw/master/assets/vertical.gif |
Center before sizingJuxtapose(
backgroundColor: Color(0xFF012747),
foregroundWidget: Center(
child: Image.asset("flutter-logo.png", width: 400),
),
backgroundWidget: Center(
child: Image.asset("flutter-logo-stroke.png", width: 400),
),
),
| Property | Default | Description | Type |
|---|---|---|---|
foregroundWidget |
required |
Widget displayed in front of the backgroundWidget |
Widget |
backgroundWidget |
required |
Widget displayed behind the foregroundWidget |
Widget |
height |
optional | Height of the Juxtapose box | double |
width |
optional | Width of the Juxtapose box. | double |
direction |
Axis.horizontal |
Sliding direction for juxtaposing between the two widgets | Axis |
backgroundColor |
Colors.transparent |
Background color of the Juxtapose box | Color |
dividerColor |
Colors.white |
Color of the horizontal/vertical divider | Color |
dividerThickness |
3.0 |
Line thickness of the horizontal/vertical divider | double |
thumbColor |
Colors.white |
Color of the thumb that is dragged to juxtapose | Color |
thumbSize |
Size(12, 100) |
Size of the thumb widget. Width is the shortest side. Height is the longest side. | Size |
thumbBorderRadius |
BorderRadius.circular(4) |
Sets the border radius of the thumb widget | BorderRadius |
showArrows |
true |
Indicates whether the arrows on the sides of the thumb are shown or not | bool |
Reach me on Twitter @lesliearkorful