{"id":23897928,"url":"https://github.com/byteszero/flutter_close_app","last_synced_at":"2026-01-11T04:05:27.448Z","repository":{"id":62458858,"uuid":"505059448","full_name":"BytesZero/flutter_close_app","owner":"BytesZero","description":"A simple and flexible Flutter close app plugin,(Android press 2 times to return to close, MacOS, iOS, Windows, Linux one-click close)一款灵活的 Flutter 关闭 App 插件，包含Android 按2次返回关闭，MacOS、iOS、Windows、Linux 一键关闭）","archived":false,"fork":false,"pushed_at":"2022-06-19T15:38:31.000Z","size":8374,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-04T17:19:08.296Z","etag":null,"topics":["close","flutter","simple"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_close_app","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/BytesZero.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":"2022-06-19T09:03:06.000Z","updated_at":"2023-12-31T05:04:51.000Z","dependencies_parsed_at":"2022-11-02T00:45:55.901Z","dependency_job_id":null,"html_url":"https://github.com/BytesZero/flutter_close_app","commit_stats":null,"previous_names":["byteszero/flutter_close_app","yy1300326388/flutter_close_app"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2Fflutter_close_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2Fflutter_close_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2Fflutter_close_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BytesZero%2Fflutter_close_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BytesZero","download_url":"https://codeload.github.com/BytesZero/flutter_close_app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240286508,"owners_count":19777354,"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":["close","flutter","simple"],"created_at":"2025-01-04T17:19:13.104Z","updated_at":"2025-10-29T17:38:31.184Z","avatar_url":"https://github.com/BytesZero.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003ch2 align=\"center\"\u003eA simple and flexible Flutter close app plugin\u003c/h2\u003e\n\n\u003ch4 align=\"center\"\u003e(Android press 2 times to return to close, MacOS, iOS, Windows, Linux one-click close)\u003c/h4\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://pub.dev/packages/flutter_close_app\"\u003e\u003cimg src=https://img.shields.io/badge/pub-v1.0.0-success\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/yy1300326388/flutter_close_app\"\u003e\u003cimg src=https://img.shields.io/badge/platform-Android%20%7C%20iOS%20%7C%20MacOS%20%7C%20Windows%20%7C%20Linux-brightgreen\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/yy1300326388/flutter_close_app/actions/workflows/flutter.yml\"\u003e\u003cimg src=\"https://github.com/yy1300326388/flutter_close_app/actions/workflows/flutter.yml/badge.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/yy1300326388/flutter_close_app\"\u003e\u003cimg src=https://img.shields.io/github/stars/yy1300326388/flutter_close_app?color=brightgreen\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/yy1300326388/flutter_close_app/blob/master/LICENSE\"\u003e\u003cimg src=https://img.shields.io/badge/license-MIT-brightgreen\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n- [中文说明](https://github.com/yy1300326388/flutter_close_app/tree/master/README_CN.md)\n\n## Feature\n\n- ✅ Press back 2 times to close app\n     - ✅ Custom time interval\n     - ✅ Customize the prompt message\n     - ✅ Customize matching conditions\n     - ✅ Support Android\n- ✅ One click to close app\n     - ✅ Support iOS\n     - ✅ Support MacOS\n     - ✅ Support Windows\n     - ✅ Support Linux\n## Screenshot\n\n![](https://github.com/yy1300326388/flutter_close_app/raw/master/example/images/example.gif)\n\n\n## Use\n\n- Dependent\n\n``` shell\nflutter pub add flutter_close_app\n```\n- Or\n\n``` ymal\ndependencies:\n  flutter_close_app: ^1.0.0\n```\n\n- Import package\n``` dart\nimport 'package:flutter_close_app/flutter_close_app.dart';\n```\n\n## Example\n\n- Press back 2 times to close app\n\n``` dart\nclass HomePage extends StatelessWidget {\n  const HomePage({Key? key}) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    return FlutterCloseAppPage(\n      onCloseFailed: () {\n        // Condition does not match: the first press or the second press interval is more than 2 seconds, display a prompt message\n        ScaffoldMessenger.of(context).showSnackBar(const SnackBar(\n          content: Text('Press again to exit 🎉'),\n        ));\n      },\n      child: Scaffold(\n        appBar: AppBar(),\n        body: ...\n      ),\n    );\n  }\n}\n```\n\n- One click to close app\n\n``` dart\nFlutterCloseApp.close();\n```\n\n- Advanced usage\n\n``` dart\nclass HomePage extends StatelessWidget {\n  const HomePage({Key? key}) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    return FlutterCloseAppPage(\n+      interval: 3, // Custom interval is 3 seconds\n+      condition: tabIndex == 0, // Only close the app on the home page\n      onCloseFailed: () {\n        // Not the homepage does not prompt\n+        if(tabIndex != 0) return;\n        // Condition does not match: the first press or the second press interval is more than 2 seconds, display a prompt message\n        ScaffoldMessenger.of(context).showSnackBar(const SnackBar(\n          content: Text('Press again to exit 🎉'),\n        ));\n      },\n      child: Scaffold(\n        appBar: AppBar(),\n        body: ...\n      ),\n    );\n  }\n}\n```\n\n## Issues and feedback\n\nPlease file [issues](https://github.com/yy1300326388/flutter_close_app/issues) to send feedback or report a bug. Thank you!\n\n## LICENSE\n\n- [MIT](https://github.com/yy1300326388/flutter_close_app/blob/master/LICENSE)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteszero%2Fflutter_close_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyteszero%2Fflutter_close_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteszero%2Fflutter_close_app/lists"}