{"id":15476278,"url":"https://github.com/lesnitsky/lifecycle_widget","last_synced_at":"2025-04-22T14:21:22.944Z","repository":{"id":56833950,"uuid":"296164822","full_name":"lesnitsky/lifecycle_widget","owner":"lesnitsky","description":"widget with lifecycle hooks for flutter","archived":false,"fork":false,"pushed_at":"2020-09-28T17:08:34.000Z","size":153,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T15:51:07.631Z","etag":null,"topics":["flutter","flutter-lifecycle","flutter-widget"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/lifecycle_widget","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/lesnitsky.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-09-16T22:55:22.000Z","updated_at":"2022-01-05T17:22:09.000Z","dependencies_parsed_at":"2022-09-09T21:10:22.946Z","dependency_job_id":null,"html_url":"https://github.com/lesnitsky/lifecycle_widget","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesnitsky%2Flifecycle_widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesnitsky%2Flifecycle_widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesnitsky%2Flifecycle_widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesnitsky%2Flifecycle_widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lesnitsky","download_url":"https://codeload.github.com/lesnitsky/lifecycle_widget/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250255773,"owners_count":21400411,"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":["flutter","flutter-lifecycle","flutter-widget"],"created_at":"2024-10-02T03:24:04.992Z","updated_at":"2025-04-22T14:21:22.899Z","avatar_url":"https://github.com/lesnitsky.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lifecycle widget\n\nFlutter widget with lifecycle methods\n\n[![lesnitsky.dev](https://lesnitsky.dev/icons/shield.svg?hash=42)](https://lesnitsky.dev?utm_source=lifecycle_widget)\n[![GitHub stars](https://img.shields.io/github/stars/lesnitsky/lifecycle_widget.svg?style=social)](https://github.com/lesnitsky/lifecycle_widget)\n[![Twitter Follow](https://img.shields.io/twitter/follow/lesnitsky_dev.svg?label=Follow%20me\u0026style=social)](https://twitter.com/lesnitsky_dev)\n\n## Installation\n\nAdd dependency to `pubspec.yaml`\n\n```yaml\ndependencies:\n  ...\n  lifecycle_widget: ^1.0.0\n```\n\nRun in your terminal\n\n```sh\nflutter packages get\n```\n\n## Example\n\n```dart\nclass TestWidget extends LifecycleWidget {\n  final int number;\n\n  const TestWidget({Key key, this.number}) : super(key: key);\n\n  void notify(BuildContext context, String text) {\n    Scaffold.of(context).showSnackBar(SnackBar(\n      content: Text(text),\n    ));\n  }\n\n  @override\n  void didMount(BuildContext context) {\n    notify(context, 'did mount');\n    super.didMount(context);\n  }\n\n  @override\n  void didUpdate(\n    BuildContext context,\n    covariant TestWidget oldWidget,\n    covariant TestWidget widget,\n  ) {\n    notify(context, 'update ${oldWidget.number} =\u003e ${widget.number}');\n    super.didUpdate(context, oldWidget, widget);\n  }\n\n  @override\n  void willUnmount(BuildContext context) {\n    print('will unmount');\n    super.willUnmount(context);\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return Center(child: Text(\"number is $number\"));\n  }\n}\n```\n\n## License\n\nMIT\n\n[![lesnitsky.dev](https://lesnitsky.dev/icons/shield.svg?hash=42)](https://lesnitsky.dev?utm_source=lifecycle_widget)\n[![GitHub stars](https://img.shields.io/github/stars/lesnitsky/lifecycle_widget.svg?style=social)](https://github.com/lesnitsky/lifecycle_widget)\n[![Twitter Follow](https://img.shields.io/twitter/follow/lesnitsky_dev.svg?label=Follow%20me\u0026style=social)](https://twitter.com/lesnitsky_dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesnitsky%2Flifecycle_widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flesnitsky%2Flifecycle_widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesnitsky%2Flifecycle_widget/lists"}