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

shirne_dialog 封面
套件詳情v4.9.0

shirne_dialog

一個 Flutter 套件,可在任何地方使用可自訂樣式的提醒、彈出視窗、訊息、氣泡、圖片預覽、載入等。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
217
喜歡數
51
Pub 分數
150

安裝套件

flutter pub add shirne_dialog

套件介紹

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

shirne_dialog 是一個 Flutter 套件,提供一組多功能且可自訂的 UI 元件,例如警示、提示、彈窗、訊息列、圖片預覽與載入指示器。設計上注重易用性,讓開發者能以一致且美觀的方式在應用程式中任何位置顯示這些元件。此套件支援 Android、iOS、Web、macOS、Windows 與 Linux 多個平台,非常適合跨平台應用開發。透過 pub add 簡單整合,它以直覺且即時的回饋機制提升使用者體驗。

適用情境

  • 顯示警示和確認
  • 顯示暫時通知(吐司)
  • 實現加載旋轉圖示
  • 在模態框中預覽圖像
  • 建立自訂訊息提示
  • 增強使用者反饋

主要特色

  • 可自定樣式
  • 跨平台支援
  • 輕鬆整合
  • 多種對話類型
  • 輕巧且快速
  • 可重用組件

適合對象

  • 從初學者到高級的Flutter開發者
  • 需要豐富UI反饋的應用程式
  • 跨平台專案
  • 快速原型設計
  • 面向用戶的互動元素

使用建議

  • 需要理解 Flutter 上下文
  • 可能需要額外的樣式來實現複雜的設計
  • 僅限基本對話功能
  • 不適合高度自訂的模式工作流程
  • 依賴於正確的控件樹結構

原始 README

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

Shirne Dialog

A flutter package to use alert, confirm, prompt, toast, popup, snack, imagePreview, loading etc. with customizable style in anywhere.

pub package

Features

  • ✅ toast

  • ✅ alert

  • ✅ confirm

  • ✅ prompt [new]

  • ✅ modal

  • ✅ popup

  • ✅ imagePreview

  • ✅ snack

  • ✅ loading

  • ✅ dropdown [new]

  • 🚧 imagePreview support hero

  • 🚧 modal adaptive & more style

  • 🚧 guide

Notice

You must initialize ShirneDialogTheme on theme.extensions between flutter version 3.0.0 - 3.0.4

Above 3.0.5 dialog will use default theme when not provide in ThemeData.extends

Preview

Online Demo

Toast Dialog ImagePreview
toast dialog imagePreview
Loading Popup Snackbar
loading popup snack
Dropdown Dropdown Customize
loading popup snack

Usage

add localizations

dependencies:
    #...
  flutter_localizations:
    sdk: flutter
    #...

Recommanded usage


// Use Mydialog.navigatorKey with MaterialApp
// and set theme for dialog
MaterialApp(
    // ...
    navigatorKey: MyDialog.navigatorKey,
    localizationsDelegates:[
        ShirneDialogLocalizations.delegate,

        // flutter locals see [https://docs.flutter.dev/development/accessibility-and-localization/internationalization]
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
    ],
    theme: ThemeData.light().copyWith(extensions: [const ShirneDialogTheme()]);
    // ...
);

// Use with MaterialApp.router
MaterialApp.router(
    routerDelegate: AppRouterDelegate(),
);
class AppRouterDelegate<T> extends RouterDelegate<T> with PopNavigatorRouterDelegateMixin{
  
  @override
  GlobalKey<NavigatorState>? get navigatorKey => MyDialog.navigatorKey;

  // ...
}

// Use with Getx
MyDialog.navigatorKey = Get.key;
 

// call in anywhere
MyDialog.confirm('aaa');
MyDialog.alert('test');
MyDialog.toast('test');

In 2.x and earlier


MyDialog.of(context).toast('tip message');

MyDialog.of(context).alert(Text('alert message'));

MyDialog.of(context).confirm(Text('alert message')).then((v){

});

MyDialog.of(context).popup(Text('popup contents'));

MyDialog.of(context).snack('tip');


// initialize in MaterialApp
 MaterialApp(
    //...
    navigatorKey: MyDialog.navigatorKey,
    //...
);

// and then call in anywhere
MyDialog.confirm('aaa');
MyDialog.alert('test');
MyDialog.toase('test');

所屬分類

依賴

依賴清單 1 項

  • combined_animation>=0.3.1 <1.0.0

原始碼儲存庫

使用此套件的專案

暫無相關資料。