tcs_custom_dialog 1.0.4 copy "tcs_custom_dialog: ^1.0.4" to clipboard
tcs_custom_dialog: ^1.0.4 copied to clipboard

Some custom Dialogs

📦 tcs_custom_dialog #

自訂樣式的彈跳視窗 Dialog 元件,支援單按鈕與雙按鈕版本,方便於 Flutter 專案中快速呼叫彈窗。


✨ Features #

  • ✅ 單按鈕對話框:TcsCustomOneButtonDialog
  • ✅ 雙按鈕水平樣式對話框:TcsCustomTwoButtonHorizontalDialog
  • ✅ 雙按鈕垂直樣式對話框:TcsCustomTwoButtonVerticalDialog
  • ✅ 選擇視窗樣式對話框:TcsCustomSelectionDialog
  • 🎨 可自訂標題、文字內容、對齊方式和按鈕操作
  • 🧩 支援子小部件以容納更複雜的內容
  • 📱 響應式設計,適合各種螢幕尺寸

📦 Installation #

將以下內容新增至您的 pubspec.yaml:

dependencies:
  tcs_custom_dialog: ^1.0.0  # Replace with actual version

Then run:

flutter pub get

如果您正在使用本機套件 (for development/testing):

dependencies:
  tcs_custom_dialog:
    path: ../tcs_custom_dialog

🚀 Quick Start #

Import the package #

import 'package:tcs_custom_dialog/tcs_custom_dialog.dart';

Show 單按鈕對話框 #

await SmartDialog.show(
  context: context,
  builder: (context) => TcsCustomOneButtonDialog(
    title: '提示',
    text: '這是一個提示訊息',
    buttonTxt: '確認',
    function: () {
        debugPrint('按下確認');
    },
  ),
);

Show 雙按鈕水平樣式對話框 #

await SmartDialog.show(
  context: context,
  builder: (context) => TcsCustomTwoButtonHorizontalDialog(
    title: '提醒',
    text: '確定執行?',
    buttonTxtA: '取消',
    buttonTxtB: '確認',
    functionA: () {
        debugPrint('按下取消');
    },
    functionB: () {
        debugPrint('按下確認');
    },
  ),
);

Show 雙按鈕垂直樣式對話框 #

await SmartDialog.show(
  context: context,
  builder: (context) => TcsCustomTwoButtonVerticalDialog(
    title: '提醒',
    text: '確定執行?',
    buttonTxtA: '取消',
    buttonTxtB: '確認',
    functionA: () {
        debugPrint('按下取消');
    },
    functionB: () {
        debugPrint('按下確認');
    },
  ),
);

⚖️ Testing and Coverage #

測試覆蓋率報告

本專案包含一個輔助腳本 generate_filtered_coverage.sh,用於生成特定目錄的測試覆蓋率報告。

  1. 確保已安裝 lcov 工具
brew install lcov  # macOS
sudo apt-get install lcov  # Linux
  1. 執行腳本以生成 lib/Package 目錄的測試覆蓋率報告
bash scripts/generate_filtered_coverage.sh
  1. 報告生成後,使用瀏覽器開啟報告
open coverage/filtered_html/index.html

腳本功能

  • 運行測試並生成完整的覆蓋率數據。
  • 過濾 lib/Package 目錄的覆蓋率數據。
  • 生成可視化的 HTML 報告。
0
likes
110
points
20
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Some custom Dialogs

Homepage
Repository

License

unknown (license)

Dependencies

flutter

More

Packages that depend on tcs_custom_dialog