fancy_dialog
自訂彈出對話方塊,靈感來自 Android 的 FancyGifDialog,新功能是您可以選擇兩種主題:Fancy 和 Flat,並且可以從您的資源中載入圖片和 GIF。
用於顯示設計精美的警告對話方塊的 Flutter 套件
以下為英文專案原文快照,最新內容請造訪 GitHub。
Pure Dart and Flutter package for Android,IOS and Web
A flutter Package to show custom alert Dialog,you can choose between two themes 'Fancy' and 'Flat'
The package is available in fancy_dialog
add this dependencies to your app
dependencies: fancy_dialog: ^1.0.4
add this import statement
import 'package:fancy_dialog/fancy_dialog.dart';
to show a Basic Dialog
showDialog(
context: context,
builder: (BuildContext context) => FancyDialog(
title: "Fancy Gif Dialog",
descreption: "This is descreption for fancy gif,you can load any image or gif to be displayed :), and you can choose between two themes Fancy and Flat",
)
)
the title and descreption are required
and the rest of the parameters are :
okFun : the function to be called when the user press Ok button (positive button)
cancelFun : the function to be called when the user press cancel button (negative button)
cancelColor : the color of the negative button, by default it's Colors.grey
oklColor : the color of the positive button, by default it's Colors.pink
ok : the text of the positive button, by default it's 'OK !'
cancel : the text of the negative button, by default it's 'cancel'
animationType : The type of the animation, there are 4 types,which are :
FancyAnimation.LEFT_RIGHT the default oneFancyAnimation.RIGHT_LEFTFancyAnimation.TOP_BOTTOMFancyAnimation.BOTTOM_TOPgifpath : the path for the image or the GIF to be displayed,or you can choose between 6 Gifs the package provides :
FancyGif.MOVE_FORWARD the default oneFancyGif.CHECK_MAILFancyGif.FUNNY_MANFancyGif.PLAY_MEDIAFancyGif.SUBMITFancyGif.SHAREtheme : Fancy or Flat
FancyTheme.FANCYFancyTheme.FLATThe dialog will be dissmised by default when the user click Ok or cancel, DON'T ADD
Navigator.of(context).pop() to okFun or cancelFun
Feel free to contribute,report a bug or to suggest a feature
Thank you :)
依賴清單 2 項
{"sdk":"flutter"}{"sdk":"flutter"}先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗