{"id":13491161,"url":"https://github.com/fluttercandies/flutter_smart_dialog","last_synced_at":"2025-05-14T09:06:31.762Z","repository":{"id":39597149,"uuid":"317240575","full_name":"fluttercandies/flutter_smart_dialog","owner":"fluttercandies","description":"An elegant Flutter Dialog solution | 一种更优雅的 Flutter Dialog 解决方案","archived":false,"fork":false,"pushed_at":"2025-04-27T14:43:34.000Z","size":6577,"stargazers_count":1189,"open_issues_count":0,"forks_count":148,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-05-14T09:05:09.361Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluttercandies.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-30T13:58:55.000Z","updated_at":"2025-05-12T16:00:52.000Z","dependencies_parsed_at":"2023-10-16T06:46:33.677Z","dependency_job_id":"15ed4e94-24ba-46a3-9cf5-598e2a8e2416","html_url":"https://github.com/fluttercandies/flutter_smart_dialog","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_smart_dialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_smart_dialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_smart_dialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_smart_dialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluttercandies","download_url":"https://codeload.github.com/fluttercandies/flutter_smart_dialog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T19:00:54.146Z","updated_at":"2025-05-14T09:06:31.741Z","avatar_url":"https://github.com/fluttercandies.png","language":"Dart","funding_links":[],"categories":["Dart","UI库"],"sub_categories":[],"readme":"[![pub](https://img.shields.io/pub/v/flutter_smart_dialog?label=pub\u0026logo=dart)](https://pub.dev/packages/flutter_smart_dialog/install) [![stars](https://img.shields.io/github/stars/fluttercandies/flutter_smart_dialog?logo=github)](https://github.com/fluttercandies/flutter_smart_dialog)  [![issues](https://img.shields.io/github/issues/fluttercandies/flutter_smart_dialog?logo=github)](https://github.com/fluttercandies/flutter_smart_dialog/issues) [![commit](https://img.shields.io/github/last-commit/fluttercandies/flutter_smart_dialog?logo=github)](https://github.com/fluttercandies/flutter_smart_dialog/commits)\n\nFeature and Usage（Must read！）：[super detailed guide](https://xdd666t.github.io/flutter_use/web/index.html#/smartDialog)\n\n功能和用法（必看！）： [超详细指南](https://xdd666t.github.io/flutter_use/web/index.html#/smartDialog)\n\n***\n\nLanguage:  English | [中文](https://juejin.cn/post/7026150456673959943)\n\nMigrate doc：[3.x migrate 4.0](https://github.com/fluttercandies/flutter_smart_dialog/blob/master/docs/3.x%20migrate%204.0.md) | [3.x 迁移 4.0](https://juejin.cn/post/7093867453012246565)\n\nFlutter 2：Please use `flutter_smart_dialog: 4.2.5`\n\n# Introduction\n\nAn elegant Flutter Dialog solution.\n\n# Some Effect\n\n![attachLocationAndPoint](https://raw.githubusercontent.com/xdd666t/MyData/master/pic/flutter/blog/20220103160140.gif)\n\n![attachHighlight](https://raw.githubusercontent.com/xdd666t/MyData/master/pic/flutter/blog/20220103160210.gif)\n\n![dialogStack](https://raw.githubusercontent.com/xdd666t/MyData/master/pic/flutter/blog/20211216222718.gif)\n\n![loadingCustom](https://raw.githubusercontent.com/xdd666t/MyData/master/pic/flutter/blog/202201140931573.gif)\n\n![toastCustom](https://raw.githubusercontent.com/xdd666t/MyData/master/pic/flutter/blog/20211103092253.gif)\n\n# Advantage\n\n- **Do not need BuildContext**\n- **Can penetrate dark background, click on the page behind dialog**\n- **Support dialog stack，close the specified dialog**\n\n- **Support positioning widget, display the specified location dialog**\n- **Support highlight feature，dissolve the specified location mask**\n\n- **Easily implement toast，loading，attach dialog，custome dialog，custome notify**\n\n# Quick start\n\n## Install\n\n- **latest version：[install pub](https://pub.flutter-io.cn/packages/flutter_smart_dialog/install)**\n\n## Initialization\n\n\u003e **initialization**\n\n```dart\nvoid main() =\u003e runApp(MyApp());\n\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: HomePage,\n      // here\n      navigatorObservers: [FlutterSmartDialog.observer],\n      // here\n      builder: FlutterSmartDialog.init(),\n    );\n  }\n}\n```\n\n\u003e **Advanced initialization: configure global custom Loading and Toast**\n\nSmartDialog's showLoading and showToast provide a default style. Of course, custom param are definitely supported.\n\n- SmartDialog custom Loading or Toast is very simple: However, when using it, it may make you feel a little troublesome\n- for example\n  - Use custom Loading: `SmartDialog.showLoading(builder: (_) =\u003e CustomLoadingWidget);`\n  - The effect we want must be like this:  `SmartDialog.showLoading();`\n- In view of the above considerations, I added the function of setting custom default Loading and Toast styles at the entrance\n\nLet me show you the following\n\n- The entry needs to be configured: implement toastBuilder and loadingBuilder, and pass in custom Toast and Loading\n\n\n````dart\nvoid main() =\u003e runApp(MyApp());\n\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: HomePage,\n      // here\n      navigatorObservers: [FlutterSmartDialog.observer],\n      // here\n      builder: FlutterSmartDialog.init(\n        //custom default toast widget\n        toastBuilder: (String msg) =\u003e CustomToastWidget(msg: msg),\n        //custom default loading widget\n        loadingBuilder: (String msg) =\u003e CustomLoadingWidget(msg: msg),\n        //custom default notify widget\n        notifyStyle: FlutterSmartNotifyStyle(\n          successBuilder: (String msg) =\u003e CustomSuccessWidget(msg: msg),\n          failureBuilder: (String msg) =\u003e CustomFailureWidget(msg: msg),\n          warningBuilder: (String msg) =\u003e CustomWarningWidget(msg: msg),\n          alertBuilder: (String msg) =\u003e CustomAlertWidget(msg: msg),\n          errorBuilder: (String msg) =\u003e CustomErrorWidget(msg: msg),\n        ),\n      ),\n    );\n  }\n}\n````\n\n- SmartDialog supports default global configuration\n\n```dart\nSmartDialog.config\n  ..custom = SmartConfigCustom(\n    maskColor: Colors.black.withOpacity(0.35),\n    useAnimation: true,\n  )\n  ..attach = SmartConfigAttach(\n    animationType: SmartAnimationType.scale,\n    usePenetrate: false,\n  )\n  ..loading = SmartConfigLoading(\n    clickMaskDismiss: false,\n    leastLoadingTime: const Duration(milliseconds: 0),\n  )\n  ..toast = SmartConfigToast(\n    intervalTime: const Duration(milliseconds: 100),\n    displayTime: const Duration(milliseconds: 2000),\n  );\n```\n\n## Easy usage\n\n- **toast usage**💬\n\n```dart\nSmartDialog.showToast('test toast');\n```\n\n![toastDefault](https://raw.githubusercontent.com/xdd666t/MyData/master/pic/flutter/blog/20211102232805.gif)\n\n- **loading usage**⏳\n\n```dart\nSmartDialog.showLoading();\nawait Future.delayed(Duration(seconds: 2));\nSmartDialog.dismiss(); \n```\n\n![loadingDefault](https://raw.githubusercontent.com/xdd666t/MyData/master/pic/flutter/blog/20211102232815.gif)\n\n- **dialog usage**🎨\n\n```dart\nSmartDialog.show(builder: (context) {\n  return Container(\n    height: 80,\n    width: 180,\n    decoration: BoxDecoration(\n      color: Colors.black,\n      borderRadius: BorderRadius.circular(10),\n    ),\n    alignment: Alignment.center,\n    child:\n    Text('easy custom dialog', style: TextStyle(color: Colors.white)),\n  );\n});\n```\n\n![dialogEasy](https://raw.githubusercontent.com/xdd666t/MyData/master/pic/flutter/blog/20211102232821.gif)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluttercandies%2Fflutter_smart_dialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluttercandies%2Fflutter_smart_dialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluttercandies%2Fflutter_smart_dialog/lists"}