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

art_sweetalert 封面
套件詳情v0.0.5

art_sweetalert

一個美觀、響應式、可自訂、可存取且易於使用的 Flutter 氣泡框替代品。同時支援 iOS 與 Android。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
517
喜歡數
54
Pub 分數
140

安裝套件

flutter pub add art_sweetalert

套件介紹

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

ArtSweetAlert 是一個視覺上吸引人、響應迅速且高度可自訂的 Flutter 對話框套件,提供了比標準彈出對話框更易存取、更易使用的替代方案。它支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,確保在各種裝置上提供一致的使用者體驗。憑藉流暢的動畫和現代設計,它增強了應用程式的互動性,同時保持無障礙標準。非常適合以風格化的方式顯示警告、確認和通知。

適用情境

  • 顯示警示訊息
  • 使用者確認對話方塊
  • 載入指示器
  • 成功或錯誤通知
  • 可自訂的彈窗

主要特色

  • 漂亮的動畫
  • 跨平台支援
  • 無障礙存取相容
  • 高度可自訂
  • 輕鬆整合
  • 響應式設計

適合對象

  • 需要現代 UI 對話方塊的應用程式
  • 重視使用者體驗的開發人員
  • 需要一致的跨平台行為的專案
  • 希望快速實施的團隊
  • 針對多個作業系統的應用

使用建議

  • 可能需要額外的樣式設定以應對複雜用例
  • 限於對話框類型互動
  • 過度使用時的效能影響
  • 依賴外部相依性
  • 不適用於非對話框UI元件

原始 README

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

art_sweetalert

A beautiful, responsive, customizable, accessible replacement, easy use for flutter popup boxes. Both supported ios and android.

A success message

ArtSweetAlert.show(
  context: context,
  artDialogArgs: ArtDialogArgs(
    type: ArtSweetAlertType.success,
    title: "A success message!",
    text: "Show a success message with an icon"
  )
);

A message with title and text

ArtSweetAlert.show(
    context: context,
    artDialogArgs: ArtDialogArgs(
        type: ArtSweetAlertType.question,
        title: "A question?",
        text: "Show a question message with an icon"
    )
);

An error message

ArtSweetAlert.show(
    context: context,
    artDialogArgs: ArtDialogArgs(
        type: ArtSweetAlertType.danger,
        title: "Oops...",
        text: "There is a problem :("
    )
);

A dialog with three buttons

ArtDialogResponse response = await ArtSweetAlert.show(
  barrierDismissible: false,
  context: context,
  artDialogArgs: ArtDialogArgs(
    showCancelBtn: true,
    denyButtonText: "Don't save",
    title: "Do you want to save the changes?",
    confirmButtonText: "Save",
  )
);

if(response==null) {
  return;
}

if(response.isTapConfirmButton) {
  ArtSweetAlert.show(
    context: context,
    artDialogArgs: ArtDialogArgs(
      type: ArtSweetAlertType.success,
      title: "Saved!"
    )
  );
  return;
}

if(response.isTapDenyButton) {
  ArtSweetAlert.show(
    context: context,
    artDialogArgs: ArtDialogArgs(
      type: ArtSweetAlertType.info,
      title: "Changes are not saved!"
    )
  );
  return;
}

A confirm dialog

ArtDialogResponse response = await ArtSweetAlert.show(
  barrierDismissible: false,
  context: context,
  artDialogArgs: ArtDialogArgs(
    denyButtonText: "Cancel",
    title: "Are you sure?",
    text: "You won't be able to revert this!",
    confirmButtonText: "Yes, delete it",
    type: ArtSweetAlertType.warning
  )
);

if(response==null) {
  return;
}

if(response.isTapConfirmButton) {
  ArtSweetAlert.show(
      context: context,
      artDialogArgs: ArtDialogArgs(
          type: ArtSweetAlertType.success,
          title: "Deleted!"
      )
  );
  return;
}


A message with a custom image



ArtSweetAlert.show(
    context: context,
    artDialogArgs: ArtDialogArgs(
        title: "Sweet!",
        text: "Modal with a custom image.",
        customColumns: [
          Container(
            margin: EdgeInsets.only(
                bottom: 12.0
            ),
            child: Image.network(
              "https://unsplash.it/400/200",
            ),

          )
        ]
    )
);


Submit your Github username!

ArtDialogResponse response = await ArtSweetAlert.show(
    artDialogKey: _artDialogKey,
    context: context,
    artDialogArgs: ArtDialogArgs(
        title: "Submit your Github username!",
        customColumns: [
            Container(
                margin: EdgeInsets.only( bottom: 20.0 ),
                child: CupertinoTextField(
                    controller: _textController,
                ),
            )
        ],
        onConfirm: () async  {
            _artDialogKey.currentState.showLoader();
            var response = await http.get(Uri.parse('https://api.github.com/users/'+_textController.text));
            if(response.statusCode!=200) {
                _artDialogKey.currentState.hideLoader();
                _artDialogKey.currentState.showErrors(["Request failed: Error"]);
                return;
            }
            var body = response.body;
            var bodyJson = json.decode(body);
            _artDialogKey.currentState.hideLoader();
            _artDialogKey.currentState.closeDialog( data: { "image": bodyJson["avatar_url"] } );
        },
        onDispose: () {
            _artDialogKey = GlobalKey<ArtDialogState>();
        },
    )
);

if (response == null) { return; }

if (response.isTapConfirmButton) {
    ArtSweetAlert.show(
        context: context,
        artDialogArgs: ArtDialogArgs(
            customColumns: [
                Container(
                    margin: EdgeInsets.only(bottom: 12.0),
                    child: Image.network( response.data["image"]),
                )
            ]
        )
    );
    return;
}


所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。