{"id":17684605,"url":"https://github.com/mattrltrent/shrinking_view","last_synced_at":"2025-05-12T23:54:50.714Z","repository":{"id":61975579,"uuid":"543952403","full_name":"mattrltrent/shrinking_view","owner":"mattrltrent","description":"A Flutter Pub package. Used to shrink/expand a widget/view/screen.","archived":false,"fork":false,"pushed_at":"2023-12-02T03:41:02.000Z","size":35930,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T23:54:46.538Z","etag":null,"topics":["dart","flutter","package","pub"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/shrinking_view","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/mattrltrent.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}},"created_at":"2022-10-01T08:37:12.000Z","updated_at":"2023-12-14T00:31:07.000Z","dependencies_parsed_at":"2024-08-22T23:25:17.934Z","dependency_job_id":null,"html_url":"https://github.com/mattrltrent/shrinking_view","commit_stats":{"total_commits":9,"total_committers":3,"mean_commits":3.0,"dds":0.2222222222222222,"last_synced_commit":"5c100e07c3cf8c52a9ae078f3972b1db65d820d3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattrltrent%2Fshrinking_view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattrltrent%2Fshrinking_view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattrltrent%2Fshrinking_view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattrltrent%2Fshrinking_view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattrltrent","download_url":"https://codeload.github.com/mattrltrent/shrinking_view/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843194,"owners_count":21972871,"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","flutter","package","pub"],"created_at":"2024-10-24T10:24:09.687Z","updated_at":"2025-05-12T23:54:50.691Z","avatar_url":"https://github.com/mattrltrent.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A simple, lightweight, and fully customizable widget designed to shrink and expand a view/screen/widget programmatically. ✨\n\n_Similar to how iOS shrinks pages behind content in the foreground. Mainly intended to wrap Scaffold widgets._\n\n-\u003e Submit an issue [here](https://github.com/mattrltrent/shrinking_view/issues).\n-\u003e Create a pull request [here](https://github.com/mattrltrent/shrinking_view/pulls).\n-\u003e Contact me via email [here](mailto:me@matthewtrent.me).\n\n## Features 🔥\n\n- Shrinks and expands a view/screen/widget.\n- Controlled programmatically with a `ShrinkingViewController`.\n- Requires only a few lines of code - simplicity is beautiful.\n\n## Gif Demos 📸\n\n\u003cimg src=\"https://github.com/mattrltrent/shrinking_view/blob/main/resources/demo1.gif?raw=true\" width=\"200\" height=\"\" style=\"display: inline\"/\u003e\n\u003cimg src=\"https://github.com/mattrltrent/shrinking_view/blob/main/resources/demo2.gif?raw=true\" width=\"200\" height=\"\" style=\"display: inline\"/\u003e\n\u003cimg src=\"https://github.com/mattrltrent/shrinking_view/blob/main/resources/demo4.gif?raw=true\" width=\"200\" height=\"\" style=\"display: inline\"/\u003e\n\u003cimg src=\"https://github.com/mattrltrent/shrinking_view/blob/main/resources/demo3.gif?raw=true\" width=\"200\" height=\"\" style=\"display: inline\"/\u003e\n\n## Getting Started 📜\n\n1.  Install and import the package.\n    \u003cbr\u003e\n\n    ```\n    $ flutter pub add shrinking_view\n\n    import 'package:shrinking_view/shrinking_view.dart';\n    ```\n\n    \u003cbr\u003e\n\n2.  In your app, create a `ShrinkingViewController` to pass to the `ShrinkingView` like so:\n    \u003cbr\u003e\n\n    ```dart\n    late ShrinkingViewController controller; // \u003c--- Create a ShrinkingViewController.\n\n        @override\n        void initState() {\n            controller = ShrinkingViewController(tickerProvider: this); // \u003c-- Initialize it with a TickerProvider.\n            super.initState();\n        }\n    ```\n\n    **Note:** Make sure your class is using either a `SingleTickerProviderStateMixin` or `TickerProviderStateMixin` so you can pass in `this` as the `TickerProvider` as required by the `ShrinkingViewController`.\n    \u003cbr\u003e\n\n3.  Wrap your `Scaffold` (or any widget, but `Scaffold` is recommended) inside the `ShrinkingView`, passing in the `controller` you just created.\n    \u003cbr\u003e\n\n    ```dart\n    return ShrinkingView(\n      controller: controller,\n      child: const Scaffold(\n        body: \u003cYOUR_APP\u003e,\n      ),\n    );\n    ```\n\n    \u003cbr\u003e\n\n4.  You're done! You can now call `controller.\u003cSOME_METHOD\u003e` to control your `ShrinkingView`! 🎉\n\n## `ShrinkingViewController` Methods 🛠️\n\n- `shrink() =\u003e void`: Starts the shrinking animation.\n  \u003cbr\u003e\n- `expand() =\u003e void`: Starts the expanding animation.\n  \u003cbr\u003e\n- `isShrunk() =\u003e bool`: Returns `true` if the last static state was shrunk. For example, if the `ShrinkingView` is currently animating, this will reflect the state before the animation began.\n  \u003cbr\u003e\n- `isExpanded() =\u003e bool`: Returns `true` if the last static state was expanded. For example, if the `ShrinkingView` is currently animating, this will reflect the state before the animation began.\n  \u003cbr\u003e\n- `isAnimating() =\u003e bool`: Returns `true` if the `ShrinkingView` is currently animating.\n  \u003cbr\u003e\n- `isShrinkingCurrently() =\u003e bool`: Returns `true` if the `ShrinkingView` is currently shrinking.\n  \u003cbr\u003e\n- `isExpandingCurrently() =\u003e bool`: Returns `true` if the `ShrinkingView` is currently expanding.\n\n## `ShrinkingView` Properties 🛠️\n\n- (required) `controller`: The `ShrinkingViewController` you must pass in order to control the `ShrinkingView`. No default value, as it's a required field.\n  \u003cbr\u003e\n- (required) `child`: The `Widget` you must pass that wraps what you want to be shrunk/expanded. Usually, this is a `Scaffold`. No default value, as it's a required field.\n  \u003cbr\u003e\n- `topLeftSquared`: Whether the top left of the widget should have no `BorderRadius` applied. Default: `false`.\n  \u003cbr\u003e\n- `topRightSquared`: Whether the top right of the widget should have no `BorderRadius` applied. Default: `false`.\n  \u003cbr\u003e\n- `bottomRightSquared`: Whether the bottom right of the widget should have no `BorderRadius` applied. Default: `true`.\n  \u003cbr\u003e\n- `bottomLeftSquared`: Whether the bottom left of the widget should have no `BorderRadius`. Default: `true`.\n  \u003cbr\u003e\n- `safeAreaTop`: Whether the widget should automatically add a top `SafeArea`. Default: `false`.\n  \u003cbr\u003e\n- `safeAreaBottom`: Whether the widget should automatically add a bottom `SafeArea`. Default: `false`.\n  \u003cbr\u003e\n- `safeAreaLeft`: Whether the widget should automatically add a left `SafeArea`. Default: `false`.\n  \u003cbr\u003e\n- `safeAreaRight`: Whether the widget should automatically add a right `SafeArea`. Default: `false`.\n  \u003cbr\u003e\n- `backgroundColorWhileAnimating`: The background `Color` behind the passed `child` widget that is (usually; depending on your implementation) displayed when a shrinking/expanding animation is occuring. Default: `Colors.black`.\n  \u003cbr\u003e\n- `maintainBottomViewPadding`: Specifies whether the `SafeArea` should maintain the bottom `MediaQueryData.viewPadding` instead of the bottom `MediaQueryData.padding`. Default: `true`.\n  \u003cbr\u003e\n- `shrinkingAnimationCurve`: The `Animation` `Curve` that's used when a shrinking animation is occuring. Default: `Curves.decelerate`.\n  \u003cbr\u003e\n- `expandingAnimationCurve`: The `Animation` `Curve` that's used when an expanding animation is occuring. Default: `Curves.linear`.\n  \u003cbr\u003e\n- `verticalTranslateMultiplier`: The factor by how much down the `child` should translate. This is proportionate to the screen height (translation down: screen height \\* `verticalTranslateMultiplier`). Default: `0.055`.\n  \u003cbr\u003e\n- `scaleMultiplier`: The factor by how much smaller the `child` should get while shrinking. Example: `0.5` means the `child` would get 50% smaller, `0.25` means it would get 25% smaller. Default: `0.04`.\n  \u003cbr\u003e\n- `borderRadiusValue`: The circular `BorderRadius` value each of the 4 corners can animate to (if their respective `\u003cTheir_Side\u003eSquared` property is `false`). Default: `50.0`.\n\n## Example ✍️\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:shrinking_view/shrinking_view.dart';\n\nvoid main() {\n  runApp(const MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  const MyApp({super.key});\n\n  @override\n  Widget build(BuildContext context) {\n    return const MaterialApp(\n      debugShowCheckedModeBanner: false,\n      title: 'shrinking_view package',\n      home: HomePage(),\n    );\n  }\n}\n\nclass HomePage extends StatefulWidget {\n  const HomePage({super.key});\n\n  @override\n  State\u003cHomePage\u003e createState() =\u003e _HomePageState();\n}\n\n// Ensure you use either SingleTickerProviderStateMixin or TickerProviderStateMixin.\nclass _HomePageState extends State\u003cHomePage\u003e with SingleTickerProviderStateMixin {\n  late ShrinkingViewController controller; // \u003c--- Create a ShrinkingViewController.\n\n  @override\n  void initState() {\n    controller = ShrinkingViewController(tickerProvider: this); // \u003c-- Initialize it with a TickerProvider.\n    super.initState();\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return ShrinkingView(\n      // \u003c--- Wrap your widget (usually a Scaffold) with the ShrinkingView.\n      controller: controller, // \u003c--- Pass it the controller.\n      child: Scaffold(\n        appBar: AppBar(\n          title: const Text(\"shrinking_view example\"),\n        ),\n        body: Center(\n          child: Column(\n            crossAxisAlignment: CrossAxisAlignment.center,\n            mainAxisAlignment: MainAxisAlignment.center,\n            children: [\n              TextButton(\n                onPressed: () =\u003e controller.expand(), // \u003c--- Expand the ShrinkingView.\n                child: const Text(\"Expand (void)\"),\n              ),\n              TextButton(\n                onPressed: () =\u003e controller.shrink(), // \u003c--- Shrink the ShrinkingView.\n                child: const Text(\"Shrink (void)\"),\n              ),\n              TextButton(\n                onPressed: () =\u003e print(controller.isShrunk()), // \u003c--- Is it shrunk?\n                child: const Text(\"Is shrunk? (bool)\"),\n              ),\n              TextButton(\n                onPressed: () =\u003e print(controller.isExpanded()), // \u003c--- Is it expanded?\n                child: const Text(\"Is expanded? (bool)\"),\n              ),\n              TextButton(\n                onPressed: () =\u003e print(controller.isAnimating()), // \u003c--- Is it animating?\n                child: const Text(\"Is animating? (bool)\"),\n              ),\n              TextButton(\n                onPressed: () =\u003e print(controller.isShrinkingCurrently()), // \u003c--- Is it currently shrinking?\n                child: const Text(\"Is currently shrinking? (bool)\"),\n              ),\n              TextButton(\n                onPressed: () =\u003e print(controller.isExpandingCurrently()), // \u003c--- Is it currently expanding?\n                child: const Text(\"Is currently expanding? (bool)\"),\n              ),\n            ],\n          ),\n        ),\n      ),\n    );\n  }\n}\n\n```\n\n## Additional information 📣\n\nThe package is always open to improvements and suggestions! Hope you enjoy :)\n\n![analytics](https://hidden-coast-90561-45544df95b1b.herokuapp.com/api/v1/analytics/?kind=package-shrinking-view)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattrltrent%2Fshrinking_view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattrltrent%2Fshrinking_view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattrltrent%2Fshrinking_view/lists"}