{"id":32279488,"url":"https://github.com/paul-thommithazhe/scroll-restore","last_synced_at":"2026-02-22T18:01:37.647Z","repository":{"id":296397760,"uuid":"993231727","full_name":"paul-thommithazhe/scroll-restore","owner":"paul-thommithazhe","description":"A lightweight Flutter plugin that automatically saves and restores scroll positions for any scrollable widget—across rebuilds, navigation, hot reloads, and app restarts.","archived":false,"fork":false,"pushed_at":"2025-05-30T15:51:15.000Z","size":296,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-23T00:39:21.145Z","etag":null,"topics":["android","dart","flutter","flutterpackage","ios","sharedpreferences","state-management","web"],"latest_commit_sha":null,"homepage":"","language":"C++","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/paul-thommithazhe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-30T12:44:44.000Z","updated_at":"2025-07-04T05:58:48.000Z","dependencies_parsed_at":"2025-05-30T18:04:05.378Z","dependency_job_id":"49fa3e0a-3452-4b97-8bf5-bebae7643116","html_url":"https://github.com/paul-thommithazhe/scroll-restore","commit_stats":null,"previous_names":["paul-thommithazhe/scroll-restore"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/paul-thommithazhe/scroll-restore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-thommithazhe%2Fscroll-restore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-thommithazhe%2Fscroll-restore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-thommithazhe%2Fscroll-restore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-thommithazhe%2Fscroll-restore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paul-thommithazhe","download_url":"https://codeload.github.com/paul-thommithazhe/scroll-restore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-thommithazhe%2Fscroll-restore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29721048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: 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":["android","dart","flutter","flutterpackage","ios","sharedpreferences","state-management","web"],"created_at":"2025-10-23T00:33:18.982Z","updated_at":"2026-02-22T18:01:37.637Z","avatar_url":"https://github.com/paul-thommithazhe.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scroll_restore\n\n[![pub package](https://img.shields.io/pub/v/scroll_restore.svg)](https://pub.dev/packages/scroll_restore)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/paul-thommithazhe/scroll-restore/dart.yml?branch=main)](https://github.com/paul-thommithazhe/scroll-restore/actions)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n`scroll_restore` is a tiny Flutter package that **automatically saves and restores** the scroll position of any scrollable widget—across rebuilds, hot reloads, navigation pops/pushes, and even app restarts. No boilerplate, no manual state management: just wrap your `ListView`, `GridView`, or any scrollable, and it “just works.”\n\n---\n\n## 🎯 Features\n\n- ✅ Persist scroll offset using `SharedPreferences`  \n- ✅ Restore position on init (clamps if content is shorter)  \n- ✅ Simple, one-widget API  \n- ✅ Zero external dependencies (except `shared_preferences`)  \n- ✅ Compatible with mobile, web, and desktop Flutter apps\n\n---\n\n## 📦 Installation\n\n\n```yaml\ndependencies:\n  flutter:\n    sdk: flutter\n\n  scroll_restore: ^0.1.0\n\n\nThen run:\n\n\nflutter pub get\n🚀 Quick Start\nWrap your scrollable in ScrollRestore, giving it a unique id:\n\n\nimport 'package:flutter/material.dart';\nimport 'package:scroll_restore/scroll_restore.dart';\n\nclass ChatScreen extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(title: const Text('Chat')),\n      body: ScrollRestore(\n        id: 'chat_screen_list',  // unique key per scrollable\n        builder: (context, controller) {\n          return ListView.builder(\n            controller: controller,\n            itemCount: messages.length,\n            itemBuilder: (_, index) {\n              return ListTile(\n                title: Text(messages[index].text),\n              );\n            },\n          );\n        },\n      ),\n    );\n  }\n}\nid: persisted key in SharedPreferences. Use a different id for each scrollable you want to remember.\n\nThe package takes care of saving .offset on every scroll and jumping to it on next build.\n\n📖 Example\nA full example app lives in the example/ folder:\n\ncd example\nflutter pub get\nflutter run\nTry scrolling halfway, hot-reloading, navigating away/back, or restarting the app—you’ll stay at the same scroll position!\n\n🧪 Testing\nTo run the package’s unit \u0026 widget tests:\n\nflutter test\n\n⚙️ CI\nWe use GitHub Actions to:\n\nflutter analyze\n\nflutter test (package \u0026 example)\n\nWorkflow file: .github/workflows/dart.yml\n\n🛠️ Caveats \u0026 Tips\nIf the saved offset exceeds the new content’s max scroll, it’s clamped to the end.\n\nWorks with any ScrollController-driven widget: ListView, GridView, CustomScrollView, etc.\n\nYou can nest multiple ScrollRestore widgets on one screen by using different ids.\n\n📜 Changelog\n0.1.0\nInitial release with basic save \u0026 restore logic\n\nSupports clamp-to-boundary and async init\n\n📝 License\nMIT © Paul Thommithazhe\n\n## 👤 Author\nPaul Thommithazhe\n🔗 GitHub: [https://github.com/paul-thommithazhe](https://github.com/paul-thommithazhe)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaul-thommithazhe%2Fscroll-restore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaul-thommithazhe%2Fscroll-restore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaul-thommithazhe%2Fscroll-restore/lists"}