GithubHelp home page GithubHelp logo

tchigher / juxtapose Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lesliearkorful/juxtapose

0.0 0.0 0.0 1001 KB

A flutter widget for comparing two stacked widgets by dragging a slider thumb to reveal either sides of the slider horizontally or vertically.

License: MIT License

Kotlin 0.82% Swift 7.62% Objective-C 0.25% Dart 83.94% HTML 7.37%

juxtapose's Introduction

Juxtapose

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

Installation

Add the Juxtapose package to pubspec.yaml

dependencies:
  juxtapose: ^1.0.2

Import the package in your dart file

import 'package:juxtapose/juxtapose.dart';

Usage

Juxtapose(
  backgroundColor: Color(0xFF012747),
  foregroundWidget: Image.asset("flutter-logo.png"),
  backgroundWidget: Image.asset("flutter-logo-stroke.png"),
),
Horizontal Vertical

By default the inner widgets expand to fill up space. Wrap in Center before sizing

Juxtapose(
  backgroundColor: Color(0xFF012747),
  foregroundWidget: Center(
    child: Image.asset("flutter-logo.png", width: 400),
  ),
  backgroundWidget: Center(
    child: Image.asset("flutter-logo-stroke.png", width: 400),
  ),
),

Sized Children output

API Reference

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

Found an issue or have a suggestion?

Create an issue

Contact

Reach me on Twitter @lesliearkorful

juxtapose's People

Contributors

lesliearkorful avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.