{"id":32305709,"url":"https://github.com/fuadarradhi/double_back_to_close","last_synced_at":"2026-05-18T14:40:36.377Z","repository":{"id":56828163,"uuid":"267238806","full_name":"fuadarradhi/double_back_to_close","owner":"fuadarradhi","description":"Flutter package for request double back pressed before close app/route/screen.","archived":false,"fork":false,"pushed_at":"2021-04-14T15:20:06.000Z","size":226,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T06:54:41.940Z","etag":null,"topics":["back","close","flutter","plugin","to"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/double_back_to_close","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/fuadarradhi.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":"2020-05-27T06:27:36.000Z","updated_at":"2021-07-21T10:11:34.000Z","dependencies_parsed_at":"2022-08-28T21:51:30.621Z","dependency_job_id":null,"html_url":"https://github.com/fuadarradhi/double_back_to_close","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fuadarradhi/double_back_to_close","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuadarradhi%2Fdouble_back_to_close","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuadarradhi%2Fdouble_back_to_close/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuadarradhi%2Fdouble_back_to_close/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuadarradhi%2Fdouble_back_to_close/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuadarradhi","download_url":"https://codeload.github.com/fuadarradhi/double_back_to_close/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuadarradhi%2Fdouble_back_to_close/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33181645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["back","close","flutter","plugin","to"],"created_at":"2025-10-23T06:54:40.515Z","updated_at":"2026-05-18T14:40:36.372Z","avatar_url":"https://github.com/fuadarradhi.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# double_back_to_close\n\nFlutter package for request double back pressed before close app/route/screen.\n\n![Demo](double_back2.gif)\n\n## Usage\n\nWrapping widget with DoubleBack where you want to use double back to close screen or app:\n\n### Default (using TOAST)\n```dart\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: DoubleBack(\n          message:\"Press back again to close\",\n          child: Home(),\n        ),\n      ),\n  }\n}\n```\n\n\n### Default (using TOAST) with optional style\n```dart\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: DoubleBack(\n          message:\"Press back again to close\",\n          child: Home(),\n        ),\n      ),\n      // optional style\n      textStyle: TextStyle(\n        fontSize: 13,\n        color: Colors.white,\n      ),\n      background: Colors.red,\n      backgroundRadius: 30,\n    );\n  }\n}\n```\n\n\n### Custom ( using snackbar for example)\n```dart\n\n\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: DoubleBack(\n        onFirstBackPress: (context) {\n\n          // you can use your custom here\n          // change this with your custom action\n          final snackBar = SnackBar(content: Text('Press back again to exit'));\n          ScaffoldMessenger.of(context).showSnackBar(snackBar);\n          // ---\n\n        },\n\n        child: Home(),\n      ),\n    );\n  }\n}\n```\n\n### with custom delay\n```dart\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: DoubleBack(\n          onFirstBackPress: (context) {\n\n            Flushbar(\n              title: \"Hey User\",\n              message: \"Press back again to exit\",\n              duration: Duration(seconds: 15), // show 15 second flushbar\n            )..show(context);\n\n          },\n          child: Home(),\n          waitForSecondBackPress: 15, // wait for 15 second for second back pressed\n        ),\n    );\n  }\n}\n```\n\n### with custom condition\nif you want to show message at spesific condition, for example, only show message if pageView at index 0.\n\n```dart\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      // Imagine that you are using materialbottom and only want to close when tabIndex = 0\n\n      home: DoubleBack(\n          condition: tabIndex == 0, // only show message when tabIndex=0\n          onConditionFail: (){\n            setState((){\n                tabIndex = 0; // if not 0, set pageview jumptopage 0\n            });\n          }\n          child: Home(),\n        ),\n    );\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuadarradhi%2Fdouble_back_to_close","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuadarradhi%2Fdouble_back_to_close","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuadarradhi%2Fdouble_back_to_close/lists"}