v1.0.2
xdialog
一个高度可定制的Flutter动画对话框包,支持动态配置、多个按钮和流畅的动画效果。
1喜欢 10近 30 天下载145Pub 分数
AndroidiOSWebmacOSWindowsLinux
anwarsafy/xdialog open-source repository details.
以下为英文项目原文快照,最新内容请访问 GitHub。
A feature-rich, highly customizable dialog package for Flutter applications.
Add the dependency in your pubspec.yaml:
dependencies:
xdialog: ^1.0.0
Then, run:
flutter pub get
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',
);
}
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',
);
}
XDialog.show(
context: context,
title: const Text('Custom Size'),
message: const Text('You can control the size.'),
width: 300,
height: 200,
);
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),
);
This project is licensed under the MIT License.
Feel free to submit pull requests or open issues for suggestions and improvements.
Happy coding! 🚀
依赖清单 3 项
{"sdk":"flutter"}{"sdk":"flutter"}^2.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗