{"id":13551531,"url":"https://github.com/fluttercandies/flutter_switch_clipper","last_synced_at":"2025-04-21T22:32:18.317Z","repository":{"id":56830285,"uuid":"429728085","full_name":"fluttercandies/flutter_switch_clipper","owner":"fluttercandies","description":"A Flutter package that two widgets switch with clipper.","archived":false,"fork":false,"pushed_at":"2024-06-24T10:03:17.000Z","size":1868,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-03T22:32:15.147Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/fluttercandies.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-19T08:47:50.000Z","updated_at":"2024-07-24T11:47:58.000Z","dependencies_parsed_at":"2024-06-28T07:30:40.983Z","dependency_job_id":null,"html_url":"https://github.com/fluttercandies/flutter_switch_clipper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_switch_clipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_switch_clipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_switch_clipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercandies%2Fflutter_switch_clipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluttercandies","download_url":"https://codeload.github.com/fluttercandies/flutter_switch_clipper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223881749,"owners_count":17219268,"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":[],"created_at":"2024-08-01T12:01:49.942Z","updated_at":"2024-11-09T20:40:01.852Z","avatar_url":"https://github.com/fluttercandies.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# Flutter Switch Clipper\n\nA Flutter package that two widgets switch with clipper. \n\n[![pub package](https://img.shields.io/pub/v/flutter_switch_clipper?logo=dart\u0026label=stable\u0026style=flat-square)](https://pub.dev/packages/flutter_switch_clipper)\n[![GitHub stars](https://img.shields.io/github/stars/fluttercandies/flutter_switch_clipper?logo=github\u0026style=flat-square)](https://github.com/fluttercandies/flutter_switch_clipper/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/fluttercandies/flutter_switch_clipper?logo=github\u0026style=flat-square)](https://github.com/fluttercandies/flutter_switch_clipper/network/members)\n[![CodeFactor](https://img.shields.io/codefactor/grade/github/fluttercandies/flutter_switch_clipper?logo=codefactor\u0026logoColor=%23ffffff\u0026style=flat-square)](https://www.codefactor.io/repository/github/fluttercandies/flutter_switch_clipper)\n\u003ca target=\"_blank\" href=\"https://jq.qq.com/?_wv=1027\u0026k=5bcc0gy\"\u003e\u003cimg border=\"0\" src=\"https://pub.idqqimg.com/wpa/images/group.png\" alt=\"FlutterCandies\" title=\"FlutterCandies\"\u003e\u003c/a\u003e\n\n\n### 体验一下\n\n体验网址:[Demo](https://xsilencex.github.io/flutter_switch_clipper_demo/)\n\n### 使用\n\n\u003e 使用FillClipper并自定义相关参数 \n\n\u003cimg src=\"https://raw.githubusercontent.com/fluttercandies/flutter_switch_clipper/master/preview/fv.gif\" height=100\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eView code\u003c/summary\u003e\n\n```dart\nSwitchClipper(\n    initSelect: true,\n    child: const Icon(Icons.favorite, size: 200, color: Colors.redAccent),\n    background: const Icon(Icons.favorite, size: 200, color: Colors.white),\n    duration: const Duration(milliseconds: 800),\n    customClipperBuilder: (Animation\u003cdouble\u003e animation) =\u003e FillClipper(\n        animation: animation,\n        fillAlignment: _alignment,\n        fillOffset: 50,\n    ),\n),\n```\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n\u003e 使用默认FillClipper \n\n\u003cimg src=\"https://raw.githubusercontent.com/fluttercandies/flutter_switch_clipper/master/preview/fc.gif\" height=100\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eView code\u003c/summary\u003e\n\n```dart\nconst SwitchClipper(\n    enableWhenAnimating: false,\n    child: Text(\n        'FlutterCandies',\n        style: TextStyle(\n            fontWeight: FontWeight.bold,\n            fontSize: 50,\n            color: Colors.amber,\n            height: 2,\n        ),\n    ),\n    background: Text(\n        'FlutterCandies',\n        style: TextStyle(\n            fontWeight: FontWeight.bold,\n            fontSize: 50,\n            color: Colors.white,\n            height: 2,\n        ),\n    ),\n    curve: Curves.slowMiddle,\n    reverseCurve: Curves.linear,\n),\n```\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n\u003e 使用CircleClipper切换图标颜色 \n\n\u003cimg src=\"https://raw.githubusercontent.com/fluttercandies/flutter_switch_clipper/master/preview/cs.gif\" height=100\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eView code\u003c/summary\u003e\n\n```dart\nSwitchClipper(\n    child: const Icon(Icons.accessibility_new_rounded, size: 200, color: Colors.blueAccent),\n    background: const Icon(Icons.accessibility_new_rounded, size: 200, color: Colors.white),\n    curve: Curves.ease,\n    duration: const Duration(milliseconds: 800),\n    customClipperBuilder: (Animation\u003cdouble\u003e animation) =\u003e CircleClipper(animation: animation),\n),\n```\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n\u003e 使用CircleClipper切换两个图标 \n\n\u003cimg src=\"https://raw.githubusercontent.com/fluttercandies/flutter_switch_clipper/master/preview/cs2.gif\" height=100\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eView code\u003c/summary\u003e\n\n```dart\nSwitchClipper(\n    child: ColoredBox(\n    color: Colors.blueGrey[200] ?? Colors.blueGrey,\n    child: const Icon(Icons.accessibility_new_rounded, size: 200, color: Colors.white)),\n    background: const Icon(Icons.accessible_forward_outlined, size: 200, color: Colors.white),\n    curve: Curves.ease,\n    duration: const Duration(milliseconds: 800),\n    customClipperBuilder: (Animation\u003cdouble\u003e animation) =\u003e CircleClipper(animation: animation),\n),\n```\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n\u003e 使用ShutterClipper \n\n\u003cimg src=\"https://raw.githubusercontent.com/fluttercandies/flutter_switch_clipper/master/preview/cs3.gif\" height=100\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eView code\u003c/summary\u003e\n\n```dart\nSwitchClipper(\n    child: ColoredBox(\n        color: Colors.blueGrey[200] ?? Colors.blueGrey,\n        child: const Icon(Icons.accessibility_new_rounded, size: 200, color: Colors.white)),\n    background: const Icon(Icons.accessible_forward_outlined, size: 200, color: Colors.white),\n    curve: Curves.ease,\n    duration: const Duration(milliseconds: 800),\n    customClipperBuilder: (Animation\u003cdouble\u003e animation) =\u003e ShutterClipper(\n        animation: animation,\n        activeAlignment: _alignment,\n    ),\n),\n```\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n\u003e 使用WaveClipper \n\n\u003cimg src=\"https://raw.githubusercontent.com/fluttercandies/flutter_switch_clipper/master/preview/cs4.gif\" height=100\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eView code\u003c/summary\u003e\n\n```dart\nSwitchClipper(\n    child: const Icon(Icons.access_time_filled_rounded, size: 200, color: Colors.blue),\n    background: const Icon(Icons.access_time_filled_rounded, size: 200, color: Colors.white),\n    curve: Curves.ease,\n    duration: const Duration(milliseconds: 2000),\n    customClipperBuilder: (Animation\u003cdouble\u003e animation) =\u003e WaveClipper(\n        animation: animation,\n        waveAlignment: _alignment == FillAlignment.left ? WaveAlignment.left : WaveAlignment.right,\n    ),\n),\n```\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n\u003e 使用CameraClipper \n\n\u003cimg src=\"https://raw.githubusercontent.com/fluttercandies/flutter_switch_clipper/master/preview/cs5.gif\" height=100\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eView code\u003c/summary\u003e\n\n```dart\nSwitchClipper(\n    child: Container(\n        width: 200,\n        height: 200,\n        alignment: Alignment.center,\n        decoration: const BoxDecoration(\n            shape: BoxShape.circle,\n            color: Colors.blue,\n        ),\n        child: const Text(\n            'Camera',\n            style: TextStyle(color: Colors.white, fontSize: 40, fontWeight: FontWeight.bold),\n        ),\n    ),\n    background: Container(\n        width: 200,\n        height: 200,\n        decoration: const BoxDecoration(\n            shape: BoxShape.circle,\n            color: Colors.white,\n        ),\n    ),\n    duration: const Duration(milliseconds: 2000),\n    customClipperBuilder: (Animation\u003cdouble\u003e animation) =\u003e CameraClipper(\n        animation: animation,\n    ),\n),\n```\n\n\u003c/details\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluttercandies%2Fflutter_switch_clipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluttercandies%2Fflutter_switch_clipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluttercandies%2Fflutter_switch_clipper/lists"}