{"id":13646295,"url":"https://github.com/inRush/TipDialog","last_synced_at":"2025-04-21T17:32:29.796Z","repository":{"id":59150044,"uuid":"145083291","full_name":"inRush/TipDialog","owner":"inRush","description":"flutter tip dialog","archived":false,"fork":false,"pushed_at":"2022-05-01T05:25:43.000Z","size":174,"stargazers_count":77,"open_issues_count":0,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-09T19:41:35.756Z","etag":null,"topics":["dart","dialog","flutter","loading","ui-component"],"latest_commit_sha":null,"homepage":null,"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/inRush.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":null,"security":null,"support":null}},"created_at":"2018-08-17T06:50:20.000Z","updated_at":"2024-07-09T09:50:58.000Z","dependencies_parsed_at":"2022-09-13T11:00:23.354Z","dependency_job_id":null,"html_url":"https://github.com/inRush/TipDialog","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inRush%2FTipDialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inRush%2FTipDialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inRush%2FTipDialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inRush%2FTipDialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inRush","download_url":"https://codeload.github.com/inRush/TipDialog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250100718,"owners_count":21374991,"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":["dart","dialog","flutter","loading","ui-component"],"created_at":"2024-08-02T01:02:52.372Z","updated_at":"2025-04-21T17:32:28.835Z","avatar_url":"https://github.com/inRush.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# TipDialog\n\u003e 1. Please use 3.0.0 or above version, because earlier versions have serious performance issues\n\u003e 2. if example no working, please google questions about Flutter upgrade AndroidX,\n\u003e [AndroidX Migration - Flutterblock](https://flutter.dev/docs/development/androidx-migration)\n\u003e 3. if run your app, it shows `Error: Cannot run with sound null safety`, please upgrade version to 4.0.0\n\u003e [Reference](https://dart.dev/null-safety/migration-guide)\n\n[中文版](https://github.com/inRush/TipDialog/blob/master/README.zh-CN.md)\n\nA Flutter Tip Dialog\n\n| Loading Type Dialog | Success Tye Dialog | Fail Type Dialog |\n| --- | --- | --- |\n|  ![Loading](https://raw.githubusercontent.com/inRush/Resources/master/images/tip-dialog/loading.jpeg) | ![Success](https://raw.githubusercontent.com/inRush/Resources/master/images/tip-dialog/success.jpeg)| ![Fail](https://raw.githubusercontent.com/inRush/Resources/master/images/tip-dialog/failed.jpeg) |\n\n\n| Info Type Dialog | Only Icon Dialog | Onl Text Dialog  |\n| --- | --- | --- |\n| ![Info](https://raw.githubusercontent.com/inRush/Resources/master/images/tip-dialog/info.jpeg)| ![OnlyIcon](https://raw.githubusercontent.com/inRush/Resources/master/images/tip-dialog/only-icon.jpeg)| ![OnlyText](https://raw.githubusercontent.com/inRush/Resources/master/images/tip-dialog/only-text.jpeg)|\n\n\n| Custom Icon Dialog | Custom Body Dialog |\n| --- | --- |\n| ![CustomIcon](https://raw.githubusercontent.com/inRush/Resources/master/images/tip-dialog/custom-icon.jpeg)| ![CustomBody](https://raw.githubusercontent.com/inRush/Resources/master/images/tip-dialog/custom-body.jpeg)|\n\n\n## 1. Depend on it\nAdd this to your package's pubspec.yaml file:\n\n``` dart\ndependencies:\n  tip_dialog: ^4.0.0\n```\n## 2. Install it\nYou can install packages from the command line:\nwith Flutter:\n\n```\n$ flutter packages get\n```\n## 3. Import it\nNow in your Dart code, you can use:\n\n```dart\nimport 'package:tip_dialog/tip_dialog.dart';\n```\n## 4. Use\n#### Available attributes\n\n```\n/// [TipDialogContainer]\n@required this.child,\n/// automatically disappear time\nthis.duration: const Duration(seconds: 3),\n/// mask layer alpha\nthis.maskAlpha: 0.3\n// outside touchable, default false\n// if true and onOutsideTouch not set, when use TipDialogHelper.loading(), you can touch mask layer to dismiss\n// if true and onOutsideTouch set, when touching the mask layer, onOutsideTouch will be called.\nthis.outsideTouchable: false\n// outside touch callback {@link OutsideTouchCallback}\nthis.onOutsideTouch\n```\n\n#### Global Use\n```dart\n/// Use [TipDialogContainer] globally\n/// This widget can be globally supported\nvoid main() =\u003e runApp(new MyApp());\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return new MaterialApp(\n      title: 'TipDialog Demo',\n      theme: new ThemeData(),\n      home: Stack(\n        children: \u003cWidget\u003e[\n          MyHomePage(title: 'TipDialog Demo Home Page'),\n          // add [TipDialogContainer] widget here\n          TipDialogContainer(duration: const Duration(seconds: 2))\n        ],\n      ),\n    );\n  }\n}\n/// use TipDialogHelper to show or dismiss tip\n  Widget build(BuildContext context) {\n    return new Scaffold(\n        appBar: new AppBar(\n          title: new Text(widget.title),\n          elevation: 0.5,\n        ),\n        body: new ListView(children: \u003cWidget\u003e[\n          _buildItem(\"Loading Type Tip Dialog\", () async {\n            TipDialogHelper.loading(\"Loading\");\n            await new Future.delayed(new Duration(seconds: 5));\n            TipDialogHelper.dismiss();\n          }),\n          new Divider(),\n          _buildItem(\"Success Type Tip Dialog\", () async {\n            TipDialogHelper.success(\"Loaded Successfully\");\n          }),\n          new Divider(),\n          _buildItem(\"Only text Tip Dialog\", () async {\n            TipDialogHelper.show(new TipDialog(\n              type: TipDialogType.NOTHING,\n              tip: \"Do Not Repeat\",\n            ));\n          }),\n          new Divider(),\n          _buildItem(\"Custom Icon Tip Dialog\", () async {\n            TipDialogHelper.show(new TipDialog.customIcon(\n              icon: new Icon(\n                Icons.file_download,\n                color: Colors.white,\n                size: 30.0,\n                textDirection: TextDirection.ltr,\n              ),\n              tip: \"Download\",\n            ));\n          }),\n          new Divider(),\n          _buildItem(\"Custom Body Tip Dialog\", () async {\n            TipDialogHelper.show(new TipDialog.builder(\n              bodyBuilder: (context) {\n                return new Container(\n                  width: 120.0,\n                  height: 90.0,\n                  alignment: Alignment.center,\n                  child: new Text(\n                    \"Custom\",\n                    style: new TextStyle(color: Colors.white),\n                    /// if TipDialogContainer are outside of MaterialApp,\n                    /// here is a must to set\n                    textDirection: TextDirection.ltr,\n                  ),\n                );\n              },\n              color: Colors.blue.withAlpha(150),\n            ));\n          }),\n          new Divider(),\n        ]));\n  }\n```\n\n\u003eUse a custom widget when using [TipDialogContainer] globally, there may be appear some unexpected errors.\n\u003esuch as Text or Icon, will appear similar to the following error.\n\n***No Directionality widget found.***\n\n\u003eJust set TextDirection just fine. See the custom Widget in the example for details.\n\n## 5. Default Dialog Type\n```\nenum TipDialogType { NOTHING, LOADING, SUCCESS, FAIL, INFO }\n\nNOTHING: no icon\nLOADING: have a loading icon\nSUCCESS: have a success icon\nFAIL: have a fail icon\nINFO: have a info icon\nCUSTOM: custom tip dialog type, just a sign, do nothing\n```\n## 6. TipDialogHelper Method\n\n```dart\n/// tipDialog: Need to display the widget\n///\n/// isAutoDismiss: decide whether to disappear automatically, default is true\n/// if true, the dialog will not automatically disappear\n/// otherwise, the dialog will automatically disappear after the [Duration] set by [TipDialogContainer]\nvoid show(Widget tipDialog, {bool isAutoDismiss: true});\n\n/// dismiss dialog\nvoid dismiss();\n\n/// show info dialog\nvoid info(String tip);\n/// show fail dialog\nvoid fail(String errMsg);\n/// show success dialog\nvoid success(String success);\n/// show loading dialog\nvoid loading(String loadingTip);\n```\n\n\u003eSee the example directory for more details.\n\n\n## 7. Change log\n\n### [4.0.0]\n\n* migrating to null safety\n\n### [3.1.0]\n\n* add outside touchable features\n\n### [3.0.0]\n\n* fix performance issues\n* easier way to call\n\n### [2.1.0]\n\n* add TipDialogHelper and deprecated TipDialogConnector\n\n### [2.0.1]\n\n* fix dismiss bug\n* upgrade android build gradle to 5.1.1\n\n### [2.0.0] \n\n* set default auto dismiss duration as 2 seconds\n* delete [TipDialogContainer] Partial parameters\n    -- show\n    -- outSideTouchable\n    -- defaultTip\n    -- defaultType\n* change show method parameter isLoading to isAutoDismiss\n* force display mask layer\n\n### [1.1.2] - (MODIFY)\n\n* fix infinite call dismiss bug\n* fixed an issue where setting the isLoading value is invalid\n\n### [1.1.1] - (MODIFY)\n\n* fix bugs that occur when using globally\n\n### [1.1.0] - (FUNCTION CHANGE)\n\n* add tip dialog global support\n\n### [1.0.1] - (MODIFY).\n\n* fix loading view version bug.\n* set default loading duration\n\n### [1.0.0] - first release.\n\n* add release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FinRush%2FTipDialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FinRush%2FTipDialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FinRush%2FTipDialog/lists"}