パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリhsndmr/art_sweetalert

art_sweetalert

Flutter用の新しいスイートアラート

art_sweetalert のプロジェクト画像
スター
6
フォーク
2
最終プッシュ(UTC)
2022/08/22
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

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;
}


Hasan GitHub avatar
GitHub 作者

Hasan ↗

Research Assistant
言語DartSwiftKotlinObjective-C

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 2 件

  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗