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

GitHub 儲存庫anwarsafy/xdialog

xdialog

anwarsafy/xdialog open-source repository details.

xdialog 專案封面
星標
1
分支
0
最近推送(UTC)
2025年2月3日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

XDialog - Flutter Custom Dialog Package

A feature-rich, highly customizable dialog package for Flutter applications.

🚀 Features

  • 🎨 Fully Customizable UI – Modify colors, fonts, and layouts.
  • ⚡ Smooth Animations – Built-in transitions for a better UX.
  • 🖱️ Hover Effects – Interactive UI elements.
  • 🌈 Multiple Button Support – Add as many actions as needed.
  • 🎚️ Size Customization – Adjust width, height, and padding.
  • 🕒 Animation Control – Customize animation duration & style.
  • 🎮 Interactive Examples – Ready-to-use examples for quick setup.

📦 Installation

Add the dependency in your pubspec.yaml:

dependencies:
  xdialog: ^1.0.0

Then, run:

flutter pub get

🎯 Usage

📝 Basic Dialog

To display a simple confirmation dialog:

import 'package:flutter/material.dart';
import 'package:xdialog/xdialog.dart';

void showBasicDialog(BuildContext context) {
  XDialog.show(
    context: context,
    title: const Text('Confirmation'),
    message: const Text('Are you sure?'),
    positiveButtonText: 'Yes',
    negativeButtonText: 'No',
  );
}

🖼️ Dialog with Image
import 'package:flutter/material.dart';
import 'package:xdialog/xdialog.dart';

void showImageDialog(BuildContext context) {
  XDialog.show(
    context: context,
    title: const Text('Image Preview'),
    message: const Text('This is an example with an image.'),
    image: Image.network('https://via.placeholder.com/150'),
    positiveButtonText: 'OK',
  );
}

Basic Confirmation Dialog

🎛️ Customization

Adjust Dialog Size
XDialog.show(
  context: context,
  title: const Text('Custom Size'),
  message: const Text('You can control the size.'),
  width: 300,
  height: 200,
);
Customize Button Styles
XDialog.show(
  context: context,
  title: const Text('Styled Buttons'),
  message: const Text('Different button styles.'),
  positiveButtonText: 'Confirm',
  negativeButtonText: 'Cancel',
  positiveButtonStyle: ElevatedButton.styleFrom(backgroundColor: Colors.green),
  negativeButtonStyle: TextButton.styleFrom(foregroundColor: Colors.red),
);

🔥 Roadmap

  • [ ] Add dark mode support.
  • [ ] Support for icon-based buttons.
  • [ ] More transition effects.

📜 License

This project is licensed under the MIT License.


💡 Contributing

Feel free to submit pull requests or open issues for suggestions and improvements.

Happy coding! 🚀

Anwar Safy GitHub avatar
GitHub 作者

Anwar Safy ↗

Passionate Flutter coder, building the future of mobile

@Alo-Information-TechnologySaudi Arabia
語言Dart

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項

  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^2.0.0

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

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

GitHub Docs — About repositories ↗