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

套件詳情v2.0.1

kumi_popup_window

一個簡單易用的彈窗。沒有華麗的預設樣板。您想要彈出的任何內容都由您自行客製化。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
418
喜歡數
26
Pub 分數
150

安裝套件

flutter pub add kumi_popup_window

套件介紹

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

kumi_popup_window 是一個輕量級、可自訂的 Flutter 弹窗套件。它提供一個乾淨、簡約的介面,沒有預設範本,讓開發者能完全設計彈窗的內容與外觀。非常適合建立簡單、客製化的覆蓋層,例如警告訊息、表單或自訂對話框。此套件支援所有主要平台,包含 Android、iOS、Web、macOS、Windows 與 Linux,讓跨平台應用更具彈性。其簡單與靈活性使其容易整合至現有專案中。

適用情境

  • 自定義警告對話框
  • 表單覆蓋
  • 通知彈窗
  • 使用者引導提示
  • 模態內容顯示

主要特色

  • 完全可自定內容
  • 無預設範本
  • 跨平台支援
  • 簡單 API
  • Lightweight
  • 輕鬆整合

適合對象

  • 需要彈性浮層的開發者
  • 具有獨特使用者介面需求的專案
  • 極簡設計
  • 跨平台應用
  • 快速對話方塊實作

使用建議

  • 需要手動設定樣式
  • 無內建動畫
  • 有限的預設計佈局
  • 不適合複雜的模態框
  • 取決於開發人員的使用者體驗細節

原始 README

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

✨ kumi_popup_window

pub package

[Language] English | 中文文档

A simple and easy-to-use pop-up window. There are no flashy preset templates. Everything you want to pop up is customized by you.

1.Install

dependencies:
  kumi_popup_window: ^2.0.1

2.Import

import 'package:kumi_popup_window/kumi_popup_window.dart';

3.Use

//both sowPopupWindow and createPopupWindow
showPopupWindow(
  context,
  gravity: KumiPopupGravity.rightBottom,
  //curve: Curves.elasticOut,
  bgColor: Colors.grey.withOpacity(0.5),
  clickOutDismiss: true,
  clickBackDismiss: true,
  customAnimation: false,
  customPop: false,
  customPage: false,
  //targetRenderBox: (btnKey.currentContext.findRenderObject() as RenderBox),
  //needSafeDisplay: true,
  underStatusBar: false,
  underAppBar: true,
  offsetX: 0,
  offsetY: 0,
  duration: Duration(milliseconds: 200),
  onShowStart: (pop) {
    print("showStart");
  },
  onShowFinish: (pop) {
    print("showFinish");
  },
  onDismissStart: (pop) {
    print("dismissStart");
  },
  onDismissFinish: (pop) {
    print("dismissFinish");
  },
  onClickOut: (pop){
    print("onClickOut");
  },
  onClickBack: (pop){
    print("onClickBack");
  },
  childFun: (pop) {
    return Container(
      key: GlobalKey(),
      padding: EdgeInsets.all(10),
      height: 100,
      width: 100,
      color: Colors.redAccent,
    );
  },
);

4.Demo screen

Screenshot Screenshot

note Data update if using setState, please see [example] (example/lib/main.dart)

Brief description, see here for details

params description default
childFun Method for customizing the content of the popup window. The returned widget will be used as the content of the popup window null,(require)
gravity Relative position of the pop-up window. KumiPopupGravity.center
curve Animation interpolator Curves.decelerate
customAnimation Custom popupWindow animation false
customPop Customize the position and animation of popupWindow false
customPage Customize the entire page, including Scaffold false
bgColor The color of the mask layer Colors.black.withOpacity(0.5)
targetRenderBox RenderBox of the target widget null
underStatusBar When the top pops up, is it below the statusBar false
underAppBar When the top pops up, is it below the AppBar false
clickOutDismiss Click outside the pop-up window to dismiss true
clickBackDismiss Click the physical back button to dismiss true
offsetX Offset at horizontal axis edge 0.0
offsetY Offset at vertical axis edge 0.0
duration Duration of the animation Duration(milliseconds: 300)
needSafeDisplay Do you need to display pop ups safely false
onShowStart When the popupWindow show animation start null
onShowEnd When the popupWindow show animation finish null
onDismissStart When the popupWindow dismiss animation start null
onDismissEnd When the popupWindow dismiss animation finish null
onClickOut Click on the listener outside the popup null
onClickBack Listening on clicking the physical back button null
property/method description
child Popup window widget,Get its size and position by GlobalKey
isShow Is the current pop-up displayed
controller Animation Controller
show() popup window show
dismiss() popup window dismiss

About

  • QQ:876625596
  • Email:876625596@qq.com
  • Github:https://github.com/q876625596

License

MIT License

Copyright (c) 2020 q876625596

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。