Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A flutter based liquid swipe

License

NotificationsYou must be signed in to change notification settings

iamSahdeep/liquid_swipe_flutter

Repository files navigation


Liquid Swipe

PubAwesome Flutter

This repository contains theLiquid Swipe Flutter source code. Liquid swipe is the revealing clipper to bring off amazing liquid like swipe to stacked Container/Widgets and inspired by Cuberto's liquid swipe andIntroViews.

Table of contents

Getting Started

  • Add this to your pubspec.yaml

    dependencies:liquid_swipe: ^3.1.0
  • Get the package from Pub:

    flutter packages get
  • Import it in your file

    import 'package:liquid_swipe/liquid_swipe.dart';

Usage

  • Liquid Swipe just requires the list ofWidgets like Container. Just to provide flexibity to the developer to design its own UI through it.
final pages= [Container(...),Container(...),Container(...), ];
  • Now just pass these pages to LiquidSwipe widget.
@overrideWidgetbuild(BuildContext context) {returnnewMaterialApp(     home:Builder(         builder: (context)=>LiquidSwipe(                 pages: pages             )),   ); }

Migration

Some things to keep in mind while updating to v2.0.0 from any version.

  • v2.0.0 is migrated to null safety. Seemigration
  • AttributeenableSlideIcon is removed from LiquidSwipe. You can simply passnull toslideIconWidget to enable and disable it.
  • AttributepositionSlideIcon is now ranged from 0.0 to 1.0.
  • Next Reveal is there by default. If you want to disable it you might want to make changes in your fork. Create an issue I will help.

That's it ;)

Sample APK

Please download apk fromReleases orAssets folder

Documentation

LiquidSwipe

Please Refer toAPI documentation for more details.

PropertyTypeDescriptionDefault Value
pagesList<Widget>Set Pages/Views/Containers. See complete example for usage.@required value
fullTransitionValuedoubleHandle swipe sensitivity through it. Lower the value faster the animation400.0
initialPageintSet initial page value, wrong position will throw exception.0
slideIconWidgetWidgetIcon/Widget you want to display for swipe indication. Remember the curve will be created according to it.null
positionSlideIcondoubleIcon position on vertical axis. Must satisfy this condition0.0 <= value <= 1.00.8
enableLoopboolWhether you want to loop through all thosepages.true
liquidControllerLiquidControllerController to handle some runtime changes.Refernull
waveTypeWaveType enumType of clipper you want to use.WaveType.liquidReveal
onPageChangeCallbackCallbackTriggered whenever page changes.null
currentUpdateTypeCallbackCallbackTriggered whenever UpdateType changes.Refernull
slidePercentCallbackCallbackTriggered on Swipe animation. Use carefully as its quite frequent on swipe.null
ignoreUserGestureWhileAnimatingboolIf you want to block gestures while swipe is still animating. See #5false
disableUserGestureboolDisable user gesture, always.false
enableSideRevealboolEnable/Disable side revealfalse
preferDragFromRevealedAreaboolDisabling the drag from the whole page and allowing only from the revealed part of the screen and the iconfalse

LiquidController

A Controller class with some utility fields and methods.

Simple Usage :

Firstly make an Object of LiquidController and initialize it in initState()

LiquidController liquidController;@overridevoidinitState() {super.initState();   liquidController=LiquidController();   }

Now simply add it to LiquidSwipe's Constructor

LiquidSwipe(        pages: pages,LiquidController: liquidController,    ),

Only Rules/Limitation to its Usage is, you can't use any method in Liquid Controller before build method is being called in which LiquidSwipe is initialized. So we have to use them after LiquidSwipe is Built

  • Properties
    • currentPage - Getter to get current Page. Default value is 0.
    • isUserGestureDisabled - If somehow you want to check if gestures are disabled or not. Default value is false;
  • Methods
    • animateToPage({required int page, int duration = 600})Animate to mentioned page within given Duration Remember the duration here is the total duration in which it will animate though all pages not the single page.
    • jumpToPage({required int page})Jump Directly to mentioned Page index but without Animation.
    • shouldDisableGestures({required bool disable})Use this method to disable gestures during runtime, like on certain pages using OnPageChangeCallback.

Please Refer toAPI documentation for more details.

Credits

Disclaimer : This project is not anyhow connected to Cuberto, but have apprised them through thisissue.

Author & support

This project is created bySahdeep Singh but with lots of support and help. See credits.

If you appreciate my work you can connect/endorse me onLinkedIn to keep me motivated.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Sahdeep Singh

💻

Yasser Omar Jammeli

💻🐛

Mourad Brahim

💻

heshesh2010

🐛📓

Federico Tarascio

💻

This project follows theall-contributors specification. Contributions of any kind welcome!

Packages

No packages published

Contributors9

Languages


[8]ページ先頭

©2009-2025 Movatter.jp