搜尋套件、儲存庫與 APP 分類

liquid_swipe 封面
套件詳情v3.1.0

liquid_swipe

一個 Flutter 插件,用於為提供的組件實作液態滑動效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1850
喜歡數
1370
Pub 分數
150

安裝套件

flutter pub add liquid_swipe

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Liquid Swipe 是一個 Flutter 套件,可為組件啟用流暢的液態滑動效果,透過平滑過渡增強使用者互動體驗。非常適合用來建立吸引人的引導畫面、圖片輪播圖,或任何需要動態水平滑動的介面。此外,該套件支援多個平台,包括 Android、iOS、Web、macOS、Windows 與 Linux,確保在各裝置上行為一致。僅需透過 `flutter pub add liquid_swipe` 即可輕鬆設定,將此效果整合至應用程式中。原始碼開源並托管於 GitHub,以確保透明度並促進社群貢獻。

適用情境

  • 入門畫面
  • 圖片滑塊
  • 互動式教程
  • 基於滑動的導航
  • 動態內容輪播

主要特色

  • 平滑的液體過渡效果
  • 跨平台支援
  • 與 Flutter 的輕鬆整合
  • 可自定義的滑動行為
  • 開源且持續維護

適合對象

  • 尋求動畫 UI 的開發者
  • 具有互動式引導的App
  • 注重設計的移動應用
  • 跨平台 Flutter 項目
  • UI/UX優化愛好者

使用建議

  • 可能影響低階裝置的效能
  • 需要仔細處理大型數據集
  • 複雜手勢的自訂功能有限
  • 不適用於靜態內容
  • 最佳搭配輕量級小部件使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。


Liquid Swipe

Pub Awesome Flutter

This repository contains the Liquid 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 and IntroViews.

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 of Widgets 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.
 @override
 Widget build(BuildContext context) {
   return new MaterialApp(
     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. See migration
  • Attribute enableSlideIcon is removed from LiquidSwipe. You can simply pass null to slideIconWidget to enable and disable it.
  • Attribute positionSlideIcon 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 from Releases or Assets folder

Documentation

LiquidSwipe

Please Refer to API documentation for more details.

Property Type Description Default Value
pages List<Widget> Set Pages/Views/Containers. See complete example for usage. @required value
fullTransitionValue double Handle swipe sensitivity through it. Lower the value faster the animation 400.0
initialPage int Set initial page value, wrong position will throw exception. 0
slideIconWidget Widget Icon/Widget you want to display for swipe indication. Remember the curve will be created according to it. null
positionSlideIcon double Icon position on vertical axis. Must satisfy this condition 0.0 <= value <= 1.0 0.8
enableLoop bool Whether you want to loop through all those pages. true
liquidController LiquidController Controller to handle some runtime changes. Refer null
waveType WaveType enum Type of clipper you want to use. WaveType.liquidReveal
onPageChangeCallback Callback Triggered whenever page changes. null
currentUpdateTypeCallback Callback Triggered whenever UpdateType changes. Refer null
slidePercentCallback Callback Triggered on Swipe animation. Use carefully as its quite frequent on swipe. null
ignoreUserGestureWhileAnimating bool If you want to block gestures while swipe is still animating. See #5 false
disableUserGesture bool Disable user gesture, always. false
enableSideReveal bool Enable/Disable side reveal false
preferDragFromRevealedArea bool Disabling the drag from the whole page and allowing only from the revealed part of the screen and the icon false

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;

   @override
   void initState() {
   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 to API documentation for more details.

Credits

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

Author & support

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

If you appreciate my work you can connect/endorse me on LinkedIn 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 the all-contributors specification. Contributions of any kind welcome!

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案